{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Rebyte API","version":"1.0.0","description":"The complete public /v1 contract for Rebyte Agents, Sessions, Messages, Agent Computers, legacy Tasks, Webhooks, files, workspace artifacts, Agent Context, billing, and restricted partner operations.\n\nNew integrations should create reusable Agents, create isolated Sessions from an Agent snapshot, and submit Messages asynchronously. The existing Web application and legacy /v1/tasks API remain available and backward-compatible.\n\nSession SSE is a live/recent observation transport, not a durable event ledger. Durable cursor replay is intentionally outside this version.\n\nExisting organization Webhooks remain best-effort: one delivery attempt, no retry, and delivery failure may be dropped."},"servers":[{"url":"https://api.rebyte.ai"}],"externalDocs":{"description":"Rebyte API v1 guide","url":"https://rebyte.ai/docs/agent-computer-api/reference"},"tags":[{"name":"Agents","description":"Reusable Agent configuration snapshots."},{"name":"Sessions","description":"Conversation runtimes created from an Agent."},{"name":"Tasks","description":"Backward-compatible task-centric API. Prefer Agents and Sessions for new integrations."},{"name":"Files","description":"Uploads used by legacy Tasks."},{"name":"Webhooks","description":"Best-effort lifecycle delivery for API-created work."},{"name":"Agent Computers","description":"Provisioned Agent Computer workspaces and DB9 access."},{"name":"Workspace Artifacts","description":"Read and delete files produced in a workspace."},{"name":"Context Lake","description":"Agent Context configuration, catalogs, SQL, and lifecycle operations."},{"name":"Billing","description":"Organization credit information."},{"name":"Partner API","description":"Restricted account and top-up operations requiring accounts:write."},{"name":"Sandbox","description":"Sandbox credentials for Agent Computer integrations."},{"name":"Specification","description":"Machine-readable and Markdown API contracts."}],"paths":{"/v1/openapi.json":{"get":{"tags":["Specification"],"operationId":"getOpenApiJson","summary":"Download the OpenAPI document","security":[],"responses":{"200":{"description":"OpenAPI 3.1 document.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/openapi.md":{"get":{"tags":["Specification"],"operationId":"getOpenApiMarkdown","summary":"Download the LLM-friendly Markdown contract","security":[],"responses":{"200":{"description":"Markdown generated from this OpenAPI document.","content":{"text/markdown":{"schema":{"type":"string"}}}}}}},"/v1/agents":{"get":{"tags":["Agents"],"operationId":"listAgents","summary":"List Agents","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"responses":{"200":{"description":"Organization Agents.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}}},"additionalProperties":false}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agents"],"operationId":"createAgent","summary":"Create an Agent","description":"Creates configuration only. Each new Session receives an isolated snapshot of the Agent configuration.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Up to 255 visible ASCII characters. Reusing the key with the same body returns the same resource.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"\\S"},"instructions":{"type":"string","maxLength":100000},"model":{"type":"string","enum":["deepseek-v4-pro","glm-5.2","kimi-k3","claude-sonnet-5","claude-opus-5","gpt-5.6","gpt-5.4-mini"]},"maxSteps":{"type":"integer","exclusiveMinimum":0,"maximum":128},"mcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"internal"},"name":{"type":"string","enum":["web_search_&_browse","sandbox","coding_agent","ask_user_question","report_builder","company","app_builder_contract","github","sound_studio","speech_generator","http_client"]}},"required":["kind","name"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"composio"},"toolkit":{"type":"string","minLength":1,"maxLength":300,"pattern":"^\\S(?:[\\s\\S]*\\S)?$"}},"required":["kind","toolkit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"custom"},"serverId":{"type":"string","format":"uuid"}},"required":["kind","serverId"],"additionalProperties":false}]},"maxItems":64,"uniqueItems":true},"skills":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","minLength":1,"maxLength":300,"pattern":"^(?!.*\\.[gG][iI][tT]$)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\\/[A-Za-z0-9._-]+$"},"path":{"type":"string","minLength":1,"maxLength":1000,"pattern":"^(?!\\/)(?!.*(?:^|\\/)\\.\\.?(?:\\/|$))(?!.*\\\\)(?!.*[?#\\s])(?!.*(?:^|\\/)[sS][kK][iI][lL][lL]\\.[mM][dD]$)[^/]+(?:\\/[^/]+)*$"}},"required":["repo","path"],"additionalProperties":false},"maxItems":128,"uniqueItems":true}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Agent created or idempotently replayed.","content":{"application/json":{"schema":{"type":"object","required":["agent"],"properties":{"agent":{"$ref":"#/components/schemas/Agent"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The selected model or turn requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current resource or idempotency state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}":{"get":{"tags":["Agents"],"operationId":"getAgent","summary":"Get an Agent","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agent.","content":{"application/json":{"schema":{"type":"object","required":["agent"],"properties":{"agent":{"$ref":"#/components/schemas/Agent"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Agents"],"operationId":"updateAgent","summary":"Update an Agent","description":"Existing Sessions retain their creation-time Agent snapshot.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent ID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"\\S"},"instructions":{"type":"string","maxLength":100000},"model":{"type":"string","enum":["deepseek-v4-pro","glm-5.2","kimi-k3","claude-sonnet-5","claude-opus-5","gpt-5.6","gpt-5.4-mini"]},"maxSteps":{"type":"integer","exclusiveMinimum":0,"maximum":128},"mcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"internal"},"name":{"type":"string","enum":["web_search_&_browse","sandbox","coding_agent","ask_user_question","report_builder","company","app_builder_contract","github","sound_studio","speech_generator","http_client"]}},"required":["kind","name"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"composio"},"toolkit":{"type":"string","minLength":1,"maxLength":300,"pattern":"^\\S(?:[\\s\\S]*\\S)?$"}},"required":["kind","toolkit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"custom"},"serverId":{"type":"string","format":"uuid"}},"required":["kind","serverId"],"additionalProperties":false}]},"maxItems":64,"uniqueItems":true},"skills":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","minLength":1,"maxLength":300,"pattern":"^(?!.*\\.[gG][iI][tT]$)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\\/[A-Za-z0-9._-]+$"},"path":{"type":"string","minLength":1,"maxLength":1000,"pattern":"^(?!\\/)(?!.*(?:^|\\/)\\.\\.?(?:\\/|$))(?!.*\\\\)(?!.*[?#\\s])(?!.*(?:^|\\/)[sS][kK][iI][lL][lL]\\.[mM][dD]$)[^/]+(?:\\/[^/]+)*$"}},"required":["repo","path"],"additionalProperties":false},"maxItems":128,"uniqueItems":true}},"additionalProperties":false,"minProperties":1}}}},"responses":{"200":{"description":"Updated Agent.","content":{"application/json":{"schema":{"type":"object","required":["agent"],"properties":{"agent":{"$ref":"#/components/schemas/Agent"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The selected model or turn requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Agents"],"operationId":"deleteAgent","summary":"Delete an Agent","description":"Rejected while Sessions still reference the Agent and rejected for the organization default Agent.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Agent deleted."},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current resource or idempotency state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions":{"get":{"tags":["Sessions"],"operationId":"listSessions","summary":"List Sessions","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"agentId","in":"query","required":false,"description":"Return only Sessions created from this Agent.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"Maximum number of records to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"description":"Number of records to skip.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Sessions.","content":{"application/json":{"schema":{"type":"object","required":["data","total","limit","offset"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Session"}},"total":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":1,"maximum":100},"offset":{"type":"integer","minimum":0}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Sessions"],"operationId":"createSession","summary":"Create an idle Session","description":"Creates the durable Session and isolated runtime snapshot. Execution starts only when the first message is submitted.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Up to 255 visible ASCII characters. Reusing the key with the same body returns the same resource.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"}},"required":["agentId"],"additionalProperties":false}}}},"responses":{"201":{"description":"Session created or idempotently replayed.","content":{"application/json":{"schema":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/Session"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The source Agent was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current resource or idempotency state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}":{"get":{"tags":["Sessions"],"operationId":"getSession","summary":"Get Session state","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Session.","content":{"application/json":{"schema":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/Session"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Sessions"],"operationId":"deleteSession","summary":"Delete a Session","description":"Cancels the active turn, then deletes the Session and its isolated runtime. Webhook delivery remains best-effort.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Session deleted."},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}/messages":{"get":{"tags":["Sessions"],"operationId":"listSessionMessages","summary":"List the durable Session transcript","description":"Returns public Messages in transcript order. Use these records, rather than SSE replay, to reconcile authoritative Message status, unresolved HITL actions, response, and error state.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"Maximum number of records to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"description":"Number of records to skip.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Paginated public Messages.","content":{"application/json":{"schema":{"type":"object","required":["data","total","limit","offset"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"total":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":1,"maximum":100},"offset":{"type":"integer","minimum":0}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Sessions"],"operationId":"createSessionMessage","summary":"Submit a message asynchronously","description":"Returns a 202 acceptance projection after the turn is accepted or queued. An idempotent replay may already be terminal; GET the Message for its current authoritative state. The returned message.id is the stable public prompt ID used by SSE and transcript GETs. Multiple input text parts are joined with newline characters into one effective prompt, and transcript reads return that normalized text as one part. Warnings describe only this acceptance attempt and are non-fatal.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Required. Scoped to the organization and Session. Reusing the key with different message content returns 409.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"parts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":100000}},"required":["type","text"],"additionalProperties":false},"minItems":1,"maxItems":32}},"required":["parts"],"additionalProperties":false}}}},"responses":{"202":{"description":"Message accepted or queued; execution continues asynchronously.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedMessage"}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The selected model or turn requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current resource or idempotency state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}/messages/{messageId}":{"get":{"tags":["Sessions"],"operationId":"getSessionMessage","summary":"Get one durable Message","description":"The authoritative reconciliation endpoint for a submitted Message, including unresolved HITL actions and terminal response or error state.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}},{"name":"messageId","in":"path","required":true,"description":"Public Message ID returned by POST /messages.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Public Message.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"$ref":"#/components/schemas/Message"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}/messages/{messageId}/answer":{"post":{"tags":["Sessions"],"operationId":"answerSessionMessageQuestion","summary":"Answer a blocked Message question","description":"Answers one human-in-the-loop question emitted as a message.event with data.sourceType tool_ask_user_question. Send data.actionId and the answer value verbatim.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}},{"name":"messageId","in":"path","required":true,"description":"Public Message ID returned by POST /messages.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"actionId":{"type":"integer","minimum":0},"answer":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"array","items":{}},{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"required":["actionId","answer"],"additionalProperties":false}}}},"responses":{"200":{"description":"Answer recorded; the Message either resumed or is waiting for another blocked action.","content":{"application/json":{"schema":{"type":"object","required":["messageId","actionId","status"],"properties":{"messageId":{"type":"string","format":"uuid"},"actionId":{"type":"integer","minimum":0},"status":{"type":"string","enum":["accepted","resuming"]}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action does not exist, does not belong to this Message, or is no longer waiting for an answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}/stream":{"get":{"tags":["Sessions"],"operationId":"streamSession","summary":"Open the standing Session SSE stream","description":"Multiplexes conversation and per-run events. Frames carry channel-scoped wire ids; global ordering and durable Last-Event-ID recovery are not promised in v1. History, initialization buffers, and socket backpressure are bounded; reconnect and reconcile with Message GETs if the connection closes. Each data line decodes to SessionEvent.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Standing SSE stream with heartbeat comments every 15 seconds.","content":{"text/event-stream":{"schema":{"type":"string","description":"SSE wire frames. Parse each data field as a SessionEvent JSON object."},"x-sse-event-schema":{"$ref":"#/components/schemas/SessionEvent"}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}/interrupt":{"post":{"tags":["Sessions"],"operationId":"interruptSession","summary":"Interrupt the active turn","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Interruption status.","content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["interrupting","no_turn"]}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks":{"get":{"tags":["Tasks"],"operationId":"listLegacyTasks","summary":"List API-created Tasks","description":"Lists non-deleted Tasks created through the task-based API, newest first. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"limit","in":"query","required":false,"description":"Maximum records to return. Values above 100 are clamped to 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"description":"Number of records to skip.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Paginated API-created Tasks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTaskList"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Tasks"],"operationId":"createLegacyTask","summary":"Create a Task","description":"Creates a task-based Agent run. Omit `workspaceId` to create a new Workspace, or supply an existing non-Session Workspace. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyCreateTaskRequest"}}}},"responses":{"201":{"description":"Task and initial prompt accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTaskCreated"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The request requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The selected Workspace is reserved for an Agent API Session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}":{"get":{"tags":["Tasks"],"operationId":"getLegacyTask","summary":"Get a Task","description":"Returns Task metadata, derived status, and prompt statuses. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Task details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTask"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Tasks"],"operationId":"deleteLegacyTask","summary":"Delete a Task","description":"Soft-deletes an API-created Task. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Task deleted. No response body."},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/content":{"get":{"tags":["Tasks"],"operationId":"getLegacyTaskContent","summary":"Get a Task transcript","description":"Returns top-level user prompts and final responses. Add `include=events` to include synthesized manager events. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}},{"name":"include","in":"query","required":false,"description":"Include the normalized event array for each prompt.","schema":{"type":"string","const":"events"}}],"responses":{"200":{"description":"Authoritative Task transcript.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTaskContent"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/prompts":{"post":{"tags":["Tasks"],"operationId":"createLegacyTaskPrompt","summary":"Submit a follow-up prompt","description":"Submits or queues a follow-up on an existing API-created Task. The optional execution identifiers depend on whether the prompt starts immediately or is queued. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyFollowUpRequest"}}}},"responses":{"201":{"description":"Follow-up accepted or queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyFollowUpAccepted"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The request requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/visibility":{"patch":{"tags":["Tasks"],"operationId":"updateLegacyTaskVisibility","summary":"Change Task visibility","description":"Changes the Task Workspace visibility. Public visibility returns a share URL. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyVisibilityRequest"}}}},"responses":{"200":{"description":"Updated visibility.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyVisibility"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/events":{"get":{"tags":["Tasks"],"operationId":"streamLegacyTaskEvents","summary":"Stream the latest Task prompt","description":"Streams the latest visible top-level prompt as SSE. Frames use event name `event` with `LegacyTaskEvent` data and finish with event name `done`; the connection can also end after 15 minutes with status still `running`. Sequence numbers are connection-local, so deduplicate synthesized events by `eventKey`. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Task execution SSE stream.","content":{"text/event-stream":{"schema":{"type":"string"},"x-sse-event-schema":{"oneOf":[{"$ref":"#/components/schemas/LegacyTaskEvent"},{"$ref":"#/components/schemas/LegacyTaskStreamDone"}]}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/prompts/{promptId}/events":{"get":{"tags":["Tasks"],"operationId":"getLegacySubPromptEvents","summary":"Get sub-prompt events","description":"Returns normalized object-storage events for a sub-prompt belonging to this Task. Parent tool events expose the sub-prompt ID. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}},{"name":"promptId","in":"path","required":true,"description":"Sub-prompt ID exposed by a parent tool event.","schema":{"type":"string","format":"uuid"}},{"name":"afterSeq","in":"query","required":false,"description":"Return only events with seq greater than this finite number.","schema":{"type":"number","default":-1}}],"responses":{"200":{"description":"Sub-prompt events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacySubPromptEvents"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/cancel":{"post":{"tags":["Tasks"],"operationId":"cancelLegacyTask","summary":"Cancel a Task","description":"Cancels active manager messages, pending prompts, and active sandbox sub-prompts. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Cancellation result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyCancelTaskResult"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/answer":{"post":{"tags":["Tasks"],"operationId":"answerLegacyTaskQuestion","summary":"Answer a blocked Task question","description":"Answers the `ask_user_question` identified by the Task event `messageId` and `actionId`, then resumes the same turn. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTaskAnswerRequest"}}}},"responses":{"200":{"description":"Answer accepted and Workflow resumed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTaskAnswerResult"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The Task no longer has the identified blocked action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/files":{"post":{"tags":["Files"],"operationId":"createLegacyFileUpload","summary":"Create a temporary file upload","description":"Returns a signed object-storage PUT URL valid for one hour. Upload the bytes separately, then pass `id` and `filename` to a Task request. Required scope: `files:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["files:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyCreateFileRequest"}}}},"responses":{"201":{"description":"Temporary upload reservation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyFileUpload"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"tags":["Webhooks"],"operationId":"listLegacyWebhooks","summary":"List Webhooks","description":"Lists this organization's Webhook registrations. Required scope: `webhooks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["webhooks:read"],"responses":{"200":{"description":"Webhook registrations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyWebhookList"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"operationId":"createLegacyWebhook","summary":"Create a Webhook","description":"Registers up to three Webhook endpoints per organization. An existing URL is returned idempotently. Lifecycle delivery is best-effort: one attempt, no retry, and failures may be dropped. Required scope: `webhooks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["webhooks:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyCreateWebhookRequest"}}}},"responses":{"201":{"description":"Webhook registration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyWebhookCreated"}}}},"400":{"description":"The body is invalid or the organization already has three Webhooks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"get":{"tags":["Webhooks"],"operationId":"getLegacyWebhook","summary":"Get a Webhook","description":"Returns one organization-owned Webhook registration. Required scope: `webhooks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["webhooks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook registration ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook registration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyWebhook"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Webhooks"],"operationId":"deleteLegacyWebhook","summary":"Delete a Webhook","description":"Deletes a Webhook registration. Required scope: `webhooks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["webhooks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook registration ID.","schema":{"type":"string"}}],"responses":{"204":{"description":"Webhook deleted. No response body."},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workspaces/{id}/artifacts":{"get":{"tags":["Workspace Artifacts"],"operationId":"listLegacyWorkspaceArtifacts","summary":"List Workspace artifacts","description":"Lists files produced in the Workspace artifact store and returns one-hour user-content download URLs. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Workspace artifacts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyWorkspaceArtifactList"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Workspace Artifacts"],"operationId":"deleteAllLegacyWorkspaceArtifacts","summary":"Delete all Workspace artifacts","description":"Deletes every file in the Workspace artifact store. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"All artifacts deleted. No response body."},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workspaces/{id}/artifacts/{filename}":{"get":{"tags":["Workspace Artifacts"],"operationId":"downloadLegacyWorkspaceArtifact","summary":"Download a Workspace artifact","description":"Streams one artifact with a Content-Disposition attachment header. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}},{"name":"filename","in":"path","required":true,"description":"Artifact filename, URL encoded as one path segment.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Artifact bytes. Content-Type is derived from the filename.","headers":{"Content-Disposition":{"description":"Attachment filename.","schema":{"type":"string"}}},"content":{"*/*":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Workspace Artifacts"],"operationId":"deleteLegacyWorkspaceArtifact","summary":"Delete a Workspace artifact","description":"Deletes one artifact after verifying that it exists. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}},{"name":"filename","in":"path","required":true,"description":"Artifact filename, URL encoded as one path segment.","schema":{"type":"string","minLength":1}}],"responses":{"204":{"description":"Artifact deleted. No response body."},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-computers":{"get":{"tags":["Agent Computers"],"operationId":"listLegacyAgentComputers","summary":"List Agent Computers","description":"Lists non-deleted organization Workspaces through the Agent Computer projection. The current route does not filter by Workspace kind. List items intentionally omit Microsandbox credentials. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"limit","in":"query","required":false,"description":"Maximum records to return. The server clamps the value to 1 through 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"description":"Number of records to skip.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Paginated Agent Computers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyAgentComputerList"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agent Computers"],"operationId":"createLegacyAgentComputer","summary":"Create an Agent Computer","description":"Creates a persistent Workspace. Provisioning is asynchronous unless `db9_enabled` is true; the caller can poll GET until `sandboxId` is non-null. The DB9 path waits for provisioning and returns its API key once. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyCreateAgentComputerRequest"}}}},"responses":{"201":{"description":"Agent Computer created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyAgentComputerCreated"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-computers/{id}":{"get":{"tags":["Agent Computers"],"operationId":"getLegacyAgentComputer","summary":"Get an Agent Computer","description":"Returns details, Microsandbox connection settings, Agent configuration, and up to ten recent Tasks. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agent Computer details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyAgentComputerDetail"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Agent Computers"],"operationId":"updateLegacyAgentComputer","summary":"Configure an Agent Computer","description":"Updates its Workspace Agent instructions and/or toggles MCPServerViews by ID. An empty body reads back the current configuration. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyUpdateAgentComputerRequest"}}}},"responses":{"200":{"description":"Resulting Agent configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyAgentComputerConfiguration"}}}},"400":{"description":"The body is invalid or a requested MCPServerView does not belong to this Workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-computers/{id}/db9/api-key":{"post":{"tags":["Agent Computers"],"operationId":"mintLegacyAgentComputerDb9ApiKey","summary":"Mint a DB9 API key","description":"Mints a new full-account DB9 key inside a ready, DB9-enabled Agent Computer. The token is returned once and is not stored by the Relay. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"New DB9 API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyDb9ApiKey"}}}},"400":{"description":"DB9 is not enabled for this Agent Computer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The Agent Computer does not exist or its VM is not ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-computers/{id}/db9/share-token":{"post":{"tags":["Agent Computers"],"operationId":"mintLegacyAgentComputerDb9ShareToken","summary":"Mint a DB9 share token","description":"Mints a new read-write share token for the ready Agent Computer Workspace database. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"New DB9 share token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyDb9ShareToken"}}}},"400":{"description":"DB9 is not enabled for this Agent Computer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The Agent Computer does not exist or its VM is not ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/context-lake/config":{"get":{"tags":["Context Lake"],"operationId":"getContextLakeConfig","summary":"Get the Context Lake configuration","description":"Returns both the serialized YAML and the structured configuration assembled from the organization's datasets and views.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"Current Context Lake configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeConfigResponse"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"Configuration loading failed, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}},"patch":{"tags":["Context Lake"],"operationId":"patchContextLakeConfig","summary":"Apply an atomic partial configuration update","description":"Applies removals, additions, then updates; validates the resulting config; persists it; and redeploys SpiceD. Dataset params and view acceleration objects are shallow replacements, not deep merges.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakePatchConfigRequest"}}}},"responses":{"200":{"description":"Configuration applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeMutationResult"}}}},"400":{"description":"The requested operations failed or the resulting configuration was invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/datasets":{"get":{"tags":["Context Lake"],"operationId":"listContextLakeDatasets","summary":"List datasets","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"Configured datasets.","content":{"application/json":{"schema":{"type":"object","required":["datasets"],"properties":{"datasets":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeDataset"}}},"additionalProperties":false}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"Dataset loading failed, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}},"post":{"tags":["Context Lake"],"operationId":"createContextLakeDataset","summary":"Create a dataset","description":"Adds a dataset, validates the full configuration, persists it, and redeploys SpiceD. Enabling notifications may also return SQS setup information.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeCreateDatasetRequest"}}}},"responses":{"201":{"description":"Dataset created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeCreateDatasetResult"}}}},"400":{"description":"The dataset already exists, has invalid connector parameters, or could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/datasets/{name}":{"put":{"tags":["Context Lake"],"operationId":"updateContextLakeDataset","summary":"Update a dataset","description":"Shallow-merges the supplied fields into the named dataset, then validates, persists, and redeploys the full configuration. A supplied params object replaces the previous params object.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"parameters":[{"name":"name","in":"path","required":true,"description":"Dataset or view name. The route performs no additional path-format validation.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeUpdateDatasetRequest"}}}},"responses":{"200":{"description":"Dataset updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeMutationResult"}}}},"400":{"description":"The dataset was not found, the update was invalid, or the configuration could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}},"delete":{"tags":["Context Lake"],"operationId":"deleteContextLakeDataset","summary":"Delete a dataset","description":"Removes the named dataset, persists the configuration, and redeploys SpiceD.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"parameters":[{"name":"name","in":"path","required":true,"description":"Dataset or view name. The route performs no additional path-format validation.","schema":{"type":"string"}}],"responses":{"204":{"description":"Dataset deleted."},"400":{"description":"The dataset was not found or the updated configuration could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/views":{"get":{"tags":["Context Lake"],"operationId":"listContextLakeViews","summary":"List views","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"Configured views.","content":{"application/json":{"schema":{"type":"object","required":["views"],"properties":{"views":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeView"}}},"additionalProperties":false}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"View loading failed, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}},"post":{"tags":["Context Lake"],"operationId":"createContextLakeView","summary":"Create a view","description":"Adds a view, validates the full configuration, persists it, and redeploys SpiceD.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeCreateViewRequest"}}}},"responses":{"201":{"description":"View created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeCreateViewResult"}}}},"400":{"description":"The view already exists, is invalid, or could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/views/{name}":{"put":{"tags":["Context Lake"],"operationId":"updateContextLakeView","summary":"Update a view","description":"Shallow-merges supplied fields into the named view, then validates, persists, and redeploys the full configuration. A supplied acceleration object replaces the previous object.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"parameters":[{"name":"name","in":"path","required":true,"description":"Dataset or view name. The route performs no additional path-format validation.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeUpdateViewRequest"}}}},"responses":{"200":{"description":"View updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeBasicMutationResult"}}}},"400":{"description":"The view was not found, the update was invalid, or the configuration could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}},"delete":{"tags":["Context Lake"],"operationId":"deleteContextLakeView","summary":"Delete a view","description":"Removes the named view, persists the configuration, and redeploys SpiceD.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"parameters":[{"name":"name","in":"path","required":true,"description":"Dataset or view name. The route performs no additional path-format validation.","schema":{"type":"string"}}],"responses":{"204":{"description":"View deleted."},"400":{"description":"The view was not found or the updated configuration could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/sql":{"post":{"tags":["Context Lake"],"operationId":"queryContextLakeSql","summary":"Run a SQL query","description":"Ensures the Context Lake VM is running, waits for SpiceD to become queryable, then proxies the SQL query. The route waits for at most 180 seconds.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeSqlRequest"}}}},"responses":{"200":{"description":"SpiceD query result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeSqlResult"}}}},"400":{"description":"The query field is missing or SpiceD rejected the query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"The query failed unexpectedly, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}},"504":{"description":"The VM did not become queryable within 180 seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeTimeoutError"}}}}}}},"/v1/context-lake/status":{"get":{"tags":["Context Lake"],"operationId":"getContextLakeStatus","summary":"Get VM and dataset status","description":"Returns the derived VM state and per-dataset health. An unreachable or non-running SpiceD instance is represented as dataset status error rather than failing this request.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"Context Lake status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeStatus"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"Status loading failed, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/start":{"post":{"tags":["Context Lake"],"operationId":"startContextLake","summary":"Start or provision the Context Lake VM","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"VM is running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeStartResult"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"The VM could not be started, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/stop":{"post":{"tags":["Context Lake"],"operationId":"stopContextLake","summary":"Pause the Context Lake VM","description":"Succeeds even when no provisioned VM exists.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"VM is paused or no VM existed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeBasicMutationResult"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"The VM could not be paused, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/redeploy":{"post":{"tags":["Context Lake"],"operationId":"redeployContextLake","summary":"Redeploy the Context Lake configuration","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"Configuration redeployed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeBasicMutationResult"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"The configuration could not be redeployed, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/accounts":{"get":{"tags":["Partner API"],"operationId":"listHeadlessAccounts","summary":"List partner-created headless accounts","description":"Restricted Partner API. Returns headless accounts linked to the caller as their owning partner.","security":[{"ApiKey":[]}],"x-required-scopes":["accounts:write"],"x-rebyte-audience":"partner","responses":{"200":{"description":"Partner-created headless accounts.","content":{"application/json":{"schema":{"type":"object","required":["accounts"],"properties":{"accounts":{"type":"array","items":{"$ref":"#/components/schemas/HeadlessAccount"}}},"additionalProperties":false}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Partner API"],"operationId":"createHeadlessAccount","summary":"Create a headless account","description":"Restricted Partner API. Creates an API-only child account and returns its plaintext rbk_ API key exactly once. A headless caller cannot create another sub-account.","security":[{"ApiKey":[]}],"x-required-scopes":["accounts:write"],"x-rebyte-audience":"partner","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHeadlessAccountRequest"}}}},"responses":{"201":{"description":"Headless account and one-time API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHeadlessAccountResult"}}}},"400":{"description":"The JSON request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks accounts:write, or a headless account attempted to create a sub-account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/billing":{"patch":{"tags":["Partner API"],"operationId":"updateHeadlessAccountBilling","summary":"Change an account billing mode","description":"Restricted Partner API. The caller may update itself or an account linked to it as the owning partner.","security":[{"ApiKey":[]}],"x-required-scopes":["accounts:write"],"x-rebyte-audience":"partner","parameters":[{"name":"id","in":"path","required":true,"description":"Account ID. The caller may manage only itself or an account linked to it as the owning partner.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountBillingRequest"}}}},"responses":{"200":{"description":"Billing mode updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountBillingResult"}}}},"400":{"description":"The JSON request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks accounts:write, or the account is not owned by this partner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The account does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/credits":{"get":{"tags":["Billing"],"operationId":"getBillingCredits","summary":"Get available credits","description":"Returns the caller account, the account actually billed after parent-billing resolution, and purchased plus expiring credit balances.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"responses":{"200":{"description":"Current credit balances.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCredits"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/topups":{"post":{"tags":["Partner API"],"operationId":"createPartnerBillingTopup","summary":"Top up an account","description":"Restricted Partner API. externalPaymentId is the idempotency identity within the calling partner: a replay returns 200 and does not add credits twice; a newly processed top-up returns 201.","security":[{"ApiKey":[]}],"x-required-scopes":["accounts:write"],"x-rebyte-audience":"partner","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBillingTopupRequest"}}}},"responses":{"200":{"description":"The external payment was already processed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayedBillingTopupResult"}}}},"201":{"description":"Credits added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedBillingTopupResult"}}}},"400":{"description":"The JSON request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks accounts:write, or the target account is not owned by this partner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sandbox/api-key":{"get":{"tags":["Sandbox"],"operationId":"getSandboxApiKey","summary":"Get direct Sandbox gateway credentials","description":"Returns the organization's plaintext Microsandbox credential and gateway URL for direct SDK access. The reported expiry is the service's fixed non-expiring compatibility timestamp.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"responses":{"200":{"description":"Sandbox gateway credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxApiKeyResult"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"API_KEY","description":"Organization API key. See each operation's x-required-scopes extension; header aliases api-key and x-api-key are also accepted."}},"schemas":{"LegacyTaskFileReference":{"type":"object","required":["id","filename"],"properties":{"id":{"type":"string","description":"Temporary file ID returned by POST /v1/files."},"filename":{"type":"string","description":"Normalized filename returned by POST /v1/files."}},"additionalProperties":false},"LegacyCreateTaskRequest":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","minLength":1,"maxLength":100000},"workspaceId":{"type":"string","format":"uuid","description":"Existing organization Workspace to reuse. Agent API Session Workspaces are rejected."},"agentProfileId":{"type":"string","format":"uuid","description":"Organization Agent Profile copied when a new Workspace is created."},"githubUrl":{"type":"string"},"branchName":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskFileReference"}},"skills":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300}}},"additionalProperties":false},"LegacyFollowUpRequest":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","minLength":1,"maxLength":100000},"skills":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"files":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskFileReference"}}},"additionalProperties":false},"LegacyTaskCreated":{"type":"object","required":["id","workspaceId","url","status","createdAt","promptId","warnings"],"properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"status":{"type":"string","const":"running"},"createdAt":{"type":"string","format":"date-time"},"promptId":{"type":"string","format":"uuid"},"agentMessageId":{"type":"string"},"warnings":{"type":"array","description":"Non-fatal setup warnings; the Task was still accepted.","items":{"type":"string"}}},"additionalProperties":false},"LegacyTaskSummary":{"type":"object","required":["id","url","title","createdAt","completedAt"],"properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"title":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"LegacyTaskList":{"type":"object","required":["data","total","limit","offset"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskSummary"}},"total":{"type":"integer","minimum":0},"limit":{"type":"integer"},"offset":{"type":"integer"}},"additionalProperties":false},"LegacyTaskPromptSummary":{"type":"object","required":["id","status","submittedAt","completedAt"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","running","succeeded","failed","canceled"]},"submittedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"LegacyTask":{"type":"object","required":["id","url","status","title","createdAt","completedAt","prompts"],"properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"status":{"type":"string","enum":["running","completed","failed","canceled"]},"title":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"prompts":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskPromptSummary"}}},"additionalProperties":false},"LegacyTaskEvent":{"type":"object","required":["seq","timestamp","promptId","eventType","payload"],"properties":{"seq":{"type":"integer","minimum":0},"timestamp":{"type":"number","description":"Event timestamp in Unix milliseconds."},"promptId":{"type":"string"},"eventType":{"type":"string","enum":["init","thinking","tool_use","tool_result","ask_user_question","text","result"]},"eventKey":{"type":"string","description":"Stable identity for deduplication; sequence numbers may change when an event is synthesized later."},"payload":{"type":"object","additionalProperties":true}},"additionalProperties":false},"LegacyTaskTranscriptPrompt":{"type":"object","required":["id","status","userPrompt","response","submittedAt","completedAt"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["running","succeeded","failed","canceled","paused"]},"userPrompt":{"type":"string"},"response":{"type":["string","null"]},"submittedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"events":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskEvent"}}},"additionalProperties":false},"LegacyTaskContent":{"type":"object","required":["id","status","prompts"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["running","completed","failed","canceled"]},"prompts":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskTranscriptPrompt"}}},"additionalProperties":false},"LegacyFollowUpAccepted":{"type":"object","required":["promptId","visibility","warnings"],"properties":{"promptId":{"type":"string","format":"uuid"},"visibility":{"type":"string","enum":["visible","pending"]},"agentMessageId":{"type":"string"},"workflowId":{"type":"string"},"steeringSignaledMessageId":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"LegacyVisibilityRequest":{"type":"object","required":["visibility"],"properties":{"visibility":{"type":"string","enum":["private","shared","public"]}},"additionalProperties":false},"LegacyVisibility":{"type":"object","required":["visibility"],"properties":{"visibility":{"type":"string","enum":["private","shared","public"]},"shareUrl":{"type":"string","format":"uri","description":"Present when visibility is public."}},"additionalProperties":false},"LegacyTaskStreamDone":{"type":"object","required":["status","lastSeq","finalResult"],"properties":{"status":{"type":"string","enum":["running","succeeded","failed","canceled"]},"lastSeq":{"type":"integer","minimum":0},"errorMessage":{"type":"string"},"finalResult":{"type":"string"}},"additionalProperties":false},"LegacySubPromptEvents":{"type":"object","required":["promptId","events"],"properties":{"promptId":{"type":"string"},"events":{"type":"array","items":{"type":"object","required":["seq","eventType","payload","timestamp"],"properties":{"seq":{"type":"number"},"eventType":{"type":"string"},"payload":{},"timestamp":{"type":"number"},"promptId":{"type":"string"}},"additionalProperties":true}}},"additionalProperties":false},"LegacyCancelTaskResult":{"type":"object","required":["id","status","canceledPrompts","canceledSandboxPrompts"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","const":"canceled"},"canceledPrompts":{"type":"integer","minimum":0},"canceledSandboxPrompts":{"type":"integer","minimum":0}},"additionalProperties":false},"LegacyTaskAnswerRequest":{"type":"object","required":["messageId","actionId","answer"],"properties":{"messageId":{"type":"string","minLength":1},"actionId":{"type":"number"},"answer":{"description":"Any JSON value, including null."}},"additionalProperties":false},"LegacyTaskAnswerResult":{"type":"object","required":["ok","workflowId"],"properties":{"ok":{"type":"boolean","const":true},"workflowId":{"type":"string"}},"additionalProperties":false},"LegacyCreateFileRequest":{"type":"object","required":["filename"],"properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"contentType":{"type":"string","default":"application/octet-stream"}},"additionalProperties":false},"LegacyFileUpload":{"type":"object","required":["id","filename","uploadUrl","maxFileSize"],"properties":{"id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"uploadUrl":{"type":"string","format":"uri","description":"Signed PUT URL valid for one hour. Upload using the requested Content-Type."},"maxFileSize":{"type":"integer","const":209715200,"description":"Maximum upload size in bytes."}},"additionalProperties":false},"LegacyWebhookEvent":{"type":"string","enum":["task.created","task.running","task.completed","task.failed","task.canceled"]},"LegacyCreateWebhookRequest":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/LegacyWebhookEvent"}},"description":{"type":"string","maxLength":500},"secret":{"type":"string","maxLength":500,"writeOnly":true,"description":"Optional value echoed in X-Webhook-Secret on deliveries; never returned."}},"additionalProperties":false},"LegacyWebhook":{"type":"object","required":["id","url","events","description","hasSecret","isActive","createdAt","failureCount"],"properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/LegacyWebhookEvent"}},"description":{"type":["string","null"]},"hasSecret":{"type":"boolean"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"lastTriggeredAt":{"type":"string","format":"date-time"},"failureCount":{"type":"integer","minimum":0}},"additionalProperties":false},"LegacyWebhookCreated":{"type":"object","required":["id","url","events","description","hasSecret","isActive","createdAt"],"properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/LegacyWebhookEvent"}},"description":{"type":["string","null"]},"hasSecret":{"type":"boolean"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"LegacyWebhookList":{"type":"object","required":["webhooks"],"properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/LegacyWebhook"}}},"additionalProperties":false},"LegacyWorkspaceArtifact":{"type":"object","required":["name","size","contentType","downloadUrl"],"properties":{"name":{"type":"string"},"size":{"type":"integer","minimum":0},"contentType":{"type":"string"},"downloadUrl":{"type":"string","format":"uri","description":"User-content isolation URL valid for one hour. Re-list for a fresh URL."}},"additionalProperties":false},"LegacyWorkspaceArtifactList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegacyWorkspaceArtifact"}}},"additionalProperties":false},"LegacyAgentComputerViewServer":{"type":"object","required":["type","internalName","remoteId"],"properties":{"type":{"type":"string","enum":["internal","remote"]},"internalName":{"type":["string","null"]},"remoteId":{"type":["string","null"]}},"additionalProperties":false},"LegacyAgentComputerView":{"type":"object","required":["id","name","enabled","server"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"enabled":{"type":"boolean"},"server":{"$ref":"#/components/schemas/LegacyAgentComputerViewServer"}},"additionalProperties":false},"LegacyAgentComputerBase":{"type":"object","required":["id","name","sandboxId","icon","url","db9Enabled","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"sandboxId":{"type":["string","null"]},"icon":{"type":["string","null"]},"url":{"type":"string","format":"uri"},"db9Enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"LegacyAgentComputerSummary":{"allOf":[{"$ref":"#/components/schemas/LegacyAgentComputerBase"}],"unevaluatedProperties":false},"LegacyDb9ApiKey":{"type":"object","required":["id","name","token","createdAt","expiresAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"token":{"type":"string","readOnly":true,"description":"Sensitive credential returned once by the mint operation."},"createdAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"LegacyCreateAgentComputerRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"default":"Agent Computer"},"icon":{"type":"string","maxLength":50},"agent_instructions":{"type":["string","null"],"maxLength":100000},"agent_profile_id":{"type":"string","format":"uuid"},"db9_enabled":{"type":"boolean","default":false,"description":"When true, creation waits for provisioning and returns a one-shot DB9 API key."}},"additionalProperties":false},"LegacyAgentComputerCreated":{"allOf":[{"$ref":"#/components/schemas/LegacyAgentComputerBase"},{"type":"object","required":["sandboxBaseUrl","sandboxApiKey","agentInstructions","views"],"properties":{"sandboxBaseUrl":{"type":"string","format":"uri"},"sandboxApiKey":{"type":"string","readOnly":true,"description":"Sensitive organization-level Microsandbox credential returned to the caller."},"agentInstructions":{"type":["string","null"]},"views":{"type":"array","items":{"$ref":"#/components/schemas/LegacyAgentComputerView"}},"db9ApiKey":{"anyOf":[{"$ref":"#/components/schemas/LegacyDb9ApiKey"},{"type":"null"}],"description":"Returned once when db9_enabled is true."}}}],"unevaluatedProperties":false},"LegacyAgentComputerList":{"type":"object","required":["data","total","limit","offset"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegacyAgentComputerSummary"}},"total":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":1,"maximum":100},"offset":{"type":"integer","minimum":0}},"additionalProperties":false},"LegacyAgentComputerRecentTask":{"type":"object","required":["id","title","status","createdAt","completedAt"],"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed","canceled"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"LegacyAgentComputerDetail":{"allOf":[{"$ref":"#/components/schemas/LegacyAgentComputerBase"},{"type":"object","required":["sandboxBaseUrl","sandboxApiKey","agentInstructions","views","taskCount","recentTasks"],"properties":{"sandboxBaseUrl":{"type":"string","format":"uri"},"sandboxApiKey":{"type":"string","readOnly":true,"description":"Sensitive organization-level Microsandbox credential returned to the caller."},"agentInstructions":{"type":["string","null"]},"views":{"type":"array","items":{"$ref":"#/components/schemas/LegacyAgentComputerView"}},"taskCount":{"type":"integer","minimum":0},"recentTasks":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/LegacyAgentComputerRecentTask"}}}}],"unevaluatedProperties":false},"LegacyUpdateAgentComputerRequest":{"type":"object","properties":{"agent_instructions":{"type":["string","null"],"maxLength":100000},"views":{"type":"object","description":"Map of MCPServerView ID to enabled state.","additionalProperties":{"type":"boolean"}}},"additionalProperties":false},"LegacyAgentComputerConfiguration":{"type":"object","required":["id","agentInstructions","views"],"properties":{"id":{"type":"string","format":"uuid"},"agentInstructions":{"type":["string","null"]},"views":{"type":"array","items":{"$ref":"#/components/schemas/LegacyAgentComputerView"}}},"additionalProperties":false},"LegacyDb9ShareToken":{"type":"object","required":["token","expiresAt"],"properties":{"token":{"type":"string","readOnly":true,"description":"Sensitive share credential returned by the mint operation."},"expiresAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"ContextLakeValidationIssue":{"type":"object","required":["path","message"],"properties":{"path":{"type":"string"},"message":{"type":"string"}},"additionalProperties":false},"ContextLakeError":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeValidationIssue"}}},"additionalProperties":false},"ContextLakeTimeoutError":{"type":"object","required":["error","timeout"],"properties":{"error":{"type":"string"},"timeout":{"type":"integer","const":180000}},"additionalProperties":false},"ContextLakeDataset":{"type":"object","required":["from","name"],"properties":{"from":{"type":"string"},"name":{"type":"string"},"mode":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}},"notifications":{"type":"boolean"}},"additionalProperties":true},"ContextLakeViewAcceleration":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"},"engine":{"type":"string"},"mode":{"type":"string"},"refresh_mode":{"type":"string"},"refresh_check_interval":{"type":"string"},"refresh_retry_enabled":{"type":"boolean"},"refresh_retry_max_attempts":{"type":"integer"},"refresh_jitter_enabled":{"type":"boolean"}},"additionalProperties":true},"ContextLakeView":{"type":"object","required":["name","sql"],"properties":{"name":{"type":"string"},"sql":{"type":"string"},"acceleration":{"$ref":"#/components/schemas/ContextLakeViewAcceleration"}},"additionalProperties":true},"ContextLakeSecret":{"type":"object","required":["from","name"],"properties":{"from":{"type":"string"},"name":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}}},"additionalProperties":true},"ContextLakeConfig":{"type":"object","required":["version","kind","name"],"properties":{"version":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"secrets":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeSecret"}},"runtime":{"type":"object","additionalProperties":true},"datasets":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeDataset"}},"views":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeView"}},"x-rebyte":{"type":"object","properties":{"notifications":{"type":"object","properties":{"s3_datasets":{"type":"array","items":{"type":"object","required":["name","from"],"properties":{"name":{"type":"string"},"from":{"type":"string"}},"additionalProperties":false}}},"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":true},"ContextLakeConfigResponse":{"type":"object","required":["yaml","config"],"properties":{"yaml":{"type":"string"},"config":{"$ref":"#/components/schemas/ContextLakeConfig"}},"additionalProperties":false},"ContextLakeDatasetUpdate":{"type":"object","properties":{"from":{"type":"string"},"mode":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}},"notifications":{"type":"boolean"}},"additionalProperties":true},"ContextLakeViewUpdate":{"type":"object","properties":{"sql":{"type":"string"},"acceleration":{"$ref":"#/components/schemas/ContextLakeViewAcceleration"}},"additionalProperties":true},"ContextLakePatchConfigRequest":{"type":"object","properties":{"addDatasets":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeDataset"}},"removeDatasets":{"type":"array","items":{"type":"string"}},"updateDatasets":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ContextLakeDatasetUpdate"}},"addViews":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeView"}},"removeViews":{"type":"array","items":{"type":"string"}},"updateViews":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ContextLakeViewUpdate"}}},"additionalProperties":true},"ContextLakeNotificationInfo":{"type":"object","required":["queueArn","region","instructions"],"properties":{"queueArn":{"type":"string"},"region":{"type":"string"},"instructions":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"ContextLakeBasicMutationResult":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","const":true}},"additionalProperties":false},"ContextLakeMutationResult":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","const":true},"notifications":{"$ref":"#/components/schemas/ContextLakeNotificationInfo"}},"additionalProperties":false},"ContextLakeCreateDatasetRequest":{"allOf":[{"$ref":"#/components/schemas/ContextLakeDataset"},{"type":"object","required":["from","name"]}]},"ContextLakeUpdateDatasetRequest":{"$ref":"#/components/schemas/ContextLakeDatasetUpdate"},"ContextLakeCreateDatasetResult":{"type":"object","required":["ok","dataset"],"properties":{"ok":{"type":"boolean","const":true},"dataset":{"$ref":"#/components/schemas/ContextLakeDataset"},"notifications":{"$ref":"#/components/schemas/ContextLakeNotificationInfo"}},"additionalProperties":false},"ContextLakeCreateViewRequest":{"allOf":[{"$ref":"#/components/schemas/ContextLakeView"},{"type":"object","required":["name","sql"]}]},"ContextLakeUpdateViewRequest":{"$ref":"#/components/schemas/ContextLakeViewUpdate"},"ContextLakeCreateViewResult":{"type":"object","required":["ok","view"],"properties":{"ok":{"type":"boolean","const":true},"view":{"type":"object","required":["name","sql"],"properties":{"name":{"type":"string"},"sql":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false},"ContextLakeSqlRequest":{"type":"object","required":["query"],"properties":{"query":{"type":"string","minLength":1}},"additionalProperties":true},"ContextLakeSqlResult":{"type":"object","required":["rows"],"properties":{"rows":{"description":"The JSON value returned by SpiceD. It is normally an array of row objects."}},"additionalProperties":false},"ContextLakeDatasetStatus":{"type":"object","required":["ok","status","connectorId","notifications"],"properties":{"ok":{"type":"boolean"},"status":{"type":"string","enum":["ready","error"]},"connectorId":{"type":"string"},"notifications":{"type":"boolean"},"s3LastEventAt":{"type":["string","null"],"format":"date-time"},"s3LastRefreshAt":{"type":["string","null"],"format":"date-time"},"s3EventCount":{"type":["integer","null"]}},"additionalProperties":false},"ContextLakeStatus":{"type":"object","required":["vmStatus","datasets"],"properties":{"vmStatus":{"type":"string","enum":["not_provisioned","paused","running","provisioning"]},"datasets":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ContextLakeDatasetStatus"}}},"additionalProperties":false},"ContextLakeStartResult":{"type":"object","required":["sandboxId","status"],"properties":{"sandboxId":{"type":"string"},"status":{"type":"string","const":"running"}},"additionalProperties":false},"CreateHeadlessAccountRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"billToParent":{"type":"boolean"}},"additionalProperties":true},"CreateHeadlessAccountResult":{"type":"object","required":["id","name","api_key"],"properties":{"id":{"type":"string","pattern":"^acct_[A-Za-z0-9_-]{27}$"},"name":{"type":"string"},"api_key":{"type":"string","pattern":"^rbk_[0-9a-f]{40}$","description":"Plaintext organization API key. Returned only in this response."}},"additionalProperties":false},"HeadlessAccount":{"type":"object","required":["id","name","type","status","createdAt"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"UpdateAccountBillingRequest":{"type":"object","required":["billToParent"],"properties":{"billToParent":{"type":"boolean"}},"additionalProperties":true},"UpdateAccountBillingResult":{"type":"object","required":["id","billToParent"],"properties":{"id":{"type":"string"},"billToParent":{"type":"boolean"}},"additionalProperties":false},"BillingCredits":{"type":"object","required":["accountId","billingOrgId","balance","expiringBalance","expiringAllowance","totalAvailable","lifetimePurchased","lifetimeUsed","updatedAt"],"properties":{"accountId":{"type":"string"},"billingOrgId":{"type":"string"},"balance":{"type":"integer"},"expiringBalance":{"type":"integer"},"expiringAllowance":{"type":"integer"},"totalAvailable":{"type":"integer"},"lifetimePurchased":{"type":"integer"},"lifetimeUsed":{"type":"integer"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"CreateBillingTopupRequest":{"type":"object","required":["accountId","amount","externalPaymentId"],"properties":{"accountId":{"type":"string","minLength":1},"amount":{"type":"integer","minimum":1},"externalPaymentId":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":500},"metadata":{"type":"object","additionalProperties":true}},"additionalProperties":true},"CreatedBillingTopupResult":{"type":"object","required":["success","accountId","billingOrgId","amount","newBalance","transactionId"],"properties":{"success":{"type":"boolean","const":true},"accountId":{"type":"string"},"billingOrgId":{"type":"string"},"amount":{"type":"integer","minimum":1},"newBalance":{"type":"integer"},"transactionId":{"type":["string","null"],"format":"uuid"}},"additionalProperties":false},"ReplayedBillingTopupResult":{"type":"object","required":["success","alreadyProcessed","accountId","billingOrgId","amount","newBalance","updatedAt"],"properties":{"success":{"type":"boolean","const":true},"alreadyProcessed":{"type":"boolean","const":true},"accountId":{"type":"string"},"billingOrgId":{"type":"string"},"amount":{"type":"integer","minimum":1},"newBalance":{"type":"integer"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"SandboxApiKeyResult":{"type":"object","required":["apiKey","baseUrl","expiresAt"],"properties":{"apiKey":{"type":"string","minLength":1,"description":"Plaintext organization Microsandbox API key."},"baseUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"Agent":{"type":"object","required":["id","object","name","instructions","model","maxSteps","mcpServers","skills"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"agent"},"name":{"type":"string"},"instructions":{"type":"string"},"model":{"type":"string","enum":["deepseek-v4-pro","glm-5.2","kimi-k3","claude-sonnet-5","claude-opus-5","gpt-5.6","gpt-5.4-mini"]},"maxSteps":{"type":"integer","minimum":1,"maximum":128},"mcpServers":{"type":"array","items":{"oneOf":[{"type":"object","required":["kind","name"],"properties":{"kind":{"type":"string","const":"internal"},"name":{"type":"string","enum":["web_search_&_browse","sandbox","skills","coding_agent","ask_user_question","report_builder","company","scheduled_tasks","app_builder_contract","github","mock","statuspage","clari_copilot","databricks","fathom","front","gong","luma","openai_usage","productboard","salesloft","slab","ukg_ready","vanta","ashby","freshservice","sound_studio","speech_generator","snowflake","http_client","microsoft_excel","outlook","outlook_calendar"]}},"additionalProperties":false},{"type":"object","required":["kind","toolkit"],"properties":{"kind":{"type":"string","const":"composio"},"toolkit":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["kind","serverId"],"properties":{"kind":{"type":"string","const":"custom"},"serverId":{"type":"string","format":"uuid"}},"additionalProperties":false}],"discriminator":{"propertyName":"kind"}}},"skills":{"type":"array","items":{"type":"object","required":["repo","path"],"properties":{"repo":{"type":"string"},"path":{"type":"string"}},"additionalProperties":false}}},"additionalProperties":false},"Session":{"type":"object","required":["id","object","agentId","title","status","latestMessageId","latestMessageStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"session"},"agentId":{"type":"string","format":"uuid"},"title":{"type":"string"},"status":{"type":"string","enum":["idle","running","paused"]},"latestMessageId":{"type":["string","null"],"format":"uuid"},"latestMessageStatus":{"type":["string","null"],"enum":["queued","running","paused","completed","failed","canceled",null]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"UserQuestionOption":{"type":"object","required":["label","description"],"properties":{"label":{"type":"string"},"description":{"type":["string","null"]}},"additionalProperties":false},"UserQuestionItem":{"type":"object","required":["question","options","multiSelect"],"properties":{"question":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/UserQuestionOption"}},"multiSelect":{"type":"boolean"},"input":{}},"additionalProperties":false},"UserQuestion":{"type":"object","required":["question","options","multiSelect","questions"],"properties":{"question":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/UserQuestionOption"}},"multiSelect":{"type":"boolean"},"input":{},"questions":{"type":"array","minItems":1,"maxItems":4,"items":{"$ref":"#/components/schemas/UserQuestionItem"}}},"additionalProperties":false},"PendingAction":{"type":"object","required":["type","actionId","messageId","question"],"properties":{"type":{"type":"string","const":"ask_user_question"},"actionId":{"type":"integer","minimum":0},"messageId":{"type":"string","format":"uuid","description":"Canonical public Message ID to use in the answer endpoint."},"question":{"$ref":"#/components/schemas/UserQuestion"}},"additionalProperties":false},"Message":{"type":"object","required":["id","object","sessionId","status","parts","response","error","pendingActions","createdAt","completedAt"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"message"},"sessionId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","accepted","running","paused","completed","failed","canceled"]},"parts":{"type":"array","items":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"}},"additionalProperties":false}},"response":{"type":["string","null"]},"error":{"type":["string","null"]},"pendingActions":{"type":"array","description":"Durable unresolved HITL actions. Use these after an SSE disconnect to resume a paused Message.","items":{"$ref":"#/components/schemas/PendingAction"}},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"AcceptedMessage":{"type":"object","required":["message"],"properties":{"message":{"type":"object","required":["id","object","sessionId","status","warnings"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"message"},"sessionId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["running","queued"]},"warnings":{"type":"array","description":"Non-fatal setup warnings; the Message was still accepted.","items":{"type":"string"}}},"additionalProperties":false}},"additionalProperties":false},"SessionEventEnvelope":{"type":"object","required":["object","type","sessionId","channel","messageId","runId","createdAt","data"],"properties":{"object":{"type":"string","const":"session.event"},"type":{"type":"string","enum":["session.connected","session.event","message.started","message.event","message.completed","message.failed","message.canceled","message.stream_end"]},"sessionId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["conversation","message"]},"messageId":{"type":["string","null"],"format":"uuid","description":"Stable public prompt ID used by Message transcript endpoints."},"runId":{"type":["string","null"],"format":"uuid","description":"Internal execution-run correlation ID; distinct from messageId."},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object"}},"additionalProperties":false},"SessionSourceEventData":{"type":"object","required":["sourceType","step","payload"],"properties":{"sourceType":{"type":"string"},"step":{"type":["integer","null"]},"payload":{"type":"object","additionalProperties":true},"actionId":{"type":"integer","minimum":0,"description":"Present when sourceType is tool_ask_user_question; pass this value to the answer endpoint."},"question":{"$ref":"#/components/schemas/UserQuestion","description":"Present when sourceType is tool_ask_user_question."}},"allOf":[{"if":{"required":["sourceType"],"properties":{"sourceType":{"type":"string","const":"tool_ask_user_question"}}},"then":{"required":["actionId","question"]}}],"additionalProperties":false},"SessionSourceEvent":{"allOf":[{"$ref":"#/components/schemas/SessionEventEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SessionSourceEventData"}}}]},"SessionConnectedEvent":{"allOf":[{"$ref":"#/components/schemas/SessionEventEnvelope"},{"type":"object","properties":{"type":{"type":"string","const":"session.connected"},"channel":{"type":"string","const":"conversation"},"messageId":{"type":"null"},"runId":{"type":"null"},"data":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/Session"}},"additionalProperties":false}}}]},"SessionRuntimeEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"session.event"},"channel":{"type":"string","const":"conversation"}}}]},"MessageStartedEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.started"},"channel":{"type":"string","const":"conversation"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"MessageRuntimeEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.event"},"channel":{"type":"string","const":"message"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"MessageCompletedEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.completed"},"channel":{"type":"string","const":"message"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"MessageFailedEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.failed"},"channel":{"type":"string","const":"message"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"MessageCanceledEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.canceled"},"channel":{"type":"string","const":"message"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"MessageStreamEndEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.stream_end"},"channel":{"type":"string","const":"message"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"SessionEvent":{"type":"object","required":["object","type","sessionId","channel","messageId","runId","createdAt","data"],"properties":{"object":{"type":"string","const":"session.event"},"type":{"type":"string","enum":["session.connected","session.event","message.started","message.event","message.completed","message.failed","message.canceled","message.stream_end"]},"sessionId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["conversation","message"]},"messageId":{"type":["string","null"],"format":"uuid"},"runId":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object"}},"oneOf":[{"$ref":"#/components/schemas/SessionConnectedEvent"},{"$ref":"#/components/schemas/SessionRuntimeEvent"},{"$ref":"#/components/schemas/MessageStartedEvent"},{"$ref":"#/components/schemas/MessageRuntimeEvent"},{"$ref":"#/components/schemas/MessageCompletedEvent"},{"$ref":"#/components/schemas/MessageFailedEvent"},{"$ref":"#/components/schemas/MessageCanceledEvent"},{"$ref":"#/components/schemas/MessageStreamEndEvent"}],"discriminator":{"propertyName":"type","mapping":{"session.connected":"#/components/schemas/SessionConnectedEvent","session.event":"#/components/schemas/SessionRuntimeEvent","message.started":"#/components/schemas/MessageStartedEvent","message.event":"#/components/schemas/MessageRuntimeEvent","message.completed":"#/components/schemas/MessageCompletedEvent","message.failed":"#/components/schemas/MessageFailedEvent","message.canceled":"#/components/schemas/MessageCanceledEvent","message.stream_end":"#/components/schemas/MessageStreamEndEvent"}},"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{},"modelId":{"type":"string"},"balance":{"type":"number"},"required":{"type":"number"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}