{"openapi":"3.2.0","info":{"title":"Inspect API","version":"1.0.0","description":"API for programmatically creating and managing Inspect sessions.\n\n## Authentication\n\nMost API requests require authentication using an API key. Include your API key in the `Authorization` header as a Bearer token:\n\n```\nAuthorization: Bearer riu_xxxxxxxxxxxxx\n```\n\nFor WebSocket event streaming (GET /api/public/v1/sessions/{session_id}/events), pass your API key in the token query parameter instead.\n\n## Getting an API Key\n\n### User keys (`riu_` prefix)\n\nUser keys let you use the API as yourself. Sessions created with your key will open PRs under your GitHub account.\n\nTo generate a user API key:\n1. Go to [Settings](https://inspect.com/my/settings)\n2. Scroll to the **Developer** section\n3. Click **Generate API key**\n4. Copy and save the key - it will only be shown once\n\n### System keys (`ris_` prefix)\n\nSystem keys are for automated integrations that need to open PRs as Inspect itself (not as a specific user).\nTo request a system key, ask your Inspect administrators so they can assess the request. Include:\n\n1. The system key name.\n2. Whether the key needs read-only or write access.\n3. The repository scope the key needs.\n4. What the integration will do with the key.\n5. The expected request/session volume.\n"},"tags":[{"name":"Artifacts","description":"Manage artifacts"},{"name":"Automations","description":"Manage automations"},{"name":"Skills","description":"Manage reusable skills"},{"name":"Agents","description":"Manage custom agents"},{"name":"Memories","description":"Read and write personal memories"},{"name":"User","description":"Read the API key user's preferences"},{"name":"Workspaces","description":"List workspaces and manage their setup scripts"},{"name":"Previews","description":"Report pull request preview deployments"},{"name":"Deployments","description":"Report repository deployments"},{"name":"Repositories","description":"List available repositories"},{"name":"Models","description":"List available models"},{"name":"Sessions","description":"Create and manage Inspect sessions"}],"paths":{"/api/public/v1/agents":{"get":{"operationId":"listAgents","summary":"List agents","description":"List available agents. Returns all non-deleted agents with their basic metadata (no `prompt` or `skills` here; use `GET /api/public/v1/agents/{agent_id}` for full configuration). Use the returned `id` in the `agent_id` field when creating a session.","parameters":[],"responses":{"200":{"description":"List of custom agents","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agents.Agent"}}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Agents"]},"post":{"operationId":"createAgent","summary":"Create agent","description":"Create a custom agent owned by the user associated with the API key. Slack app, avatar, and contributor settings are not managed by this endpoint.","parameters":[],"responses":{"201":{"description":"Custom agent created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Agents.AgentDetail"}}}}}},"400":{"description":"Invalid request body. JSON for schema errors; plain text for repositories that are not configured workspace IDs.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"The agent could not be saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agents.CreateAgentRequest"}}}}}},"/api/public/v1/agents/managed/review-buddy":{"put":{"operationId":"ensureManagedAgent","summary":"Create or replace Review agent","description":"Create the Review agent custom agent with its canonical ID and Inspect-owned safe configuration, or restore that configuration. Repeating the same request produces the same agent and preserves the runner Review agent policy. Requires a system API key with the `ci:webhook` tag.","parameters":[],"responses":{"200":{"description":"Existing custom agent replaced","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Agents.AgentDetail"}}}}}},"201":{"description":"Custom agent created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Agents.AgentDetail"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, or the API key is not a system key with the `ci:webhook` tag, or the existing agent is owned by someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"The agent could not be saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Agents"]}},"/api/public/v1/agents/{agent_id}":{"get":{"operationId":"getAgent","summary":"Get agent","description":"Retrieve a single agent by ID, including system `prompt`, `skills`, capabilities, and repository configuration. The list endpoint (`GET /api/public/v1/agents`) returns summary metadata only; use this route for full configuration. Same API key authentication as other public v1 endpoints.","parameters":[{"name":"agent_id","in":"path","required":true,"description":"Agent ID (from the list agents response)","schema":{"type":"string"}}],"responses":{"200":{"description":"Agent details","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Agents.AgentDetail"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Agent not found or deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Agents"]},"patch":{"operationId":"updateAgent","summary":"Update agent","description":"Partially update a custom agent. The API key user must be the creator, a contributor, or an Inspect admin. Only provided fields are changed.","parameters":[{"name":"agent_id","in":"path","required":true,"description":"Agent ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Custom agent updated","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Agents.AgentDetail"}}}}}},"400":{"description":"Invalid request body. JSON for schema errors; plain text for repositories that are not configured workspace IDs.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, the managed Review agent, or insufficient agent permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Agent not found or deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"The agent could not be saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agents.UpdateAgentRequest"}}}}}},"/api/public/v1/agents/{agent_id}/versions":{"get":{"operationId":"listAgentVersions","summary":"List agent versions","description":"List every saved prompt version for an agent, newest first. Only the prompt is versioned; the rest of the agent's configuration is always current. The API key user must be the creator, a contributor, or an Inspect admin.","parameters":[{"name":"agent_id","in":"path","required":true,"description":"Agent ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Agent prompt versions","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agents.AgentVersion"}}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient agent permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Agent not found or archived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Agents"]}},"/api/public/v1/artifacts":{"get":{"operationId":"listArtifacts","summary":"List artifacts","description":"List or search published artifacts. Supports cursor pagination and optional text search.","parameters":[{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.first"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.after"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.last"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.before"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.aggregates"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.query"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.kind"}],"responses":{"200":{"description":"List results for artifacts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifacts.ArtifactList"}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Artifact storage is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Artifacts"]},"post":{"operationId":"createArtifact","summary":"Create artifact","description":"Create a published artifact. If the canonical URL already exists, returns the existing artifact unchanged.","parameters":[],"responses":{"200":{"description":"Artifact already existed for the provided URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifacts.CreateArtifactResult"}}}},"201":{"description":"Artifact created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifacts.CreateArtifactResult"}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Artifact storage is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Artifacts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifacts.CreateArtifactRequest"}}}}}},"/api/public/v1/artifacts/search":{"get":{"operationId":"searchArtifacts","summary":"Search artifacts","description":"Legacy alias for `GET /api/public/v1/artifacts`. Search published artifacts with cursor pagination and optional text search.","parameters":[{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.first"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.after"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.last"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.before"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.aggregates"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.query"},{"$ref":"#/components/parameters/Artifacts.ListArtifactsQuery.kind"}],"responses":{"200":{"description":"Search results for artifacts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifacts.ArtifactList"}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Artifact storage is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Artifacts"],"deprecated":true}},"/api/public/v1/artifacts/{artifact_id}":{"get":{"operationId":"getArtifact","summary":"Get artifact","description":"Retrieve a published artifact.","parameters":[{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Artifact details","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Artifacts.Artifact"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Artifact not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Artifact storage is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Artifacts"]},"patch":{"operationId":"updateArtifact","summary":"Update artifact","description":"Partially update a published artifact. URL changes are rejected if another artifact already uses that URL.","parameters":[{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Artifact updated","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Artifacts.Artifact"}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Artifact not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Artifact URL already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Artifact storage is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Artifacts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifacts.UpdateArtifactRequest"}}}}},"delete":{"operationId":"deleteArtifact","summary":"Delete artifact","description":"Delete a published artifact.","parameters":[{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Artifact deleted"},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Artifact not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Artifact storage is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Artifacts"]}},"/api/public/v1/automations":{"get":{"operationId":"listAutomations","summary":"List automations","description":"List automations owned by or shared with the authenticated user. Pass `scope=all` to also include published automations and their soft forks. Supports cursor pagination.","parameters":[{"name":"first","in":"query","required":false,"description":"Number of results to return (max 100).","schema":{"$ref":"#/components/schemas/Automations.AutomationPageSize","default":50},"explode":false},{"name":"after","in":"query","required":false,"description":"Cursor for pagination. Use `meta.page.end_cursor` from a previous response.","schema":{"type":"string"},"explode":false},{"name":"include_archived","in":"query","required":false,"description":"If true, include archived automations. Defaults to false.","schema":{"type":"boolean","default":false},"explode":false},{"name":"scope","in":"query","required":false,"description":"`mine` returns automations the authenticated user owns or collaborates on. `all` also returns every automation the user can view, including published automations and their soft forks. Defaults to `mine`.","schema":{"$ref":"#/components/schemas/Automations.AutomationListScope","default":"mine"},"explode":false}],"responses":{"200":{"description":"List of automations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Automations.AutomationList"}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Automations"]},"post":{"operationId":"createAutomation","summary":"Create automation","description":"Create a new automation with zero or more independently configured triggers.","parameters":[],"responses":{"201":{"description":"Automation created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Automations.Automation"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, insufficient automation permissions, or a repository outside the API key's allowed repositories","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Source automation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicting automation, trigger, or integration state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Trigger integration is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Automations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Automations.CreateAutomationRequest"}}}}}},"/api/public/v1/automations/{automation_id}":{"get":{"operationId":"getAutomation","summary":"Get automation","description":"Retrieve a single automation by ID.","parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Automation details","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Automations.Automation"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, insufficient automation permissions, or a repository outside the API key's allowed repositories","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Automation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Automations"]},"patch":{"operationId":"updateAutomation","summary":"Update automation","description":"Partially update an automation. Only provided fields are changed.","parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Automation updated","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Automations.Automation"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, insufficient automation permissions, or a repository outside the API key's allowed repositories","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Automation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicting automation, trigger, or integration state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Trigger integration is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Automations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Automations.UpdateAutomationRequest"}}}}},"delete":{"operationId":"archiveAutomation","summary":"Archive automation","description":"Soft-archive an automation. The automation is disabled and hidden from default list queries but can still be retrieved with include_archived=true.","parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Automation archived"},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, insufficient automation permissions, or a repository outside the API key's allowed repositories","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Automation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Automations"]}},"/api/public/v1/automations/{automation_id}/trigger":{"post":{"operationId":"triggerAutomation","summary":"Trigger automation","description":"Manually trigger an automation run.","parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Automation triggered","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Automations.Automation"}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, insufficient automation permissions, or a repository outside the API key's allowed repositories","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Automation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Automations"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Automations.TriggerAutomationRequest"}}}}}},"/api/public/v1/memories":{"get":{"operationId":"listMemories","summary":"List memories","description":"List active memories in a personal scope. Memory reads are available to every Inspect API key holder.","parameters":[{"name":"scope","in":"query","required":true,"description":"Scope type to read.","schema":{"$ref":"#/components/schemas/Memories.MemoryScopeType"},"explode":false},{"name":"scope_id","in":"query","required":false,"description":"User id. Defaults to the API key user.","schema":{"$ref":"#/components/schemas/Memories.MemoryUserId"},"explode":false},{"name":"directive_limit","in":"query","required":false,"description":"Maximum number of directive memories to return.","schema":{"$ref":"#/components/schemas/Memories.MemoryDirectiveLimit","default":20},"explode":false},{"name":"fact_limit","in":"query","required":false,"description":"Maximum number of fact memories to return.","schema":{"$ref":"#/components/schemas/Memories.MemoryFactLimit","default":50},"explode":false}],"responses":{"200":{"description":"Active memories in the requested scope","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Memories.MemoryList"}}}}}},"400":{"description":"Invalid scope selection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Memory storage failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Memories"]},"post":{"operationId":"createMemory","summary":"Create memory","description":"Create one durable memory. `personal` always targets the API key user's own scope.","parameters":[],"responses":{"201":{"description":"Created memory","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Memories.CreatedMemory"}}}}}},"400":{"description":"Invalid memory payload","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Memory storage failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Memories"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Memories.CreateMemoryRequest"}}}}}},"/api/public/v1/memories/context":{"get":{"operationId":"getMemoryContext","summary":"Get memory context","description":"Read the active memory context for a user. Personal memories default to the API key user; pass `user_id` to read another user's context.","parameters":[{"name":"user_id","in":"query","required":false,"description":"User whose personal memories are included. Defaults to the API key user. Ignored when `include_personal` is `false`.","schema":{"$ref":"#/components/schemas/Memories.MemoryUserId"},"explode":false},{"name":"include_personal","in":"query","required":false,"description":"Set to `false` to exclude personal memories from the context.","schema":{"type":"boolean","default":true},"explode":false},{"name":"directive_limit","in":"query","required":false,"description":"Maximum number of directive memories to return.","schema":{"$ref":"#/components/schemas/Memories.MemoryDirectiveLimit","default":20},"explode":false},{"name":"fact_limit","in":"query","required":false,"description":"Maximum number of fact memories to return.","schema":{"$ref":"#/components/schemas/Memories.MemoryFactLimit","default":50},"explode":false}],"responses":{"200":{"description":"Active memory context for the requested scopes","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Memories.MemoryContext"}}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Memory storage failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Memories"]}},"/api/public/v1/memories/{memory_id}":{"get":{"operationId":"getMemory","summary":"Get memory","description":"Read one memory by id, including its canonical body, lifecycle state, and every scope it is placed in. Archived memories are returned.","parameters":[{"name":"memory_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Memory details","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Memories.MemoryDetails"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Memory not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Memory storage failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Memories"]},"patch":{"operationId":"updateMemory","summary":"Update memory","description":"Replace the title, canonical body, discovery summary, and type of an active memory.","parameters":[{"name":"memory_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated memory","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Memories.MemoryResult"}}}}}},"400":{"description":"Invalid memory payload","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Memory not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Memory is archived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Memory storage failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Memories"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Memories.UpdateMemoryRequest"}}}}}},"/api/public/v1/memories/{memory_id}/archive":{"post":{"operationId":"archiveMemory","summary":"Archive memory","description":"Archive a stale, superseded, or no-longer-relevant memory.","parameters":[{"name":"memory_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Archived memory","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Memories.MemoryResult"}}}}}},"400":{"description":"Invalid or malformed archive payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Memory not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Memory is already archived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Memory storage failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Memories"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Memories.ArchiveMemoryRequest"}}}}}},"/api/public/v1/models":{"get":{"operationId":"listModels","summary":"List models","description":"List available models.","parameters":[],"responses":{"200":{"description":"List of models","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Models.Model"}}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Models"]}},"/api/public/v1/repositories":{"get":{"operationId":"listRepositories","summary":"List repositories","description":"List available repositories. System API keys see every repository available to them; user keys see their visible, non-hidden repositories.","parameters":[],"responses":{"200":{"description":"List of repositories","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Repositories.RepositoryList"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Repositories"]}},"/api/public/v1/repositories/{owner}/{repo}/deployments":{"post":{"operationId":"reportDeployment","summary":"Report deployment","description":"Report deployment status for one or more pull requests. Accepts normal personal or system API keys with write access and access to the repository workspace. Only deployed and failed statuses are accepted. Each new event is notified independently, without a cross-environment completion gate. Send requests to your own workspace origin. Idempotency keys are scoped per repository/PR, independent of the API key: retries with the same key do not record or notify again. Reuse a key only for the same event.","parameters":[{"name":"owner","in":"path","required":true,"description":"GitHub repository owner.","schema":{"$ref":"#/components/schemas/Deployments.RepositoryPathSegment"}},{"name":"repo","in":"path","required":true,"description":"GitHub repository name.","schema":{"$ref":"#/components/schemas/Deployments.RepositoryPathSegment"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Stable event ID, deduplicated per repository/PR across retries and credential rotation. Trimmed before the length check.","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"The event was recorded, or was already recorded with the same idempotency key. Slack delivery is asynchronous and best effort.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deployments.DeploymentReport"}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or its user is read-only, or the key scope does not allow the repository workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The repository is not registered, has no workspace, or is not accessible to this user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Deployments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deployments.ReportDeploymentRequest"}}}}}},"/api/public/v1/repositories/{owner}/{repo}/pulls/{pull_number}/previews":{"get":{"operationId":"listPullRequestPreviews","summary":"List pull request previews","description":"List the latest state of every preview reported for a pull request, as stored on the Inspect sessions currently linked to it.","parameters":[{"$ref":"#/components/parameters/Previews.PullRequestParams.owner"},{"$ref":"#/components/parameters/Previews.PullRequestParams.repo"},{"$ref":"#/components/parameters/Previews.PullRequestParams.pull_number"}],"responses":{"200":{"description":"Previews for the pull request","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Previews.PullRequestPreview"}}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key is not allowed to access this repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The repository is not registered or not accessible to this API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Previews"]}},"/api/public/v1/repositories/{owner}/{repo}/pulls/{pull_number}/previews/{name}":{"put":{"operationId":"upsertPullRequestPreview","summary":"Report pull request preview","description":"Record the deploy status of a named preview for a pull request, typically from CI. The status is applied to every Inspect session currently linked to the pull request; sessions linked later receive the next reported status. Retries are safe: an update whose `occurred_at` is older than the stored status for the same preview is ignored. A `deploying` or `failed` status keeps the last successful URL.","parameters":[{"$ref":"#/components/parameters/Previews.PullRequestParams.owner"},{"$ref":"#/components/parameters/Previews.PullRequestParams.repo"},{"$ref":"#/components/parameters/Previews.PullRequestParams.pull_number"},{"$ref":"#/components/parameters/Previews.PreviewParams.name"}],"responses":{"200":{"description":"The status was accepted","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Previews.UpsertedPullRequestPreview"}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key is read-only or not allowed to access this repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The repository is not registered or not accessible to this API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Previews"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Previews.UpsertPullRequestPreviewRequest"}}}}},"delete":{"operationId":"deletePullRequestPreview","summary":"Delete pull request preview","description":"Remove a named preview from every Inspect session linked to the pull request, for example after the preview environment is torn down.","parameters":[{"$ref":"#/components/parameters/Previews.PullRequestParams.owner"},{"$ref":"#/components/parameters/Previews.PullRequestParams.repo"},{"$ref":"#/components/parameters/Previews.PullRequestParams.pull_number"},{"$ref":"#/components/parameters/Previews.PreviewParams.name"}],"responses":{"204":{"description":"The preview was removed (or did not exist)"},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key is read-only or not allowed to access this repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The repository is not registered or not accessible to this API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Previews"]}},"/api/public/v1/sessions":{"get":{"operationId":"listSessions","summary":"List sessions","description":"List sessions. By default returns only sessions owned by the authenticated user. Use `all=true` to return all sessions. Private sessions are excluded from this discoverable listing unless the API key user owns or participates in them; fetch other sessions by direct session ID instead.","parameters":[{"name":"all","in":"query","required":false,"description":"If true, return all sessions (not just the authenticated user's).","schema":{"type":"boolean","default":false},"explode":false},{"name":"include_archived","in":"query","required":false,"description":"If true, include archived (deleted) sessions in the results.","schema":{"type":"boolean","default":false},"explode":false},{"name":"repository","in":"query","required":false,"description":"Filter by repository ID","schema":{"type":"string"},"explode":false},{"name":"pull_request_number","in":"query","required":false,"description":"Filter by pull request number","schema":{"type":"number"},"explode":false},{"name":"branch_name","in":"query","required":false,"description":"Filter by branch name. Also matches the current head branch of pull requests the session opened.","schema":{"type":"string"},"explode":false},{"name":"agent_id","in":"query","required":false,"description":"Filter by custom agent ID","schema":{"type":"string"},"explode":false},{"name":"slack_thread","in":"query","required":false,"description":"Filter by linked Slack thread in `channel_id:thread_ts` format.","schema":{"type":"string"},"explode":false},{"name":"tag","in":"query","required":false,"description":"Filter by a single session tag (exact, case-sensitive match). By default matches tags added by each session owner; combine with `tagged_by` to match tags added by a specific user instead.","schema":{"type":"string"},"explode":false},{"name":"tagged_by","in":"query","required":false,"description":"Email of the Inspect user whose tags should be used for the `tag` filter and surfaced in each returned session's `tags` field. Defaults to each session's owner. Returns 400 when no Inspect user exists for the email.","schema":{"type":"string","format":"email"},"explode":false},{"name":"start_date","in":"query","required":false,"description":"Filter sessions created on or after this date. ISO 8601 format (e.g. 2025-01-01T00:00:00Z); date-only values use the server's local time.","schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date"}]},"explode":false},{"name":"end_date","in":"query","required":false,"description":"Filter sessions created on or before this date. ISO 8601 format (e.g. 2025-12-31T23:59:59Z); date-only values use the server's local time.","schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date"}]},"explode":false},{"name":"sort_by","in":"query","required":false,"description":"Sort order for sessions by creation time. Defaults to newest first.","schema":{"$ref":"#/components/schemas/Sessions.SessionSortOrder","default":"created_at_desc"},"explode":false},{"name":"limit","in":"query","required":false,"description":"Maximum number of sessions to return (1-100)","schema":{"$ref":"#/components/schemas/Sessions.SessionPageSize","default":100},"explode":false}],"responses":{"200":{"description":"List of sessions","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.Session"}}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]},"post":{"operationId":"createSession","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional client-supplied key for safe retries. A same-key retry from the same API key user returns the originally-created session (HTTP 200) instead of creating a duplicate. Trimmed; blank keys are ignored, otherwise 8 to 255 characters. Idempotency is keyed per API key user.","schema":{"type":"string","maxLength":255}}],"description":"Create a new Inspect session with an initial prompt. Accepts either `application/json` or `multipart/form-data`. Use multipart when you need to upload file attachments alongside the prompt; put the JSON request in the `data` field.\n\nSupports an `Idempotency-Key` request header. When the same key is sent twice from the same API key, the second call returns the originally-created session (HTTP 200) instead of creating a new one. Keys are scoped per API key user and remain valid until the originally-created session is archived; a same-key request after archive starts a fresh session.","summary":"Create session","responses":{"200":{"description":"Idempotency-Key replay - returns the session originally created for this key.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.Session"}}}}}},"201":{"description":"Session created successfully","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.Session"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/Error"}]}}}}},"tags":["Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.CreateSessionRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Sessions.CreateSessionMultipartRequest"},"encoding":{"data":{"contentType":"application/json"},"attachments":{"contentType":"*/*"}}}}}}},"/api/public/v1/sessions/warm":{"post":{"operationId":"warmSession","summary":"Warm session","description":"Pre-warm the sandboxed environment for a repository to reduce latency when creating a new session. Call this before creating a session if you want faster startup times.","parameters":[],"responses":{"200":{"description":"Warm request accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.WarmSessionResult"}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.WarmSessionRequest"}}}}}},"/api/public/v1/sessions/{session_id}":{"get":{"operationId":"getSession","summary":"Get session","description":"Retrieve details for a specific session.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"200":{"description":"Session details","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.SessionDetail"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]},"patch":{"operationId":"updateSession","summary":"Update session","description":"Update session metadata. Only the session owner can update a session.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"200":{"description":"Session","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.Session"}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.UpdateSessionRequest"}}}}},"delete":{"operationId":"archiveSession","summary":"Archive session","description":"Archive a session by setting its deletedAt timestamp. Archived sessions are hidden from default list queries but can still be retrieved individually or by using include_archived=true. The session can be archived by the session owner or by the API key user who originally created the session (e.g. when using on_behalf_of).","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"},{"name":"close_pull_request","in":"query","required":false,"description":"Whether to close the session pull request when archiving.","schema":{"type":"boolean","default":true},"explode":false}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]}},"/api/public/v1/sessions/{session_id}/btw":{"post":{"operationId":"answerBtwQuestion","summary":"Ask session side question","description":"Answer a question using the current session transcript without prompting, interrupting, or modifying the session. This works while the session is in progress. Optionally provide a JSON Schema to receive structured output.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"200":{"description":"Question answered successfully","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.BtwAnswer"}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.BtwAnswerRequest"}}}}}},"/api/public/v1/sessions/{session_id}/compact":{"post":{"operationId":"compactSession","summary":"Compact session","description":"Summarize the existing conversation to reduce the context used by subsequent prompts. Laminar-runtime sessions do not support this operation and return 409.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"200":{"description":"Session compacted successfully","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.CompactSessionResult"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]}},"/api/public/v1/sessions/{session_id}/cost":{"get":{"operationId":"getSessionCost","summary":"Get session cost","description":"Best-effort refresh the session durable-object export and return the latest persisted token totals and cost for a specific session. This can be used while a session is still running, without waiting for the scheduled export job. Laminar-runtime sessions return Laminar usage totals, including the usage of the session's subagents such as Verification agent runs, and messageCount is always 0 for them. Use GET /sessions/{session_id}/subagents/{subagent_id}/cost for a single subagent's usage. A Laminar-runtime session that was never bound to a Laminar session returns zero totals.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"200":{"description":"Latest session cost and token totals","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.SessionCost"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]}},"/api/public/v1/sessions/{session_id}/diff":{"get":{"operationId":"getSessionDiff","summary":"Get session diff","description":"Retrieve the raw unified diff for an authorized Inspect session. The endpoint is session-scoped and does not accept arbitrary diff file IDs. Pending or running sessions return the local working-tree diff when one is available; otherwise the stored authoritative session diff is returned.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"},{"name":"repository","in":"query","required":false,"description":"Repository ID whose diff should be returned. Must be a constituent repository of the session workspace. Defaults to the first repository in workspace order.","schema":{"type":"string"},"explode":false}],"responses":{"200":{"description":"Raw unified diff for the session","headers":{"X-Inspect-Diff-Source":{"required":true,"description":"Source selected for this response: local for an active working-tree diff, github for the authoritative GitHub diff, or unknown for legacy rows without source metadata.","schema":{"type":"string","enum":["local","github","unknown"]}}},"content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]}},"/api/public/v1/sessions/{session_id}/events":{"get":{"operationId":"streamSessionEvents","summary":"Stream session events","description":"Establish a WebSocket connection to receive real-time session events. This endpoint requires an `Upgrade: websocket` header and an API key passed as the `token` query parameter; the `Authorization` header is not used.\n\nEach server frame is a JSON text message with `type` and `payload`. Broadcast frames also carry a monotonically increasing `sequence`:\n\n- `agent`: a session event. `payload.type` names the event (for example `message.updated`, `message.part.updated` or `session.status`) and `payload.properties` carries its data. Message and part payloads use the shapes returned by GET /sessions/{session_id}/messages.\n- `replay_complete`: `payload` is `{ requestedAfter, sequence }`, sent after replaying missed frames.\n- `replay_unavailable`: `payload` is `{ requestedAfter, sequence, reason }`; refetch state over HTTP.\n- `sync_status`: `payload` is `{ requestId?, sequence }`.\n\nEvents include assistant responses, tool calls, and other session activity.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"},{"name":"token","in":"query","required":true,"description":"API key token used to authenticate the WebSocket connection","schema":{"type":"string"},"explode":false},{"name":"upgrade","in":"header","required":true,"description":"Must be `websocket`.","schema":{"type":"string"}}],"responses":{"101":{"description":"Switching Protocols - WebSocket connection established"},"400":{"description":"Bad Request - Not a WebSocket request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/Error"}]}}}}},"tags":["Sessions"],"security":[{}]}},"/api/public/v1/sessions/{session_id}/link-slack-thread":{"post":{"operationId":"linkSessionSlackThread","summary":"Link session to Slack thread","description":"Link a session to an existing Slack thread so session updates and questions can be posted there.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.LinkSlackThreadRequest"}}}}}},"/api/public/v1/sessions/{session_id}/messages":{"get":{"operationId":"getSessionMessages","summary":"List session messages","description":"Retrieve all messages for a specific session, including user prompts and assistant responses. Laminar-runtime sessions return the same message shape, projected from the Laminar transcript. If the Laminar transcript exceeds the read limits, the response contains the latest history only and has the header `X-Inspect-Transcript-Truncated: true`.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"200":{"description":"Session messages","headers":{"X-Inspect-Transcript-Truncated":{"required":false,"description":"Set to `true` when a Laminar transcript exceeded the read limits and only the latest history is returned.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.Message"}}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]}},"/api/public/v1/sessions/{session_id}/prompt":{"post":{"operationId":"sendPrompt","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"description":"Send a follow-up prompt to an existing session. Accepts either `application/json` or `multipart/form-data` (JSON request in the `data` field, files in `attachments`). By default prompts are delivered immediately. Set `delivery` to `queued` to enqueue the prompt behind active or outstanding work. If the session has no outstanding prompts, the prompt is delivered immediately and `queued_prompt` is omitted, restarting a dormant sandbox when necessary. Prompts that remain queued may not appear in `/messages` until they are released and processed.","summary":"Send prompt","responses":{"200":{"description":"Prompt accepted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.SendPromptResult"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unhandled server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.SendPromptRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Sessions.SendPromptMultipartRequest"},"encoding":{"data":{"contentType":"application/json"},"attachments":{"contentType":"*/*"}}}}}}},"/api/public/v1/sessions/{session_id}/stop":{"post":{"operationId":"stopSession","summary":"Stop session","description":"Interrupt the session's active turn without archiving it. Cancels any queued prompts and sets the session status to `finished`, but leaves `deletedAt` untouched — so a session that was previously archived and resumed can still be stopped. No-ops (returns the current session) when the session is not running. The session can be stopped by the session owner or by the API key user who originally created the session (e.g. when using on_behalf_of).","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"200":{"description":"Session","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.Session"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]}},"/api/public/v1/sessions/{session_id}/subagents":{"get":{"operationId":"listSessionSubagents","summary":"List session subagents","description":"List the subagents of a session, newest first, including Verification agent runs Inspect started for it. Subagents are not sessions: read them through the subagent endpoints of their parent session. Sessions without a Laminar runtime return an empty list.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"200":{"description":"Subagents of the session","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionSubagent"}}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]}},"/api/public/v1/sessions/{session_id}/subagents/{subagent_id}/cost":{"get":{"operationId":"getSessionSubagentCost","summary":"Get session subagent cost","description":"Return the token totals and cost of a subagent of the session, including its own subagents. `sessionId` is the subagent ID and messageCount is always 0. Returns 404 when the subagent does not belong to the session.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"},{"$ref":"#/components/parameters/Sessions.SessionSubagentIdParams.subagent_id"}],"responses":{"200":{"description":"Latest session cost and token totals","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.SessionCost"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]}},"/api/public/v1/sessions/{session_id}/subagents/{subagent_id}/messages":{"get":{"operationId":"getSessionSubagentMessages","summary":"List session subagent messages","description":"Retrieve the messages of a subagent of the session, in the same shape as GET /sessions/{session_id}/messages. Returns 404 when the subagent does not belong to the session. If the transcript exceeds the read limits, the response contains the latest history only and has the header `X-Inspect-Transcript-Truncated: true`.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"},{"$ref":"#/components/parameters/Sessions.SessionSubagentIdParams.subagent_id"}],"responses":{"200":{"description":"Session messages","headers":{"X-Inspect-Transcript-Truncated":{"required":false,"description":"Set to `true` when a Laminar transcript exceeded the read limits and only the latest history is returned.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.Message"}}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"]}},"/api/public/v1/sessions/{session_id}/tags":{"put":{"operationId":"updateSessionTags","summary":"Replace session tags","description":"Replace the set of tags that the API key's user has applied to a session. Tags are scoped per user: this endpoint only affects tags added by the calling API key's user and never modifies tags added by the session owner or anyone else. Passing an empty array removes all of the caller's tags from the session. The operation is idempotent, making it suitable for pipelines that periodically reconcile labels onto sessions. Find sessions by these tags with `GET /sessions?tag=...&tagged_by=<caller email>`.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"200":{"description":"The caller's tags on the session were replaced","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.SessionTags"}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.UpdateSessionTagsRequest"}}}}}},"/api/public/v1/sessions/{session_id}/update-base-branch":{"post":{"operationId":"updateSessionBaseBranch","summary":"Update session base branch","description":"Update the base branch for a session's first repository. The branch must exist in the session repository. If the session already has an open pull request, its base branch is updated on GitHub as well. Only the session owner can update the base branch. Returns 400 when the branch or repository is invalid (including a branch that does not exist), 409 when the session's pull request is merged or closed, 502 when updating the pull request on GitHub fails, and 500 when the new base branch could not be saved.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"200":{"description":"Base branch update result.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.UpdateBaseBranchSuccess"}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.UpdateBaseBranchRequest"}}}}}},"/api/public/v1/sessions/{session_id}/verification":{"post":{"operationId":"startSessionVerification","summary":"Start session verification","description":"Start or rerun the Verification agent on the current head of the session's pull request. A new run supersedes any older run for that pull request. Runs even when the session owner has turned off automatic Verification agent runs, as long as the repository configures verification at `.inspect/verification/config.yml`. The session owner or the API key user who originally created the session can start a run; read-only API keys cannot start runs in writable sessions. Returns 202 when a run started or was already running, 400 when the session has pull requests in multiple repositories and no repository was given, and 409 with a `reason` when no run started.","parameters":[{"$ref":"#/components/parameters/Sessions.SessionIdParam"}],"responses":{"202":{"description":"Verification agent run started or already running","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.SessionVerificationStarted"}}}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Verification agent run did not start","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.SessionVerificationNotStarted"}}}}},"tags":["Sessions"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sessions.StartSessionVerificationRequest"}}}}}},"/api/public/v1/skills":{"get":{"operationId":"listSkills","summary":"List skills","description":"List active skills in the catalog, including built-in skills. Filter by a case-insensitive `query` that matches the skill ID or description. Use `GET /api/public/v1/skills/{skill_id}` for skill files.","parameters":[{"name":"query","in":"query","required":false,"description":"Optional text to match against skill IDs and descriptions.","schema":{"type":"string"},"explode":false},{"name":"limit","in":"query","required":false,"description":"Maximum number of skills to return.","schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":20},"explode":false}],"responses":{"200":{"description":"Matching skills","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Skills.SkillSummary"}}}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Skills"]},"post":{"operationId":"createSkill","summary":"Create skill","description":"Create a skill owned by the API key user. Provide either `content` (the `SKILL.md` body) or `files` (the complete file set, which must include `SKILL.md`). Creating a skill with the ID of an archived skill restores it; only its original owner or an admin can do this.","parameters":[],"responses":{"201":{"description":"Skill created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Skills.Skill"}}}}}},"400":{"description":"Invalid skill, missing `SKILL.md`, too many or too large files, or unknown collaborator IDs","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, or the archived skill belongs to another user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A skill with this ID already exists or is built into Inspect","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Skills"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skills.CreateSkillRequest"}}}}}},"/api/public/v1/skills/{skill_id}":{"get":{"operationId":"getSkill","summary":"Get skill","description":"Retrieve an active skill, including every file, its owner, and its collaborators.","parameters":[{"name":"skill_id","in":"path","required":true,"description":"Skill ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Skill details","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Skills.Skill"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Skill not found or archived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Skills"]},"patch":{"operationId":"updateSkill","summary":"Update skill","description":"Update or rename a skill. Omitted fields are unchanged. `files` replaces the complete file set and must include `SKILL.md`; `content` replaces only `SKILL.md`. Renaming updates references from user settings and custom agents. Only the owner, a collaborator, or an admin can update a skill; built-in skills are read-only.","parameters":[{"name":"skill_id","in":"path","required":true,"description":"Current skill ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Skill updated","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Skills.Skill"}}}}}},"400":{"description":"Invalid or empty skill update, missing `SKILL.md`, too many or too large files, or unknown collaborator IDs","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, built-in skill, or insufficient skill permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Skill not found or archived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The new skill ID already exists or is built into Inspect","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Skills"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skills.UpdateSkillRequest"}}}}},"delete":{"operationId":"archiveSkill","summary":"Archive skill","description":"Archive a skill so it no longer appears in the catalog or loads for agents. Only the owner, a collaborator, or an admin can archive a skill; built-in skills cannot be archived.","parameters":[{"name":"skill_id","in":"path","required":true,"description":"Skill ID","schema":{"type":"string"}}],"responses":{"204":{"description":"Skill archived"},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, built-in skill, or insufficient skill permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Skill not found or already archived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Skills"]}},"/api/public/v1/user/preferences":{"get":{"operationId":"getUserPreferences","summary":"Get user preferences","description":"Retrieve the authenticated user's preferences, including their default model and agent.","parameters":[],"responses":{"200":{"description":"User preferences","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/User.UserPreferences"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["User"]}},"/api/public/v1/workspaces":{"get":{"operationId":"listWorkspaces","summary":"List workspaces","description":"List available non-hidden repositories.","parameters":[{"name":"type","in":"query","required":false,"description":"Filter results by workspace entry type.","schema":{"$ref":"#/components/schemas/Workspaces.WorkspaceListEntryType"},"explode":false}],"responses":{"200":{"description":"List of workspaces","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspaces.WorkspaceList"}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Workspaces"]}},"/api/public/v1/workspaces/{workspace_id}/scripts":{"get":{"operationId":"getWorkspaceScripts","summary":"Get workspace setup scripts","description":"Get the pre-install and post-install scripts for a managed GitHub repository. Requires repository read permission.","parameters":[{"name":"workspace_id","in":"path","required":true,"description":"The workspace ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Current and default setup scripts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspaces.WorkspaceScripts"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing repository read permission, or the API key is not allowed to access this repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Repository not found, or it is not a GitHub repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Stored setup scripts are invalid or could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Workspaces"]},"put":{"operationId":"updateWorkspaceScripts","summary":"Update workspace setup scripts","description":"Update the pre-install and/or post-install scripts for a managed GitHub repository. Omitted scripts are left unchanged. Saving supersedes any running build and invalidates the current build. Requires repository manage permission and a non-read-only API key.","parameters":[{"name":"workspace_id","in":"path","required":true,"description":"The workspace ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Scripts saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspaces.UpdatedWorkspaceScripts"}}}},"400":{"description":"Invalid request parameters or body","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only API key, missing repository manage permission, or the API key is not allowed to access this repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Repository not found, or it is not a GitHub repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Stored setup scripts are invalid or could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Workspaces"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspaces.UpdateWorkspaceScriptsRequest"}}}}}}},"security":[{"bearerAuth":[]}],"components":{"parameters":{"Artifacts.ListArtifactsQuery.after":{"name":"after","in":"query","required":false,"description":"Cursor for pagination. Use `meta.page.end_cursor` from a previous response.","schema":{"$ref":"#/components/schemas/Artifacts.ArtifactCursor"},"explode":false},"Artifacts.ListArtifactsQuery.aggregates":{"name":"aggregates","in":"query","required":false,"description":"Comma-separated aggregates to include. Supported aggregates: `total_count`.","schema":{"$ref":"#/components/schemas/Artifacts.ArtifactAggregateNames"},"explode":false},"Artifacts.ListArtifactsQuery.before":{"name":"before","in":"query","required":false,"description":"Cursor for backward pagination. Mutually exclusive with `first` and `after`.","schema":{"$ref":"#/components/schemas/Artifacts.ArtifactCursor"},"explode":false},"Artifacts.ListArtifactsQuery.first":{"name":"first","in":"query","required":false,"description":"Number of results to return (max 100). Defaults to 50 when `last` is not set.","schema":{"$ref":"#/components/schemas/Artifacts.ArtifactPageSize"},"explode":false},"Artifacts.ListArtifactsQuery.kind":{"name":"kind","in":"query","required":false,"description":"Filter artifacts by kind.","schema":{"$ref":"#/components/schemas/Artifacts.ArtifactKind"},"explode":false},"Artifacts.ListArtifactsQuery.last":{"name":"last","in":"query","required":false,"description":"Number of results to return when paginating backward (max 100). Use `before` to return results before a cursor. Mutually exclusive with `first` and `after`.","schema":{"$ref":"#/components/schemas/Artifacts.ArtifactPageSize"},"explode":false},"Artifacts.ListArtifactsQuery.query":{"name":"query","in":"query","required":false,"description":"Full-text search across title, URL, and description.","schema":{"$ref":"#/components/schemas/Artifacts.ArtifactSearchQuery"},"explode":false},"Previews.PreviewParams.name":{"name":"name","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Previews.PreviewName"}},"Previews.PullRequestParams.owner":{"name":"owner","in":"path","required":true,"description":"GitHub repository owner.","schema":{"type":"string","minLength":1}},"Previews.PullRequestParams.pull_number":{"name":"pull_number","in":"path","required":true,"description":"Pull request number.","schema":{"$ref":"#/components/schemas/Previews.PullRequestNumber"}},"Previews.PullRequestParams.repo":{"name":"repo","in":"path","required":true,"description":"GitHub repository name.","schema":{"type":"string","minLength":1}},"Sessions.SessionIdParam":{"name":"session_id","in":"path","required":true,"description":"The unique identifier of the session","schema":{"type":"string"}},"Sessions.SessionSubagentIdParams.subagent_id":{"name":"subagent_id","in":"path","required":true,"description":"The unique identifier of a subagent of the session","schema":{"type":"string"}}},"schemas":{"Agents.Agent":{"type":"object","required":["id","name","description","model","is_builtin","created_at"],"properties":{"id":{"type":"string","description":"Unique identifier for the agent"},"name":{"type":"string","description":"Display name of the agent"},"description":{"type":"string","description":"Description of what this agent does"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Preferred model for this agent, or null to use the default"},"is_builtin":{"type":"boolean","description":"Whether this is a built-in agent"},"created_at":{"type":"string","format":"date-time","description":"When the agent was created"}}},"Agents.AgentCapabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"git_write":{"type":"boolean"},"browser":{"type":"boolean"},"user_skills":{"type":"boolean"},"repo_skills":{"type":"boolean"},"datadog":{"type":"boolean"},"customer_data_access":{"type":"boolean"},"notion":{"type":"boolean"},"inspect_sessions":{"type":"boolean"},"web_search":{"type":"boolean"},"artifacts":{"type":"boolean"},"tools":{"type":"object","unevaluatedProperties":{"type":"boolean"},"description":"Per-tool enablement overrides"},"linear":{"type":"boolean","description":"Deprecated. This capability was removed and is ignored; only kept for backwards compatibility.","deprecated":true},"feature_flags":{"type":"boolean","description":"Deprecated. This capability was removed and is ignored; only kept for backwards compatibility.","deprecated":true},"zendesk":{"type":"boolean","description":"Deprecated. This capability was removed and is ignored; only kept for backwards compatibility.","deprecated":true},"sentry":{"type":"boolean","description":"Deprecated. This capability was removed and is ignored; only kept for backwards compatibility.","deprecated":true},"deepwiki":{"type":"boolean","description":"Deprecated. This capability was removed and is ignored; only kept for backwards compatibility.","deprecated":true}},"description":"Capability and tool access overrides. Omitted capabilities retain their defaults.","additionalProperties":false},"Agents.AgentDetail":{"type":"object","required":["prompt","created_by","skills","capabilities","prompt_context_mode","repositories","repo_hint"],"properties":{"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"System prompt for this agent, or null when not set"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User id of the creator, if any"},"skills":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Configured skills for this agent"},"capabilities":{"anyOf":[{"$ref":"#/components/schemas/Agents.AgentCapabilities"},{"type":"null"}],"description":"Boolean capability toggles (edit, git_write, browser, integrations, etc.)"},"prompt_context_mode":{"$ref":"#/components/schemas/Agents.PromptContextMode","description":"How this agent applies its custom prompt: append keeps the tuned base system prompt, replace uses the custom prompt as the primary system prompt."},"repositories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Repository allowlist for this agent, or null when unrestricted"},"repo_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional repository hint string"}},"allOf":[{"$ref":"#/components/schemas/Agents.Agent"}],"description":"Full agent configuration for a single ID. Includes fields not present on the list-agents response."},"Agents.AgentVersion":{"type":"object","required":["version","prompt","created_at","created_by"],"properties":{"version":{"type":"integer","format":"int32","description":"Monotonic prompt version number"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Prompt saved in this version"},"created_at":{"type":"string","format":"date-time"},"created_by":{"anyOf":[{"$ref":"#/components/schemas/Agents.AgentVersionAuthor"},{"type":"null"}],"description":"User who saved this version, when known"}}},"Agents.AgentVersionAuthor":{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},"Agents.CreateAgentRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name of the agent. Leading and trailing whitespace is trimmed."},"description":{"type":"string","description":"Description of what this agent does","default":""},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":100000,"description":"System prompt, or null to clear it","default":null},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":200,"description":"Preferred model, or null to use the default. Any string up to 200 characters is stored; it is not checked against the model list.","default":null},"skills":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Agents.SkillName"}},{"type":"null"}],"description":"Configured skill names, or null for no explicit skill list","default":null},"capabilities":{"anyOf":[{"$ref":"#/components/schemas/Agents.AgentCapabilities"},{"type":"null"}],"description":"Capability overrides, or null to restore defaults","default":null},"prompt_context_mode":{"$ref":"#/components/schemas/Agents.PromptContextMode","description":"Whether the custom prompt appends to or replaces the base system prompt","default":"append"},"repositories":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Agents.WorkspaceId"}},{"type":"null"}],"description":"Workspace allowlist containing configured workspace IDs; null means unrestricted","default":null},"repo_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":500,"description":"Optional default repository hint","default":null}},"additionalProperties":false},"Agents.PromptContextMode":{"type":"string","enum":["append","replace"]},"Agents.SkillName":{"type":"string","minLength":1},"Agents.UpdateAgentRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name of the agent. Leading and trailing whitespace is trimmed."},"description":{"type":"string","description":"Description of what this agent does"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":100000,"description":"System prompt, or null to clear it"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":200,"description":"Preferred model, or null to use the default. Any string up to 200 characters is stored; it is not checked against the model list."},"skills":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Agents.SkillName"}},{"type":"null"}],"description":"Configured skill names, or null for no explicit skill list"},"capabilities":{"anyOf":[{"$ref":"#/components/schemas/Agents.AgentCapabilities"},{"type":"null"}],"description":"Capability overrides, or null to restore defaults"},"prompt_context_mode":{"$ref":"#/components/schemas/Agents.PromptContextMode","description":"Whether the custom prompt appends to or replaces the base system prompt"},"repositories":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Agents.WorkspaceId"}},{"type":"null"}],"description":"Workspace allowlist containing configured workspace IDs; null means unrestricted"},"repo_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":500,"description":"Optional default repository hint"}},"description":"At least one field must be provided.","additionalProperties":false,"minProperties":1},"Agents.WorkspaceId":{"type":"string","minLength":1,"description":"Configured Inspect workspace ID"},"Artifacts.Artifact":{"type":"object","required":["id","title","url","description","kind","metadata","created_at"],"properties":{"id":{"type":"string","description":"Unique artifact identifier"},"title":{"type":"string","description":"Artifact title"},"url":{"type":"string","format":"uri","description":"Canonical artifact URL"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Artifact description"},"kind":{"$ref":"#/components/schemas/Artifacts.ArtifactKind"},"metadata":{"type":"object","unevaluatedProperties":{},"description":"Additional metadata stored with the artifact, excluding `url`"},"created_at":{"type":"string","format":"date-time","description":"When the artifact was created"}}},"Artifacts.ArtifactAggregateNames":{"type":"string","maxLength":1024,"pattern":"^\\s*(total_count)?\\s*(,\\s*(total_count)?\\s*)*$"},"Artifacts.ArtifactAggregates":{"type":"object","required":["total_count"],"properties":{"total_count":{"type":"integer","format":"int32","description":"Rows matching all filters, ignoring pagination"}}},"Artifacts.ArtifactCursor":{"type":"string","maxLength":1024},"Artifacts.ArtifactDescription":{"type":"string","minLength":10,"maxLength":2000},"Artifacts.ArtifactKind":{"type":"string","enum":["link","doc","ticket","message","channel","dashboard","pdf","design","feature_flag","file","session_replay"]},"Artifacts.ArtifactList":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Artifacts.Artifact"}},"meta":{"$ref":"#/components/schemas/Artifacts.ArtifactListMeta"}}},"Artifacts.ArtifactListMeta":{"type":"object","required":["page"],"properties":{"page":{"$ref":"#/components/schemas/Automations.PageInfo"},"aggregates":{"$ref":"#/components/schemas/Artifacts.ArtifactAggregates","description":"Present only when `aggregates` was requested."}}},"Artifacts.ArtifactPageSize":{"type":"integer","format":"int32","minimum":1,"maximum":100},"Artifacts.ArtifactSearchQuery":{"type":"string","minLength":1,"maxLength":200},"Artifacts.ArtifactTitle":{"type":"string","minLength":1,"maxLength":200},"Artifacts.ArtifactUrl":{"type":"string","maxLength":2048,"format":"uri","description":"HTTP(S) URL without credentials or local/private host literals. Stored in WHATWG-canonical form."},"Artifacts.CreateArtifactMeta":{"type":"object","required":["created","duplicate_url"],"properties":{"created":{"type":"boolean","description":"True when this request created a new artifact row."},"duplicate_url":{"type":"boolean","description":"True when the submitted artifact matched an existing artifact (same canonical URL, or same upload/replay id for `file` and `session_replay` artifacts) and the existing artifact was returned unchanged."}}},"Artifacts.CreateArtifactRequest":{"type":"object","required":["title","url","description","kind"],"properties":{"title":{"$ref":"#/components/schemas/Artifacts.ArtifactTitle"},"url":{"$ref":"#/components/schemas/Artifacts.ArtifactUrl"},"description":{"$ref":"#/components/schemas/Artifacts.ArtifactDescription"},"kind":{"$ref":"#/components/schemas/Artifacts.ArtifactKind"},"metadata":{"type":"object","unevaluatedProperties":{},"default":{}}},"description":"Metadata must match the artifact kind: `file` requires `uploadId`, `fileName` and `mimeType`; `session_replay` requires `inspectSessionId`, `replayId`, `replay` and `markers`. `url` is always taken from the top-level field."},"Artifacts.CreateArtifactResult":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Artifacts.Artifact"},"meta":{"$ref":"#/components/schemas/Artifacts.CreateArtifactMeta"}}},"Artifacts.UpdateArtifactRequest":{"type":"object","properties":{"title":{"$ref":"#/components/schemas/Artifacts.ArtifactTitle"},"url":{"$ref":"#/components/schemas/Artifacts.ArtifactUrl"},"description":{"$ref":"#/components/schemas/Artifacts.ArtifactDescription"},"kind":{"$ref":"#/components/schemas/Artifacts.ArtifactKind"},"metadata":{"type":"object","unevaluatedProperties":{},"description":"Replaces the stored metadata. `url` is always taken from the top-level field or the current artifact."}},"description":"Provide at least one field to update. When `url` or `metadata` changes, the resulting metadata must match the artifact kind.","minProperties":1},"Automations.AutoAddressPrReviewBuddyPolicy":{"type":"object","required":["enabledFindingTypes"],"properties":{"enabled":{"type":"boolean"},"enabledFindingTypes":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutoAddressPrReviewFindingType"}}},"additionalProperties":false},"Automations.AutoAddressPrReviewFindingType":{"type":"string","enum":["critical","warning","suggestion"]},"Automations.AutoAddressPrReviewIdentityRule":{"type":"object","required":["selector","ruleType"],"properties":{"selector":{"type":"string","minLength":1,"description":"GitHub identity selector key."},"ruleType":{"$ref":"#/components/schemas/Automations.AutoAddressPrReviewIdentityRuleType"}},"additionalProperties":false},"Automations.AutoAddressPrReviewIdentityRuleType":{"type":"string","enum":["allow","block"]},"Automations.AutoAddressPrReviewReviewerCategories":{"type":"object","required":["human","bot"],"properties":{"human":{"type":"boolean"},"bot":{"type":"boolean"}},"additionalProperties":false},"Automations.AutoAddressPrReviewsPolicy":{"type":"object","required":["enabled","reviewerCategories","identityRules","reviewBuddy"],"properties":{"enabled":{"type":"boolean"},"reviewerCategories":{"$ref":"#/components/schemas/Automations.AutoAddressPrReviewReviewerCategories"},"identityRules":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutoAddressPrReviewIdentityRule"}},"reviewBuddy":{"$ref":"#/components/schemas/Automations.AutoAddressPrReviewBuddyPolicy"}},"description":"PR review auto-addressing policy. Requests reject unknown fields.","additionalProperties":false},"Automations.Automation":{"type":"object","required":["id","name","description","prompt","repositories","triggers","slack_channel_id","slack_fanout_destinations","post_to_slack_on_start","slack_mention_users","notify_collaborators_on_merge","run_as","owner","collaborators","model_id","custom_agent_id","autofix_ci_failures","auto_review_enabled","auto_address_pr_reviews_policy","template_variables","enabled","last_run_at","next_run_at","archived_at","created_at","updated_at","viewer_can_edit"],"properties":{"id":{"type":"string","description":"Unique automation identifier"},"name":{"type":"string","description":"Automation name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional description"},"prompt":{"type":"string","description":"Prompt template sent to the agent"},"repositories":{"type":"array","items":{"type":"string"},"description":"Repository IDs the automation targets"},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationTrigger"},"description":"Trigger definitions"},"slack_channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Slack channel to post session updates to. Null when the viewer cannot edit the automation."},"slack_fanout_destinations":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationSlackFanoutDestination"},"description":"Purpose-routed Slack destinations. Each entry grants permission to post in one channel only when the result matches that entry context. Empty when the viewer cannot edit the automation."},"post_to_slack_on_start":{"type":"boolean","description":"Whether automation sessions post to Slack when they start. False when the viewer cannot edit the automation."},"slack_mention_users":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationSlackMention"},"description":"Slack users and user groups mentioned in automation posts. Empty when the viewer cannot edit the automation."},"notify_collaborators_on_merge":{"type":"boolean","description":"Whether automation-created PR merges ping the automation owner and collaborators in the Slack thread, or a group DM when no thread is available."},"run_as":{"$ref":"#/components/schemas/Automations.AutomationRunAs","description":"Identity automation sessions run as: `owner` (the automation owner) or `inspect` (the Inspect system user). Only the owner can change this."},"owner":{"anyOf":[{"$ref":"#/components/schemas/Automations.AutomationCollaborator"},{"type":"null"}],"description":"User who owns the automation. Null for system-owned automations."},"collaborators":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationCollaborator"},"description":"Users who can view and edit this automation from Automations. The automation owner is always included in this list. Empty when the viewer cannot edit the automation."},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Model override"},"custom_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom agent override"},"autofix_ci_failures":{"type":"boolean","description":"Whether sessions created by this automation automatically respond to CI failures."},"auto_review_enabled":{"type":"boolean","description":"Whether sessions created by this automation automatically review and fix code."},"auto_address_pr_reviews_policy":{"anyOf":[{"$ref":"#/components/schemas/Automations.AutoAddressPrReviewsPolicy"},{"type":"null"}],"description":"PR review auto-addressing policy applied to sessions. Null follows the owner user setting."},"template_variables":{"type":"object","unevaluatedProperties":{"$ref":"#/components/schemas/Automations.AutomationTemplateVariableDefinition"},"description":"Template variable definitions"},"enabled":{"type":"boolean","description":"Whether automatic triggers are active. Manual-only automations do not have an enable/disable state."},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the automation last ran"},"next_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the automation is next scheduled to run"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the automation was archived, null if active"},"created_at":{"type":"string","format":"date-time","description":"When the automation was created"},"updated_at":{"type":"string","format":"date-time","description":"When the automation was last updated"},"viewer_can_edit":{"type":"boolean","description":"Whether the authenticated user owns or collaborates on this automation. When false, destinations, collaborators, and agent execution settings are redacted."}}},"Automations.AutomationBranchName":{"type":"string","maxLength":250},"Automations.AutomationCheckName":{"type":"string","minLength":1,"maxLength":250},"Automations.AutomationCollaborator":{"type":"object","required":["id","name","email","image"],"properties":{"id":{"type":"string","description":"User id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User display name"},"email":{"type":"string","description":"User email"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User avatar URL"}}},"Automations.AutomationConditionText":{"type":"string","minLength":1,"maxLength":500},"Automations.AutomationFilePattern":{"type":"string","minLength":1},"Automations.AutomationList":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Automations.Automation"}},"meta":{"$ref":"#/components/schemas/Automations.PageMeta"}}},"Automations.AutomationListScope":{"type":"string","enum":["mine","all"]},"Automations.AutomationPageSize":{"type":"integer","format":"int32","minimum":1,"maximum":100},"Automations.AutomationRepositoryId":{"type":"string","minLength":1,"description":"Workspace id, or `auto` to let Inspect detect the repository. Must be a workspace known to Inspect."},"Automations.AutomationRunAs":{"type":"string","enum":["owner","inspect"]},"Automations.AutomationSlackFanoutContext":{"type":"string","minLength":1,"maxLength":1000},"Automations.AutomationSlackFanoutDestination":{"type":"object","required":["channel_id","context"],"properties":{"channel_id":{"type":"string","description":"Slack channel id for a configured fanout destination."},"context":{"type":"string","description":"Natural-language routing context for the specific purpose that makes this channel the right destination."}}},"Automations.AutomationSlackFanoutDestinationInput":{"type":"object","required":["channel_id","context"],"properties":{"channel_id":{"type":"string","minLength":1,"maxLength":500,"description":"Slack channel id or pasted Slack channel link. The API normalizes channel ids from links.","examples":["C03KH3AGN2G"]},"context":{"$ref":"#/components/schemas/Automations.AutomationSlackFanoutContext","description":"The exact purpose that belongs in this destination, e.g. \"mobile app related issues or minor improvements\". Do not use this as a generic broadcast reason."}}},"Automations.AutomationSlackMention":{"anyOf":[{"$ref":"#/components/schemas/Automations.AutomationSlackMentionUser"},{"$ref":"#/components/schemas/Automations.AutomationSlackMentionUserGroup"}],"description":"Slack user or user group mentioned when the automation posts to Slack."},"Automations.AutomationSlackMentionInput":{"anyOf":[{"$ref":"#/components/schemas/Automations.AutomationSlackMentionUserInput"},{"$ref":"#/components/schemas/Automations.AutomationSlackMentionUserGroupInput"}],"description":"Slack user (the default when `type` is omitted) or user group to mention."},"Automations.AutomationSlackMentionUser":{"type":"object","required":["type","id","name","image"],"properties":{"type":{"type":"string","enum":["user"]},"id":{"type":"string"},"name":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"Automations.AutomationSlackMentionUserGroup":{"type":"object","required":["type","id","name","handle"],"properties":{"type":{"type":"string","enum":["usergroup"]},"id":{"type":"string"},"name":{"type":"string"},"handle":{"type":"string"}}},"Automations.AutomationSlackMentionUserGroupInput":{"type":"object","required":["type","id","name","handle"],"properties":{"type":{"type":"string","enum":["usergroup"]},"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"handle":{"type":"string","minLength":1}}},"Automations.AutomationSlackMentionUserInput":{"type":"object","required":["id","name","image"],"properties":{"type":{"type":"string","enum":["user"],"default":"user"},"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"Automations.AutomationTemplateVariableDefinition":{"type":"object","properties":{"label":{"type":"string","description":"Optional display label for this variable."},"valueType":{"$ref":"#/components/schemas/Automations.AutomationTemplateVariableValueType","description":"Expected value shape for editor inputs. Prompt rendering still substitutes strings."},"defaultValue":{"type":"string","description":"Optional default substitution value."},"options":{"type":"array","items":{"type":"string"},"description":"Optional allowed substitution values shown as a picker."}}},"Automations.AutomationTemplateVariableValueType":{"type":"string","enum":["text","integer","number","boolean"]},"Automations.AutomationTextOperator":{"type":"string","enum":["contains","not_contains","starts_with","ends_with","equals","not_equals"]},"Automations.AutomationTrigger":{"anyOf":[{"$ref":"#/components/schemas/Automations.CronAutomationTrigger"},{"$ref":"#/components/schemas/Automations.PushAutomationTrigger"},{"$ref":"#/components/schemas/Automations.StatusCheckAutomationTrigger"},{"$ref":"#/components/schemas/Automations.PrCommentAutomationTrigger"},{"$ref":"#/components/schemas/Automations.SentryAutomationTrigger"},{"$ref":"#/components/schemas/Automations.SlackAutomationTrigger"},{"$ref":"#/components/schemas/Automations.DatadogAutomationTrigger"},{"$ref":"#/components/schemas/Automations.LaunchDarklyAutomationTrigger"}]},"Automations.AutomationTriggerInput":{"anyOf":[{"$ref":"#/components/schemas/Automations.CronAutomationTriggerInput"},{"$ref":"#/components/schemas/Automations.PushAutomationTriggerInput"},{"$ref":"#/components/schemas/Automations.StatusCheckAutomationTriggerInput"},{"$ref":"#/components/schemas/Automations.PrCommentAutomationTriggerInput"},{"$ref":"#/components/schemas/Automations.SentryAutomationTriggerInput"},{"$ref":"#/components/schemas/Automations.SlackAutomationTriggerInput"},{"$ref":"#/components/schemas/Automations.DatadogAutomationTriggerInput"},{"$ref":"#/components/schemas/Automations.LaunchDarklyAutomationTriggerInput"}],"description":"Trigger definition, selected by `type`."},"Automations.AutomationTriggerInputBase":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Existing stable trigger id when updating. Pass null for an unambiguously new trigger in a replacement update; legacy clients may omit ids and retain existing identities by type order."},"enabled":{"type":"boolean","default":true}}},"Automations.AutomationUserId":{"type":"string","minLength":1},"Automations.CreateAutomationRequest":{"type":"object","required":["name","prompt","repositories","triggers"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Automation name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":500,"description":"Optional description. When omitted, a short plain-language description is generated from the prompt.","default":null},"prompt":{"type":"string","minLength":1,"maxLength":100000,"description":"Prompt template sent to the agent"},"sourceAutomationId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional published automation ID to soft fork.","default":null},"source_automation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias of `sourceAutomationId`. `sourceAutomationId` wins when both are set.","default":null},"repositories":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationRepositoryId"},"minItems":1,"description":"Repository IDs the automation targets"},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationTriggerInput"},"description":"Trigger definitions. Pass an empty array for manual-only. Any trigger type may appear multiple times."},"slack_channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"slack_fanout_destinations":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationSlackFanoutDestinationInput"},"maxItems":50,"description":"Optional purpose-routed destinations. When users describe Slack routing in natural language, extract each Slack channel id/link plus the specific purpose/context that belongs there into this array and show the diff before enabling or saving.","default":[]},"post_to_slack_on_start":{"type":"boolean","description":"Whether automation sessions post to Slack when they start.","default":true},"slack_mention_users":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationSlackMentionInput"},"description":"Slack users and user groups to mention in automation posts.","default":[]},"notify_collaborators_on_merge":{"type":"boolean","description":"When true, automation-created PR merges ping the automation owner and collaborators in the Slack thread, or a group DM when no thread is available.","default":false},"run_as":{"$ref":"#/components/schemas/Automations.AutomationRunAs","description":"Identity automation sessions run as: `owner` (the automation owner) or `inspect` (the Inspect system user). Only the owner can change this.","default":"owner"},"collaborator_user_ids":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationUserId"},"description":"Users who can view and edit this automation from Automations. The owner is always included and ignored if passed here.","default":[]},"model_id":{"anyOf":[{"$ref":"#/components/schemas/Models.ModelId"},{"type":"null"}],"description":"Model used by the automation. Must be one of the model ids from `GET /api/public/v1/models`. Defaults to the default automation model unless the selected custom agent defines its own model.","default":null},"custom_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"autofix_ci_failures":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Null resolves to the owner user setting and is stored explicitly.","default":null},"auto_review_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Null resolves to false and is stored explicitly.","default":null},"auto_address_pr_reviews_policy":{"anyOf":[{"$ref":"#/components/schemas/Automations.AutoAddressPrReviewsPolicy"},{"type":"null"}],"description":"Policy applied to sessions. Null snapshots the owner user setting when the automation is created.","default":null},"enabled":{"type":"boolean","description":"Whether automatic triggers are active. Ignored when triggers is empty for manual-only automations.","default":true},"template_variables":{"type":"object","unevaluatedProperties":{"type":"object","unevaluatedProperties":{}},"description":"Template variable definitions keyed by variable name. Each value must be an object; `label`, `valueType` (`text`, `integer`, `number` or `boolean`), `defaultValue` and `options` are read from it and any other or invalid fields are ignored.","default":{}}},"description":"Creates an automation whose ordered trigger list may contain repeated trigger types."},"Automations.CronAutomationTrigger":{"type":"object","required":["id","type","schedule_expression","cron_expression","timezone","enabled"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Stable trigger identifier. Legacy triggers may return null."},"type":{"type":"string","enum":["cron"]},"schedule_expression":{"type":"string","description":"Human-readable or raw cron schedule expression"},"cron_expression":{"type":"string","description":"Cron expression"},"timezone":{"type":"string","description":"IANA timezone"},"enabled":{"type":"boolean","description":"Whether this trigger is enabled"}}},"Automations.CronAutomationTriggerInput":{"type":"object","required":["type"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Existing stable trigger id when updating. Pass null for an unambiguously new trigger in a replacement update; legacy clients may omit ids and retain existing identities by type order."},"enabled":{"type":"boolean","default":true},"type":{"type":"string","enum":["cron"]},"schedule_expression":{"type":"string","maxLength":200,"description":"Human-readable or raw cron schedule expression.","default":""},"cron_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":100,"description":"Cron expression. Required: a missing, null, or empty value is rejected.","default":null},"timezone":{"type":"string","description":"IANA timezone for cron triggers","default":"UTC"}}},"Automations.DatadogAutomationTrigger":{"type":"object","required":["id","type","enabled","monitor_url","scope","monitor_id","reply_to_slack_message","provisioning_status","provisioning_error"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["datadog"]},"enabled":{"type":"boolean"},"monitor_url":{"type":"string","description":"Datadog monitor URL for a Datadog trigger."},"scope":{"$ref":"#/components/schemas/Automations.DatadogTriggerScope","description":"Datadog transitions that start this trigger."},"monitor_id":{"type":"string","description":"Datadog monitor identifier."},"reply_to_slack_message":{"type":"boolean","description":"Whether automation responses should reuse the matching Datadog notification thread in the configured Slack channel."},"provisioning_status":{"$ref":"#/components/schemas/Automations.DatadogTriggerProvisioningStatus"},"provisioning_error":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"Automations.DatadogAutomationTriggerInput":{"type":"object","required":["type","monitor_url","scope"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Existing stable trigger id when updating. Pass null for an unambiguously new trigger in a replacement update; legacy clients may omit ids and retain existing identities by type order."},"enabled":{"type":"boolean","default":true},"type":{"type":"string","enum":["datadog"]},"monitor_url":{"$ref":"#/components/schemas/Automations.DatadogMonitorUrl","description":"Full Datadog monitor URL."},"scope":{"$ref":"#/components/schemas/Automations.DatadogTriggerScope","description":"Transitions that start the automation."},"reply_to_slack_message":{"type":"boolean","description":"Reply in the matching Datadog notification thread when it appears in the configured Slack channel.","default":true}}},"Automations.DatadogMonitorUrl":{"type":"string","minLength":1,"maxLength":2000},"Automations.DatadogTriggerProvisioningStatus":{"type":"string","enum":["pending","active","error","deprovisioning","deleted"]},"Automations.DatadogTriggerScope":{"type":"string","enum":["alert","warning","all"]},"Automations.GithubPrCommentAuthorCondition":{"type":"object","required":["field","operator","values"],"properties":{"field":{"type":"string","enum":["author"]},"operator":{"type":"string","enum":["is_any_of","is_none_of"]},"values":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100,"description":"GitHub logins, matched case-insensitively. Requests trim each login and strip a leading `@` before validating it as a GitHub username (optionally ending in `[bot]`)."}}},"Automations.GithubPrCommentAuthorTypeCondition":{"type":"object","required":["field","operator","value"],"properties":{"field":{"type":"string","enum":["author_type"]},"operator":{"type":"string","enum":["equals","not_equals"]},"value":{"type":"string","enum":["human","bot"]}}},"Automations.GithubPrCommentCondition":{"anyOf":[{"$ref":"#/components/schemas/Automations.GithubPrCommentTextCondition"},{"$ref":"#/components/schemas/Automations.GithubPrCommentKindCondition"},{"$ref":"#/components/schemas/Automations.GithubPrCommentAuthorTypeCondition"},{"$ref":"#/components/schemas/Automations.GithubPrCommentAuthorCondition"}],"description":"A typed GitHub PR comment condition. Conditions on one trigger are ANDed."},"Automations.GithubPrCommentKind":{"type":"string","enum":["conversation","review_comment","review"]},"Automations.GithubPrCommentKindCondition":{"type":"object","required":["field","operator","values"],"properties":{"field":{"type":"string","enum":["comment_kind"]},"operator":{"type":"string","enum":["is_any_of","is_none_of"]},"values":{"type":"array","items":{"$ref":"#/components/schemas/Automations.GithubPrCommentKind"},"minItems":1,"maxItems":3}}},"Automations.GithubPrCommentTextCondition":{"type":"object","required":["field","operator","value"],"properties":{"field":{"type":"string","enum":["text"]},"operator":{"$ref":"#/components/schemas/Automations.AutomationTextOperator"},"value":{"$ref":"#/components/schemas/Automations.AutomationConditionText"}}},"Automations.GithubStatusCheckResult":{"type":"string","enum":["failure","error","timed_out","startup_failure","action_required","success","cancelled","neutral","skipped"]},"Automations.LaunchDarklyAutomationTrigger":{"type":"object","required":["id","type","enabled","projectKey","environmentKey","conditions","provisioningStatus","provisioningError"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["launchdarkly"]},"enabled":{"type":"boolean"},"projectKey":{"type":"string"},"environmentKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/Automations.LaunchDarklyCondition"}},"provisioningStatus":{"$ref":"#/components/schemas/Automations.LaunchDarklyTriggerProvisioningStatus"},"provisioningError":{"anyOf":[{"type":"string"},{"type":"null"}]}},"description":"LaunchDarkly trigger. Unlike other trigger types, its fields are returned in camelCase."},"Automations.LaunchDarklyAutomationTriggerInput":{"type":"object","required":["type","projectKey","conditions"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Existing stable trigger id when updating. Pass null for an unambiguously new trigger in a replacement update; legacy clients may omit ids and retain existing identities by type order."},"enabled":{"type":"boolean","default":true},"type":{"type":"string","enum":["launchdarkly"]},"projectKey":{"$ref":"#/components/schemas/Automations.LaunchDarklyProjectKey"},"environmentKey":{"anyOf":[{"$ref":"#/components/schemas/Automations.LaunchDarklyEnvironmentKey"},{"type":"null"}],"default":null},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/Automations.LaunchDarklyCondition"},"maxItems":20}},"description":"LaunchDarkly trigger input. Its fields use camelCase."},"Automations.LaunchDarklyCondition":{"type":"object","required":["field","operator","value"],"properties":{"field":{"$ref":"#/components/schemas/Automations.LaunchDarklyConditionField"},"operator":{"$ref":"#/components/schemas/Automations.LaunchDarklyConditionOperator"},"value":{"$ref":"#/components/schemas/Automations.AutomationConditionText"}}},"Automations.LaunchDarklyConditionField":{"type":"string","enum":["flag_key","action","member_email","comment"]},"Automations.LaunchDarklyConditionOperator":{"type":"string","enum":["equals","not_equals","contains","starts_with"]},"Automations.LaunchDarklyEnvironmentKey":{"type":"string","maxLength":256,"pattern":"^[a-zA-Z0-9_.-]*$"},"Automations.LaunchDarklyProjectKey":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[a-zA-Z0-9_.-]+$"},"Automations.LaunchDarklyTriggerProvisioningStatus":{"type":"string","enum":["pending","active","error","deleted"]},"Automations.PageInfo":{"type":"object","required":["start_cursor","end_cursor","has_next_page","has_previous_page"],"properties":{"start_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for the first result; null only when the page is empty"},"end_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for the last result; null only when the page is empty"},"has_next_page":{"type":"boolean","description":"Whether a next page exists. Exact for forward requests; backward requests infer this from `before`."},"has_previous_page":{"type":"boolean","description":"Whether a previous page exists. Exact for backward requests; forward requests infer this from `after`."}}},"Automations.PageMeta":{"type":"object","required":["page"],"properties":{"page":{"$ref":"#/components/schemas/Automations.PageInfo"}}},"Automations.PrCommentAutomationTrigger":{"type":"object","required":["id","type","enabled","watched_repo","conditions"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["pr_comment"]},"enabled":{"type":"boolean"},"watched_repo":{"type":"string","description":"Workspace id containing the watched repository."},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/Automations.GithubPrCommentCondition"},"description":"All conditions must match. Empty matches every new PR comment, including bot comments."}}},"Automations.PrCommentAutomationTriggerInput":{"type":"object","required":["type","watched_repo"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Existing stable trigger id when updating. Pass null for an unambiguously new trigger in a replacement update; legacy clients may omit ids and retain existing identities by type order."},"enabled":{"type":"boolean","default":true},"type":{"type":"string","enum":["pr_comment"]},"watched_repo":{"$ref":"#/components/schemas/Automations.AutomationRepositoryId","description":"Workspace id containing the watched repository."},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/Automations.GithubPrCommentCondition"},"maxItems":20,"description":"All conditions must match. Empty matches every new PR comment, including bot comments. When omitted, defaults to `[{ \"field\": \"author_type\", \"operator\": \"equals\", \"value\": \"human\" }]` (human-authored comments only)."}}},"Automations.PushAutomationTrigger":{"type":"object","required":["id","type","enabled","watched_repo","file_patterns","branch"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Stable trigger identifier. Legacy triggers may return null."},"type":{"type":"string","enum":["push"]},"enabled":{"type":"boolean"},"watched_repo":{"type":"string","description":"Workspace id containing the repository watched by a push trigger."},"file_patterns":{"type":"array","items":{"type":"string"},"description":"File globs matched by a push trigger."},"branch":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact branch matched by a push trigger, or null for any branch."}}},"Automations.PushAutomationTriggerInput":{"type":"object","required":["type","watched_repo","file_patterns"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Existing stable trigger id when updating. Pass null for an unambiguously new trigger in a replacement update; legacy clients may omit ids and retain existing identities by type order."},"enabled":{"type":"boolean","default":true},"type":{"type":"string","enum":["push"]},"watched_repo":{"$ref":"#/components/schemas/Automations.AutomationRepositoryId","description":"Workspace id containing the watched repository."},"file_patterns":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationFilePattern"},"minItems":1,"description":"File globs matched against changed paths."},"branch":{"anyOf":[{"$ref":"#/components/schemas/Automations.AutomationBranchName"},{"type":"null"}],"description":"Optional exact branch name.","default":null}}},"Automations.SentryAutomationTrigger":{"type":"object","required":["id","type","enabled","installation_id"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["sentry"]},"enabled":{"type":"boolean"},"installation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inspect Sentry organization id to accept alerts from. Null accepts alerts from every connected Sentry organization."}}},"Automations.SentryAutomationTriggerInput":{"type":"object","required":["type"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Existing stable trigger id when updating. Pass null for an unambiguously new trigger in a replacement update; legacy clients may omit ids and retain existing identities by type order."},"enabled":{"type":"boolean","default":true},"type":{"type":"string","enum":["sentry"]},"installation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":64,"description":"Inspect Sentry organization id to accept alerts from. Omit or use null to accept alerts from every connected Sentry organization.","default":null}}},"Automations.SlackAutomationCondition":{"anyOf":[{"$ref":"#/components/schemas/Automations.SlackTextCondition"},{"$ref":"#/components/schemas/Automations.SlackThreadCondition"},{"$ref":"#/components/schemas/Automations.SlackSenderCondition"},{"$ref":"#/components/schemas/Automations.SlackSenderTypeCondition"},{"$ref":"#/components/schemas/Automations.SlackMentionsCondition"},{"$ref":"#/components/schemas/Automations.SlackReactionCondition"},{"$ref":"#/components/schemas/Automations.SlackUserCondition"}],"description":"A typed Slack event condition. Conditions on one trigger are ANDed; values or entities inside one condition use the operator semantics."},"Automations.SlackAutomationEntityRef":{"type":"object","required":["kind","id"],"properties":{"kind":{"type":"string","enum":["user","app"]},"id":{"$ref":"#/components/schemas/Automations.SlackEntityId","description":"Canonical Slack user, app, or bot id."},"aliases":{"type":"array","items":{"$ref":"#/components/schemas/Automations.SlackEntityId"},"maxItems":10,"description":"Equivalent Slack identity ids accepted by this entity."}},"description":"A Slack user or app identity. Aliases allow one app to match its app, bot, or bot-user ids. `user` ids start with U or W; `app` ids start with A or B."},"Automations.SlackAutomationEvent":{"type":"string","enum":["message","reaction_added"]},"Automations.SlackAutomationTrigger":{"type":"object","required":["id","type","enabled","event","channel_ids","conditions"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["slack"]},"enabled":{"type":"boolean"},"event":{"$ref":"#/components/schemas/Automations.SlackAutomationEvent","description":"Slack event type matched by a Slack trigger."},"channel_ids":{"type":"array","items":{"type":"string"},"description":"Slack channel ids watched by a Slack trigger."},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/Automations.SlackAutomationCondition"},"description":"Conditions matched by a Slack trigger. Message and reaction events support different condition fields."}}},"Automations.SlackAutomationTriggerInput":{"type":"object","required":["type","event","channel_ids","conditions"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Existing stable trigger id when updating. Pass null for an unambiguously new trigger in a replacement update; legacy clients may omit ids and retain existing identities by type order."},"enabled":{"type":"boolean","default":true},"type":{"type":"string","enum":["slack"]},"event":{"$ref":"#/components/schemas/Automations.SlackAutomationEvent","description":"Slack event type to match."},"channel_ids":{"type":"array","items":{"$ref":"#/components/schemas/Automations.SlackChannelId"},"minItems":1,"maxItems":100,"description":"Slack channel ids to watch."},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/Automations.SlackAutomationCondition"},"maxItems":20,"description":"Every condition must be valid for the selected event."}}},"Automations.SlackChannelId":{"type":"string","pattern":"^[CGcg][A-Za-z0-9]{8,}$"},"Automations.SlackEntityId":{"type":"string","pattern":"^[ABUWabuw][A-Za-z0-9]{8,}$"},"Automations.SlackMentionsCondition":{"type":"object","required":["field","operator","entities"],"properties":{"field":{"type":"string","enum":["mentions"]},"operator":{"type":"string","enum":["includes_any","includes_all","includes_none"]},"entities":{"type":"array","items":{"$ref":"#/components/schemas/Automations.SlackAutomationEntityRef"},"minItems":1,"maxItems":100}}},"Automations.SlackReactionCondition":{"type":"object","required":["field","operator","values"],"properties":{"field":{"type":"string","enum":["reaction"]},"operator":{"type":"string","enum":["is_any_of","is_none_of"]},"values":{"type":"array","items":{"$ref":"#/components/schemas/Automations.SlackReactionName"},"minItems":1,"maxItems":100}}},"Automations.SlackReactionName":{"type":"string","minLength":1,"maxLength":100,"pattern":"^:?[a-zA-Z0-9_+-]+:?$"},"Automations.SlackSenderCondition":{"type":"object","required":["field","operator","entities"],"properties":{"field":{"type":"string","enum":["sender"]},"operator":{"type":"string","enum":["is_any_of","is_none_of"]},"entities":{"type":"array","items":{"$ref":"#/components/schemas/Automations.SlackAutomationEntityRef"},"minItems":1,"maxItems":100}}},"Automations.SlackSenderTypeCondition":{"type":"object","required":["field","operator","value"],"properties":{"field":{"type":"string","enum":["sender_type"]},"operator":{"type":"string","enum":["equals","not_equals"]},"value":{"type":"string","enum":["human","bot"]}}},"Automations.SlackTextCondition":{"type":"object","required":["field","operator","value"],"properties":{"field":{"type":"string","enum":["text"]},"operator":{"$ref":"#/components/schemas/Automations.AutomationTextOperator"},"value":{"$ref":"#/components/schemas/Automations.AutomationConditionText"}}},"Automations.SlackThreadCondition":{"type":"object","required":["field","operator","value"],"properties":{"field":{"type":"string","enum":["thread"]},"operator":{"type":"string","enum":["equals","not_equals"]},"value":{"type":"string","enum":["reply","top_level"]}}},"Automations.SlackUserCondition":{"type":"object","required":["field","operator","entities"],"properties":{"field":{"type":"string","enum":["user"]},"operator":{"type":"string","enum":["is_any_of","is_none_of"]},"entities":{"type":"array","items":{"$ref":"#/components/schemas/Automations.SlackAutomationEntityRef"},"minItems":1,"maxItems":100}}},"Automations.StatusCheckAutomationTrigger":{"type":"object","required":["id","type","enabled","watched_repo","branch","check_names","results"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["status_check"]},"enabled":{"type":"boolean"},"watched_repo":{"type":"string","description":"Workspace id containing the watched repository."},"branch":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact branch to watch, or null for any branch."},"check_names":{"type":"array","items":{"type":"string"},"description":"Check names to match. Empty matches every check."},"results":{"type":"array","items":{"$ref":"#/components/schemas/Automations.GithubStatusCheckResult"},"description":"Check results that start the automation."}}},"Automations.StatusCheckAutomationTriggerInput":{"type":"object","required":["type","watched_repo","results"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Existing stable trigger id when updating. Pass null for an unambiguously new trigger in a replacement update; legacy clients may omit ids and retain existing identities by type order."},"enabled":{"type":"boolean","default":true},"type":{"type":"string","enum":["status_check"]},"watched_repo":{"$ref":"#/components/schemas/Automations.AutomationRepositoryId","description":"Workspace id containing the watched repository."},"branch":{"anyOf":[{"$ref":"#/components/schemas/Automations.AutomationBranchName"},{"type":"null"}],"description":"Optional exact branch name.","default":null},"check_names":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationCheckName"},"maxItems":50,"description":"Check names to match. Empty matches every check.","default":[]},"results":{"type":"array","items":{"$ref":"#/components/schemas/Automations.GithubStatusCheckResult"},"minItems":1,"description":"Check results that start the automation."}}},"Automations.TriggerAutomationRequest":{"type":"object","properties":{"variables":{"type":"object","unevaluatedProperties":{"type":"string"},"description":"Template variable overrides (string values only)"}}},"Automations.UpdateAutomationRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":500},"prompt":{"type":"string","minLength":1,"maxLength":100000},"repositories":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationRepositoryId"},"minItems":1},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationTriggerInput"},"description":"Replacement trigger definitions. Pass an empty array for manual-only. Preserve ids for retained triggers; any trigger type may appear multiple times."},"slack_channel_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"slack_fanout_destinations":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationSlackFanoutDestinationInput"},"maxItems":50,"description":"Replacement purpose-routed destination list. Use this when an automation description/update says things like \"[#C03KH3AGN2G](slack://channel?team=T039LN97R&id=C03KH3AGN2G) - mobile app related issues or minor improvements\". Each entry means results matching that purpose may post to that channel."},"post_to_slack_on_start":{"type":"boolean","description":"Whether automation sessions post to Slack when they start."},"slack_mention_users":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationSlackMentionInput"},"description":"Replacement list of Slack users and user groups to mention in automation posts."},"notify_collaborators_on_merge":{"type":"boolean","description":"When true, automation-created PR merges ping the automation owner and collaborators in the Slack thread, or a group DM when no thread is available."},"run_as":{"$ref":"#/components/schemas/Automations.AutomationRunAs","description":"Identity automation sessions run as: `owner` (the automation owner) or `inspect` (the Inspect system user). Only the owner can change this."},"collaborator_user_ids":{"type":"array","items":{"$ref":"#/components/schemas/Automations.AutomationUserId"},"description":"Replacement collaborator list. Collaborators can view and edit this automation from Automations. The owner is always included and ignored if passed here."},"model_id":{"anyOf":[{"$ref":"#/components/schemas/Models.ModelId"},{"type":"null"}],"description":"Must be one of the model ids from `GET /api/public/v1/models`."},"custom_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"autofix_ci_failures":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Null resolves to the owner user setting and is stored explicitly."},"auto_review_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Null resolves to false and is stored explicitly."},"auto_address_pr_reviews_policy":{"anyOf":[{"$ref":"#/components/schemas/Automations.AutoAddressPrReviewsPolicy"},{"type":"null"}],"description":"Policy applied to sessions. Null restores fallback to the owner user setting."},"enabled":{"type":"boolean","description":"Whether automatic triggers are active. Ignored when the automation is manual-only."},"template_variables":{"type":"object","unevaluatedProperties":{"type":"object","unevaluatedProperties":{}},"description":"Template variable definitions keyed by variable name. Each value must be an object; `label`, `valueType` (`text`, `integer`, `number` or `boolean`), `defaultValue` and `options` are read from it and any other or invalid fields are ignored."}},"description":"Updates an automation. Only provided fields are changed. The triggers field replaces the ordered list; preserve ids for retained triggers."},"Deployments.DeploymentReport":{"type":"object","required":["repository","pull_request_numbers"],"properties":{"repository":{"type":"string","description":"Lowercased `owner/repo`."},"pull_request_numbers":{"type":"array","items":{"$ref":"#/components/schemas/Deployments.PullRequestNumber"}}}},"Deployments.DeploymentStatus":{"type":"string","enum":["deployed","failed"]},"Deployments.PullRequestNumber":{"type":"integer","format":"int64","exclusiveMinimum":0},"Deployments.ReportDeploymentRequest":{"type":"object","required":["pull_request_numbers","status"],"properties":{"pull_request_numbers":{"type":"array","items":{"$ref":"#/components/schemas/Deployments.PullRequestNumber"},"minItems":1,"maxItems":500,"description":"Pull requests the deployment applies to. Values must be unique.","uniqueItems":true},"status":{"$ref":"#/components/schemas/Deployments.DeploymentStatus"},"environment":{"type":"string","minLength":1,"maxLength":200,"description":"Optional caller-defined environment, shown in notifications and never a completion gate. Omission uses the storage key `default`.","examples":["production"]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":2000,"description":"Optional deployment failure details."},"occurred_at":{"type":"string","format":"date-time","description":"When the deployment transition occurred. Defaults to receipt time."}},"description":"Unknown properties are rejected. String values are trimmed before length limits are checked.","additionalProperties":false},"Deployments.RepositoryPathSegment":{"type":"string","pattern":"^[^/\\s]+$"},"Error":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Error message"}}},"Memories.ArchiveMemoryRequest":{"type":"object","properties":{"reason":{"$ref":"#/components/schemas/Memories.MemoryArchiveReason"}},"description":"Values are trimmed before length limits are checked."},"Memories.CreateMemoryRequest":{"type":"object","required":["title","content","description","memory_type","scope"],"properties":{"title":{"$ref":"#/components/schemas/Memories.MemoryTitle"},"content":{"$ref":"#/components/schemas/Memories.MemoryContent","description":"Canonical Markdown body. Directive memories must be at most 2000 characters so they can be injected in full."},"description":{"$ref":"#/components/schemas/Memories.MemoryDescription"},"memory_type":{"$ref":"#/components/schemas/Memories.MemoryType"},"scope":{"$ref":"#/components/schemas/Memories.MemoryScopeType"},"scope_id":{"$ref":"#/components/schemas/Memories.MemoryUserId","description":"Not supported for personal memories. Any value is rejected with 400."}},"description":"Values are trimmed before length limits are checked."},"Memories.CreatedMemory":{"type":"object","required":["memory","scope"],"properties":{"memory":{"$ref":"#/components/schemas/Memories.Memory"},"scope":{"$ref":"#/components/schemas/Memories.MemoryScope"}}},"Memories.Memory":{"type":"object","required":["id","title","content","description","memoryType","archivedAt","archivedReason"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"content":{"type":"string","description":"Canonical Markdown body."},"description":{"type":"string","description":"Standalone discovery summary."},"memoryType":{"$ref":"#/components/schemas/Memories.MemoryType"},"archivedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"archivedReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"Memories.MemoryArchiveReason":{"type":"string","minLength":1,"maxLength":500},"Memories.MemoryCatalogEntry":{"type":"object","required":["id","title","description","content","memoryType","updatedAt","scope"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","description":"Standalone discovery summary."},"content":{"type":"string","description":"Canonical Markdown body."},"memoryType":{"$ref":"#/components/schemas/Memories.MemoryType"},"updatedAt":{"type":"string","format":"date-time"},"scope":{"$ref":"#/components/schemas/Memories.MemoryScope"}}},"Memories.MemoryContent":{"type":"string","minLength":1,"maxLength":20000},"Memories.MemoryContext":{"type":"object","required":["scopes","directives","facts"],"properties":{"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Memories.MemoryScope"},"description":"Scopes the returned memories were read from."},"directives":{"type":"array","items":{"$ref":"#/components/schemas/Memories.MemoryCatalogEntry"},"description":"Always-on behavioral directives that apply in the requested scopes."},"facts":{"type":"array","items":{"$ref":"#/components/schemas/Memories.MemoryCatalogEntry"},"description":"Fact memories available for discovery in the requested scopes."}}},"Memories.MemoryDescription":{"type":"string","minLength":10,"maxLength":420},"Memories.MemoryDetails":{"type":"object","required":["memory","scopes"],"properties":{"memory":{"$ref":"#/components/schemas/Memories.Memory"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Memories.MemoryScope"}}}},"Memories.MemoryDirectiveLimit":{"type":"integer","format":"int32","minimum":1,"maximum":25},"Memories.MemoryFactLimit":{"type":"integer","format":"int32","minimum":1,"maximum":100},"Memories.MemoryList":{"type":"object","required":["scope","directives","facts"],"properties":{"scope":{"$ref":"#/components/schemas/Memories.MemoryScope"},"directives":{"type":"array","items":{"$ref":"#/components/schemas/Memories.MemoryCatalogEntry"}},"facts":{"type":"array","items":{"$ref":"#/components/schemas/Memories.MemoryCatalogEntry"}}}},"Memories.MemoryResult":{"type":"object","required":["memory"],"properties":{"memory":{"$ref":"#/components/schemas/Memories.Memory"}}},"Memories.MemoryScope":{"type":"object","required":["type","id"],"properties":{"type":{"$ref":"#/components/schemas/Memories.MemoryScopeType"},"id":{"type":"string","description":"User id."}}},"Memories.MemoryScopeType":{"type":"string","enum":["personal"]},"Memories.MemoryTitle":{"type":"string","minLength":1,"maxLength":200},"Memories.MemoryType":{"type":"string","enum":["fact","directive"]},"Memories.MemoryUserId":{"type":"string","minLength":1},"Memories.UpdateMemoryRequest":{"type":"object","required":["title","content","description","memory_type"],"properties":{"title":{"$ref":"#/components/schemas/Memories.MemoryTitle"},"content":{"$ref":"#/components/schemas/Memories.MemoryContent","description":"Canonical Markdown body. Directive memories must be at most 2000 characters so they can be injected in full."},"description":{"$ref":"#/components/schemas/Memories.MemoryDescription"},"memory_type":{"$ref":"#/components/schemas/Memories.MemoryType"}},"description":"Values are trimmed before length limits are checked."},"Models.Model":{"type":"object","required":["id","name","description","supported_variants"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"},"description":"Stable shorthand aliases that resolve to this model."},"supported_variants":{"type":"array","items":{"$ref":"#/components/schemas/Models.ModelVariant"},"description":"Reasoning variants accepted for this model. Empty when the model does not support configurable reasoning."},"hidden":{"anyOf":[{"type":"boolean","enum":[true]},{"type":"string","enum":["eap"]}]}}},"Models.ModelAlias":{"type":"string","enum":["opus","sonnet","haiku","fable","gemini","gemini-pro","gemini-flash","gemini-flash-lite","gemini-3.5-flash","gpt","gpt-6","astra","gpt-5","balanced","frontier","sol","terra","luna","codex","grok","kimi","glm","glm-fast","minimax","qwen","deepseek","muse-wonder","muse-spark"],"description":"Stable shorthand aliases that resolve to a model ID."},"Models.ModelId":{"type":"string","enum":["claude-opus-5-5","claude-opus-5","claude-opus-4-8","claude-opus-4-7","claude-opus-4-6","claude-opus-4-5-20251101","claude-sonnet-5-5","claude-sonnet-5","claude-sonnet-4-6","claude-sonnet-4-5-20250929","claude-haiku-5-5","claude-haiku-4-5-20251001","claude-fable-5-1","claude-fable-5","gpt-6-astra","gpt-6.1-sol","gpt-6.1-terra","gpt-6-sol","gpt-6-luna","gpt-5.6-sol","gpt-5.6-terra","gpt-5.6-luna","gpt-5.5","gpt-5.4","gpt-5.3-codex-api-preview","gpt-5.3-codex","gpt-5.3-codex-spark","gpt-5.4-mini","gpt-5.4-nano","gpt-5.2-codex-medium","gpt-5.2-codex-high","gpt-5.2-codex-xhigh","gpt-5.2-medium","gpt-5.2-high","gpt-5.2-xhigh","gpt-5.2-pro-high","gemini-4-argon","gemini-3.1-pro-preview","gemini-3.1-flash-lite","gemini-3-pro-preview","gemini-3-flash-preview","gemini-3.5-flash","gemini-3.6-flash","gemini-3.5-flash-lite","gemini-flash-early-exp2","gemini-pro-early-exp","grok-4.7","grok-4.5","grok-code-fast-1","zai-glm-4.7","zai-glm-4.6","moonshotai/kimi-k2-instruct-0905","accounts/fireworks/models/kimi-k3","accounts/fireworks/routers/kimi-k3-fast","kimi-k2p7-code","kimi-k2p7-code-fast","kimi-k2p6","kimi-k2p6-turbo","accounts/fireworks/routers/kimi-k2p5-turbo","accounts/fireworks/routers/glm-5-fast","glm-5p3","accounts/fireworks/models/glm-5p2","accounts/fireworks/routers/glm-5p2-fast","accounts/fireworks/routers/glm-5p1-fast","minimax-m3","accounts/fireworks/models/minimax-m2p5","qwen3p8-max","accounts/fireworks/models/qwen3p6-plus","deepseek-v4.1-flash-1017","accounts/fireworks/models/deepseek-v4-flash-0731","accounts/fireworks/models/deepseek-v4-pro","kimi-k3-modal","muse-wonder-1.0","muse-spark-1.3"],"description":"Model IDs known to Inspect."},"Models.ModelVariant":{"type":"string","enum":["low","medium","high","xhigh","max","minimal","none"]},"Previews.HttpUrl":{"type":"string","format":"uri","maxLength":2048,"description":"An http or https URL, trimmed before validation."},"Previews.PreviewName":{"type":"string","maxLength":64,"pattern":"^[a-z][a-z0-9]*(?:-[a-z][a-z0-9]*)*$","description":"Preview name chosen by the caller, e.g. `default` or `storybook`. Lowercase kebab-case where each segment starts with a letter, at most 64 characters. The `default` preview is the session's primary preview."},"Previews.PreviewStatus":{"type":"string","enum":["deploying","deployed","failed"]},"Previews.PullRequestNumber":{"type":"integer","format":"int64","exclusiveMinimum":0},"Previews.PullRequestPreview":{"type":"object","required":["name","label","status","url","commit_sha","deployed_commit_sha","last_succeeded_at","job_url","error","occurred_at"],"properties":{"name":{"type":"string","description":"Preview name"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name for the preview"},"status":{"$ref":"#/components/schemas/Previews.PreviewStatus","description":"Most recently reported status"},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Last successfully deployed URL, kept while a newer deploy is in progress or has failed"},"commit_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Commit of the most recently reported status"},"deployed_commit_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Commit the `url` was built from"},"last_succeeded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the preview last deployed successfully"},"job_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Link to the CI job or run"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Failure details for a failed status"},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the most recently reported status occurred"}}},"Previews.UpsertPullRequestPreviewRequest":{"type":"object","required":["status"],"properties":{"status":{"$ref":"#/components/schemas/Previews.PreviewStatus"},"url":{"anyOf":[{"$ref":"#/components/schemas/Previews.HttpUrl"},{"type":"null"}],"description":"Preview URL (http or https). Required when `status` is `deployed`."},"commit_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"minLength":1,"maxLength":64,"description":"Commit the preview was built from. Recommended: Inspect uses it to mark previews of older commits as outdated."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"minLength":1,"maxLength":100,"description":"Display name for the preview. Omit to keep the current label."},"job_url":{"anyOf":[{"$ref":"#/components/schemas/Previews.HttpUrl"},{"type":"null"}],"description":"Link to the CI job or run."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"maxLength":2000,"description":"Failure details, recorded when `status` is `failed`."},"occurred_at":{"type":"string","format":"date-time","description":"When the status change occurred. Defaults to receipt time."}},"description":"Unknown properties are rejected. String values are trimmed before length limits are checked.","additionalProperties":false},"Previews.UpsertedPullRequestPreview":{"type":"object","required":["name","label","status","url","commit_sha","deployed_commit_sha","last_succeeded_at","job_url","error","occurred_at","session_ids"],"properties":{"name":{"type":"string","description":"Preview name"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name for the preview"},"status":{"$ref":"#/components/schemas/Previews.PreviewStatus","description":"Most recently reported status"},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Last successfully deployed URL, kept while a newer deploy is in progress or has failed"},"commit_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Commit of the most recently reported status"},"deployed_commit_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Commit the `url` was built from"},"last_succeeded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the preview last deployed successfully"},"job_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Link to the CI job or run"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Failure details for a failed status"},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the most recently reported status occurred"},"session_ids":{"type":"array","items":{"type":"string"},"description":"Sessions updated by this request. Empty when no session is linked to the pull request or the update was older than the stored status."}}},"Repositories.Repository":{"type":"object","required":["id","name","description","organization","remote","githubHost","baseBranch"],"properties":{"id":{"type":"string","description":"Repository identifier"},"name":{"type":"string","description":"Repository name"},"description":{"type":"string","description":"Repository description"},"organization":{"type":"string","description":"GitHub organization or owner for this repository."},"remote":{"$ref":"#/components/schemas/Repositories.RepositoryRemote"},"githubHost":{"type":"string","enum":["github"],"description":"Compatibility host key for this GitHub.com repository."},"baseBranch":{"type":"string","description":"Default branch for the repository"},"autoMatchEnabled":{"type":"boolean","description":"Whether repository inference may select this repository without an explicit directive or URL"}},"description":"A workspace exposed under the historical repository naming. Wire fields are camelCase."},"Repositories.RepositoryList":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Repositories.Repository"}},"meta":{"type":"object","properties":{"suggested":{"type":"array","items":{"type":"string"},"description":"IDs of the repositories the user has used most, most used first. Up to five; always empty for system API keys."}},"required":["suggested"]}}},"Repositories.RepositoryRemote":{"type":"string","enum":["github","codestorage"],"description":"Backing remote type for the workspace"},"Sessions.ApiCallbackDataSchema":{"type":"object","properties":{"type":{"type":"string","enum":["object"]}},"unevaluatedProperties":{}},"Sessions.ApprovalProviderStatus":{"type":"string","enum":["not_started","pending","success","ineligible","unavailable","failed","stale"]},"Sessions.ApprovalPublication":{"type":"object","required":["sourceSequence","generation","publicationSequence","headSha","baseRef"],"properties":{"sourceSequence":{"type":"integer","minimum":0},"generation":{"type":"integer","minimum":0},"publicationSequence":{"type":"integer","minimum":0},"headSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"baseRef":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"Sessions.ApprovalRationale":{"type":"object","required":["version","sections"],"properties":{"version":{"type":"number","enum":[1]},"sections":{"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"status":{"type":"string","enum":["passed","failed","pending","not_completed","neutral"]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"sessions":{"type":"array","items":{"type":"string"}},"details":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"values":{"type":"array","items":{"type":"string"}}},"required":["label","text","values"]}}},"required":["title","status","summary","sessions","details"]}}},"required":["title","items"]}}}},"Sessions.ApprovalStatus":{"type":"object","properties":{"stampBuddy":{"$ref":"#/components/schemas/Sessions.StampBuddyApprovalStatus"},"smartReviewer":{"$ref":"#/components/schemas/Sessions.SmartReviewerApprovalStatus"}}},"Sessions.AutoApprovalStatus":{"type":"string","enum":["pending","available","approved","ineligible","shadow","inactive","unavailable","stale"]},"Sessions.BtwAnswer":{"type":"object","required":["prompt","result"],"properties":{"prompt":{"type":"string","description":"The trimmed question."},"result":{"description":"A string answer, or the JSON value matching `output_schema` when one was provided."}}},"Sessions.BtwAnswerRequest":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","minLength":1,"description":"The side question to answer from the current session transcript."},"output_schema":{"type":"object","unevaluatedProperties":{},"description":"Optional JSON Schema for the result. The schema must use the subset supported by OpenAI Structured Outputs."}}},"Sessions.CompactSessionResult":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","enum":[true]}}},"Sessions.ContextualActionKey":{"type":"string","enum":["send_prompt","request_review","merge_when_ready","archive_session"]},"Sessions.CreateSessionMultipartRequest":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Sessions.CreateSessionRequest"}],"description":"JSON-encoded create session request."},"attachments":{"type":"array","items":{},"description":"Optional file attachments."}},"required":["data"]},"Sessions.CreateSessionRequest":{"type":"object","required":["repository"],"properties":{"review_buddy_reviewers":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.ReviewBuddyReviewer"},"description":"Optional Review agent reviewers. Each model must be available to the caller and support the requested reasoning effort."},"repository":{"type":"string","minLength":1,"description":"The repository to create the session for. Use \"auto\" to infer the best repository from the prompt."},"prompt":{"type":"string","description":"The initial prompt for the session. At least one of prompt, attachments, or agent_context is required."},"title":{"type":"string","description":"Optional title for the session. When omitted, Inspect generates one from the creation request."},"no_reply":{"type":"boolean","description":"If true, stores the prompt and dispatches the runner silently without posting an assistant reply back into the session timeline.","default":false},"model":{"anyOf":[{"$ref":"#/components/schemas/Models.ModelId"},{"$ref":"#/components/schemas/Models.ModelAlias"},{"type":"string"}],"description":"Optional model ID or shorthand alias. An explicit model takes precedence over custom-agent and saved-default models; leave unspecified to use the normal default selection. Use GET /api/public/v1/models for model IDs and aliases."},"variant":{"$ref":"#/components/schemas/Models.ModelVariant","description":"Optional model variant. Supported values depend on the model; see `supported_variants` in GET /api/public/v1/models. When omitted, public API automation sessions default gpt-5.6-luna to medium and otherwise use the model's default variant."},"service_tier":{"$ref":"#/components/schemas/Sessions.ModelServiceTier","description":"Optional model service tier. Supported values depend on the selected model; unsupported combinations return 400."},"agent":{"type":"string","description":"Deprecated. This field is ignored for session APIs and only kept for backwards compatibility.","deprecated":true},"enabled_skill_ids":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SkillId"},"description":"Optional list of skill IDs to enable for this session in addition to those configured on the caller's user settings, custom agent, or referenced via slash commands in the prompt. Unknown skill IDs are ignored."},"base_branch":{"type":"string","description":"Optional base branch, defaults to the repository's default branch. If provided, Inspect normalizes common Git prefixes and verifies the branch exists on GitHub before creating the session."},"base_commit":{"type":"string","description":"Benchmark mode only (SWE-bench agent). Pins the session to a per-session Code Storage fork of the repository at this commit SHA: full real history up to the commit, no forward history, and no GitHub remote. Required (non-blank) for the SWE-bench agent; ignored for other agents."},"branch_name":{"type":"string","description":"Optional branch name for the session, only pass this if trying to work on an existing branch"},"pull_request_number":{"type":"number","description":"Optional existing pull request number to associate with this session"},"attach_pull_request":{"type":"boolean","description":"Whether Inspect may automatically associate this session with an existing pull request that matches pull_request_number or branch_name. Set to false to check out branch_name without attaching its existing pull request. Pull requests created by this session are still attached. Defaults to true.","default":true},"agent_context":{"type":"string","description":"Optional additional context for the agent that will not appear in user messages. Useful for providing detailed system context or metadata that should inform the agent but not clutter the visible conversation."},"agent_id":{"type":"string","description":"Optional ID of an agent to use for this session. When provided, the session will be configured with the agent's system prompt, model, capability settings, and any repository restrictions. If the agent is limited to a set of repositories, the chosen repository must be within that set. Private agents cannot be started from the public API. Use GET /api/public/v1/agents to list available agents and their IDs."},"is_readonly":{"type":"boolean","description":"If true, creates a read-only session where the agent cannot create PRs, push code, or make persistent changes. Useful for Q&A, research, or exploratory tasks.","default":false},"visibility":{"$ref":"#/components/schemas/Sessions.SessionVisibility","description":"Controls whether the session appears in discoverable listings and analytics exports. Private sessions remain accessible by direct URL/session ID, but are excluded from list endpoints, public tables, leaderboards, and exports."},"settings":{"$ref":"#/components/schemas/Sessions.CreateSessionSettings","description":"Optional session settings"},"collaborators":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.NonEmptyString"},"description":"Optional list of collaborator email addresses to add to the session. Users matching these emails will be added as session participants."},"pr_footer":{"type":"string","description":"Optional custom footer text to append to PR descriptions. This will appear between the agent-generated description and the standard Inspect footer."},"commit_prefix":{"type":"string","description":"Optional prefix to prepend to commit messages and PR titles. Useful for linking sessions to external systems like incident trackers or issue management tools."},"pr_labels":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.TrimmedNonEmptyString"},"description":"Optional list of GitHub labels to apply to any PR created or adopted by this session. Child sessions inherit these labels automatically."},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionTag"},"maxItems":50,"description":"Optional list of tags for grouping and filtering sessions (for example, run IDs, workflow names, or tenant keys)."},"callback_url":{"type":"string","format":"uri","description":"Optional HTTPS webhook URL that the session can call back to via the api_callback tool. The hostname must be allowed by Inspect. When provided, the agent inside the session can send structured events to this URL, proxied through the Inspect API."},"api_callback_data_schema":{"$ref":"#/components/schemas/Sessions.ApiCallbackDataSchema","description":"Optional JSON Schema describing the expected shape of the `data` argument of the `api_callback` tool. Must be an object whose `type`, when present, is `object`. The schema is injected verbatim into the api_callback tool's description so the model knows what payload to send back."},"api_callback_event_types":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.TrimmedNonEmptyString"},"minItems":1,"description":"Optional non-empty list of allowed event_type values for the api_callback tool. When provided, Inspect exposes those values as the tool schema enum and rejects callbacks whose event_type is not in the list.","uniqueItems":true},"opencode_history":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.OpencodeHistoryEntry"},"description":"Optional conversation history in OpenCode format to import into the session. When provided, the history is bulk-inserted as structured messages visible in the Inspect UI timeline, and the hosted agent is dispatched with noReply (the caller should send a follow-up prompt via POST /:session_id/prompt to start the agent)."},"opencode_history_source":{"$ref":"#/components/schemas/Sessions.OpencodeHistorySource","description":"Optional source of opencode_history, used to label imported messages and continuation context. Defaults to claude-code for backward compatibility."},"on_behalf_of":{"type":"string","format":"email","description":"Optional email address of an existing Inspect user to create the session on behalf of. When provided, the session will be owned by and attributed to this user (including git commits and PR authorship) instead of the API key owner. The user must have logged into Inspect at least once."}}},"Sessions.CreateSessionSettings":{"type":"object","properties":{"ci_failures_enabled":{"type":"boolean","description":"Whether to automatically respond to CI failures for this session. Defaults to user settings or true."},"auto_review_enabled":{"type":"boolean","description":"Whether to automatically review and fix code for this session. Defaults to user settings or false."},"auto_address_pr_reviews_policy":{"$ref":"#/components/schemas/Automations.AutoAddressPrReviewsPolicy","description":"Optional per-session automatic PR review addressing policy. When provided, it overrides the session owner's saved policy for reviews associated with this session."}}},"Sessions.DeployStatus":{"type":"string","enum":["succeeded","failed"]},"Sessions.DiffSource":{"type":"string","enum":["local","github"]},"Sessions.LinkSlackThreadRequest":{"type":"object","required":["channel_id","thread_ts","slack_user_id"],"properties":{"channel_id":{"type":"string","minLength":1,"description":"Slack channel ID that contains the thread"},"thread_ts":{"type":"string","minLength":1,"description":"Slack thread timestamp (the parent message ts)"},"slack_user_id":{"type":"string","minLength":1,"description":"Slack user ID to associate with the linked thread"}}},"Sessions.Message":{"type":"object","required":["info","parts"],"properties":{"info":{"$ref":"#/components/schemas/Sessions.MessageInfo"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.MessagePart"},"description":"Content parts that make up the message"}},"description":"A message in the session conversation"},"Sessions.MessageChildPart":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","enum":["reasoning","tool"],"description":"The kind of child part."},"id":{"type":"string","description":"Opencode part id."},"sessionID":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opencode child session id the part came from. Optional for backwards compatibility with sessions written before this field was added."},"text":{"type":"string","description":"Reasoning text (for `type: \"reasoning\"` parts)."},"time":{"type":"object","properties":{"start":{"type":"integer"},"end":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"description":"Timing info (for `type: \"reasoning\"` parts)."},"tool":{"type":"string","description":"Tool name (for `type: \"tool\"` parts)."},"state":{"type":"object","unevaluatedProperties":{},"description":"Tool state (for `type: \"tool\"` parts). Shape matches the opencode tool part state."}}},"Sessions.MessageInfo":{"type":"object","required":["role"],"properties":{"id":{"type":"string","description":"Unique message identifier"},"sessionID":{"type":"string","description":"ID of the session the message belongs to"},"role":{"type":"string","enum":["user","assistant"],"description":"The role of the message sender"},"time":{"$ref":"#/components/schemas/Sessions.MessageTime"},"agent":{"type":"string","description":"Name of the agent that handled the message"},"model":{"type":"object","properties":{"providerID":{"type":"string"},"modelID":{"type":"string"},"variant":{"type":"string"}},"description":"Model requested for the turn (user messages only)"},"parentID":{"type":"string","description":"ID of the user message this assistant message responds to (assistant messages only)"},"providerID":{"type":"string","description":"Model provider that produced the message (assistant messages only)"},"modelID":{"type":"string","description":"Model that produced the message (assistant messages only)"},"mode":{"type":"string","description":"Agent mode (assistant messages only)"},"cost":{"type":"number","description":"Cost of the message in USD (assistant messages only)"},"tokens":{"$ref":"#/components/schemas/Sessions.MessageTokens","description":"Token usage statistics (assistant messages only)"},"finish":{"type":"string","description":"Why the assistant message finished (assistant messages only)"},"error":{"type":"object","properties":{"name":{"type":"string"},"data":{"type":"object","unevaluatedProperties":{}}},"description":"Error information if the assistant message failed (assistant messages only)"},"path":{"type":"object","properties":{"cwd":{"type":"string"},"root":{"type":"string"}},"required":["cwd","root"],"description":"Working directory and project root the assistant ran in (assistant messages only)"},"variant":{"type":"string","description":"Model variant that produced the message (assistant messages only)"}},"description":"Message metadata in the opencode message format. Message text is not stored here; it is carried by the `text` parts in `parts`."},"Sessions.MessagePart":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["text","reasoning","tool","file","subtask","step-start","step-finish","snapshot","patch","agent","retry","compaction"],"description":"The type of content part"},"id":{"type":"string","description":"Unique part identifier"},"sessionID":{"type":"string","description":"ID of the session the part belongs to"},"messageID":{"type":"string","description":"ID of the message the part belongs to"},"text":{"type":"string","description":"Text content (for `text` and `reasoning` parts)"},"time":{"$ref":"#/components/schemas/Sessions.MessagePartTime","description":"Part timing in Unix epoch milliseconds (for `text` and `reasoning` parts)"},"callID":{"type":"string","description":"Tool call ID (for `tool` parts)"},"tool":{"type":"string","description":"Tool name (for `tool` parts)"},"state":{"$ref":"#/components/schemas/Sessions.MessageToolState"},"mime":{"type":"string","description":"MIME type (for `file` parts)"},"filename":{"type":"string","description":"File name (for `file` parts)"},"url":{"type":"string","description":"File URL (for `file` parts)"},"metadata":{"anyOf":[{"$ref":"#/components/schemas/Sessions.MessagePartMetadata"},{"type":"null"}]}},"description":"A content part (text, tool call, file, etc.)"},"Sessions.MessagePartMetadata":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/Sessions.MessagePartSource","description":"For user text parts only. Origin of the turn. Human-authored sources include `web`, `chrome-extension`, `slack`, `github`, `linear`, `email` and `review-chat` (the latter arrive via an integration but are written by a person). `automation` and `background-task` are injected programmatically and are not human-authored; `agent` turns are sent by another agent, Inspect session, or the agent runtime, such as parent or child session messages; `slack-reaction` and `unknown` are unclassified. Platform-generated turns, such as goal continuations and scheduled wake-ups, also set `@inspect/synthetic: true`. Every prompt submitted through the public API is stamped `automation`. May be absent on messages imported from an external transcript."},"parentSessionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For user text parts only. ID of the parent session when the turn was sent within a child session; null or absent otherwise."},"childSessionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For `task` tool parts only. The opencode child session id for the subagent spawned by this task. Present on sessions written after subagent tracking was added; older sessions may omit this field even when child activity was captured. When absent, consumers can fall back to scanning `childParts[n].sessionID` for the first non-null id."},"childParts":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Sessions.MessageChildPart"}},{"type":"null"}],"description":"For `task` tool parts only. Reasoning and tool-call parts captured from the subagent, in the order they were emitted. Does not include the subagent's final text output (see the parent tool part's `output` field for that)."}},"description":"Part-level metadata. On user text parts, records how the turn was submitted (see `source` and `parentSessionId`). For the built-in `task` tool, includes opencode subagent activity captured by the runner (see properties below). May be absent or empty for other parts."},"Sessions.MessagePartSource":{"type":"string","enum":["web","chrome-extension","slack","slack-reaction","github","linear","email","review-chat","automation","background-task","agent","unknown"]},"Sessions.MessagePartTime":{"type":"object","properties":{"start":{"type":"integer"},"end":{"type":"integer"}}},"Sessions.MessageTime":{"type":"object","required":["created"],"properties":{"created":{"type":"integer","description":"When the message was created"},"completed":{"type":"integer","description":"When the assistant message finished (assistant messages only)"}},"description":"Message timestamps in Unix epoch milliseconds"},"Sessions.MessageTokens":{"type":"object","properties":{"total":{"type":"integer"},"input":{"type":"integer"},"output":{"type":"integer"},"reasoning":{"type":"integer"},"cache":{"type":"object","properties":{"read":{"type":"integer"},"write":{"type":"integer"}}}}},"Sessions.MessageToolState":{"type":"object","required":["status","input"],"properties":{"status":{"type":"string","enum":["pending","running","completed","error"],"description":"Tool execution status"},"input":{"type":"object","unevaluatedProperties":{},"description":"Tool input parameters"},"output":{"type":"string","description":"Tool output (when `status` is `completed`)"},"error":{"type":"string","description":"Error message (when `status` is `error`)"},"title":{"type":"string","description":"Short title describing the tool call"},"metadata":{"type":"object","unevaluatedProperties":{},"description":"Tool-specific metadata"},"time":{"$ref":"#/components/schemas/Sessions.MessagePartTime","description":"Tool execution timing in Unix epoch milliseconds"}},"description":"Tool execution state, including the tool input and output (for `tool` parts)"},"Sessions.ModelServiceTier":{"type":"string","enum":["default","auto","flex","priority"]},"Sessions.NonEmptyString":{"type":"string","minLength":1},"Sessions.OpencodeHistoryEntry":{"type":"object","required":["info","parts"],"properties":{"info":{"description":"OpenCode message info. Any non-null value is accepted."},"parts":{"type":"array","items":{},"description":"OpenCode message parts. Each entry may be any non-null value."}}},"Sessions.OpencodeHistorySource":{"type":"string","enum":["claude-code","codex","opencode"]},"Sessions.PromptDelivery":{"type":"string","enum":["immediate","queued"]},"Sessions.PullRequestStatus":{"type":"string","enum":["draft","awaiting_review","approved","queued","closed","merged"]},"Sessions.QueuedPrompt":{"type":"object","required":["id","created_at"],"properties":{"id":{"type":"string","description":"Durable queued prompt acceptance handle. There is no per-prompt public lifecycle endpoint yet."},"created_at":{"type":"string","format":"date-time","description":"Timestamp from the persisted Hosted Agent prompt row."}}},"Sessions.ReviewBuddyReviewer":{"type":"object","required":["model","reasoningEffort"],"properties":{"model":{"$ref":"#/components/schemas/Models.ModelId"},"reasoningEffort":{"$ref":"#/components/schemas/Models.ModelVariant"}}},"Sessions.SendPromptMultipartRequest":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Sessions.SendPromptRequest"}],"description":"JSON-encoded prompt request."},"attachments":{"type":"array","items":{},"description":"Optional file attachments."}},"required":["data"]},"Sessions.SendPromptRequest":{"type":"object","properties":{"review_buddy_reviewers":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.ReviewBuddyReviewer"},"description":"Optional Review agent reviewers merged into the session's reviewers. Each model must be available to the caller and support the requested reasoning effort."},"prompt":{"type":"string","description":"The follow-up prompt to accept. At least one of prompt, attachments, or agent_context is required."},"no_reply":{"type":"boolean","description":"If true, stores the prompt and dispatches the runner silently without posting an assistant reply back into the session timeline.","default":false},"model":{"anyOf":[{"$ref":"#/components/schemas/Models.ModelId"},{"$ref":"#/components/schemas/Models.ModelAlias"},{"type":"string"}],"description":"Optional model ID or shorthand alias to switch to for this prompt. When omitted, the session keeps its current model. Use GET /api/public/v1/models for model IDs and aliases."},"variant":{"$ref":"#/components/schemas/Models.ModelVariant","description":"Optional model variant. Supported values depend on the model; see `supported_variants` in GET /api/public/v1/models. Defaults to the session's current variant."},"agent":{"type":"string","description":"Deprecated. This field is ignored for session APIs and only kept for backwards compatibility.","deprecated":true},"agent_context":{"type":"string","description":"Optional additional context for the agent that will not appear in user messages."},"commit_prefix":{"type":"string","description":"Optional prefix to prepend to commit messages and PR titles."},"delivery":{"$ref":"#/components/schemas/Sessions.PromptDelivery","description":"`immediate` (default) dispatches the prompt right away. `queued` stores the prompt behind active or outstanding work and returns `queued_prompt` metadata. If an existing session has no outstanding prompts, a queued request is promoted to immediate delivery, `queued_prompt` is omitted, and a dormant sandbox is restarted.","default":"immediate"}}},"Sessions.SendPromptResult":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Sessions.Session"},"queued_prompt":{"$ref":"#/components/schemas/Sessions.QueuedPrompt","description":"Present only when the prompt remained queued."}}},"Sessions.Session":{"type":"object","required":["id","title","description","status","visibility","model","user","openingPr","pushing","workingPhase","deployed","deployUrl","deployLastSucceededAt","deployCommitSha","latestCommitSha","deploy","vncUrl","vncExpiresAt","otaInstallUrl","otaQrCodeUrl","otaExpiresAt","hasChanges","diffFileId","localDiffFileId","diffSource","diffAdditions","diffDeletions","createdAt","finishedAt","lastReadAt","deletedAt","pullRequests","repositories","branchName","baseBranch","stackBaseBranch","helpfulness","helpfulnessReason","totalInputTokens","totalOutputTokens","totalReasoningTokens","totalCacheReadTokens","totalCacheWriteTokens","totalTokens","totalCost","lastUserMessageAt","parentSessionId","projectId","childSessions","tags","metadata","automation","automationTriggerSource","contextualActions","settings","isReadonly","participants","agent","workspace","workspaceRef","repository","pullRequest","pullRequestNumber","pullRequestStatus"],"properties":{"id":{"type":"string","description":"Unique identifier for the session"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Auto-generated title for the session"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Auto-generated description for the session"},"status":{"$ref":"#/components/schemas/Sessions.SessionStatus","description":"Current status of the session"},"retryable":{"type":"boolean","description":"Whether the failed operation is expected to succeed if retried. Present only when status is failed; false for archived sessions and failures known to be permanent, otherwise true. Retry mechanics and limits are defined by the calling workflow."},"visibility":{"$ref":"#/components/schemas/Sessions.SessionVisibility","description":"Whether this session is discoverable in listings and exports, or only accessible by direct link/session ID."},"model":{"$ref":"#/components/schemas/Sessions.SessionModel"},"user":{"$ref":"#/components/schemas/Sessions.SessionUser"},"openingPr":{"type":"boolean","description":"Whether a PR is currently being opened"},"pushing":{"type":"boolean","description":"Whether changes are currently being pushed"},"workingPhase":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Current working phase of the agent"},"deployed":{"type":"boolean","description":"Whether the session has been deployed (deprecated, use deploy.active)","deprecated":true},"deployUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL of the deployed preview (deprecated, use deploy.url)","deprecated":true},"deployLastSucceededAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the last successful deploy occurred (deprecated, use deploy.lastSucceededAt)","deprecated":true},"deployCommitSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Commit SHA of the last successful deploy (deprecated, use deploy.commitSha)","deprecated":true},"latestCommitSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Latest commit SHA pushed to the branch (deprecated, use deploy.latestCommitSha)","deprecated":true},"deploy":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionDeploy"},{"type":"null"}]},"vncUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"vncExpiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"otaInstallUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"otaQrCodeUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"otaExpiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"hasChanges":{"type":"boolean","description":"Whether the session has uncommitted changes"},"diffFileId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Deprecated session-level mirror. Read repositories[].diff.fileId instead.","deprecated":true},"localDiffFileId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Deprecated session-level mirror. Read repositories[].diff.localFileId instead.","deprecated":true},"diffSource":{"anyOf":[{"$ref":"#/components/schemas/Sessions.DiffSource"},{"type":"null"}],"description":"Deprecated session-level mirror. Read repositories[].diff.source instead.","deprecated":true},"diffAdditions":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Deprecated session-level mirror. Read repositories[].diff.additions instead.","deprecated":true},"diffDeletions":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Deprecated session-level mirror. Read repositories[].diff.deletions instead.","deprecated":true},"createdAt":{"type":"string","format":"date-time","description":"When the session was created"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the session finished"},"lastReadAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the API key user last read this session"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the session was archived"},"pullRequests":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionPullRequest"},"description":"All current pull requests for the session across its repositories."},"repositories":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionRepository"},"description":"Per-repository source-control state in workspace order. The first repository is the launch and deploy anchor."},"branchName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Git branch name for the session"},"baseBranch":{"type":"string","description":"Base branch for the session"},"stackBaseBranch":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Branch this session was explicitly stacked on. Preserved when GitHub retargets the pull request after an upstream merge."},"helpfulness":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"User rating of helpfulness (-1 = not helpful, 0 = neutral, 1 = helpful)"},"helpfulnessReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User-provided reason for the helpfulness rating"},"totalInputTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalOutputTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalReasoningTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalCacheReadTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalCacheWriteTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalCost":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Latest persisted total session cost in USD. Null when no usage has been recorded."},"lastUserMessageAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the last user message was sent"},"parentSessionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ID of the parent session if this is a child session"},"projectId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project this session belongs to"},"childSessions":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionChild"},"description":"Direct child sessions spawned from this session. Always empty in list responses."},"tags":{"type":"array","items":{"type":"string"},"description":"Tags on the session as added by the session owner, or by the `tagged_by` user when that list-endpoint parameter is provided. Tags are per-user; other users' tags are not included."},"metadata":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionMetadata"},{"type":"null"}]},"automation":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionAutomation"},{"type":"null"}],"description":"Automation that created this session, if any. Null for sessions created manually or via the API."},"automationTriggerSource":{"anyOf":[{"type":"string","enum":["scheduled","manual","service_trigger","internal"]},{"type":"null"}],"description":"How the automation run that created this session was triggered. Always null in list responses."},"contextualActions":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionContextualActions"},{"type":"null"}]},"settings":{"$ref":"#/components/schemas/Sessions.SessionSettings","description":"Session settings controlling behavior like notifications"},"isOwner":{"type":"boolean","description":"Whether the current user owns this session"},"isReadonly":{"type":"boolean","description":"Whether this is a read-only session where the agent cannot create PRs, push code, or make persistent changes"},"participants":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionParticipant"},"description":"Users who have participated in this session"},"agent":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionAgent"},{"type":"null"}],"description":"Custom agent the session runs with. Always null in list responses."},"workspace":{"$ref":"#/components/schemas/Sessions.SessionWorkspace"},"workspaceRef":{"type":"string","description":"Canonical workspace ref: currently always the workspace id."},"repository":{"$ref":"#/components/schemas/Sessions.SessionWorkspace","description":"Legacy alias for workspace. Use workspace instead.","deprecated":true},"pullRequest":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionPullRequestSummary"},{"type":"null"}]},"pullRequestNumber":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Deprecated. Associated pull request number. Prefer `pullRequest.pullRequestNumber`.","deprecated":true},"pullRequestStatus":{"anyOf":[{"$ref":"#/components/schemas/Sessions.PullRequestStatus"},{"type":"null"}],"description":"Deprecated. Status of the associated pull request. Prefer `pullRequest.status`.","deprecated":true}}},"Sessions.SessionAgent":{"type":"object","required":["id","name","model","avatarUrl"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"Sessions.SessionAutomation":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","description":"Unique automation identifier"},"name":{"type":"string","description":"Human-readable automation name"}}},"Sessions.SessionAutomationFanoutEntry":{"type":"object","required":["channelId","title","permalink","postedAt"],"properties":{"channelId":{"type":"string"},"channelName":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"type":"string"},"permalink":{"type":"string"},"postedAt":{"type":"string"},"targetRepo":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["high","low","urgent","normal"]},{"type":"null"}]},"proposalId":{"type":"string"},"proposalStatus":{"type":"string","enum":["closed","merged","failed","rejected","canceled","accepted","posted"]},"childSessionId":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"Sessions.SessionChild":{"type":"object","required":["id","title","metadata","status","createdAt"],"properties":{"id":{"type":"string","description":"Child session identifier"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Child session title"},"metadata":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"}}},{"type":"null"}]},"status":{"$ref":"#/components/schemas/Sessions.SessionStatus","description":"Current status of the child session"},"createdAt":{"type":"string","format":"date-time","description":"When the child session was created"}}},"Sessions.SessionContextualActions":{"type":"object","required":["sourceAssistantMessageId","suggestions"],"properties":{"sourceAssistantMessageId":{"type":"string"},"suggestions":{"type":"array","items":{"type":"object","properties":{"actionKey":{"$ref":"#/components/schemas/Sessions.ContextualActionKey"},"label":{"type":"string"},"prompt":{"type":"string"},"repository":{"type":"string"},"pullRequestNumber":{"type":"integer"}},"required":["actionKey","label"]}}}},"Sessions.SessionCost":{"type":"object","required":["sessionId","messageCount","totalInputTokens","totalOutputTokens","totalReasoningTokens","totalCacheReadTokens","totalCacheWriteTokens","totalTokens","totalCost","updatedAt"],"properties":{"sessionId":{"type":"string","description":"Unique identifier for the session"},"messageCount":{"type":"integer","description":"Number of assistant messages included in the refreshed cost rollup. Always 0 for Laminar-runtime sessions."},"totalInputTokens":{"type":"integer","description":"Input tokens, including cache read and cache write tokens"},"totalOutputTokens":{"type":"integer","description":"Output tokens, including reasoning tokens"},"totalReasoningTokens":{"type":"integer","description":"Reasoning output tokens"},"totalCacheReadTokens":{"type":"integer","description":"Cache read input tokens"},"totalCacheWriteTokens":{"type":"integer","description":"Cache write input tokens"},"totalTokens":{"type":"integer","description":"Total tokens included in the refreshed cost rollup"},"totalCost":{"type":"number","format":"double","description":"Total session cost in USD"},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the cost rollup was last refreshed. Null when no usage has been recorded."}}},"Sessions.SessionDeploy":{"type":"object","required":["active","url","commitSha","latestCommitSha","lastSucceededAt","lastAttemptStatus","lastAttemptCommitSha","lastAttemptStartedAt","timedOut","outdated"],"properties":{"active":{"type":"boolean","description":"Whether a deploy has been attempted"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL of the deployed preview"},"commitSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Commit SHA of the last successful deploy"},"latestCommitSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Latest commit SHA pushed to the branch"},"lastSucceededAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the last successful deploy occurred"},"lastAttemptStatus":{"anyOf":[{"$ref":"#/components/schemas/Sessions.DeployStatus"},{"type":"null"}],"description":"Status of the latest completed deploy attempt"},"lastAttemptCommitSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Commit SHA of the latest completed deploy attempt"},"lastAttemptStartedAt":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Unix timestamp in milliseconds when the latest deploy attempt started"},"timedOut":{"type":"boolean","description":"Whether the latest preview deploy did not report completion in time"},"outdated":{"type":"boolean","description":"Whether the preview is outdated (deployed commit differs from latest pushed commit)"}},"description":"Deploy preview state"},"Sessions.SessionDetail":{"type":"object","required":["id","title","description","status","visibility","model","user","openingPr","pushing","workingPhase","deployed","deployUrl","deployLastSucceededAt","deployCommitSha","latestCommitSha","deploy","vncUrl","vncExpiresAt","otaInstallUrl","otaQrCodeUrl","otaExpiresAt","hasChanges","diffFileId","localDiffFileId","diffSource","diffAdditions","diffDeletions","createdAt","finishedAt","lastReadAt","deletedAt","pullRequests","repositories","branchName","baseBranch","stackBaseBranch","helpfulness","helpfulnessReason","totalInputTokens","totalOutputTokens","totalReasoningTokens","totalCacheReadTokens","totalCacheWriteTokens","totalTokens","totalCost","lastUserMessageAt","parentSessionId","projectId","childSessions","tags","metadata","automation","automationTriggerSource","contextualActions","settings","isReadonly","participants","agent","workspace","workspaceRef","repository","pullRequest","pullRequestNumber","pullRequestStatus","slackThreadPermalink"],"properties":{"id":{"type":"string","description":"Unique identifier for the session"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Auto-generated title for the session"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Auto-generated description for the session"},"status":{"$ref":"#/components/schemas/Sessions.SessionStatus","description":"Current status of the session"},"retryable":{"type":"boolean","description":"Whether the failed operation is expected to succeed if retried. Present only when status is failed; false for archived sessions and failures known to be permanent, otherwise true. Retry mechanics and limits are defined by the calling workflow."},"visibility":{"$ref":"#/components/schemas/Sessions.SessionVisibility","description":"Whether this session is discoverable in listings and exports, or only accessible by direct link/session ID."},"model":{"$ref":"#/components/schemas/Sessions.SessionModel"},"user":{"$ref":"#/components/schemas/Sessions.SessionUser"},"openingPr":{"type":"boolean","description":"Whether a PR is currently being opened"},"pushing":{"type":"boolean","description":"Whether changes are currently being pushed"},"workingPhase":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Current working phase of the agent"},"deployed":{"type":"boolean","description":"Whether the session has been deployed (deprecated, use deploy.active)","deprecated":true},"deployUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL of the deployed preview (deprecated, use deploy.url)","deprecated":true},"deployLastSucceededAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the last successful deploy occurred (deprecated, use deploy.lastSucceededAt)","deprecated":true},"deployCommitSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Commit SHA of the last successful deploy (deprecated, use deploy.commitSha)","deprecated":true},"latestCommitSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Latest commit SHA pushed to the branch (deprecated, use deploy.latestCommitSha)","deprecated":true},"deploy":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionDeploy"},{"type":"null"}]},"vncUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"vncExpiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"otaInstallUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"otaQrCodeUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"otaExpiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"hasChanges":{"type":"boolean","description":"Whether the session has uncommitted changes"},"diffFileId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Deprecated session-level mirror. Read repositories[].diff.fileId instead.","deprecated":true},"localDiffFileId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Deprecated session-level mirror. Read repositories[].diff.localFileId instead.","deprecated":true},"diffSource":{"anyOf":[{"$ref":"#/components/schemas/Sessions.DiffSource"},{"type":"null"}],"description":"Deprecated session-level mirror. Read repositories[].diff.source instead.","deprecated":true},"diffAdditions":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Deprecated session-level mirror. Read repositories[].diff.additions instead.","deprecated":true},"diffDeletions":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Deprecated session-level mirror. Read repositories[].diff.deletions instead.","deprecated":true},"createdAt":{"type":"string","format":"date-time","description":"When the session was created"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the session finished"},"lastReadAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the API key user last read this session"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the session was archived"},"pullRequests":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionPullRequest"},"description":"All current pull requests for the session across its repositories."},"repositories":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionRepository"},"description":"Per-repository source-control state in workspace order. The first repository is the launch and deploy anchor."},"branchName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Git branch name for the session"},"baseBranch":{"type":"string","description":"Base branch for the session"},"stackBaseBranch":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Branch this session was explicitly stacked on. Preserved when GitHub retargets the pull request after an upstream merge."},"helpfulness":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"User rating of helpfulness (-1 = not helpful, 0 = neutral, 1 = helpful)"},"helpfulnessReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User-provided reason for the helpfulness rating"},"totalInputTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalOutputTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalReasoningTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalCacheReadTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalCacheWriteTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalTokens":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalCost":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Latest persisted total session cost in USD. Null when no usage has been recorded."},"lastUserMessageAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the last user message was sent"},"parentSessionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ID of the parent session if this is a child session"},"projectId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project this session belongs to"},"childSessions":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionChild"},"description":"Direct child sessions spawned from this session. Always empty in list responses."},"tags":{"type":"array","items":{"type":"string"},"description":"Tags on the session as added by the session owner, or by the `tagged_by` user when that list-endpoint parameter is provided. Tags are per-user; other users' tags are not included."},"metadata":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionMetadata"},{"type":"null"}]},"automation":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionAutomation"},{"type":"null"}],"description":"Automation that created this session, if any. Null for sessions created manually or via the API."},"automationTriggerSource":{"anyOf":[{"type":"string","enum":["scheduled","manual","service_trigger","internal"]},{"type":"null"}],"description":"How the automation run that created this session was triggered. Always null in list responses."},"contextualActions":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionContextualActions"},{"type":"null"}]},"settings":{"$ref":"#/components/schemas/Sessions.SessionSettings","description":"Session settings controlling behavior like notifications"},"isOwner":{"type":"boolean","description":"Whether the current user owns this session"},"isReadonly":{"type":"boolean","description":"Whether this is a read-only session where the agent cannot create PRs, push code, or make persistent changes"},"participants":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionParticipant"},"description":"Users who have participated in this session"},"agent":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionAgent"},{"type":"null"}],"description":"Custom agent the session runs with. Always null in list responses."},"workspace":{"$ref":"#/components/schemas/Sessions.SessionWorkspace"},"workspaceRef":{"type":"string","description":"Canonical workspace ref: currently always the workspace id."},"repository":{"$ref":"#/components/schemas/Sessions.SessionWorkspace","description":"Legacy alias for workspace. Use workspace instead.","deprecated":true},"pullRequest":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionPullRequestSummary"},{"type":"null"}]},"pullRequestNumber":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Deprecated. Associated pull request number. Prefer `pullRequest.pullRequestNumber`.","deprecated":true},"pullRequestStatus":{"anyOf":[{"$ref":"#/components/schemas/Sessions.PullRequestStatus"},{"type":"null"}],"description":"Deprecated. Status of the associated pull request. Prefer `pullRequest.status`.","deprecated":true},"slackThreadPermalink":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Permalink to the Slack thread linked to the session, if any."}}},"Sessions.SessionMetadata":{"type":"object","properties":{"runtime":{"type":"string","enum":["laminar","hosted-agent"]},"laminarStartupPending":{"type":"boolean"},"laminarRuntime":{"type":"object","properties":{"sessionId":{"type":"string"},"backend":{"type":"string","enum":["cell","hosted"]},"displayReadyAt":{"type":"string"}},"required":["sessionId"]},"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"prLabels":{"type":"array","items":{"type":"string"}},"mobileDeployOtaCommitSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"hiddenFromDashboard":{"type":"boolean"},"projectCoordinator":{"type":"boolean"},"privateConnectorVisibility":{"type":"object","properties":{"connectorIds":{"type":"array","items":{"type":"string"}},"connectorNames":{"type":"array","items":{"type":"string"}},"forcedAt":{"type":"string"}},"required":["connectorIds","connectorNames","forcedAt"]},"lastDeployEventTs":{"type":"number"},"lastDeployStatus":{"$ref":"#/components/schemas/Sessions.DeployStatus"},"lastDeployCommitSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"secondaryDeployUrls":{"type":"object","unevaluatedProperties":{"$ref":"#/components/schemas/Sessions.SessionSecondaryDeployUrl"}},"customAgentPromptVersion":{"type":"number"},"serviceTier":{"type":"string"},"modelClass":{"type":"string","enum":["fast","rigorous"]},"benchmarkFork":{"type":"object","properties":{"repoId":{"type":"string"},"baseCommit":{"type":"string"},"baseBranch":{"type":"string"},"repo":{"type":"string"}},"required":["repoId","baseCommit","baseBranch","repo"]},"reviewRequested":{"type":"boolean"},"reviewRequestDestinations":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"}},"required":["label","url"]}},"autoMergeEnabled":{"type":"boolean"},"automationFanoutSummary":{"type":"object","properties":{"primaryChannelId":{"type":"string"},"summaryMessageTs":{"type":"string"},"entries":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionAutomationFanoutEntry"}}},"required":["primaryChannelId","entries"]},"adminApiRequests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"expiresAt":{"type":"string"}},"required":["id","expiresAt"]}},"githubInspectMentionCount":{"type":"number"},"githubInspectMentionsPaused":{"type":"boolean"},"structuredOutput":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["error","pending","completed"]},"output":{},"error":{"type":"string"}},"required":["status"]},{"type":"null"}]},"automationTrigger":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["manual","standard"]},"details":{"anyOf":[{"type":"string"},{"type":"null"}]},"automationRunId":{"type":"string"},"startingInternalState":{"type":"object","unevaluatedProperties":{}}},"required":["type","automationRunId","startingInternalState"]},{"type":"null"}]}},"description":"Persisted session metadata."},"Sessions.SessionModel":{"type":"object","required":["id","name","provider"],"properties":{"id":{"type":"string","description":"Model identifier"},"name":{"type":"string","description":"Human-readable model name"},"provider":{"type":"string","description":"Model provider (e.g., anthropic, openai)"},"variant":{"type":"string","description":"Active model variant when applicable."}}},"Sessions.SessionPageSize":{"type":"integer","format":"int32","minimum":1,"maximum":100},"Sessions.SessionParticipant":{"type":"object","required":["id","sessionId","userId","joinedAt","lastActiveAt","user"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Participant identifier, or null for the session owner when they have not joined the session explicitly"},"sessionId":{"type":"string"},"userId":{"type":"string"},"joinedAt":{"type":"string","format":"date-time"},"lastActiveAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"leftAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Present on single-session responses only."},"user":{"$ref":"#/components/schemas/Sessions.SessionUser"}}},"Sessions.SessionPullRequest":{"type":"object","required":["repository","githubRepository","url","pullRequestNumber","adoptedAt","statusUpdatedAt","title","reviewBuddyInspectSessionId","approvalStatus","status","mergedAt","author"],"properties":{"repository":{"type":"string","description":"Repository ID that owns the pull request"},"githubRepository":{"type":"string","description":"Canonical GitHub repository name, which may differ from the Inspect repository ID."},"url":{"type":"string","format":"uri","description":"GitHub pull request URL"},"pullRequestNumber":{"type":"integer","description":"Pull request number"},"adoptedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the pull request was adopted into the session"},"statusUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the pull request last changed workflow status"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pull request title"},"reviewBuddyInspectSessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvalStatus":{"anyOf":[{"$ref":"#/components/schemas/Sessions.ApprovalStatus"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/Sessions.PullRequestStatus","description":"Workflow status of the pull request"},"mergedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the pull request was merged, or null if it has not been merged"},"author":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionPullRequestAuthor"},{"type":"null"}],"description":"GitHub user who opened the pull request, or null when unknown"}}},"Sessions.SessionPullRequestAuthor":{"type":"object","required":["login","displayName","avatarUrl","profileUrl"],"properties":{"login":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"GitHub login"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"GitHub display name"},"avatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"GitHub avatar URL"},"profileUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"GitHub profile URL"}}},"Sessions.SessionPullRequestSummary":{"type":"object","required":["pullRequestNumber","adoptedAt","title","status","mergedAt","author"],"properties":{"pullRequestNumber":{"type":"integer","description":"Pull request number"},"adoptedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the pull request was adopted into the session"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pull request title"},"status":{"$ref":"#/components/schemas/Sessions.PullRequestStatus","description":"Workflow status of the pull request"},"mergedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the pull request was merged, or null if it has not been merged"},"author":{"anyOf":[{"$ref":"#/components/schemas/Sessions.SessionPullRequestAuthor"},{"type":"null"}],"description":"GitHub user who opened the pull request, or null when unknown"}},"description":"Deprecated. The first repository's current pull request, if any. Prefer `pullRequests`."},"Sessions.SessionRepository":{"type":"object","required":["id","isPrimary","stateUpdatedAt","branchName","baseBranch","latestCommitSha","diff"],"properties":{"id":{"type":"string","description":"Repository ID"},"isPrimary":{"type":"boolean","description":"Deprecated ordering alias. True only for repositories[0]; use array order instead."},"stateUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When this repository state was last updated"},"branchName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Current branch for this repository"},"baseBranch":{"type":"string","description":"Base branch for this repository"},"latestCommitSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Latest commit SHA pushed for this repository"},"diff":{"$ref":"#/components/schemas/Sessions.SessionRepositoryDiff"}}},"Sessions.SessionRepositoryDiff":{"type":"object","required":["fileId","localFileId","source","additions","deletions"],"properties":{"fileId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Authoritative diff file ID"},"localFileId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Local working-tree diff file ID"},"source":{"anyOf":[{"$ref":"#/components/schemas/Sessions.DiffSource"},{"type":"null"}],"description":"Source of the authoritative diff"},"additions":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Number of lines added"},"deletions":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Number of lines deleted"}}},"Sessions.SessionSecondaryDeployUrl":{"type":"object","properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSucceededAt":{"type":"string"},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["deploying","deployed","failed"]},"attemptCommitSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"occurredAt":{"type":"string"}}},"Sessions.SessionSettings":{"type":"object","required":["ciFailuresEnabled","autoReviewEnabled","autoAddressPrReviewsPolicy"],"properties":{"ciFailuresEnabled":{"type":"boolean","description":"Whether to automatically respond to CI failures"},"autoReviewEnabled":{"type":"boolean","description":"Whether to automatically review and fix code for this session"},"autoAddressPrReviewsPolicy":{"anyOf":[{"$ref":"#/components/schemas/Automations.AutoAddressPrReviewsPolicy"},{"type":"null"}],"description":"Per-session automatic PR review addressing policy, or null when the session owner's saved policy applies."}}},"Sessions.SessionSortOrder":{"type":"string","enum":["created_at_desc","created_at_asc"]},"Sessions.SessionStatus":{"type":"string","enum":["pending","running","finished","failed"]},"Sessions.SessionSubagent":{"type":"object","required":["id","kind","name","status","createdAt"],"properties":{"id":{"type":"string","description":"Unique identifier for the subagent. Use it with the subagent messages and cost endpoints of its parent session."},"kind":{"$ref":"#/components/schemas/Sessions.SessionSubagentKind","description":"`verifier` for Verification agent runs Inspect started for the session; `subagent` for other subagents."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name of the subagent, if known."},"status":{"$ref":"#/components/schemas/Sessions.SessionSubagentStatus","description":"Current status of the subagent."},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the subagent was created, if known."}}},"Sessions.SessionSubagentKind":{"type":"string","enum":["verifier","subagent"]},"Sessions.SessionSubagentStatus":{"type":"string","enum":["running","completed","error","abandoned"]},"Sessions.SessionTag":{"type":"string","minLength":1,"maxLength":100},"Sessions.SessionTags":{"type":"object","required":["tags"],"properties":{"tags":{"type":"array","items":{"type":"string"},"description":"The caller's tags on the session after replacement."}}},"Sessions.SessionUser":{"type":"object","required":["id","name","email","image"],"properties":{"id":{"type":"string","description":"User identifier"},"name":{"type":"string","description":"User display name"},"email":{"type":"string","description":"User email address"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL to user profile image"}}},"Sessions.SessionVerificationNotStarted":{"type":"object","required":["message","reason"],"properties":{"message":{"type":"string","description":"Error message"},"reason":{"type":"string","enum":["no_pull_request","not_configured","readonly","no_runtime","session_predates_verifier"],"description":"Why no run started: the session has no pull request, the pull request's head has no `.inspect/verification/config.yml`, the session is read-only, its runtime has not started, or it was created before the Verification agent was available."}}},"Sessions.SessionVerificationStarted":{"type":"object","required":["status","repository","pull_request_number"],"properties":{"status":{"type":"string","enum":["started","already_running"],"description":"`started` when a new Verification agent run started, superseding any older run for the pull request; `already_running` when a run for the current head was already in progress."},"repository":{"type":"string","description":"Repository of the verified pull request."},"pull_request_number":{"type":"integer","description":"Number of the verified pull request."}}},"Sessions.SessionVisibility":{"type":"string","enum":["public","private"]},"Sessions.SessionWorkspace":{"type":"object","required":["id","name","description","organization","remote","githubHost","baseBranch"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"organization":{"type":"string"},"remote":{"type":"string","enum":["github","codestorage"]},"githubHost":{"type":"string","enum":["github"]},"baseBranch":{"type":"string"}},"description":"The workspace a session is attached to."},"Sessions.SkillId":{"type":"string","minLength":1},"Sessions.SmartReviewerApprovalStatus":{"type":"object","required":["sourceSequence","generation","publicationSequence","headSha","baseRef","status","current","reason","recommendation","requestReviewBinding","updatedAt"],"properties":{"sourceSequence":{"type":"integer","minimum":0},"generation":{"type":"integer","minimum":0},"publicationSequence":{"type":"integer","minimum":0},"headSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"baseRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/Sessions.ApprovalProviderStatus"},"current":{"type":"boolean"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"recommendation":{"anyOf":[{"type":"object","properties":{"login":{"type":"string"},"status":{"type":"string","enum":["available","requested","received","draft"]},"reasoning":{"type":"string"},"selectionReason":{"type":"string"}},"required":["login","status","reasoning","selectionReason"]},{"type":"null"}]},"requestReviewBinding":{"anyOf":[{"type":"string"},{"type":"null"}],"minLength":1,"maxLength":4096},"updatedAt":{"type":"string","format":"date-time"}}},"Sessions.StampBuddyApprovalStatus":{"type":"object","required":["sourceSequence","generation","publicationSequence","headSha","baseRef","viewStatus","status","current","reason","rationale","autoApproval","history","grantApprovalBinding","updatedAt"],"properties":{"sourceSequence":{"type":"integer","minimum":0},"generation":{"type":"integer","minimum":0},"publicationSequence":{"type":"integer","minimum":0},"headSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"baseRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"viewStatus":{"type":"string","enum":["ready","not_started","not_enrolled","unavailable"]},"status":{"$ref":"#/components/schemas/Sessions.ApprovalProviderStatus"},"current":{"type":"boolean"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"rationale":{"anyOf":[{"$ref":"#/components/schemas/Sessions.ApprovalRationale"},{"type":"null"}]},"riskTier":{"anyOf":[{"type":"string","enum":["no_risk","low","medium","major"]},{"type":"null"}]},"autoApproval":{"$ref":"#/components/schemas/Sessions.AutoApprovalStatus"},"history":{"type":"array","items":{"type":"object","properties":{"headSha":{"type":"string","minLength":1},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}],"minLength":1},"status":{"$ref":"#/components/schemas/Sessions.ApprovalProviderStatus"},"autoApproval":{"$ref":"#/components/schemas/Sessions.AutoApprovalStatus"},"updatedAt":{"type":"string","format":"date-time"}},"required":["headSha","status","autoApproval","updatedAt"]},"maxItems":20},"grantApprovalBinding":{"anyOf":[{"type":"string"},{"type":"null"}],"minLength":1,"maxLength":4096},"updatedAt":{"type":"string","format":"date-time"}}},"Sessions.StartSessionVerificationRequest":{"type":"object","properties":{"repository":{"type":"string","minLength":1,"description":"Repository of the pull request to verify. Required only when the session has pull requests in multiple repositories."}}},"Sessions.TrimmedNonEmptyString":{"type":"string","minLength":1},"Sessions.UpdateBaseBranchRequest":{"type":"object","required":["new_base_branch"],"properties":{"new_base_branch":{"type":"string","minLength":1,"description":"The new base branch. GitHub URL and ref prefixes such as refs/heads/ and origin/ are normalized."}}},"Sessions.UpdateBaseBranchSuccess":{"type":"object","required":["success","message","previous_base_branch","new_base_branch","pr_updated","repository","pr_number","needs_rebase"],"properties":{"success":{"type":"boolean","enum":[true]},"message":{"type":"string"},"previous_base_branch":{"type":"string"},"new_base_branch":{"type":"string"},"pr_updated":{"type":"boolean","description":"Whether an existing pull request was updated on GitHub."},"repository":{"type":"string","description":"Repository whose base branch changed."},"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"The existing pull request number, if the session has one."},"needs_rebase":{"type":"boolean","description":"Whether the session has a feature branch or pull request whose commits may need to be replayed onto the new base."}}},"Sessions.UpdateSessionRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"description":"New session title."},"visibility":{"$ref":"#/components/schemas/Sessions.SessionVisibility","description":"New visibility. Private sessions cannot be made public."},"collaborators":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.NonEmptyString"},"description":"Collaborator emails to add as session participants."}}},"Sessions.UpdateSessionTagsRequest":{"type":"object","required":["tags"],"properties":{"tags":{"type":"array","items":{"$ref":"#/components/schemas/Sessions.SessionTag"},"maxItems":50,"description":"The complete set of tags the API key's user applies to the session. Pass an empty array to remove all of the caller's tags."}}},"Sessions.WarmSessionRequest":{"type":"object","required":["repository"],"properties":{"repository":{"type":"string","minLength":1,"description":"The repository to warm the environment for. Use \"auto\" to warm the most likely repository based on recent session history."},"session_id":{"type":"string","description":"Optional session ID to associate with the warm request and reuse an existing sandbox context. The session must belong to the API key user or have been created by the API key user."}}},"Sessions.WarmSessionResult":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","enum":[true]}}},"Skills.CollaboratorId":{"type":"string","minLength":1},"Skills.CreateSkillRequest":{"type":"object","required":["id"],"properties":{"id":{"$ref":"#/components/schemas/Skills.SkillId","description":"Unique kebab-case skill ID"},"description":{"type":"string","maxLength":2000,"default":""},"content":{"type":"string","description":"`SKILL.md` body. Mutually exclusive with `files`."},"files":{"type":"array","items":{"$ref":"#/components/schemas/Skills.SkillFileInput"},"maxItems":20,"description":"Complete file set including `SKILL.md`. Mutually exclusive with `content`. At most 20 files and 20 MB in total."},"collaborator_ids":{"type":"array","items":{"$ref":"#/components/schemas/Skills.CollaboratorId"},"description":"Inspect user IDs who can also edit the skill","default":[]}},"description":"Provide either `content` or `files`, not both.","not":{"required":["content","files"]},"additionalProperties":false},"Skills.Skill":{"type":"object","required":["id","url","description","files","is_builtin","owner","collaborators","viewer_can_edit","created_at","updated_at"],"properties":{"id":{"type":"string","description":"Kebab-case skill ID"},"url":{"type":"string","format":"uri","description":"Skill page in Inspect"},"description":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/Skills.SkillFile"}},"is_builtin":{"type":"boolean","description":"Built-in skills are read-only"},"owner":{"anyOf":[{"$ref":"#/components/schemas/Skills.SkillPerson"},{"type":"null"}],"description":"Skill owner; null for built-in skills"},"collaborators":{"type":"array","items":{"$ref":"#/components/schemas/Skills.SkillPerson"}},"viewer_can_edit":{"type":"boolean","description":"Whether the API key user can update or archive this skill"},"created_at":{"type":"string","format":"date-time","description":"Creation time; the Unix epoch for built-in skills"},"updated_at":{"type":"string","format":"date-time","description":"Last update time; the Unix epoch for built-in skills"}}},"Skills.SkillFile":{"type":"object","required":["name","content"],"properties":{"name":{"type":"string","description":"Safe relative file path, for example `SKILL.md` or `scripts/run.sh`"},"content":{"type":"string","description":"File contents"}}},"Skills.SkillFileInput":{"type":"object","required":["name","content"],"properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"Safe relative file path, for example `SKILL.md` or `scripts/run.sh`. Leading and trailing whitespace is trimmed; backslashes, control characters, and empty, `.` or `..` segments are rejected."},"content":{"type":"string","description":"File contents"}}},"Skills.SkillId":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9-]+$","description":"Kebab-case skill ID"},"Skills.SkillPerson":{"type":"object","required":["id","name","email","image"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"Skills.SkillSummary":{"type":"object","required":["id","url","description"],"properties":{"id":{"type":"string","description":"Kebab-case skill ID"},"url":{"type":"string","format":"uri","description":"Skill page in Inspect"},"description":{"type":"string"}}},"Skills.UpdateSkillRequest":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Skills.SkillId","description":"New skill ID, to rename the skill"},"description":{"type":"string","maxLength":2000},"content":{"type":"string","description":"Replacement `SKILL.md` body. Mutually exclusive with `files`."},"files":{"type":"array","items":{"$ref":"#/components/schemas/Skills.SkillFileInput"},"maxItems":20,"description":"Replacement for the complete file set, including `SKILL.md`. Mutually exclusive with `content`. At most 20 files and 20 MB in total."},"collaborator_ids":{"type":"array","items":{"$ref":"#/components/schemas/Skills.CollaboratorId"},"description":"Replacement collaborator list"}},"description":"At least one field must be provided. Provide either `content` or `files`, not both.","not":{"required":["content","files"]},"additionalProperties":false,"minProperties":1},"User.UserPreferences":{"type":"object","required":["defaultModel","defaultModelVariant","defaultAgent"],"properties":{"defaultModel":{"type":"string","description":"The model ID the user has configured as their default for new sessions. Falls back to the platform default model when unset or no longer available as a default.","examples":["claude-opus-4-6"]},"defaultModelVariant":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The model variant the user has configured for their default model. Null means use the default variant for that model.","examples":[null]},"defaultAgent":{"type":"string","description":"The agent ID the user has configured as their default for new sessions. Falls back to the first built-in agent when unset.","examples":["general"]}},"description":"Wire fields are camelCase."},"ValidationError":{"type":"object","required":["data","error","success"],"properties":{"data":{"description":"The validated input as received."},"error":{"type":"array","items":{"$ref":"#/components/schemas/ValidationIssue"},"description":"Validation issues."},"success":{"type":"boolean","enum":[false]}},"description":"Request validation failure returned by route validators."},"ValidationIssue":{"type":"object","required":["code","path","message"],"properties":{"code":{"type":"string","description":"Issue code, such as `invalid_type` or `too_small`."},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer","format":"int32"}]},"description":"Location of the invalid value within the validated input."},"message":{"type":"string","description":"Human-readable description of the issue."}},"description":"A request validation issue reported by the validator."},"Workspaces.DefaultWorkspaceScripts":{"type":"object","required":["preInstall","postInstall"],"properties":{"preInstall":{"type":"string"},"postInstall":{"type":"string"}}},"Workspaces.UpdateWorkspaceScriptsRequest":{"type":"object","properties":{"preInstall":{"type":"string","maxLength":100000},"postInstall":{"type":"string","maxLength":100000}},"description":"Omitted scripts are left unchanged. At least one script is required. Unknown properties are ignored.","minProperties":1},"Workspaces.UpdatedWorkspaceScripts":{"type":"object","required":["commitSha"],"properties":{"commitSha":{"type":"string","description":"Content-addressed version of the saved scripts."}}},"Workspaces.Workspace":{"type":"object","required":["type","id","name","description","organization","remote","githubHost","baseBranch"],"properties":{"type":{"type":"string","enum":["workspace"],"description":"Discriminator identifying a regular Inspect workspace."},"id":{"type":"string","description":"Repository identifier"},"name":{"type":"string","description":"Repository name"},"description":{"type":"string","description":"Repository description"},"organization":{"type":"string","description":"GitHub organization or owner for this repository."},"remote":{"$ref":"#/components/schemas/Repositories.RepositoryRemote"},"githubHost":{"type":"string","enum":["github"],"description":"Compatibility host key for this GitHub.com repository."},"baseBranch":{"type":"string","description":"Default branch for the repository"},"autoMatchEnabled":{"type":"boolean","description":"Whether repository inference may select this repository without an explicit directive or URL"}},"description":"A regular Inspect workspace. Wire fields are camelCase."},"Workspaces.WorkspaceList":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Workspaces.Workspace"}},"meta":{"type":"object","properties":{"suggested":{"type":"array","items":{"type":"string"},"description":"IDs of the workspaces the user has used most, most used first. Up to five."}},"required":["suggested"]}}},"Workspaces.WorkspaceListEntryType":{"type":"string","enum":["workspace","app"],"description":"Workspace list entry type. `app` entries are not returned by this API, so `app` returns an empty list."},"Workspaces.WorkspaceScripts":{"type":"object","required":["commitSha","preInstall","postInstall","defaults"],"properties":{"commitSha":{"type":"string","description":"Content-addressed version of the current scripts."},"preInstall":{"type":"string"},"postInstall":{"type":"string"},"defaults":{"$ref":"#/components/schemas/Workspaces.DefaultWorkspaceScripts"}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key authentication. Use your API key as the bearer token."}}},"servers":[{"url":"{origin}","variables":{"origin":{"default":"https://your-org.inspect.com","description":"Your Inspect origin"}}}]}