---
updatedAt: 2026-09-02T17:35:26.000Z
agentTools:
  projectIndex: https://docs.go.v7labs.com/llms.txt
---

# Restarts a case

Restarts a case by preserving the most recent user query and setting the status to ready

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "Common.APIErrorDetails": {
        "description": "Additional structured error context. Shape varies by error code.\n\n- For conflict errors: contains a `conflicts` array with conflicting resources\n- For other errors: may contain arbitrary error-specific context",
        "nullable": true,
        "oneOf": [
          {
            "$ref": "#/components/schemas/Common.ConflictErrorDetails"
          },
          {
            "additionalProperties": true,
            "description": "Generic error details for non-conflict errors",
            "type": "object",
            "x-struct": null,
            "x-validate": null
          }
        ],
        "title": "Common.APIErrorDetails",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.APIErrorDetails",
        "x-validate": null
      },
      "Cases.CaseModelProvider": {
        "description": "The existing sandbox-agent model provider to use for this case.",
        "enum": [
          "open_ai",
          "anthropic",
          "google_ai"
        ],
        "nullable": false,
        "title": "Cases.CaseModelProvider",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseModelProvider",
        "x-validate": null
      },
      "Cases.CaseResponse": {
        "additionalProperties": false,
        "description": "A single case",
        "properties": {
          "allowed_mcp_integration_ids": {
            "description": "Optional sandbox MCP allowlist. `null` means all authenticated MCP integrations, `[]` means none.",
            "items": {
              "$ref": "#/components/schemas/Common.UUID"
            },
            "nullable": true,
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "app": {
            "$ref": "#/components/schemas/Cases.CaseApp"
          },
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "error_code": {
            "$ref": "#/components/schemas/Cases.CaseErrorCode"
          },
          "error_reason": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/Cases.CaseFile"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "is_unread": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/Cases.CaseMessage"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "model": {
            "$ref": "#/components/schemas/Cases.CaseModel"
          },
          "model_provider": {
            "$ref": "#/components/schemas/Cases.CaseModelProvider"
          },
          "name": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "outputs": {
            "items": {
              "$ref": "#/components/schemas/Cases.CaseOutput"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "queued_messages": {
            "items": {
              "$ref": "#/components/schemas/Cases.CaseMessageQuery"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "reasoning_effort": {
            "$ref": "#/components/schemas/Cases.CaseReasoningEffort"
          },
          "resumable": {
            "nullable": true,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "sandbox_agent": {
            "description": "Whether this case uses sandbox agent mode (Claude Code handles all processing).",
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "status": {
            "$ref": "#/components/schemas/Cases.Status"
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "user_id": {
            "$ref": "#/components/schemas/Common.UUID"
          }
        },
        "required": [
          "id",
          "name",
          "user_id",
          "status",
          "outputs",
          "is_unread",
          "error_reason",
          "error_code",
          "model_provider",
          "model",
          "sandbox_agent",
          "allowed_mcp_integration_ids",
          "app",
          "created_at",
          "updated_at",
          "messages",
          "queued_messages",
          "files"
        ],
        "title": "Cases.CaseResponse",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseResponse",
        "x-validate": null
      },
      "Cases.CaseOutput": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "entity_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "project_id": {
            "$ref": "#/components/schemas/Common.UUID"
          }
        },
        "required": [
          "id",
          "project_id",
          "entity_id",
          "created_at"
        ],
        "title": "Cases.CaseOutput",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseOutput",
        "x-validate": null
      },
      "Common.ConflictErrorDetails": {
        "additionalProperties": false,
        "description": "Details for conflict errors",
        "properties": {
          "conflicts": {
            "description": "List of conflicting resources",
            "items": {
              "additionalProperties": true,
              "type": "object",
              "x-struct": null,
              "x-validate": null
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "conflicts"
        ],
        "title": "Common.ConflictErrorDetails",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.ConflictErrorDetails",
        "x-validate": null
      },
      "Playbooks.RunInputSpec": {
        "additionalProperties": false,
        "properties": {
          "allow_file_uploads": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/Playbooks.RunInputField"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "type": {
            "enum": [
              "chat",
              "form"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "type",
          "allow_file_uploads",
          "fields"
        ],
        "title": "Playbooks.RunInputSpec",
        "type": "object",
        "x-struct": null,
        "x-validate": null
      },
      "Cases.CaseErrorCode": {
        "description": "The error code of the case. Only present if the case is in an error state. Can be one of:\n- inference_policy_refused - No configured route satisfies the request and its inference policy.\n- agent_timeout - If a case called an agent and it took too long to respond.\n- file_not_found - If a case tried to use a file that was deleted or not found.\n- file_upload_timeout - If a file upload timed out.\n- invalid_html_response - The AI did not return valid HTML.\n- max_iterations_exceeded - The agent reached the maximum number of iterations.\n- max_output_tokens_exceeded - The agent reached the maximum number of output tokens.\n- agent_interrupted - The agent was interrupted by the user.\n- model_unexpected_stop - A model provider sent an unexpected stop signal.\n- model_context_length_exceeded - A model provider returned a context length exceeded error.\n- model_rate_limit_exceeded - A model provider returned a rate limit exceeded error.\n- model_overloaded - The model provider is currently overloaded.\n- usage_limit_exceeded - A case exceeded the usage limit associated with the workspace. It can be billing plan or system limit.\n- no_model_available - No AI model is currently available for the workspace.\n- skill_execution_error - A skill failed to execute.\n- context_assembly_failed - The persisted or request context needed for the chat could not be prepared; the conversation cannot resume and retrying will not help.\n- context_too_long - The chat history no longer fits the model context, even compressed; the conversation cannot resume and retrying will not help.\n- context_compaction_corrupted - The chat's compressed history was corrupted by an earlier crash; the conversation cannot resume.\n- temporary_error - A temporary problem stopped the agent, for example a failed database connection. A later retry can succeed.\n- internal_tool_error - The agent could not prepare or send its request to the model, also after its retries.\n- model_provider_error - A model provider rejected the request with a non-retryable error.\n- agent_crashed - The agent stopped unexpectedly without reporting a usable reason.\n- internal_error - An unhandled error occurred while processing the case.\n",
        "enum": [
          "agent_timeout",
          "file_not_found",
          "file_upload_timeout",
          "invalid_html_response",
          "max_iterations_exceeded",
          "max_output_tokens_exceeded",
          "agent_interrupted",
          "model_unexpected_stop",
          "model_context_length_exceeded",
          "model_rate_limit_exceeded",
          "model_overloaded",
          "usage_limit_exceeded",
          "no_model_available",
          "skill_execution_error",
          "inference_policy_refused",
          "context_assembly_failed",
          "context_too_long",
          "context_compaction_corrupted",
          "temporary_error",
          "internal_tool_error",
          "model_provider_error",
          "agent_crashed",
          "internal_error"
        ],
        "nullable": true,
        "title": "Cases.CaseErrorCode",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseErrorCode",
        "x-validate": null
      },
      "Cases.CaseMessageSkillRun": {
        "additionalProperties": false,
        "description": "A skill run message",
        "properties": {
          "arguments": {
            "type": "object",
            "x-struct": null,
            "x-validate": null
          },
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "is_unread": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "skill_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "skill_response": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Common.String"
              },
              {
                "additionalProperties": true,
                "type": "object",
                "x-struct": null,
                "x-validate": null
              },
              {
                "items": {
                  "$ref": "#/components/schemas/Common.AnyValue"
                },
                "type": "array",
                "x-struct": null,
                "x-validate": null
              }
            ],
            "nullable": true,
            "x-struct": null,
            "x-validate": null
          },
          "skill_slug": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "status": {
            "enum": [
              "input_required",
              "in_progress",
              "complete",
              "cancelled"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "type": {
            "enum": [
              "skill_run"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          }
        },
        "required": [
          "id",
          "is_unread",
          "created_at",
          "updated_at",
          "type",
          "skill_id",
          "skill_slug",
          "arguments",
          "skill_response",
          "status"
        ],
        "title": "Cases.CaseMessageSkillRun",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessageSkillRun",
        "x-validate": null
      },
      "Cases.Grounding.WebReference": {
        "additionalProperties": false,
        "description": "Reference to a web search result",
        "properties": {
          "snippet": {
            "description": "Text snippet from the page",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "title": {
            "description": "Page title",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "url": {
            "description": "URL of the web page",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "url"
        ],
        "title": "Cases.Grounding.WebReference",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.WebReference",
        "x-validate": null
      },
      "Common.NullableUUID": {
        "example": "e23ff3f3-8f77-4e78-9e81-fdb25abfb781",
        "format": "uuid",
        "nullable": true,
        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
        "title": "Common.NullableUUID",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.NullableUUID",
        "x-validate": null
      },
      "Cases.PromptRunQuestion.Display": {
        "additionalProperties": false,
        "description": "Display text with portable intent links. Grounding offsets refer to the text in this object. The original question, context and grounding remain unchanged outside this object.",
        "nullable": true,
        "properties": {
          "context": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "context_grounding": {
            "$ref": "#/components/schemas/Cases.Grounding.Grounding"
          },
          "question": {
            "$ref": "#/components/schemas/Common.String"
          },
          "question_grounding": {
            "$ref": "#/components/schemas/Cases.Grounding.Grounding"
          }
        },
        "required": [
          "question",
          "context",
          "question_grounding",
          "context_grounding"
        ],
        "title": "Cases.PromptRunQuestion.Display",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.PromptRunQuestion.Display",
        "x-validate": null
      },
      "Cases.Grounding.HubSourceLegacy": {
        "additionalProperties": false,
        "deprecated": true,
        "description": "Grounding source from a hub file (legacy format)",
        "properties": {
          "bounding_boxes": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.BoundingBox"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "boxes_normalized": {
            "description": "True when bounding_boxes use 0–1 fractions; false/null for absolute units",
            "nullable": true,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "cell_ranges": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.CellRange"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "cited_text": {
            "description": "Verbatim source snippet backing this citation, shown on hover",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "document_title": {
            "description": "Display title of the source document at grounding time",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "entity_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "hub_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "index": {
            "minimum": 1,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "input_id": {
            "deprecated": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "locations": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.Location"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "page": {
            "description": "1-based page of the evidence from the citation page hint, when known",
            "minimum": 1,
            "nullable": true,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "source_type": {
            "enum": [
              "hub"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "index",
          "source_type",
          "hub_id",
          "input_id",
          "locations",
          "bounding_boxes",
          "cell_ranges",
          "entity_id"
        ],
        "title": "Cases.Grounding.HubSourceLegacy",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.HubSourceLegacy",
        "x-validate": null
      },
      "Cases.CaseMessageAgentRun": {
        "additionalProperties": false,
        "description": "An agent run message",
        "properties": {
          "agent_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "agent_slug": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "grounding": {
            "$ref": "#/components/schemas/Cases.Grounding.Grounding"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "in_progress": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "is_unread": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "output_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "subject_references": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Cases.SubjectReference"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "type": {
            "enum": [
              "agent_run"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          }
        },
        "required": [
          "id",
          "is_unread",
          "created_at",
          "updated_at",
          "type",
          "agent_id",
          "agent_slug",
          "in_progress",
          "output_id",
          "subject_references"
        ],
        "title": "Cases.CaseMessageAgentRun",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessageAgentRun",
        "x-validate": null
      },
      "Cases.ToolSuggestion": {
        "additionalProperties": false,
        "description": "A tool suggestion in a message",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "slug": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "type": {
            "enum": [
              "skill",
              "agent"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "type",
          "slug",
          "id"
        ],
        "title": "Cases.ToolSuggestion",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.ToolSuggestion",
        "x-validate": null
      },
      "Common.NullableInteger": {
        "example": 123,
        "nullable": true,
        "title": "Common.NullableInteger",
        "type": "integer",
        "x-struct": null,
        "x-validate": null
      },
      "Cases.ConfidenceReview": {
        "additionalProperties": false,
        "nullable": true,
        "properties": {
          "assessed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "band": {
            "maximum": 4,
            "minimum": 1,
            "nullable": true,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "duration_ms": {
            "$ref": "#/components/schemas/Common.NullableInteger"
          },
          "input_fingerprint": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "model": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "policy_version": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "review": {
            "$ref": "#/components/schemas/Cases.ConfidenceReviewResult"
          },
          "state": {
            "enum": [
              "pending",
              "running",
              "complete",
              "unavailable"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "state",
          "policy_version",
          "input_fingerprint",
          "model",
          "duration_ms",
          "assessed_at",
          "band",
          "review"
        ],
        "title": "Cases.ConfidenceReview",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.ConfidenceReview",
        "x-validate": null
      },
      "Cases.CaseMessagePromptRun": {
        "additionalProperties": false,
        "description": "A prompt asking the user for input",
        "properties": {
          "answers": {
            "description": "The user's normalized structured answers. Empty while input is required, after cancellation, or after a completed whole-card free-text response. Use status to determine completion and response_text to read a whole-card response.",
            "items": {
              "$ref": "#/components/schemas/Cases.PromptRunAnswer"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "is_unread": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "questions": {
            "items": {
              "$ref": "#/components/schemas/Cases.PromptRunQuestion"
            },
            "maxItems": 4,
            "minItems": 1,
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "response_text": {
            "description": "The original free-text response to the question card.",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "status": {
            "enum": [
              "input_required",
              "complete",
              "cancelled"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "type": {
            "enum": [
              "prompt_run"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          }
        },
        "required": [
          "id",
          "is_unread",
          "created_at",
          "updated_at",
          "type",
          "questions",
          "status",
          "response_text"
        ],
        "title": "Cases.CaseMessagePromptRun",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessagePromptRun",
        "x-validate": null
      },
      "Common.UUID": {
        "example": "e23ff3f3-8f77-4e78-9e81-fdb25abfb781",
        "format": "uuid",
        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
        "title": "Common.UUID",
        "type": "string",
        "x-struct": null,
        "x-validate": null
      },
      "Cases.MessageRating": {
        "additionalProperties": false,
        "description": "The user's rating of a response. Can be changed or cleared after it is set; null while the response is unrated.",
        "nullable": true,
        "properties": {
          "comment": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "rated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "user_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "value": {
            "maximum": 5,
            "minimum": 1,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "value",
          "comment",
          "user_id",
          "rated_at"
        ],
        "title": "Cases.MessageRating",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.MessageRating",
        "x-validate": null
      },
      "Cases.CaseMessageSandboxStep": {
        "additionalProperties": false,
        "description": "A sandbox step message from Claude Code execution. Each step from the same run shares the same sandbox_run_id, enabling session forking.",
        "properties": {
          "call_id": {
            "description": "Stable ID linking tool_use to tool_result (from Anthropic's tool_use_id). Both the tool_use and its corresponding tool_result share the same call_id. Set on tool_use and tool_result steps. Null on assistant_text, thinking and complete steps. A step from an earlier agent runtime can also have a null call_id.",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "confidence_review": {
            "$ref": "#/components/schemas/Cases.ConfidenceReview"
          },
          "connect_required_integrations": {
            "$ref": "#/components/schemas/Cases.ConnectRequiredIntegrations"
          },
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "files_read": {
            "description": "List of files that were read during this step's execution",
            "items": {
              "$ref": "#/components/schemas/Cases.SandboxStepFileRead"
            },
            "nullable": true,
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "grounding": {
            "$ref": "#/components/schemas/Cases.Grounding.Grounding"
          },
          "grounding_status": {
            "$ref": "#/components/schemas/Cases.GroundingStatus"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "integration_id": {
            "description": "ID of the MCP integration that originated this step. Set for `tool_use`/`tool_result` steps invoked on a user-authenticated MCP server. Null for non-MCP steps or when the server slug does not map to a known integration.",
            "format": "uuid",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "integration_slug": {
            "description": "Slug of the MCP integration that originated this step. Set for `tool_use`/`tool_result` steps invoked on an MCP server. Null for non-MCP steps.",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "is_reasoning": {
            "description": "Whether this text step is reasoning/planning (true) or final output (false). Only set for assistant_text steps. Null if not yet classified or not applicable.",
            "nullable": true,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "is_unread": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "mentions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Cases.Mention"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "parent_id": {
            "description": "Message ID of the parent step for tree building. For tool_result: points to the matching tool_use. For sub-agent tool_use: points to the parent Task step.",
            "format": "uuid",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "sandbox_run_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "seq": {
            "description": "Sequence number of this step within the run",
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "step_type": {
            "description": "The type of step (e.g., 'tool_use', 'tool_result', 'text')",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "subject_references": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Cases.SubjectReference"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "summary": {
            "description": "User-friendly summary of a tool step (max 20 words). Present tense for tool_use, past tense for tool_result. Null for non-tool steps or if summarization was skipped.",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "text": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "tool_input": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "tool_name": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "tool_output": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "type": {
            "enum": [
              "sandbox_step"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          }
        },
        "required": [
          "id",
          "is_unread",
          "created_at",
          "updated_at",
          "type",
          "sandbox_run_id",
          "seq",
          "step_type",
          "tool_name",
          "tool_input",
          "tool_output",
          "text",
          "summary",
          "subject_references",
          "mentions",
          "confidence_review"
        ],
        "title": "Cases.CaseMessageSandboxStep",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessageSandboxStep",
        "x-validate": null
      },
      "Cases.SandboxStepCaseFileRead": {
        "additionalProperties": false,
        "description": "A case file that was read during a sandbox step execution",
        "properties": {
          "bytes_read": {
            "$ref": "#/components/schemas/Common.NullableInteger"
          },
          "case_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "file_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "file_size": {
            "$ref": "#/components/schemas/Common.NullableInteger"
          },
          "source_type": {
            "enum": [
              "case_file"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "source_type",
          "case_id",
          "file_id"
        ],
        "title": "Cases.SandboxStepCaseFileRead",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.SandboxStepCaseFileRead",
        "x-validate": null
      },
      "Cases.CaseFileStatus": {
        "enum": [
          "uploading",
          "complete",
          "error",
          "computing"
        ],
        "title": "Cases.CaseFileStatus",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseFileStatus",
        "x-validate": null
      },
      "Common.AnyValue": {
        "anyOf": [
          {
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          {
            "additionalProperties": true,
            "nullable": true,
            "type": "object",
            "x-struct": null,
            "x-validate": null
          },
          {
            "nullable": true,
            "type": "number",
            "x-struct": null,
            "x-validate": null
          },
          {
            "nullable": true,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          {
            "nullable": true,
            "type": "array",
            "x-struct": null,
            "x-validate": null
          }
        ],
        "description": "Any JSON value. Value provided as input can be any value. Value returned as response should not be checked.",
        "example": {},
        "nullable": true,
        "title": "Common.AnyValue",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.AnyValue",
        "x-validate": null
      },
      "Cases.CaseMessageResponse": {
        "additionalProperties": false,
        "description": "A full response from the case",
        "properties": {
          "connect_required_integrations": {
            "$ref": "#/components/schemas/Cases.ConnectRequiredIntegrations"
          },
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "estimated_wait_time_sec": {
            "$ref": "#/components/schemas/Common.NullableInteger"
          },
          "grounding": {
            "$ref": "#/components/schemas/Cases.Grounding.Grounding"
          },
          "grounding_status": {
            "$ref": "#/components/schemas/Cases.GroundingStatus"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "interrupted": {
            "description": "Whether this response was cut short by the user before another turn started.",
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "interrupted_sandbox_run_id": {
            "description": "The Go Agent V2 run interrupted by the user, used to reject late stream deltas after reconnecting.",
            "format": "uuid",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "is_unread": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "output_file_ids": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Common.UUID"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "processing_phase": {
            "$ref": "#/components/schemas/Cases.ProcessingPhase"
          },
          "queue_size": {
            "description": "Approximate number of pending requests in the current queue. Present only while the message is in a queued processing phase. This is a point-in-time depth estimate, not a guaranteed ordinal position.",
            "nullable": true,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "rating": {
            "$ref": "#/components/schemas/Cases.MessageRating"
          },
          "sources": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Cases.Source"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "subject_references": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Cases.SubjectReference"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "suggestions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Common.String"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "text": {
            "$ref": "#/components/schemas/Common.String"
          },
          "tool_suggestions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Cases.ToolSuggestion"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "type": {
            "enum": [
              "response"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          }
        },
        "required": [
          "id",
          "is_unread",
          "created_at",
          "updated_at",
          "type",
          "text",
          "output_file_ids",
          "sources",
          "subject_references",
          "suggestions",
          "tool_suggestions",
          "interrupted",
          "interrupted_sandbox_run_id"
        ],
        "title": "Cases.CaseMessageResponse",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessageResponse",
        "x-validate": null
      },
      "Cases.ConfidenceReviewResult": {
        "additionalProperties": false,
        "nullable": true,
        "properties": {
          "fully_checked": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "issues": {
            "items": {
              "$ref": "#/components/schemas/Cases.ConfidenceFinding"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "limitations": {
            "items": {
              "$ref": "#/components/schemas/Cases.ConfidenceFinding"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "issues",
          "limitations",
          "fully_checked"
        ],
        "title": "Cases.ConfidenceReviewResult",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.ConfidenceReviewResult",
        "x-validate": null
      },
      "Cases.Grounding.Grounding": {
        "additionalProperties": false,
        "description": "Grounding information for the message",
        "nullable": true,
        "properties": {
          "claims": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.Claim"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.Source"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "sources",
          "claims"
        ],
        "title": "Cases.Grounding.Grounding",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.Grounding",
        "x-validate": null
      },
      "Common.NullableDateTime": {
        "description": "DateTime in RFC3339 format",
        "example": "2020-01-20T14:00:00Z",
        "format": "date-time",
        "nullable": true,
        "title": "Common.NullableDateTime",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.NullableDateTime",
        "x-validate": null
      },
      "Cases.CaseReasoningEffort": {
        "description": "Reasoning effort for Go Agent V2. Must be supported by the selected model. On creation, omitted or null defaults to medium when supported, otherwise the model default. On update, null restores the model default; omission preserves the saved choice unless a model change requires normalization. Existing cases with null use the model default.",
        "enum": [
          "disabled",
          "minimal",
          "low",
          "medium",
          "high",
          "xhigh",
          "max",
          "auto"
        ],
        "nullable": true,
        "title": "Cases.CaseReasoningEffort",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseReasoningEffort",
        "x-validate": null
      },
      "Cases.PromptRunOption.AskUserQuestion": {
        "additionalProperties": false,
        "description": "Option for an ask_user_question prompt_run.",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Common.String"
          },
          "label": {
            "$ref": "#/components/schemas/Common.String"
          },
          "recommended": {
            "default": false,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "key",
          "label"
        ],
        "title": "Cases.PromptRunOption.AskUserQuestion",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.PromptRunOption.AskUserQuestion",
        "x-validate": null
      },
      "Cases.Mention": {
        "additionalProperties": false,
        "description": "A mention span inside sandbox step text. Offsets are graphemes into that text\n(which is the write-time display rendering when display_text was persisted).\n",
        "properties": {
          "kind": {
            "enum": [
              "subject",
              "case_file",
              "hub_file",
              "hub"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "label": {
            "$ref": "#/components/schemas/Common.String"
          },
          "length": {
            "minimum": 0,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "offset": {
            "minimum": 0,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "resource_id": {
            "$ref": "#/components/schemas/Common.UUID"
          }
        },
        "required": [
          "offset",
          "length",
          "kind",
          "resource_id",
          "label"
        ],
        "title": "Cases.Mention",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Mention",
        "x-validate": null
      },
      "Cases.PromptRunAnswer": {
        "additionalProperties": false,
        "description": "An answer to a prompt_run question. In requests, selected accepts option keys or labels; in responses, selected always echoes canonical option keys.",
        "properties": {
          "other_text": {
            "description": "Optional free-text Other answer.",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "question_id": {
            "description": "Question id from the prompt_run message.",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "question_index": {
            "description": "0-based question index when question_id is unavailable.",
            "minimum": 0,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "selected": {
            "description": "Selected options (keys or labels in requests; keys in responses).",
            "items": {
              "type": "string",
              "x-struct": null,
              "x-validate": null
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "selected"
        ],
        "title": "Cases.PromptRunAnswer",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.PromptRunAnswer",
        "x-validate": null
      },
      "Cases.HubPath": {
        "description": "Hub-relative path starting with `/`",
        "pattern": "^/",
        "title": "Cases.HubPath",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.HubPath",
        "x-validate": null
      },
      "Cases.Grounding.Source": {
        "description": "Grounding source information for the message.\n\nDiscriminated by `source_type`:\n- `case_file`: Source is a file attached to the case. Has `case_id` and `file_id`.\n- `hub`: Source is a file from a hub. Has `hub_id` and `file_id` (or legacy `entity_id`).\n- `project`: Source is from a project property (legacy). Has `project_id`, `property_id`, `entity_id`.\n- `web_search`: Source is from web search results. Has `web_references`.\n- `knowledge_graph_source`: Source is a context-graph observation cited via `query_context_graph`. Has `knowledge_graph_source_id`.\n",
        "oneOf": [
          {
            "$ref": "#/components/schemas/Cases.Grounding.CaseFileSource"
          },
          {
            "$ref": "#/components/schemas/Cases.Grounding.HubSource"
          },
          {
            "$ref": "#/components/schemas/Cases.Grounding.HubSourceLegacy"
          },
          {
            "$ref": "#/components/schemas/Cases.Grounding.ProjectSource"
          },
          {
            "$ref": "#/components/schemas/Cases.Grounding.WebSearchSource"
          },
          {
            "$ref": "#/components/schemas/Cases.Grounding.KnowledgeGraphSource"
          }
        ],
        "title": "Cases.Grounding.Source",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.Source",
        "x-validate": null
      },
      "Cases.CaseMessagePlaybookRunStartToolRunMetadata": {
        "additionalProperties": true,
        "description": "Tool run metadata for a native Playbook start request. The server returns only `playbook_invocation` for this tool.",
        "properties": {
          "playbook_invocation": {
            "$ref": "#/components/schemas/Cases.ToolRunPlaybookInvocation"
          }
        },
        "required": [
          "playbook_invocation"
        ],
        "title": "Cases.CaseMessagePlaybookRunStartToolRunMetadata",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessagePlaybookRunStartToolRunMetadata",
        "x-validate": null
      },
      "Cases.ToolRunToolName": {
        "enum": [
          "adopt_entity",
          "query_files",
          "rag_search_files",
          "file_qa",
          "search_files",
          "search_web",
          "hub_search",
          "internal_action_search",
          "run_skill",
          "playbook_run_start",
          "run_mcp_tool",
          "run_python",
          "ask_pdf",
          "subtask",
          "text_read",
          "grep",
          "search",
          "create_html_artifact",
          "prompt_user"
        ],
        "title": "Cases.ToolRunToolName",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.ToolRunToolName",
        "x-validate": null
      },
      "Cases.BaseToolRunMetadata": {
        "additionalProperties": false,
        "description": "Base tool run metadata",
        "properties": {},
        "title": "Cases.BaseToolRunMetadata",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.BaseToolRunMetadata",
        "x-validate": null
      },
      "Cases.ConfidenceFinding": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "evidence_ids": {
            "items": {
              "type": "string",
              "x-struct": null,
              "x-validate": null
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "kind": {
            "enum": [
              "mismatch",
              "unsupported",
              "omission",
              "conflict"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "next_step": {
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "target": {
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "target",
          "evidence_ids",
          "detail",
          "next_step"
        ],
        "title": "Cases.ConfidenceFinding",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.ConfidenceFinding",
        "x-validate": null
      },
      "Cases.PromptRunQuestionType": {
        "description": "The type of question. 'single_select' allows the user to choose exactly one option, 'multi_select' allows multiple options.",
        "enum": [
          "single_select",
          "multi_select"
        ],
        "title": "Cases.PromptRunQuestionType",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.PromptRunQuestionType",
        "x-validate": null
      },
      "Cases.PromptRunQuestion": {
        "description": "A prompt_run question.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/Cases.PromptRunQuestion.Legacy"
          },
          {
            "$ref": "#/components/schemas/Cases.PromptRunQuestion.AskUserQuestion"
          }
        ],
        "title": "Cases.PromptRunQuestion",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.PromptRunQuestion",
        "x-validate": null
      },
      "Cases.ProcessingPhase": {
        "description": "The current processing phase of the assistant response.\n- `queued` - The request is waiting in a scheduler queue\n- `scheduled` - The request has been scheduled and is waiting for execution\n- `waiting_for_provider` - The request is running and waiting for the provider to start responding\n- `streaming` - The provider is actively streaming output\n- `finalising` - The provider finished and the backend is preparing the final response\n- `completed` - The response completed successfully\n- `failed` - The response failed\n- `null` - No processing phase is currently available\n",
        "enum": [
          "queued",
          "scheduled",
          "waiting_for_provider",
          "streaming",
          "finalising",
          "completed",
          "failed"
        ],
        "nullable": true,
        "title": "Cases.ProcessingPhase",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.ProcessingPhase",
        "x-validate": null
      },
      "Cases.Grounding.CellRange": {
        "additionalProperties": false,
        "description": "Cell range reference for spreadsheet grounding sources",
        "properties": {
          "end_cell": {
            "description": "End cell reference for ranges (e.g., C5). Null for single cell.",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "sheet_name": {
            "description": "Name of the worksheet",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "start_cell": {
            "description": "Start cell reference (e.g., A1)",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "sheet_name",
          "start_cell"
        ],
        "title": "Cases.Grounding.CellRange",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.CellRange",
        "x-validate": null
      },
      "Playbooks.RunInputField": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "key": {
            "minLength": 1,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "label": {
            "minLength": 1,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "options": {
            "items": {
              "type": "string",
              "x-struct": null,
              "x-validate": null
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "placeholder": {
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "required": {
            "description": "A start from chat or MCP fails without a value for this field. A REST launch or a schedule does not check it. An omitted flag keeps the stored flag of the same key, and a new field is optional. A description block cannot be required.",
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "type": {
            "enum": [
              "text",
              "number",
              "single_select",
              "file",
              "description"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "key",
          "type",
          "label",
          "options"
        ],
        "title": "Playbooks.RunInputField",
        "type": "object",
        "x-struct": null,
        "x-validate": null
      },
      "Cases.Status": {
        "enum": [
          "working",
          "input_required",
          "ready",
          "error"
        ],
        "title": "Cases.Status",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Status",
        "x-validate": null
      },
      "Cases.CaseApp": {
        "additionalProperties": false,
        "description": "The app associated with this chat. Null when the chat has no app association.",
        "nullable": true,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "name": {
            "$ref": "#/components/schemas/Common.String"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "title": "Cases.CaseApp",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseApp",
        "x-validate": null
      },
      "Cases.Grounding.Location": {
        "additionalProperties": false,
        "description": "Location for a claim in the grounded text",
        "properties": {
          "length": {
            "minimum": 0,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "offset": {
            "minimum": 0,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "offset",
          "length"
        ],
        "title": "Cases.Grounding.Location",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.Location",
        "x-validate": null
      },
      "Cases.DataStoreReference": {
        "additionalProperties": false,
        "description": "A Data Store exposed to sandbox code as an attached SDK handle",
        "properties": {
          "data_store_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "mode": {
            "default": "read_only",
            "description": "Maximum access through the attached SDK handle. `read_only` allows reads;\n`read_write` also allows writes. Shared MCP tools called by external MCP\nclients use the acting user's resource permissions and granted scopes\nindependently of attachments. Shared MCP tools called by this case's chat\nagent also respect the attachment mode as a cap.\n",
            "enum": [
              "read_only",
              "read_write"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "data_store_id"
        ],
        "title": "Cases.DataStoreReference",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.DataStoreReference",
        "x-validate": null
      },
      "Cases.Grounding.BoundingBox": {
        "additionalProperties": false,
        "description": "Bounding box for a grounding source",
        "properties": {
          "page": {
            "minimum": 1,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "xmax": {
            "minimum": 0,
            "type": "number",
            "x-struct": null,
            "x-validate": null
          },
          "xmin": {
            "minimum": 0,
            "type": "number",
            "x-struct": null,
            "x-validate": null
          },
          "ymax": {
            "minimum": 0,
            "type": "number",
            "x-struct": null,
            "x-validate": null
          },
          "ymin": {
            "minimum": 0,
            "type": "number",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "page",
          "xmin",
          "ymin",
          "xmax",
          "ymax"
        ],
        "title": "Cases.Grounding.BoundingBox",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.BoundingBox",
        "x-validate": null
      },
      "Cases.CaseMessageQuery": {
        "additionalProperties": false,
        "description": "A query for the case",
        "properties": {
          "agent_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "background_wake": {
            "description": "True when the Case added this query to wake the agent after background tools completed. The user did not write it.",
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "data_stores": {
            "$ref": "#/components/schemas/Cases.DataStoreReferences"
          },
          "entities": {
            "$ref": "#/components/schemas/Cases.EntityReferencesResponse"
          },
          "errored_file_ids": {
            "items": {
              "$ref": "#/components/schemas/Common.UUID"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "file_ids": {
            "items": {
              "$ref": "#/components/schemas/Common.UUID"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "hub_id": {
            "$ref": "#/components/schemas/Cases.DeprecatedHubId"
          },
          "hubs": {
            "$ref": "#/components/schemas/Cases.HubReferences"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "is_unread": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "pending": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "request_source": {
            "description": "The channel that sent the query: `direct` (the app or the API), `email` or `slack`. `user_id` is the sender.",
            "enum": [
              "direct",
              "email",
              "slack"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "search_web": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "skill_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "subject_references": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Cases.SubjectReference"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "text": {
            "$ref": "#/components/schemas/Common.String"
          },
          "type": {
            "enum": [
              "query"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "user_id": {
            "$ref": "#/components/schemas/Common.UUID"
          }
        },
        "required": [
          "id",
          "is_unread",
          "created_at",
          "updated_at",
          "type",
          "text",
          "user_id",
          "file_ids",
          "errored_file_ids",
          "agent_id",
          "subject_references",
          "search_web",
          "request_source",
          "pending"
        ],
        "title": "Cases.CaseMessageQuery",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessageQuery",
        "x-validate": null
      },
      "Cases.HubReferences": {
        "description": "List of hubs to attach to this query. Each hub can optionally specify paths to filter files.",
        "items": {
          "$ref": "#/components/schemas/Cases.HubReference"
        },
        "title": "Cases.HubReferences",
        "type": "array",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.HubReferences",
        "x-validate": null
      },
      "Cases.PromptRunQuestion.AskUserQuestion": {
        "additionalProperties": false,
        "description": "Question for an ask_user_question prompt_run.",
        "properties": {
          "allow_multiple": {
            "default": false,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "allow_other": {
            "default": true,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "context": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "context_grounding": {
            "$ref": "#/components/schemas/Cases.Grounding.Grounding"
          },
          "display": {
            "$ref": "#/components/schemas/Cases.PromptRunQuestion.Display"
          },
          "id": {
            "$ref": "#/components/schemas/Common.String"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/Cases.PromptRunOption.AskUserQuestion"
            },
            "maxItems": 6,
            "minItems": 0,
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "question": {
            "$ref": "#/components/schemas/Common.String"
          },
          "question_grounding": {
            "$ref": "#/components/schemas/Cases.Grounding.Grounding"
          }
        },
        "required": [
          "question",
          "options",
          "display"
        ],
        "title": "Cases.PromptRunQuestion.AskUserQuestion",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.PromptRunQuestion.AskUserQuestion",
        "x-validate": null
      },
      "Cases.GroundingStatus": {
        "description": "The status of grounding extraction for this message.\n- `running` - Grounding extraction is in progress\n- `completed` - Grounding extraction completed successfully\n- `failed` - Grounding extraction failed\n- `null` - Grounding has not been started or is not applicable\n",
        "enum": [
          "running",
          "completed",
          "failed"
        ],
        "nullable": true,
        "title": "Cases.GroundingStatus",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.GroundingStatus",
        "x-validate": null
      },
      "Cases.EntityReferenceResponse": {
        "additionalProperties": false,
        "description": "A reference to an entity attached to a query, as returned by the API",
        "properties": {
          "entity_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "project_id": {
            "$ref": "#/components/schemas/Common.UUID"
          }
        },
        "required": [
          "project_id",
          "entity_id"
        ],
        "title": "Cases.EntityReferenceResponse",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.EntityReferenceResponse",
        "x-validate": null
      },
      "Cases.Grounding.ProjectSource": {
        "additionalProperties": false,
        "description": "Grounding source from a project property",
        "properties": {
          "agent_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "bounding_boxes": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.BoundingBox"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "boxes_normalized": {
            "description": "True when bounding_boxes use 0–1 fractions; false/null for absolute units",
            "nullable": true,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "cell_ranges": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.CellRange"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "cited_text": {
            "description": "Verbatim source snippet backing this citation, shown on hover",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "document_title": {
            "description": "Display title of the source document at grounding time",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "entity_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "index": {
            "minimum": 1,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "input_id": {
            "deprecated": true,
            "description": "Legacy input ID. Format: `agent:{agent_id}:field:{property_id}:entity:{entity_id}` or `P{property_id}:E{entity_id}`",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "locations": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.Location"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "page": {
            "description": "1-based page of the evidence from the citation page hint, when known",
            "minimum": 1,
            "nullable": true,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "project_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "property_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "source_type": {
            "enum": [
              "project"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "index",
          "source_type",
          "input_id",
          "locations",
          "bounding_boxes",
          "cell_ranges"
        ],
        "title": "Cases.Grounding.ProjectSource",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.ProjectSource",
        "x-validate": null
      },
      "Cases.SubjectReference": {
        "additionalProperties": false,
        "description": "A hydrated subject reference attached to a case message",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/Common.String"
          },
          "slug": {
            "$ref": "#/components/schemas/Common.String"
          },
          "subject_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "subject_type": {
            "$ref": "#/components/schemas/Common.String"
          }
        },
        "required": [
          "subject_id",
          "name",
          "slug",
          "subject_type"
        ],
        "title": "Cases.SubjectReference",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.SubjectReference",
        "x-validate": null
      },
      "Common.DateTime": {
        "description": "DateTime in RFC3339 format",
        "example": "2020-01-20T14:00:00Z",
        "format": "date-time",
        "title": "Common.DateTime",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.DateTime",
        "x-validate": null
      },
      "Cases.Source": {
        "additionalProperties": false,
        "description": "A source reference in a message",
        "properties": {
          "file_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "type": {
            "enum": [
              "url",
              "file"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "url": {
            "$ref": "#/components/schemas/Common.NullableString"
          }
        },
        "required": [
          "type"
        ],
        "title": "Cases.Source",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Source",
        "x-validate": null
      },
      "Common.APIError": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "example": "bad_request",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "details": {
            "$ref": "#/components/schemas/Common.APIErrorDetails"
          },
          "message": {
            "example": "Bad Request",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "Common.APIError",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.APIError",
        "x-validate": null
      },
      "Cases.Grounding.Claim": {
        "additionalProperties": false,
        "description": "Grounding claim extracted from the message",
        "properties": {
          "citation_style": {
            "description": "Rendering contract stamped when the grounding is generated.\nHistorical claims omit this field and must use the legacy pill renderer.\n",
            "enum": [
              "pill",
              "underline"
            ],
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "location": {
            "$ref": "#/components/schemas/Cases.Grounding.Location"
          },
          "object_path": {
            "description": "Semi-virtual JSON path to the field that supports this claim.\nSupported prefixes:\n- `$.motivation` - reference to the reasoning text for the value\n- `$.value.<partial_value_field>` - reference to specific part of the field's value\n- `null` - no virtual path, the claim refers to field's value read as single text block\n",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "source_indices": {
            "items": {
              "minimum": 1,
              "type": "integer",
              "x-struct": null,
              "x-validate": null
            },
            "minItems": 1,
            "type": "array",
            "uniqueItems": true,
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "location",
          "source_indices"
        ],
        "title": "Cases.Grounding.Claim",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.Claim",
        "x-validate": null
      },
      "Cases.PromptRunQuestion.Legacy": {
        "additionalProperties": false,
        "description": "Legacy prompt_run question.",
        "properties": {
          "options": {
            "items": {
              "$ref": "#/components/schemas/Cases.PromptRunOption.Legacy"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "subtitle": {
            "$ref": "#/components/schemas/Common.String"
          },
          "title": {
            "$ref": "#/components/schemas/Common.String"
          },
          "type": {
            "$ref": "#/components/schemas/Cases.PromptRunQuestionType"
          }
        },
        "required": [
          "type",
          "title",
          "subtitle",
          "options"
        ],
        "title": "Cases.PromptRunQuestion.Legacy",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.PromptRunQuestion.Legacy",
        "x-validate": null
      },
      "Cases.CaseModel": {
        "description": "The concrete Go Agent V2 model. Both current and legacy frontend selections are accepted during migration.",
        "enum": [
          "claude_5_5_opus",
          "claude_5_opus",
          "claude_5_sonnet",
          "claude_5_5_sonnet",
          "claude_4_5_haiku",
          "claude_5_5_haiku",
          "gemini_3_5_flash_lite",
          "gpt_5_6_sol",
          "gemini_3_1_pro",
          "claude_4_6_sonnet",
          "gpt_5_6_terra",
          "gemini_3_8_flash",
          "gemini_4_argon",
          "gpt_5_6_luna",
          "gpt_6_astra",
          "gpt_6_sol",
          "gpt_6_1_sol",
          "gpt_6_1_terra",
          "gpt_6_luna",
          "gpt_5_5",
          "gpt_5_4_mini",
          "claude_4_8_opus",
          "gemini_3_flash"
        ],
        "nullable": true,
        "title": "Cases.CaseModel",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseModel",
        "x-validate": null
      },
      "Cases.Grounding.CaseFileSource": {
        "additionalProperties": false,
        "description": "Grounding source from a file attached to the case",
        "properties": {
          "bounding_boxes": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.BoundingBox"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "boxes_normalized": {
            "description": "True when bounding_boxes use 0–1 fractions; false/null for absolute units",
            "nullable": true,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "case_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "cell_ranges": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.CellRange"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "cited_text": {
            "description": "Verbatim source snippet backing this citation, shown on hover",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "document_title": {
            "description": "Display title of the source document at grounding time",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "file_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "index": {
            "minimum": 1,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "input_id": {
            "deprecated": true,
            "description": "Legacy input ID. Format: `case_{case_id}:file_{file_id}`",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "locations": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.Location"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "page": {
            "description": "1-based page of the evidence from the citation page hint, when known",
            "minimum": 1,
            "nullable": true,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "source_type": {
            "enum": [
              "case_file"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "index",
          "source_type",
          "input_id",
          "locations",
          "bounding_boxes",
          "cell_ranges"
        ],
        "title": "Cases.Grounding.CaseFileSource",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.CaseFileSource",
        "x-validate": null
      },
      "Cases.DeprecatedHubId": {
        "deprecated": true,
        "description": "Deprecated. Use `hubs` array instead for multiple hub support with path filtering.",
        "format": "uuid",
        "nullable": true,
        "title": "Cases.DeprecatedHubId",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.DeprecatedHubId",
        "x-validate": null
      },
      "Cases.ToolRunPlaybookInvocation": {
        "additionalProperties": false,
        "description": "The saved request or accepted run of a native `playbook_run_start` call. The server writes it when the start commits. Do not send these ids to the model.",
        "properties": {
          "caller_run_id": {
            "description": "The agent run that made the call. A sandbox step of the call has the same `sandbox_run_id`. A provider call id can occur again in a later turn, so match a sandbox step on the two values.",
            "format": "uuid",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "child_run_id": {
            "description": "The Playbook run that the call started.",
            "format": "uuid",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "deadline": {
            "description": "The time at which a waiting request expires.",
            "format": "date-time",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "field_errors": {
            "properties": {
              "invalid": {
                "items": {
                  "type": "string",
                  "x-struct": null,
                  "x-validate": null
                },
                "type": "array",
                "x-struct": null,
                "x-validate": null
              },
              "missing": {
                "items": {
                  "type": "string",
                  "x-struct": null,
                  "x-validate": null
                },
                "type": "array",
                "x-struct": null,
                "x-validate": null
              }
            },
            "required": [
              "missing",
              "invalid"
            ],
            "type": "object",
            "x-struct": null,
            "x-validate": null
          },
          "fields": {
            "additionalProperties": true,
            "type": "object",
            "x-struct": null,
            "x-validate": null
          },
          "file_ids": {
            "items": {
              "$ref": "#/components/schemas/Common.UUID"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "input_spec": {
            "$ref": "#/components/schemas/Playbooks.RunInputSpec"
          },
          "playbook_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "request_message_id": {
            "description": "The id of the tool run message that holds this metadata.",
            "format": "uuid",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "revision": {
            "description": "The revision of that published version.",
            "minimum": 1,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "state": {
            "description": "The state of the start request. A direct start is accepted.",
            "enum": [
              "waiting",
              "accepted",
              "cancelled",
              "expired"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "tool_call_id": {
            "description": "The provider id of the call. A sandbox step of the call has the same `call_id`.",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "version_id": {
            "description": "The published Playbook version that the child run executes.",
            "format": "uuid",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "request_message_id",
          "playbook_id",
          "version_id",
          "revision",
          "state",
          "tool_call_id",
          "caller_run_id"
        ],
        "title": "Cases.ToolRunPlaybookInvocation",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.ToolRunPlaybookInvocation",
        "x-validate": null
      },
      "Cases.SandboxStepFileRead": {
        "description": "A file that was read during a sandbox step execution",
        "oneOf": [
          {
            "$ref": "#/components/schemas/Cases.SandboxStepHubFileRead"
          },
          {
            "$ref": "#/components/schemas/Cases.SandboxStepCaseFileRead"
          }
        ],
        "title": "Cases.SandboxStepFileRead",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.SandboxStepFileRead",
        "x-validate": null
      },
      "Cases.PromptRunOption.Legacy": {
        "additionalProperties": false,
        "description": "Legacy prompt_run option.",
        "properties": {
          "description": {
            "$ref": "#/components/schemas/Common.String"
          },
          "title": {
            "$ref": "#/components/schemas/Common.String"
          }
        },
        "required": [
          "title",
          "description"
        ],
        "title": "Cases.PromptRunOption.Legacy",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.PromptRunOption.Legacy",
        "x-validate": null
      },
      "Projects.ListEntities.OCRPage": {
        "additionalProperties": false,
        "description": "OCR page metadata",
        "properties": {
          "height": {
            "type": "number",
            "x-struct": null,
            "x-validate": null
          },
          "number": {
            "minimum": 1,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "offset": {
            "minimum": 0,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "unit": {
            "enum": [
              "inch",
              "pixel"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "width": {
            "type": "number",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "number",
          "offset",
          "unit",
          "width",
          "height"
        ],
        "title": "Projects.ListEntities.OCRPage",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Projects.ListEntities.OCRPage",
        "x-validate": null
      },
      "Cases.Grounding.KnowledgeGraphSource": {
        "additionalProperties": false,
        "description": "Grounding source from a knowledge-graph source (a cited metric observation)",
        "properties": {
          "bounding_boxes": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.BoundingBox"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "cited_text": {
            "description": "Verbatim source snippet backing this citation, shown on hover",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "document_title": {
            "description": "Display title of the source document at grounding time",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "index": {
            "minimum": 1,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "input_id": {
            "deprecated": true,
            "description": "Format: `knowledge_graph_source:{knowledge_graph_source_id}`",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "knowledge_graph_source_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "locations": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.Location"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "observation_id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Common.UUID"
              }
            ],
            "description": "ID of the cited metric observation",
            "x-struct": null,
            "x-validate": null
          },
          "source_type": {
            "enum": [
              "knowledge_graph_source"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "subject_ids": {
            "description": "IDs of the subject(s) the cited observation(s) are about",
            "items": {
              "$ref": "#/components/schemas/Common.UUID"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "index",
          "source_type",
          "knowledge_graph_source_id",
          "observation_id",
          "input_id",
          "locations",
          "bounding_boxes",
          "subject_ids",
          "cited_text",
          "document_title"
        ],
        "title": "Cases.Grounding.KnowledgeGraphSource",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.KnowledgeGraphSource",
        "x-validate": null
      },
      "Cases.CaseFile": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "deleted_at": {
            "$ref": "#/components/schemas/Common.NullableDateTime"
          },
          "display_url": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "grounding": {
            "$ref": "#/components/schemas/Cases.Grounding.Grounding"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "name": {
            "$ref": "#/components/schemas/Common.String"
          },
          "ocr_pages": {
            "items": {
              "$ref": "#/components/schemas/Projects.ListEntities.OCRPage"
            },
            "nullable": true,
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "path": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "progress_pct": {
            "$ref": "#/components/schemas/Common.NullableInteger"
          },
          "slides_id": {
            "$ref": "#/components/schemas/Common.NullableUUID"
          },
          "status": {
            "$ref": "#/components/schemas/Cases.CaseFileStatus"
          },
          "summary": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "url": {
            "$ref": "#/components/schemas/Common.NullableString"
          },
          "user_id": {
            "$ref": "#/components/schemas/Common.UUID"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "progress_pct",
          "user_id",
          "url",
          "display_url",
          "ocr_pages",
          "created_at",
          "deleted_at",
          "summary",
          "path",
          "slides_id"
        ],
        "title": "Cases.CaseFile",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseFile",
        "x-validate": null
      },
      "Cases.CaseMessageFileRequest": {
        "additionalProperties": false,
        "description": "An agent tool asked the user for files and waits for them. Provide them with `case-confirm-tool-run` and `file_ids`; continue without them with `case-cancel-tool-run`.",
        "properties": {
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "description": {
            "description": "What the agent asked for, in the user's words.",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "file_ids": {
            "description": "The files the user provided; empty until the request is complete.",
            "items": {
              "$ref": "#/components/schemas/Common.UUID"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "file_names": {
            "description": "Names of the files the user provided; empty until the request is complete.",
            "items": {
              "$ref": "#/components/schemas/Common.String"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "is_unread": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "note": {
            "description": "What the user wrote when providing the files or continuing without them, if anything.",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "reason": {
            "description": "Why the agent needs it.",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "status": {
            "enum": [
              "input_required",
              "complete",
              "cancelled"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "type": {
            "enum": [
              "file_request"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          }
        },
        "required": [
          "id",
          "is_unread",
          "created_at",
          "updated_at",
          "type",
          "status",
          "file_ids",
          "file_names"
        ],
        "title": "Cases.CaseMessageFileRequest",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessageFileRequest",
        "x-validate": null
      },
      "Cases.ToolRunProgressUpdate": {
        "additionalProperties": false,
        "properties": {
          "text": {
            "$ref": "#/components/schemas/Common.String"
          },
          "timestamp": {
            "$ref": "#/components/schemas/Common.DateTime"
          }
        },
        "required": [
          "timestamp",
          "text"
        ],
        "title": "Cases.ToolRunProgressUpdate",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.ToolRunProgressUpdate",
        "x-validate": null
      },
      "Cases.CaseMessagePartialResponse": {
        "additionalProperties": false,
        "description": "A partial response from the case",
        "properties": {
          "connect_required_integrations": {
            "$ref": "#/components/schemas/Cases.ConnectRequiredIntegrations"
          },
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "estimated_wait_time_sec": {
            "$ref": "#/components/schemas/Common.NullableInteger"
          },
          "grounding": {
            "$ref": "#/components/schemas/Cases.Grounding.Grounding"
          },
          "grounding_status": {
            "$ref": "#/components/schemas/Cases.GroundingStatus"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "is_unread": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "output_file_ids": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Common.UUID"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "processing_phase": {
            "$ref": "#/components/schemas/Cases.ProcessingPhase"
          },
          "queue_size": {
            "description": "Approximate number of pending requests in the current queue. Present only while the message is in a queued processing phase. This is a point-in-time depth estimate, not a guaranteed ordinal position.",
            "nullable": true,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "sources": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Cases.Source"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "subject_references": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Cases.SubjectReference"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "suggestions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Common.String"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "text": {
            "$ref": "#/components/schemas/Common.String"
          },
          "tool_suggestions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Cases.ToolSuggestion"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "type": {
            "enum": [
              "partial_response"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          }
        },
        "required": [
          "id",
          "is_unread",
          "created_at",
          "updated_at",
          "type",
          "text",
          "output_file_ids",
          "sources",
          "subject_references",
          "suggestions",
          "tool_suggestions"
        ],
        "title": "Cases.CaseMessagePartialResponse",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessagePartialResponse",
        "x-validate": null
      },
      "Cases.HubReference": {
        "additionalProperties": false,
        "description": "A hub reference with optional path filtering",
        "properties": {
          "hub_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "paths": {
            "description": "Optional list of hub-relative file or directory paths to include.\nPaths must start with `/` (e.g., `/documents/report.pdf`, `/data/`).\nIf null, all files from the hub are included. If empty array, no files are included.\n",
            "items": {
              "$ref": "#/components/schemas/Cases.HubPath"
            },
            "nullable": true,
            "type": "array",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "hub_id"
        ],
        "title": "Cases.HubReference",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.HubReference",
        "x-validate": null
      },
      "Common.NullableString": {
        "nullable": true,
        "title": "Common.NullableString",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.NullableString",
        "x-validate": null
      },
      "Cases.Grounding.HubSource": {
        "additionalProperties": false,
        "description": "Grounding source from a hub file (new format)",
        "properties": {
          "bounding_boxes": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.BoundingBox"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "boxes_normalized": {
            "description": "True when bounding_boxes use 0–1 fractions; false/null for absolute units",
            "nullable": true,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "cell_ranges": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.CellRange"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "cited_text": {
            "description": "Verbatim source snippet backing this citation, shown on hover",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "document_title": {
            "description": "Display title of the source document at grounding time",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "entity_id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Common.UUID"
              }
            ],
            "deprecated": true,
            "x-struct": null,
            "x-validate": null
          },
          "file_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "hub_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "index": {
            "minimum": 1,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "input_id": {
            "deprecated": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "locations": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.Location"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "page": {
            "description": "1-based page of the evidence from the citation page hint, when known",
            "minimum": 1,
            "nullable": true,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "source_type": {
            "enum": [
              "hub"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "index",
          "source_type",
          "hub_id",
          "input_id",
          "locations",
          "bounding_boxes",
          "cell_ranges",
          "file_id"
        ],
        "title": "Cases.Grounding.HubSource",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.HubSource",
        "x-validate": null
      },
      "Cases.Grounding.WebSearchSource": {
        "additionalProperties": false,
        "description": "Grounding source from web search results",
        "properties": {
          "bounding_boxes": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.BoundingBox"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "boxes_normalized": {
            "description": "True when bounding_boxes use 0–1 fractions; false/null for absolute units",
            "nullable": true,
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "cell_ranges": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.CellRange"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "cited_text": {
            "description": "Verbatim source snippet backing this citation, shown on hover",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "document_title": {
            "description": "Display title of the source document at grounding time",
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "index": {
            "minimum": 1,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "input_id": {
            "description": "Fixed value: 'web_search'",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "locations": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.Location"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "page": {
            "description": "1-based page of the evidence from the citation page hint, when known",
            "minimum": 1,
            "nullable": true,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "source_type": {
            "enum": [
              "web_search"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "web_references": {
            "items": {
              "$ref": "#/components/schemas/Cases.Grounding.WebReference"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "index",
          "source_type",
          "input_id",
          "web_references",
          "locations",
          "bounding_boxes",
          "cell_ranges"
        ],
        "title": "Cases.Grounding.WebSearchSource",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.Grounding.WebSearchSource",
        "x-validate": null
      },
      "Cases.SandboxStepHubFileRead": {
        "additionalProperties": false,
        "description": "A hub file that was read during a sandbox step execution",
        "properties": {
          "bytes_read": {
            "$ref": "#/components/schemas/Common.NullableInteger"
          },
          "file_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "file_size": {
            "$ref": "#/components/schemas/Common.NullableInteger"
          },
          "hub_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "source_type": {
            "enum": [
              "hub"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "source_type",
          "hub_id",
          "file_id"
        ],
        "title": "Cases.SandboxStepHubFileRead",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.SandboxStepHubFileRead",
        "x-validate": null
      },
      "Cases.EntityReferencesResponse": {
        "description": "List of entities attached to this query.",
        "items": {
          "$ref": "#/components/schemas/Cases.EntityReferenceResponse"
        },
        "title": "Cases.EntityReferencesResponse",
        "type": "array",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.EntityReferencesResponse",
        "x-validate": null
      },
      "Cases.CaseMessageHubSearchToolRunMetadata": {
        "additionalProperties": false,
        "description": "Tool run metadata for `hub_search`",
        "properties": {
          "hub_id": {
            "$ref": "#/components/schemas/Common.UUID"
          }
        },
        "required": [
          "hub_id"
        ],
        "title": "Cases.CaseMessageHubSearchToolRunMetadata",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessageHubSearchToolRunMetadata",
        "x-validate": null
      },
      "Common.String": {
        "title": "Common.String",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.String",
        "x-validate": null
      },
      "Cases.ConnectRequiredIntegrations": {
        "description": "Provider slugs the message declares as missing or unauthenticated, from either channel: a PLAYBOOK_CONNECT_REQUIRED machine line in assistant prose, or a playbook_step_wait call of type connection_required. Null when the message carries no connect request.",
        "items": {
          "type": "string",
          "x-struct": null,
          "x-validate": null
        },
        "nullable": true,
        "title": "Cases.ConnectRequiredIntegrations",
        "type": "array",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.ConnectRequiredIntegrations",
        "x-validate": null
      },
      "Cases.DataStoreReferences": {
        "description": "Data Stores to expose as SDK handles for this query. Attachments do not restrict shared MCP tools called by external MCP clients, which use ordinary resource permissions and granted scopes. Shared MCP tools called by this case's chat agent respect the attachment mode as a cap.",
        "items": {
          "$ref": "#/components/schemas/Cases.DataStoreReference"
        },
        "maxItems": 20,
        "title": "Cases.DataStoreReferences",
        "type": "array",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.DataStoreReferences",
        "x-validate": null
      },
      "Cases.CaseMessageToolRun": {
        "additionalProperties": false,
        "description": "A tool run message",
        "properties": {
          "created_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "grounding": {
            "$ref": "#/components/schemas/Cases.Grounding.Grounding"
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "in_progress": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "is_unread": {
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "metadata": {
            "description": "Tool run metadata. The shape depends on the tool_name.",
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/Cases.CaseMessageHubSearchToolRunMetadata"
              },
              {
                "$ref": "#/components/schemas/Cases.CaseMessagePlaybookRunStartToolRunMetadata"
              },
              {
                "$ref": "#/components/schemas/Cases.BaseToolRunMetadata"
              }
            ],
            "x-struct": null,
            "x-validate": null
          },
          "progress_updates": {
            "items": {
              "$ref": "#/components/schemas/Cases.ToolRunProgressUpdate"
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "status": {
            "enum": [
              "input_required",
              "in_progress",
              "complete",
              "cancelled"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "tool_name": {
            "$ref": "#/components/schemas/Cases.ToolRunToolName"
          },
          "type": {
            "enum": [
              "tool_run"
            ],
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          }
        },
        "required": [
          "id",
          "is_unread",
          "created_at",
          "updated_at",
          "type",
          "tool_name",
          "status",
          "in_progress",
          "progress_updates"
        ],
        "title": "Cases.CaseMessageToolRun",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessageToolRun",
        "x-validate": null
      },
      "Cases.CaseMessage": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Cases.CaseMessagePartialResponse"
          },
          {
            "$ref": "#/components/schemas/Cases.CaseMessageResponse"
          },
          {
            "$ref": "#/components/schemas/Cases.CaseMessageQuery"
          },
          {
            "$ref": "#/components/schemas/Cases.CaseMessageAgentRun"
          },
          {
            "$ref": "#/components/schemas/Cases.CaseMessageSkillRun"
          },
          {
            "$ref": "#/components/schemas/Cases.CaseMessagePromptRun"
          },
          {
            "$ref": "#/components/schemas/Cases.CaseMessageFileRequest"
          },
          {
            "$ref": "#/components/schemas/Cases.CaseMessageToolRun"
          },
          {
            "$ref": "#/components/schemas/Cases.CaseMessageSandboxStep"
          }
        ],
        "title": "Cases.CaseMessage",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Cases.CaseMessage",
        "x-validate": null
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "in": "header",
        "name": "X-API-KEY",
        "type": "apiKey"
      },
      "BearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "V7 Go API",
    "version": "0.1.0"
  },
  "openapi": "3.0.0",
  "paths": {
    "/api/workspaces/{workspace_id}/cases/{case_id}/restart": {
      "post": {
        "callbacks": {},
        "description": "Restarts a case by preserving the most recent user query and setting the status to ready",
        "operationId": "case-restart-case",
        "parameters": [
          {
            "description": "",
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Common.UUID"
            }
          },
          {
            "description": "",
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Common.UUID"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cases.CaseResponse"
                }
              }
            },
            "description": "Cases.CaseResponse"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          }
        },
        "summary": "Restarts a case",
        "tags": [
          "Cases"
        ]
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    },
    {
      "ApiKeyAuth": []
    }
  ],
  "servers": [
    {
      "description": "EU",
      "url": "https://go.v7labs.com",
      "variables": {}
    },
    {
      "description": "US",
      "url": "https://go.us.v7labs.com",
      "variables": {}
    },
    {
      "description": "UAE",
      "url": "https://go.uae.v7labs.com",
      "variables": {}
    }
  ]
}
```