{"openapi":"3.1.0","info":{"title":"Apollo API","description":"Build conversational experiences on your agents and manage them programmatically.\n\nThe API has two surfaces:\n\n- **Messaging** (`/messaging/v1`) — send end-user messages to your agent and read conversations back. Replies are available as a single JSON response, a Server-Sent Events token stream (`POST /messaging/v1/messages/stream`), or a bidirectional WebSocket session (see the companion AsyncAPI document at `/asyncapi.yaml`).\n- **Management** (`/management/v1`) — manage agents, their versions, projects, and conversation threads.\n\n**Authentication** — exchange your publishable key for a short-lived access token at `POST /management/v1/auth/token`, then send it as `Authorization: Bearer <access_token>`. Management endpoints also accept an organization API key via the `x-organization-api-key` header.\n\n**Errors** — every failure returns `{\"error\": {\"code\", \"message\", \"request_id\", \"details\"}}`. Branch on the stable `code`; include `request_id` when contacting support.","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["Health"],"summary":"Health check","description":"Liveness probe. Returns ``{\"status\": \"ok\"}`` when the service is up.","operationId":"health","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health"}}}}}}},"/management/v1/projects/{projectId}/agents":{"post":{"tags":["Agents"],"summary":"Create agent","description":"Create an agent in the project. New agents start without a live version\n— create and publish a version to make the agent answer.","operationId":"create_agent","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Projectid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreateResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]},"get":{"tags":["Agents"],"summary":"List agents","description":"List the project's agents, optionally filtered by name.","operationId":"list_agents","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Projectid"}},{"name":"filters","in":"query","required":true,"schema":{"$ref":"#/components/schemas/AgentListFilters"}},{"name":"page[size]","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page[Size]"}},{"name":"page[after]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[After]"}},{"name":"page[before]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[Before]"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Sort Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_Agent_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/agents/{agentId}":{"get":{"tags":["Agents"],"summary":"Get an agent","description":"Fetch one agent, including which version is currently live.","operationId":"get_agent","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]},"patch":{"tags":["Agents"],"summary":"Update an agent","description":"Rename an agent. re-publishes the published version with the updated name.\nTo change which version is live, publish a version instead.","operationId":"update_agent","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdateResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]},"delete":{"tags":["Agents"],"summary":"Delete an agent","description":"Delete an agent and all of its versions. This cannot be undone.","operationId":"delete_agent","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}}],"responses":{"204":{"description":"Successful Response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/agents/{agentId}/usage":{"get":{"tags":["Agents"],"summary":"Get agent usage","description":"Usage metrics for one agent, optionally bounded by a date range.","operationId":"get_agent_usage","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}},{"name":"created_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of the usage window (RFC 3339). Maps to created>=.","title":"Created From"},"description":"Start of the usage window (RFC 3339). Maps to created>=."},{"name":"created_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of the usage window (RFC 3339). Maps to created<=.","title":"Created To"},"description":"End of the usage window (RFC 3339). Maps to created<=."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/agents/{agentId}/versions":{"post":{"tags":["Agent Versions"],"summary":"Create a draft version","description":"Create a new draft version — empty, from a template, or cloned from an\nexisting version (``source`` selects which). Drafts stay editable until\npublished.","operationId":"create_version","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionCreateResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]},"get":{"tags":["Agent Versions"],"summary":"List versions","description":"List an agent's versions, newest first. Filter by status, tag, label,\nor version number; set ``exclude_revisions`` to see only base versions.","operationId":"list_versions","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}},{"name":"filters","in":"query","required":true,"schema":{"$ref":"#/components/schemas/AgentVersionListFilters"}},{"name":"page[size]","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page[Size]"}},{"name":"page[after]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[After]"}},{"name":"page[before]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[Before]"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Sort Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_AgentVersion_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/agents/{agentId}/versions/{versionId}":{"patch":{"tags":["Agent Versions"],"summary":"Update a version","description":"Update a version's metadata: label, tags, and notes. The configuration\nitself changes through push, never here.","operationId":"update_version","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Versionid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionUpdateResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/agents/{agentId}/versions/{versionId}/publish":{"post":{"tags":["Agent Versions"],"summary":"Publish a version","description":"Make this version the agent's live version. Publishing a draft freezes\nit first; publishing an already-published version re-activates it — the\nsame call handles shipping, switching, and rolling back.","operationId":"publish_version","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Versionid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionPublishResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/agents/{agentId}/versions/{versionId}/archive":{"post":{"tags":["Agent Versions"],"summary":"Archive a version","description":"Archive a version to retire it from everyday use. The agent's live\nversion can't be archived — publish another version first.","operationId":"archive_version","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Versionid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionArchiveResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/agents/{agentId}/versions/{versionId}/push":{"post":{"tags":["Agent Versions"],"summary":"Push a configuration bundle","description":"Upload a configuration bundle to a version, committing a new revision.\nThe response carries the new revision's tag and content digest.","operationId":"push_version","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Versionid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionPushRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionPushResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/agents/{agentId}/versions/{versionId}/pull":{"get":{"tags":["Agent Versions"],"summary":"Pull a configuration bundle","description":"Download a version's configuration bundle — the current revision, or a\nspecific one via ``version_tag``.","operationId":"pull_version","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agentid"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Versionid"}},{"name":"version_tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Revision tag (e.g. 'v3.2'). Omit for the version's current tag.","title":"Version Tag"},"description":"Revision tag (e.g. 'v3.2'). Omit for the version's current tag."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionPullResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/projects":{"post":{"tags":["Projects"],"summary":"Create project","description":"Create a project in your organization. Projects group agents.","operationId":"create_project","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]},"get":{"tags":["Projects"],"summary":"List projects","description":"List your organization's projects.","operationId":"list_projects","parameters":[{"name":"page[size]","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page[Size]"}},{"name":"page[after]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[After]"}},{"name":"page[before]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[Before]"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Sort Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_Project_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/projects/{projectId}":{"get":{"tags":["Projects"],"summary":"Get a project","description":"Fetch one project.","operationId":"get_project","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Projectid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]},"delete":{"tags":["Projects"],"summary":"Delete a project","description":"Delete a project. It disappears from listings immediately.","operationId":"delete_project","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Projectid"}}],"responses":{"204":{"description":"Successful Response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/projects/{projectId}/usage":{"get":{"tags":["Projects"],"summary":"Get project usage","description":"Usage metrics aggregated across every agent in the project, optionally\nbounded by a date range.","operationId":"get_project_usage","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Projectid"}},{"name":"created_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of the usage window (RFC 3339). Maps to created>=.","title":"Created From"},"description":"Start of the usage window (RFC 3339). Maps to created>=."},{"name":"created_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of the usage window (RFC 3339). Maps to created<=.","title":"Created To"},"description":"End of the usage window (RFC 3339). Maps to created<=."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/threads":{"get":{"tags":["Threads"],"summary":"List threads","description":"List your organization's conversation threads, newest first. Repeatable\nfilters (``tool``, ``rule``, ``param``, ``created``) OR within a field and\nAND across fields.","operationId":"list_threads","parameters":[{"name":"filters","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ThreadListFilters"}},{"name":"page[size]","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page[Size]"}},{"name":"page[after]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[After]"}},{"name":"page[before]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[Before]"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Sort Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_ThreadListItem_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/threads/{threadId}":{"get":{"tags":["Threads"],"summary":"Get a thread","description":"Fetch one thread's details — title, participants, and status.","operationId":"get_thread","parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Threadid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]},"patch":{"tags":["Threads"],"summary":"Update a thread","description":"Partial update — only ``title`` is updatable for now. Omitted fields are\nleft unchanged; the full updated thread is returned.","operationId":"update_thread","parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Threadid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/threads/{threadId}/trace":{"get":{"tags":["Threads"],"summary":"List thread traces","description":"The reasoning trace of every interaction in the thread — what the agent\nunderstood, which rules fired, and the decisions it took.","operationId":"get_thread_trace","parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Threadid"}},{"name":"page[size]","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page[Size]"}},{"name":"page[after]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[After]"}},{"name":"page[before]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[Before]"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Sort Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_Trace_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/interactions/{interactionId}/trace":{"get":{"tags":["Threads"],"summary":"Get an interaction's trace","description":"The reasoning trace of a single interaction, resolved by its id.","operationId":"get_interaction_trace","parameters":[{"name":"interactionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Interactionid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trace"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/management/v1/threads/{threadId}/messages":{"get":{"tags":["Threads"],"summary":"List thread messages","description":"The thread's full transcript, in chronological order.","operationId":"get_thread_messages","parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Threadid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Message"},"title":"Response Get Thread Messages"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]},{"organizationApiKey":[]}],"x-fern-audiences":["management"]}},"/messaging/v1/messages":{"post":{"tags":["Messaging"],"summary":"Send a message","description":"Send a message; auto-create the thread when ``thread_id`` is omitted. For a live\ntoken stream use ``POST /messages/stream`` (SSE). The resolved thread id is\nreturned in the body.","operationId":"send_message","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]}],"x-fern-audiences":["messaging"]}},"/messaging/v1/messages/stream":{"post":{"tags":["Messaging"],"summary":"Stream a message","description":"Send a message and stream the reply token-by-token over Server-Sent\nEvents. The thread is created automatically when ``thread_id`` is omitted —\nthe resolved id arrives as the first ``thread`` event. Resume a dropped\nstream with the standard ``Last-Event-ID`` header: missed events replay\nwithout running the turn again.","operationId":"stream_message","parameters":[{"name":"Last-Event-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last-Event-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"text/event-stream":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ThreadStreamEvent"},{"$ref":"#/components/schemas/MessageStreamEvent"},{"$ref":"#/components/schemas/TokenStreamEvent"},{"$ref":"#/components/schemas/ErrorStreamEvent"}],"discriminator":{"propertyName":"type","mapping":{"thread":"#/components/schemas/ThreadStreamEvent","message":"#/components/schemas/MessageStreamEvent","event":"#/components/schemas/TokenStreamEvent","error":"#/components/schemas/ErrorStreamEvent"}},"title":"Response 200 Stream Message"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"x-fern-streaming":{"format":"sse","terminator":"[DONE]","resumable":true},"security":[{"bearerAuth":[]}],"x-fern-audiences":["messaging"]}},"/messaging/v1/threads/{threadId}/rerun":{"post":{"tags":["Messaging"],"summary":"Rerun an interaction","description":"Regenerate ``interaction_id`` on the thread against the agent's live\nversion, then replay ``text`` onto the resulting new thread. The response's\n``thread_id`` is the new thread's id, not the original.","operationId":"rerun","parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Threadid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RerunMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]}],"x-fern-audiences":["messaging"]}},"/messaging/v1/threads/{threadId}/messages":{"get":{"tags":["Messaging"],"summary":"List thread messages","description":"The thread's full transcript, in chronological order.","operationId":"list_messages","parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Threadid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Message"},"title":"Response List Messages"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]}],"x-fern-audiences":["messaging"]}},"/messaging/v1/threads/{threadId}/trace":{"get":{"tags":["Messaging"],"summary":"Get trace by thread","description":"Every interaction trace in the thread.","operationId":"thread_trace","parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Threadid"}},{"name":"page[size]","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page[Size]"}},{"name":"page[after]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[After]"}},{"name":"page[before]","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page[Before]"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Sort Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_Trace_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]}],"x-fern-audiences":["messaging"]}},"/messaging/v1/interactions/{interactionId}/trace":{"get":{"tags":["Messaging"],"summary":"Get trace by interaction","description":"The reasoning trace of a single interaction, resolved by its id.","operationId":"interaction_trace","parameters":[{"name":"interactionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Interactionid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trace"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]}],"x-fern-audiences":["messaging"]}},"/messaging/v1/followup-suggestions":{"post":{"tags":["Messaging"],"summary":"Get follow-up suggestions","description":"Generate suggested follow-up prompts from a context you provide —\nuseful for offering the end user quick next questions. With no context,\nreturns the agent's static suggestions instead of calling the LLM.","operationId":"generate_followup_suggestions","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateFollowupSuggestionsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateFollowupSuggestionsResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]}],"x-fern-audiences":["messaging"]}},"/messaging/v1/welcome-message":{"get":{"tags":["Messaging"],"summary":"Get the welcome message","description":"The welcome message of the agent's live version — what to show before\nthe first user message.","operationId":"get_welcome_message","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionWelcomeMessageResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]}],"x-fern-audiences":["messaging"]}},"/messaging/v1/channels/{channel}/threads":{"post":{"tags":["Channels"],"summary":"Start a channel thread","description":"Send the opening message on ``channel`` and bind the recipient's phone\nnumber to a conversation thread. The agent is identified by your access\ntoken. Omit ``thread_id`` to start a new thread (its id is returned); pass\nit to continue an existing one. Template fields apply to WhatsApp only.","operationId":"initiate_thread","parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string","description":"Channel id: 'whatsapp' or 'sms'.","title":"Channel"},"description":"Channel id: 'whatsapp' or 'sms'."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiateThreadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiateThreadResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"bearerAuth":[]}],"x-fern-audiences":["messaging"]}},"/management/v1/auth/token":{"post":{"tags":["Auth"],"summary":"Get an access token","description":"Exchange a credential for a short-lived access token (OAuth 2.0, RFC 6749). Supported grant types: `publishable_key`. Refresh and other grants will be added on the same endpoint.","operationId":"issue_token","parameters":[{"name":"Origin","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},{"name":"X-Forwarded-For","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Forwarded-For"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"},"examples":{"publishable_key":{"summary":"Exchange a publishable key","value":{"grant_type":"publishable_key","publishable_key":"pk_network_..."}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"RFC 6749 §5.2 error response","content":{"application/json":{"examples":{"invalid_request":{"value":{"error":"invalid_request","error_description":"Missing 'grant_type'"}},"invalid_grant":{"value":{"error":"invalid_grant","error_description":"invalid_publishable_key"}},"unsupported_grant_type":{"value":{"error":"unsupported_grant_type","error_description":"grant_type 'foo' is not supported"}}}}}},"502":{"description":"Identity service is unavailable or returned an unexpected response","content":{"application/json":{"example":{"error":"server_error","error_description":"Identity service is unavailable"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-fern-audiences":["management","messaging"]}}},"components":{"schemas":{"Agent":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Agent id"},"project_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Project Id","description":"Owning project id"},"name":{"type":"string","title":"Name","description":"Agent name"},"live_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Live Version Id","description":"Tag of the currently deployed version; None until deployed"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","project_id","name","created_at","updated_at"],"title":"Agent","description":"The published Agent shape."},"AgentCreateRequest":{"properties":{"name":{"type":"string","maxLength":50,"minLength":2,"title":"Name","description":"Agent name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"AgentCreateRequest","description":"Create an agent. The owning project comes from the URL path."},"AgentCreateResponse":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Agent id"},"project_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Project Id","description":"Owning project id"},"name":{"type":"string","title":"Name","description":"Agent name"},"live_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Live Version Id","description":"Tag of the currently deployed version; None until deployed"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","project_id","name","created_at","updated_at"],"title":"AgentCreateResponse","description":"Returns the created agent."},"AgentListFilters":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Case-insensitive substring match on name"}},"type":"object","title":"AgentListFilters","description":"Query filters for listing agents in a project."},"AgentUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"New agent name"}},"additionalProperties":false,"type":"object","title":"AgentUpdateRequest","description":"Rename an agent. To change which version is live, publish a version\ninstead (``POST /agents/{agentId}/versions/{versionId}/publish``)."},"AgentUpdateResponse":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Agent id"},"project_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Project Id","description":"Owning project id"},"name":{"type":"string","title":"Name","description":"Agent name"},"live_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Live Version Id","description":"Tag of the currently deployed version; None until deployed"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","project_id","name","created_at","updated_at"],"title":"AgentUpdateResponse","description":"Returns the updated agent."},"AgentVersion":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Version id"},"agent_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agent Id","description":"Owning agent id"},"version_number":{"type":"integer","title":"Version Number"},"version_revision_number":{"type":"integer","title":"Version Revision Number"},"version_tag":{"type":"string","title":"Version Tag","description":"Canonical tag, e.g. 'v3.2'"},"status":{"type":"string","enum":["draft","published","archived"],"title":"Status"},"parent_version_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"Parent Version Id","description":"Lineage: cloned from"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"stats":{"anyOf":[{"$ref":"#/components/schemas/VersionStats"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Published At"}},"type":"object","required":["id","agent_id","version_number","version_revision_number","version_tag","status","created_at"],"title":"AgentVersion","description":"An agent version — an immutable-once-published config snapshot."},"AgentVersionArchiveResponse":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Version id"},"agent_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agent Id","description":"Owning agent id"},"version_number":{"type":"integer","title":"Version Number"},"version_revision_number":{"type":"integer","title":"Version Revision Number"},"version_tag":{"type":"string","title":"Version Tag","description":"Canonical tag, e.g. 'v3.2'"},"status":{"type":"string","enum":["draft","published","archived"],"title":"Status"},"parent_version_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"Parent Version Id","description":"Lineage: cloned from"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"stats":{"anyOf":[{"$ref":"#/components/schemas/VersionStats"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Published At"}},"type":"object","required":["id","agent_id","version_number","version_revision_number","version_tag","status","created_at"],"title":"AgentVersionArchiveResponse","description":"Returns the archived version."},"AgentVersionCreateRequest":{"properties":{"source":{"type":"string","enum":["version","agent-scope","template","empty"],"title":"Source"},"from_version":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"From Version","description":"Required when source='version'"},"from_template":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"From Template","description":"Required when source='template'"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","required":["source"],"title":"AgentVersionCreateRequest","description":"Create a draft version — empty, from a template, or cloned from an\nexisting version (``source`` selects which)."},"AgentVersionCreateResponse":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Version id"},"agent_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agent Id","description":"Owning agent id"},"version_number":{"type":"integer","title":"Version Number"},"version_revision_number":{"type":"integer","title":"Version Revision Number"},"version_tag":{"type":"string","title":"Version Tag","description":"Canonical tag, e.g. 'v3.2'"},"status":{"type":"string","enum":["draft","published","archived"],"title":"Status"},"parent_version_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"Parent Version Id","description":"Lineage: cloned from"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"stats":{"anyOf":[{"$ref":"#/components/schemas/VersionStats"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Published At"}},"type":"object","required":["id","agent_id","version_number","version_revision_number","version_tag","status","created_at"],"title":"AgentVersionCreateResponse","description":"Returns the created draft version."},"AgentVersionListFilters":{"properties":{"status":{"anyOf":[{"items":{"type":"string","enum":["draft","published","archived"]},"type":"array"},{"type":"null"}],"title":"Status"},"tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag","description":"Filter by tag (partial match)"},"version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version Number","description":"Filter by version number (exact match)"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Filter by label (partial match)"},"exclude_revisions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Exclude Revisions","description":"If true, only return base versions (revision 0)"}},"type":"object","title":"AgentVersionListFilters","description":"Query filters for listing an agent's versions (sort/pagination come from\nthe shared page-query dependency, not from here)."},"AgentVersionPublishResponse":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Version id"},"agent_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agent Id","description":"Owning agent id"},"version_number":{"type":"integer","title":"Version Number"},"version_revision_number":{"type":"integer","title":"Version Revision Number"},"version_tag":{"type":"string","title":"Version Tag","description":"Canonical tag, e.g. 'v3.2'"},"status":{"type":"string","enum":["draft","published","archived"],"title":"Status"},"parent_version_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"Parent Version Id","description":"Lineage: cloned from"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"stats":{"anyOf":[{"$ref":"#/components/schemas/VersionStats"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Published At"}},"type":"object","required":["id","agent_id","version_number","version_revision_number","version_tag","status","created_at"],"title":"AgentVersionPublishResponse","description":"Returns the now-live (published) version.\n\n``publish`` is the single verb that makes a version the agent's live one:\nit freezes a draft first, or just re-activates an already-published version\n(roll back / switch)."},"AgentVersionPullResponse":{"properties":{"return_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return Type","default":"bundle"},"agent_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agent Id"},"version_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Version Id"},"version_tag":{"type":"string","title":"Version Tag"},"bundle":{"additionalProperties":true,"type":"object","title":"Bundle","description":"Parsed agent configuration bundle"},"expires_at":{"type":"string","format":"date-time","title":"Expires At","description":"Cache-metadata expiry for this payload"}},"type":"object","required":["agent_id","version_id","version_tag","bundle","expires_at"],"title":"AgentVersionPullResponse","description":"A version's configuration bundle."},"AgentVersionPushRequest":{"properties":{"caller":{"type":"string","enum":["agent_builder","ui","cli"],"title":"Caller"},"commit_message":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Commit Message"},"bundle":{"additionalProperties":true,"type":"object","title":"Bundle","description":"Versioned agent configuration bundle. Must include 'schema_version' and 'general_settings'."}},"additionalProperties":false,"type":"object","required":["caller","bundle"],"title":"AgentVersionPushRequest","description":"Push a configuration bundle to a version, committing a new revision."},"AgentVersionPushResponse":{"properties":{"agent_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agent Id"},"version_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Version Id"},"new_version_revision_number":{"type":"integer","title":"New Version Revision Number"},"new_version_tag":{"type":"string","title":"New Version Tag"},"revision_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Revision Id","description":"Id of the newly committed revision"},"sha256":{"type":"string","title":"Sha256","description":"Hex-encoded SHA-256 of the canonical bundle bytes"},"size":{"type":"integer","title":"Size"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"commit_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Commit Message"}},"type":"object","required":["agent_id","version_id","new_version_revision_number","new_version_tag","revision_id","sha256","size","created_at"],"title":"AgentVersionPushResponse","description":"Result of a push: the new revision's identity and content digest."},"AgentVersionUpdateRequest":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","title":"AgentVersionUpdateRequest","description":"Update mutable fields (label, tags, notes) on a version."},"AgentVersionUpdateResponse":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Version id"},"agent_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Agent Id","description":"Owning agent id"},"version_number":{"type":"integer","title":"Version Number"},"version_revision_number":{"type":"integer","title":"Version Revision Number"},"version_tag":{"type":"string","title":"Version Tag","description":"Canonical tag, e.g. 'v3.2'"},"status":{"type":"string","enum":["draft","published","archived"],"title":"Status"},"parent_version_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"Parent Version Id","description":"Lineage: cloned from"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"stats":{"anyOf":[{"$ref":"#/components/schemas/VersionStats"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Published At"}},"type":"object","required":["id","agent_id","version_number","version_revision_number","version_tag","status","created_at"],"title":"AgentVersionUpdateResponse","description":"Returns the updated version."},"AgentVersionWelcomeMessageResponse":{"properties":{"welcome_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Welcome Message"}},"type":"object","title":"AgentVersionWelcomeMessageResponse","description":"The agent's welcome message (from ``general_settings.welcome_message``)."},"ErrorBody":{"properties":{"code":{"type":"string","title":"Code","description":"Stable, namespaced machine code clients branch on (e.g. \"not_found\" or \"agents.not_found\"). THE branch point -- open/extensible, append-only."},"message":{"type":"string","title":"Message","description":"Human-readable explanation. NOT part of the contract; may change anytime. Clients must never parse or branch on this."},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id","description":"Trace id for support correlation."},"details":{"anyOf":[{"items":{"$ref":"#/components/schemas/ErrorDetail"},"type":"array"},{"type":"null"}],"title":"Details","description":"Optional structured sub-errors (e.g. per-field validation failures)."}},"type":"object","required":["code","message"],"title":"ErrorBody","description":"The error body an end user receives when interacting with Apollo.\n\n``code`` is the stable, machine-readable branch point clients switch on.\n``message`` is human-readable and explicitly NOT part of the contract --\nit may change at any time and must never be parsed."},"ErrorDetail":{"properties":{"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"},"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"ErrorDetail","description":"A single structured sub-error (e.g. one field's validation failure)."},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorResponse","description":"The single envelope every Apollo error response conforms to."},"ErrorStreamEvent":{"properties":{"type":{"type":"string","const":"error","title":"Type","default":"error"},"seq":{"type":"integer","title":"Seq","description":"Monotonic sequence number; echo the last seen value via Last-Event-ID to resume."},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Error payload (message and, when available, a status code)."}},"type":"object","required":["seq","data"],"title":"ErrorStreamEvent","description":"A recoverable error raised while processing the turn."},"GenerateFollowupSuggestionsRequest":{"properties":{"context":{"additionalProperties":true,"type":"object","title":"Context","description":"Context the suggestions are generated from."},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"}},"additionalProperties":false,"type":"object","title":"GenerateFollowupSuggestionsRequest","description":"Generate follow-up prompt suggestions from a context you provide."},"GenerateFollowupSuggestionsResponse":{"properties":{"suggestions":{"items":{"type":"string"},"type":"array","title":"Suggestions"},"metadata_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata Id"}},"type":"object","title":"GenerateFollowupSuggestionsResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InitiateThreadRequest":{"properties":{"phone_number":{"type":"string","title":"Phone Number","description":"Recipient phone number in E.164 (e.g. +14155551234)."},"thread_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"Thread Id","description":"When set, continue this thread instead of creating a new one."},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User id for a new thread; defaults to the phone's digits."},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Opener body for non-template channels (SMS). Ignored by WhatsApp (uses templates)."},"agent_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Display Name","description":"WhatsApp only: bound to template variable {{1}}."},"sender_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Id","description":"Optional sender to send from (your connected number). Omit to use the platform default sender."}},"additionalProperties":false,"type":"object","required":["phone_number"],"title":"InitiateThreadRequest","description":"Start (or continue) an outbound-first thread on a channel — the agent is\nidentified by your access token. ``thread_id`` is optional: present ->\ncontinue that thread; absent -> a new thread is created and its id returned."},"InitiateThreadResponse":{"properties":{"thread_id":{"type":"string","title":"Thread Id","description":"Thread the opener landed on (new or continued)."},"message_sid":{"type":"string","title":"Message Sid","description":"Provider message id for the sent opener."},"from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From","description":"Sender number the opener was sent from (when a specific sender was used)."}},"type":"object","required":["thread_id","message_sid"],"title":"InitiateThreadResponse"},"Message":{"properties":{"id":{"type":"string","title":"Id","description":"Interaction id, or message id for interaction-less messages"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"Creation timestamp (ISO-8601)"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Message text"},"sender":{"anyOf":[{"$ref":"#/components/schemas/MessageParty"},{"type":"null"}]},"receiver":{"anyOf":[{"$ref":"#/components/schemas/MessageParty"},{"type":"null"}]},"cards":{"items":{"$ref":"#/components/schemas/MessageCard"},"type":"array","title":"Cards","description":"Rendered cards"},"welcome_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Welcome Message","description":"Agent's opening message, if this is one"},"followup_suggestions":{"items":{"type":"string"},"type":"array","title":"Followup Suggestions","description":"Suggested follow-up prompts"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Originating page URL"},"input_tokens":{"type":"integer","title":"Input Tokens","description":"Prompt tokens","default":0},"output_tokens":{"type":"integer","title":"Output Tokens","description":"Completion tokens","default":0}},"type":"object","required":["id"],"title":"Message","description":"One message in a thread transcript."},"MessageCard":{"properties":{"rendered_jsx":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rendered Jsx"},"is_recommended":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Recommended"},"index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Index"},"json_data":{"$ref":"#/components/schemas/MessageCardJsonData"}},"type":"object","title":"MessageCard"},"MessageCardJsonData":{"properties":{"entity":{"additionalProperties":true,"type":"object","title":"Entity"},"sub_entities":{"items":{"$ref":"#/components/schemas/MessageCardSubEntity"},"type":"array","title":"Sub Entities"}},"type":"object","title":"MessageCardJsonData","description":"Structured, self-contained form of the card — the JSON counterpart to\n``rendered_jsx``. ``entity`` is the card's own flat {code: value} map;\n``sub_entities`` holds its variant groups."},"MessageCardSubEntity":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"}},"type":"object","title":"MessageCardSubEntity"},"MessageParty":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},"type":"object","title":"MessageParty"},"MessageStreamEvent":{"properties":{"type":{"type":"string","const":"message","title":"Type","default":"message"},"seq":{"type":"integer","title":"Seq","description":"Monotonic sequence number; echo the last seen value via Last-Event-ID to resume."},"data":{"$ref":"#/components/schemas/Message"}},"type":"object","required":["seq","data"],"title":"MessageStreamEvent","description":"Terminal event of a turn: the completed agent reply."},"PageLinks":{"properties":{"next":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next"},"prev":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev"}},"type":"object","title":"PageLinks"},"PageMeta":{"properties":{"has_more":{"type":"boolean","title":"Has More"},"after_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After Cursor"},"before_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before Cursor"}},"type":"object","required":["has_more"],"title":"PageMeta"},"Page_AgentVersion_":{"properties":{"results":{"items":{"$ref":"#/components/schemas/AgentVersion"},"type":"array","title":"Results"},"meta":{"$ref":"#/components/schemas/PageMeta"},"links":{"$ref":"#/components/schemas/PageLinks"}},"type":"object","required":["results","meta","links"],"title":"Page[AgentVersion]"},"Page_Agent_":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Agent"},"type":"array","title":"Results"},"meta":{"$ref":"#/components/schemas/PageMeta"},"links":{"$ref":"#/components/schemas/PageLinks"}},"type":"object","required":["results","meta","links"],"title":"Page[Agent]"},"Page_Project_":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Project"},"type":"array","title":"Results"},"meta":{"$ref":"#/components/schemas/PageMeta"},"links":{"$ref":"#/components/schemas/PageLinks"}},"type":"object","required":["results","meta","links"],"title":"Page[Project]"},"Page_ThreadListItem_":{"properties":{"results":{"items":{"$ref":"#/components/schemas/ThreadListItem"},"type":"array","title":"Results"},"meta":{"$ref":"#/components/schemas/PageMeta"},"links":{"$ref":"#/components/schemas/PageLinks"}},"type":"object","required":["results","meta","links"],"title":"Page[ThreadListItem]"},"Page_Trace_":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Trace"},"type":"array","title":"Results"},"meta":{"$ref":"#/components/schemas/PageMeta"},"links":{"$ref":"#/components/schemas/PageLinks"}},"type":"object","required":["results","meta","links"],"title":"Page[Trace]"},"Project":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Project id"},"name":{"type":"string","title":"Name","description":"Project name"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","name","created_at","updated_at"],"title":"Project","description":"A project — groups your agents within an organization."},"ProjectCreateRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":2,"title":"Name","description":"Project name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"ProjectCreateRequest","description":"Create a project."},"RerunMessageRequest":{"properties":{"interaction_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Interaction Id"},"text":{"type":"string","minLength":1,"title":"Text"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"End user to attribute the rerun to; omitted, the thread's original user is kept."},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url","description":"Signed image URL on the replayed message."},"version_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"Version Id"},"version_tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Tag"}},"additionalProperties":false,"type":"object","required":["interaction_id","text"],"title":"RerunMessageRequest","description":"Rerun an interaction: regenerate it on the thread against the agent's\nlive version, then replay ``text`` onto the resulting new thread.\n``version_id``/``version_tag`` optionally pin a specific version instead of\nthe live one."},"SendMessageRequest":{"properties":{"text":{"type":"string","title":"Text"},"user_id":{"type":"string","title":"User Id"},"thread_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"Thread Id"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url","description":"Signed image URL for vision input."},"agent_variables":{"additionalProperties":true,"type":"object","title":"Agent Variables","description":"Per-message values for the agent's configured context variables."}},"additionalProperties":false,"type":"object","required":["text","user_id"],"title":"SendMessageRequest","description":"Send a message to your agent — the agent is identified by your access\ntoken. ``thread_id`` is optional: present -> append to that thread; absent\n-> a new thread is created automatically and its id returned."},"SendMessageResponse":{"properties":{"thread_id":{"type":"string","title":"Thread Id","description":"Thread the interaction belongs to"},"message":{"$ref":"#/components/schemas/Message"}},"type":"object","required":["thread_id","message"],"title":"SendMessageResponse","description":"Send/rerun reply plus the resolved thread id — the one the interaction landed\non (newly created when the request omitted ``thread_id``)."},"Thread":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Thread id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"End-user this thread belongs to, if any"},"title":{"type":"string","title":"Title","description":"Thread title"},"welcome_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Welcome Message","description":"Agent's opening message"},"followup_suggestions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Followup Suggestions","description":"Suggested follow-up prompts"}},"type":"object","required":["id","title"],"title":"Thread"},"ThreadListFilters":{"properties":{"project_id":{"anyOf":[{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},{"type":"null"}],"title":"Project Id","description":"Filter by project (account) id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"Filter by end-user id"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id","description":"Filter by caller-supplied external id"},"created":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Created","description":"RFC3339 timestamp(s); two values = a [start, end] range"},"tool":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tool","description":"Filter by activated tool code(s)"},"rule":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Rule","description":"Rule 'code', or 'code:fired|blocked|passed'"},"param":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Param","description":"'key:value', 'key:*', or 'key' with >,<,>=,<="},"agent_id":{"anyOf":[{"items":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"type":"array"},{"type":"null"}],"title":"Agent Id","description":"Filter by agent id(s)"}},"type":"object","title":"ThreadListFilters","description":"Query filters for listing threads. Repeatable filters (``tool``,\n``rule``, ``param``, ``created``) OR within a field and AND across fields."},"ThreadListItem":{"properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","title":"Id","description":"Thread id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Thread title"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"Creation timestamp (ISO-8601)"},"version_tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Tag","description":"Agent version tag the thread runs on"}},"type":"object","required":["id"],"title":"ThreadListItem"},"ThreadStreamEvent":{"properties":{"type":{"type":"string","const":"thread","title":"Type","default":"thread"},"data":{"$ref":"#/components/schemas/ThreadStreamEventData"}},"type":"object","required":["data"],"title":"ThreadStreamEvent","description":"First event of a stream: the resolved thread id (a client can't read\nresponse headers mid-stream). Unsequenced — it replays on every resume."},"ThreadStreamEventData":{"properties":{"thread_id":{"type":"string","title":"Thread Id","description":"Thread the turn runs on (newly created when the request omitted it)."}},"type":"object","required":["thread_id"],"title":"ThreadStreamEventData"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"Bearer"},"expires_in":{"type":"integer","title":"Expires In"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"}},"type":"object","required":["access_token","expires_in"],"title":"TokenResponse","description":"Successful token response (RFC 6749 §5.1), extended with the agent and\norganization behind the exchanged key. Send the token as\n``Authorization: Bearer <access_token>``; ``agent_id`` is the agent your\nmessaging calls run against (``null`` when the key carries no agent)."},"TokenStreamEvent":{"properties":{"type":{"type":"string","const":"event","title":"Type","default":"event"},"seq":{"type":"integer","title":"Seq","description":"Monotonic sequence number; echo the last seen value via Last-Event-ID to resume."},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Event payload; token deltas carry the text under data.text."}},"type":"object","required":["seq","data"],"title":"TokenStreamEvent","description":"A streaming event emitted while the agent works (token deltas, stream end)."},"Trace":{"properties":{"input":{"anyOf":[{"$ref":"#/components/schemas/TraceInput"},{"type":"null"}]},"understanding":{"anyOf":[{"$ref":"#/components/schemas/TraceUnderstanding"},{"type":"null"}]},"decisions":{"anyOf":[{"items":{"$ref":"#/components/schemas/TraceDecision"},"type":"array"},{"type":"null"}],"title":"Decisions"},"computed_parameters":{"anyOf":[{"items":{"$ref":"#/components/schemas/TraceComputedParameter"},"type":"array"},{"type":"null"}],"title":"Computed Parameters"},"response":{"anyOf":[{"$ref":"#/components/schemas/TraceResponse"},{"type":"null"}]},"rules_evaluations":{"anyOf":[{"items":{"$ref":"#/components/schemas/TraceRuleEvaluation"},"type":"array"},{"type":"null"}],"title":"Rules Evaluations"}},"type":"object","title":"Trace","description":"The published, scrubbed reasoning trace for one interaction."},"TraceComputedParameter":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}},"type":"object","title":"TraceComputedParameter"},"TraceCondition":{"properties":{"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"},"operation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operation"}},"type":"object","title":"TraceCondition"},"TraceDecision":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"},"parent_tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Tool"},"track_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Track Id"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"check_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Check Status"},"trigger":{"anyOf":[{"$ref":"#/components/schemas/TraceTrigger"},{"type":"null"}]},"trigger_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Type"},"rule":{"anyOf":[{"$ref":"#/components/schemas/TraceRule"},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"fail_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fail Reason"},"computation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Computation"},"output_param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Param"},"output_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Title"},"qualified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Qualified"},"matched_branch":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Branch"}},"type":"object","title":"TraceDecision","description":"One decision the agent took while handling the message."},"TraceGuardrails":{"properties":{"passed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passed"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"TraceGuardrails"},"TraceInput":{"properties":{"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"The end-user's message"}},"type":"object","title":"TraceInput"},"TraceJsxWidget":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"rendered_jsx":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rendered Jsx"},"is_recommended":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Recommended"},"index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Index"}},"type":"object","title":"TraceJsxWidget"},"TraceResponse":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"suggestions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Suggestions"},"question_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question Reason"},"asking_for":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Asking For"},"block_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Block Message"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"jsx_widgets":{"anyOf":[{"items":{"$ref":"#/components/schemas/TraceJsxWidget"},"type":"array"},{"type":"null"}],"title":"Jsx Widgets"}},"type":"object","title":"TraceResponse"},"TraceRule":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"type":"object","title":"TraceRule"},"TraceRuleEvaluation":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"triggered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Triggered"},"reason":{"anyOf":[{"items":{"$ref":"#/components/schemas/TraceRuleReason"},"type":"array"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"TraceRuleEvaluation"},"TraceRuleReason":{"properties":{"passed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passed"},"trigger_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Type"},"condition":{"anyOf":[{"$ref":"#/components/schemas/TraceCondition"},{"type":"null"}]}},"type":"object","title":"TraceRuleReason"},"TraceTrigger":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"reasons":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Reasons"},"matched_objective":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Objective"}},"type":"object","title":"TraceTrigger"},"TraceUnderstanding":{"properties":{"intents":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Intents"},"guardrails":{"anyOf":[{"$ref":"#/components/schemas/TraceGuardrails"},{"type":"null"}]}},"type":"object","title":"TraceUnderstanding"},"UpdateThreadRequest":{"properties":{"title":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Title","description":"New thread title; omit to leave the title unchanged."}},"additionalProperties":false,"type":"object","title":"UpdateThreadRequest","description":"Partial update of a thread. Only ``title`` is updatable for now; every\nfield is optional so future updatable fields stay additive (PATCH semantics)."},"UsageResponse":{"properties":{"interaction_count":{"type":"integer","title":"Interaction Count","description":"Number of billed interactions (one per interaction).","default":0},"input_tokens":{"type":"integer","title":"Input Tokens","description":"Total input tokens.","default":0},"output_tokens":{"type":"integer","title":"Output Tokens","description":"Total output tokens.","default":0},"cache_read_tokens":{"type":"integer","title":"Cache Read Tokens","description":"Total cached (read) input tokens.","default":0},"reasoning_tokens":{"type":"integer","title":"Reasoning Tokens","description":"Total reasoning tokens.","default":0},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Sum of input + output + cache-read + reasoning tokens.","default":0}},"type":"object","title":"UsageResponse","description":"Usage metrics for one agent or across a project over the requested window."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VersionStats":{"properties":{"workflows":{"type":"integer","title":"Workflows","default":0},"policies":{"type":"integer","title":"Policies","default":0},"agent_placeholders":{"type":"integer","title":"Agent Placeholders","default":0},"scope_entities":{"type":"integer","title":"Scope Entities","default":0},"integrations":{"type":"integer","title":"Integrations","default":0},"card_templates":{"type":"integer","title":"Card Templates","default":0},"parameters":{"type":"integer","title":"Parameters","default":0},"knowledge_bases":{"type":"integer","title":"Knowledge Bases","default":0},"agent_properties":{"type":"integer","title":"Agent Properties","default":0}},"type":"object","title":"VersionStats","description":"Counts of the entities configured in a version."}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Access token from `POST /management/v1/auth/token` (publishable-key exchange) or a login session. Publishable-key tokens are agent-scoped and serve the messaging surface; login tokens also serve management."},"organizationApiKey":{"type":"apiKey","in":"header","name":"x-organization-api-key","description":"Organization API key — alternative to a Bearer token on the management surface."}}},"tags":[{"name":"Auth","description":"Exchange a credential for a short-lived access token — start here. Send the token as `Authorization: Bearer <access_token>` on every other endpoint (management endpoints also accept an organization API key via the `x-organization-api-key` header)."},{"name":"Messaging","description":"Talk to your agent: send end-user messages (JSON reply or SSE token stream), rerun an interaction, and read a conversation's messages and reasoning traces. Threads are created automatically on the first message — pass the returned `thread_id` to continue a conversation."},{"name":"Channels","description":"Reach end users on WhatsApp and SMS: send the opening message and bind the recipient's phone number to a conversation thread; replies flow through the same thread."},{"name":"Threads","description":"Conversation threads: list and filter them, fetch one with its transcript and traces, and update its title."},{"name":"Agents","description":"Create and manage the agents in a project."},{"name":"Agent Versions","description":"An agent's configuration versions: list and inspect them, and publish a new live version."},{"name":"Projects","description":"Projects group your agents within an organization."},{"name":"Health","description":"Service liveness."}],"servers":[{"url":"https://api-v3.aui.io/apollo-api"}]}