{"openapi":"3.2.1","info":{"title": "Agents API", "version": "1.0.0", "summary": "Your agents, for your own apps and systems", "description": "Every call comes from your server with one of your API keys, made in the console, and names the\nperson it acts for: someone signed in to your app, with `X-User-ID`, or a visitor who isn't, with\n`X-Visitor-ID`, each with the ID your app keeps for them. Never put a key in a browser or an app\npeople download.\n\n**Embed sessions**: the embed on your pages calls the same routes for one person with an embed\nsession, `es_…`, in place of a key. `POST /embed/sessions` gives one, with no credential, for a\nvisitor or for the user named by a token from your identity provider or signing key. A session is its own person, so its calls\nsend no `X-User-ID` or `X-Visitor-ID`; `GET /me` is that person, with a user's own\n`/me/files` and the person's own `/me/connections`. The people's routes, `/users/…` and `/visitors/…`, stay\nyour servers', with a key. [Put an agent on your site](/api/docs/embed) shows the embed in each of\nits forms, for each use case and each identity provider.\n\n**People**: a person is made the first time a call names them. Tell the agent who they are with\n`PUT /users/{id}` or `PUT /visitors/{id}`: their name, email, language and time zone, all\noptional. Erasing a person erases their conversations too. [Let people connect their accounts](/api/docs/sign-in)\nexplains how your people are known, in the embed and here, and how they connect their own accounts.\n\n**Agents**: the agents shared through the API, as their published version in use shows them.\nAn agent for signed-in people only refuses visitors.\n\n**Conversations**: each person's own, with one agent each; no call reaches anyone else's. A\nmessage starts the agent's turn, or joins the turn under way. Every turn runs the agent's\nversion in use as the turn starts, and is a resource of its own: what became of it, and what it\nused. Once an agent stops being shared, its people can still list, read, rename and delete their\nconversations with it, and change nothing else.\n\n**Files**: a person attaches a file to a conversation, its bytes as the body, and sends it with a\nmessage by its ID once it's read; the agent gives files back the same way. Someone signed in to\nyour app also keeps the files the agent kept for them across conversations, and a home in each\nagent's sandboxes; a visitor keeps only each conversation's.\n\n**Webhooks**: your servers hear when a person's turn begins and ends and when a conversation\nwaits for its person, without holding a stream open: each event is signed and sent as Standard\nWebhooks 1.0 describes, to the endpoints set up in the console.\n\n**What people see**: everything the API answers is safe to show the person as it is: their words\nand the agent's, files, what became of a turn in words for them, never how the agent works\ninside. A turn's `usage` is for your own billing and monitoring, and comes only with a key.\n\n**Answers**: a call answers the resource itself, as JSON. A new conversation, and a person a\n`PUT` makes, is `201 Created` with its `Location`; a message and a retry, which start work, are\n`202 Accepted` with what became of the message; a delete is `204 No Content`; everything else\n`200`. IDs are 24 hexadecimal characters and timestamps Unix milliseconds. Nothing is cached:\nevery answer is `Cache-Control: no-store`.\n\n**Problems**: every refusal and failure is a problem detail (RFC 9457), as\n`application/problem+json`: its `type`, a page saying what it means and what to do, its\n`title`, `status` and `detail`, a stable `code` to branch on, the request's `request_id`, and\nfor a request that isn't valid, `errors`, naming each member at fault by its JSON Pointer\n(`pointer`), query parameter (`parameter`) or header (`header`). A method an address doesn't take\nis `405 method_not_allowed`, its `Allow` header listing those it does. The codes are the `Problem`\nschema's, and `/problems` lists them, each linked to its page.\n\n**Request IDs**: every answer names its request in `Request-Id`, the ID in a problem's\n`request_id` and in our logs. Quote it when you ask about a call. An ID you send is not used.\n\n**Idempotency**: send each message and each retry with an `Idempotency-Key` header, a key of\nyour own for the request, sent as a Structured Fields string (`Idempotency-Key: \"8e03978e\"`, a\nbare value is taken too), 1 to 100 visible ASCII characters; a new conversation, a file, a stop\nand a background job's stop take one too.\nA key is the person's within what it's sent to, a conversation for its messages and retries and\nan agent for the conversations started with it, and it holds while that conversation lives. The\nsame request sent again with its key answers what the first did, marked\n`Idempotent-Replayed: true`, and is taken once; another request with the key is\n`422 idempotency_key_reused`; the same while the first is still being answered is\n`409 idempotency_key_in_use`. Only a success is kept: a refusal or a failure leaves the key\nunused, to send again once whatever refused it has changed.\n\n**Lists** page by keyset: `limit`, 1 to 100 and 20 by default, and `cursor`, the\n`next_cursor` of the slice before, answered as `{data, has_more, next_cursor}`, `data` never\nnull and `next_cursor` null on the last slice. A cursor is opaque. A person's conversations\nare newest message first, so a conversation a message arrives in moves to the front, ahead of\na walk already past it.\n\n**Coming back later**: a `503` says how many seconds to wait in `Retry-After`, and so does a\n`409 idempotency_key_in_use`.\n"},"servers":[{"url":"https://hados.io/api/v1"}],"security":[{"apiKey": []}, {"embedSession": []}],"tags":[{"name": "People", "description": "The people your app names, and what the agent is told about them"}, {"name": "Agents", "description": "The agents shared through the API, or with an embed session those whose embed is on"}, {"name": "Conversations", "description": "A person's conversations with an agent, their messages and their turns"}, {"name": "Files", "description": "The files a person attaches to a conversation and the agent gives them"}, {"name": "Documents", "description": "This document and the problems' pages"}, {"name": "Embed", "description": "The embed's sessions, and the person a session is"}, {"name": "Connections", "description": "The accounts a person connects for an agent to use as them, and the pages that connect them"}, {"name": "Memory", "description": "What each agent remembers of the people signed in to your app, when its team turns memory on: short notes it keeps\nas it chats, each person's own with each agent, and its earlier conversations with them, which it looks back on.\nThey see each change, delete what's kept, forget everything and turn it off for an agent, and once a conversation\nhas read something from outside it, a change waits for their word. Forgetting everything leaves their\nconversations, each theirs to delete.\n"}, {"name": "Admin", "description": "Your chat app's admin area, for the people your chat app made admins, signed in to it on its own address: its\npeople, invitations, groups, sign-in rules, usage and activity. Every route checks the admin's role; where your\nrules ask two-step of admins, an admin sets it up first, and a change asks a sign-in from the last hour.\n"}, {"name": "Webhooks", "description": "Your servers hear of people's conversations as they change, without holding a stream open. An\nowner or a manager of your team sets up an endpoint in the console, its URL and the events it\ntakes, and finds its secret there. Each event is a `POST` of JSON to the endpoint, as Standard\nWebhooks 1.0 sends it, saying what happened and to whom by the API's IDs and yours for the\nperson; read the rest through the API with your key.\n\n**Answering**: answer any `2xx` within 15 seconds, then do the work. A redirect, any other\nstatus or no answer in time fails the attempt, and the event is sent again no sooner than 5\nseconds, 5 minutes, 30 minutes, 2, 5, 10, 14, 20 and 24 hours after the attempt before: ten\nattempts over about three days. After a `429` or a `503`, it's sent again no sooner than\n`Retry-After` says, up to a day. `410 Gone` turns the endpoint off at once, and so does failing\nevery attempt for three days; your team's owners and managers are told by email. An endpoint\nturned on again takes the events that come next; what failed goes again only when it's resent\nfrom the console.\n\n**At least once, in no set order**: an event can come twice, and after one that happened later.\n`webhook-id` is the same on every attempt at an event: take each once, and read what's current\nthrough the API.\n\n**Verifying**: check that each event came from us before you act on it, with one of Standard\nWebhooks' libraries (standardwebhooks.com) given your endpoint's secret, or as they do:\n\n1. Keep the body's bytes exactly as they came, before any JSON parsing, and read\n   `webhook-id`, `webhook-timestamp` and `webhook-signature`.\n2. Refuse a `webhook-timestamp` more than five minutes from your clock's.\n3. Decode what follows `whsec_` in your secret from base64: that's the key.\n4. Compute the HMAC-SHA256 of `{webhook-id}.{webhook-timestamp}.{body}` under the key, and\n   encode it as base64.\n5. Take the event when one of the entries in `webhook-signature`, separated by spaces, is\n   `v1,` and yours, compared in constant time. For a day after the secret is rotated, each\n   event is signed under both secrets, so the one replaced still verifies while you move to\n   the new one.\n"}],"paths":{"/openapi.json": {"get": {"tags": ["Documents"], "summary": "This document", "operationId": "getDocument", "security": [], "responses": {"200": {"description": "The API's OpenAPI document", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"type": "object"}}}}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/api/docs": {"servers": [{"url": "/", "description": "The API host's root, where the reference is"}], "get": {"tags": ["Documents"], "summary": "The reference", "description": "This document's reference in a browser, where a call can be tried with a key that stays in\nthe page. A client asking for `text/markdown` before `text/html` gets the reference in\nMarkdown, as `/api/docs.md` serves it.\n", "operationId": "getReference", "security": [], "responses": {"200": {"description": "The reference's page, or the reference in Markdown", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}, "text/markdown": {"schema": {"type": "string"}}}}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/api/docs.md": {"servers": [{"url": "/", "description": "The API host's root, where the reference is"}], "get": {"tags": ["Documents"], "summary": "The reference in Markdown", "description": "Every call with its parameters, body and answers, every schema and every problem, in one\nMarkdown file for coding agents and anyone reading without a browser.\n", "operationId": "getReferenceMarkdown", "security": [], "responses": {"200": {"description": "The reference", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/markdown": {"schema": {"type": "string"}}}}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/api/docs/embed": {"servers": [{"url": "/", "description": "The API host's root, where the reference is"}], "get": {"tags": ["Documents"], "summary": "Put an agent on your site", "description": "The embed's guide in a browser: an agent on your pages with a couple of lines of frontend\ncode, in each of its forms, for each use case and each kind of sign-in. A client asking for\n`text/markdown` before `text/html` gets the guide in Markdown, as `/api/docs/embed.md`\nserves it.\n", "operationId": "getEmbedGuide", "security": [], "responses": {"200": {"description": "The guide's page, or the guide in Markdown", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}, "text/markdown": {"schema": {"type": "string"}}}}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/api/docs/embed.md": {"servers": [{"url": "/", "description": "The API host's root, where the reference is"}], "get": {"tags": ["Documents"], "summary": "Put an agent on your site, in Markdown", "description": "The embed's guide in one Markdown file, for coding agents and anyone reading without a browser.", "operationId": "getEmbedGuideMarkdown", "security": [], "responses": {"200": {"description": "The guide", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/markdown": {"schema": {"type": "string"}}}}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/api/docs/sign-in": {"servers": [{"url": "/", "description": "The API host's root, where the reference is"}], "get": {"tags": ["Documents"], "summary": "Let people connect their accounts", "description": "The guide to your people's own accounts, in a browser: what a person meets when an agent needs\none of their accounts, how your agents know the people signed in to your app, what your own MCP\nserver serves so they can connect to it, each identity provider's setup and what goes wrong. A\nclient asking for `text/markdown` before `text/html` gets the guide in Markdown, as\n`/api/docs/sign-in.md` serves it.\n", "operationId": "getSignInGuide", "security": [], "responses": {"200": {"description": "The guide's page, or the guide in Markdown", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}, "text/markdown": {"schema": {"type": "string"}}}}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/api/docs/sign-in.md": {"servers": [{"url": "/", "description": "The API host's root, where the reference is"}], "get": {"tags": ["Documents"], "summary": "Let people connect their accounts, in Markdown", "description": "The guide to your people's own accounts in one Markdown file, for coding agents and anyone reading without a browser.", "operationId": "getSignInGuideMarkdown", "security": [], "responses": {"200": {"description": "The guide", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/markdown": {"schema": {"type": "string"}}}}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/api/docs/chat-app": {"servers": [{"url": "/", "description": "The API host's root, where the reference is"}], "get": {"tags": ["Documents"], "summary": "Your chat app", "description": "The guide to your people's own app for your agents, at an address of yours: opening it, who\ncan join, how people sign in, single sign-on, people, groups and the admin area, the agents in\nit, the routes it uses and what goes wrong. A client asking for `text/markdown` before\n`text/html` gets the guide in Markdown, as `/api/docs/chat-app.md` serves it.\n", "operationId": "getChatAppGuide", "security": [], "responses": {"200": {"description": "The guide's page, or the guide in Markdown", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}, "text/markdown": {"schema": {"type": "string"}}}}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/api/docs/chat-app.md": {"servers": [{"url": "/", "description": "The API host's root, where the reference is"}], "get": {"tags": ["Documents"], "summary": "Your chat app, in Markdown", "description": "The guide to your chat app in one Markdown file, for coding agents and anyone reading without a browser.", "operationId": "getChatAppGuideMarkdown", "security": [], "responses": {"200": {"description": "The guide", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/markdown": {"schema": {"type": "string"}}}}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/llms.txt": {"servers": [{"url": "/", "description": "The API host's root, where the reference is"}], "get": {"tags": ["Documents"], "summary": "The reference's index for coding agents", "description": "The API's llms.txt (llmstxt.org), linking the reference, this document and the problems.", "operationId": "getLLMsTxt", "security": [], "responses": {"200": {"description": "The index", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/plain": {"schema": {"type": "string"}}}}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/problems": {"servers": [{"url": "/", "description": "The API host's root, where every problem's type is a page"}], "get": {"tags": ["Documents"], "summary": "Every problem", "description": "Every problem the API answers, each linked to its page.", "operationId": "listProblems", "security": [], "responses": {"200": {"description": "The problems' index", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}}}}, "/problems/{code}": {"servers": [{"url": "/", "description": "The API host's root, where every problem's type is a page"}], "get": {"tags": ["Documents"], "summary": "A problem's page", "description": "What a problem means and what to do about it; every problem's `type` is its page.", "operationId": "getProblem", "security": [], "parameters": [{"name": "code", "in": "path", "required": true, "description": "A problem's code, as its `code` and the end of its `type` name it", "schema": {"$ref": "#/components/schemas/ProblemCode"}}], "responses": {"200": {"description": "The problem's page", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "404": {"$ref": "#/components/responses/NotFound"}}}}, "/users/{id}": {"parameters": [{"$ref": "#/components/parameters/PersonID"}], "put": {"tags": ["People"], "summary": "Tell the agent who a user is", "operationId": "putUser", "security": [{"apiKey": []}], "description": "Someone signed in to your app, by your ID for them, made if they're new. A field left out\nstays as it was; `null` clears it. No body makes them with nothing known.\n", "requestBody": {"required": false, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PersonPut"}}}}, "responses": {"200": {"$ref": "#/components/responses/Person"}, "201": {"$ref": "#/components/responses/PersonCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "get": {"tags": ["People"], "summary": "A user", "operationId": "getUser", "security": [{"apiKey": []}], "responses": {"200": {"$ref": "#/components/responses/Person"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["People"], "summary": "Erase a user", "operationId": "eraseUser", "security": [{"apiKey": []}], "description": "The person and their conversations are gone at once, each turn under way ended; within a day\neverything they held is erased: their conversations' messages and files, their kept files and\ntheir homes. Their ID can come back as someone new.\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/visitors/{id}": {"parameters": [{"$ref": "#/components/parameters/PersonID"}], "put": {"tags": ["People"], "summary": "Tell the agent who a visitor is", "operationId": "putVisitor", "security": [{"apiKey": []}], "description": "Someone using your site or app without signing in, by an ID your app keeps for them, made\nif they're new. A field left out stays as it was; `null` clears it. No body makes them with nothing known.\n", "requestBody": {"required": false, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PersonPut"}}}}, "responses": {"200": {"$ref": "#/components/responses/Person"}, "201": {"$ref": "#/components/responses/PersonCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "get": {"tags": ["People"], "summary": "A visitor", "operationId": "getVisitor", "security": [{"apiKey": []}], "responses": {"200": {"$ref": "#/components/responses/Person"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["People"], "summary": "Erase a visitor", "operationId": "eraseVisitor", "security": [{"apiKey": []}], "description": "The person and their conversations are gone at once, each turn under way ended; within a day\neverything they held is erased: their conversations' messages and files. Their ID can come back\nas someone new.\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/photo": {"parameters": [{"$ref": "#/components/parameters/PersonID"}], "get": {"tags": ["People"], "summary": "A user's photo", "operationId": "getUserPhoto", "description": "The picture the user gave of themselves, a JPEG, PNG or WebP image, kept in the tenant's storage and never by\nanything between them and the page. A visitor keeps none (`sign_in_required`); none given is `photo_not_found`.\n", "security": [{"apiKey": []}], "responses": {"200": {"$ref": "#/components/responses/Photo"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/FilesUnavailable"}}}, "put": {"tags": ["People"], "summary": "Give a user's photo", "operationId": "putUserPhoto", "description": "The body is the image: a JPEG, PNG or WebP by its bytes, at most 5 MB. It replaces the one before, which is\nreleased. Anything else is `photo_invalid`; past 5 MB, `photo_too_large`.\n", "security": [{"apiKey": []}], "requestBody": {"required": true, "content": {"image/jpeg": {"schema": {"type": "string", "format": "binary"}}, "image/png": {"schema": {"type": "string", "format": "binary"}}, "image/webp": {"schema": {"type": "string", "format": "binary"}}}}, "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "413": {"$ref": "#/components/responses/PhotoTooLarge"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/FilesUnavailable"}}}, "delete": {"tags": ["People"], "summary": "Take a user's photo away", "operationId": "deleteUserPhoto", "description": "The photo is released; with none, there's nothing to do.\n", "security": [{"apiKey": []}], "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/files": {"parameters": [{"$ref": "#/components/parameters/PersonID"}], "get": {"tags": ["People"], "summary": "A user's kept files", "operationId": "listKeptFiles", "security": [{"apiKey": []}], "description": "The files the agent kept for someone signed in to your app across their conversations, when they asked it\nto, newest first. A visitor keeps only each conversation's files.\n", "parameters": [{"$ref": "#/components/parameters/Limit"}, {"$ref": "#/components/parameters/Cursor"}], "responses": {"200": {"$ref": "#/components/responses/KeptFileList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/files/{file}": {"parameters": [{"$ref": "#/components/parameters/PersonID"}, {"$ref": "#/components/parameters/KeptFileID"}], "get": {"tags": ["People"], "summary": "A kept file", "operationId": "getKeptFile", "security": [{"apiKey": []}], "responses": {"200": {"$ref": "#/components/responses/KeptFile"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["People"], "summary": "Delete a kept file", "operationId": "deleteKeptFile", "security": [{"apiKey": []}], "description": "Gone from their kept files at once; the conversations it came from keep their own.", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/files/{file}/content": {"parameters": [{"$ref": "#/components/parameters/PersonID"}, {"$ref": "#/components/parameters/KeptFileID"}], "get": {"tags": ["People"], "summary": "Download a kept file", "operationId": "downloadKeptFile", "security": [{"apiKey": []}], "parameters": [{"$ref": "#/components/parameters/Range"}, {"$ref": "#/components/parameters/IfRange"}], "responses": {"200": {"$ref": "#/components/responses/FileContent"}, "206": {"$ref": "#/components/responses/FilePart"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "416": {"$ref": "#/components/responses/RangeNotSatisfiable"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/files/{file}/download-link": {"parameters": [{"$ref": "#/components/parameters/PersonID"}, {"$ref": "#/components/parameters/KeptFileID"}], "post": {"tags": ["People"], "summary": "Get a link to download a kept file", "operationId": "createKeptFileDownloadLink", "description": "A link the person's browser saves the kept file from by itself, `GET /downloads/{tenant}/{secret}`, as a\nconversation's file's link is: hand it to them rather than passing the bytes through your servers. It opens\nfor five minutes, with no key, for this file read as this person.\n", "security": [{"apiKey": []}], "responses": {"201": {"$ref": "#/components/responses/DownloadLinkCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/FilesUnavailable"}}}}, "/users/{id}/files/{file}/preview": {"parameters": [{"$ref": "#/components/parameters/PersonID"}, {"$ref": "#/components/parameters/KeptFileID"}], "get": {"tags": ["People"], "summary": "A kept picture's smaller copy", "operationId": "previewKeptFile", "security": [{"apiKey": []}], "responses": {"200": {"$ref": "#/components/responses/FilePreview"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/homes": {"parameters": [{"$ref": "#/components/parameters/PersonID"}], "get": {"tags": ["People"], "summary": "A user's homes", "operationId": "listHomes", "security": [{"apiKey": []}], "description": "A user's home in each agent's sandboxes: what they installed and made there, kept between their\nconversations with the agent, one for each agent that kept one.\n", "responses": {"200": {"$ref": "#/components/responses/HomeList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/connections": {"parameters": [{"$ref": "#/components/parameters/PersonID"}], "get": {"tags": ["Connections"], "summary": "A user's connections", "operationId": "listConnections", "security": [{"apiKey": []}], "description": "The accounts a user connected for agents' tools to use as them, a connector once each:\nwhether each works or needs signing in again (`reconnect`), and the actions it takes\nwithout asking. A visitor's are at `GET /visitors/{id}/connections`.\n", "responses": {"200": {"$ref": "#/components/responses/ConnectionList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/connections/{connector}": {"parameters": [{"$ref": "#/components/parameters/PersonID"}, {"$ref": "#/components/parameters/ConnectorID"}], "patch": {"tags": ["Connections"], "summary": "Change a user's connection", "operationId": "changeUserConnection", "security": [{"apiKey": []}], "description": "Whether the account's actions that change something ask the person first, and actions taken\nback from those it takes without asking, named by the words `always_allowed` shows. Words that\nname no such action change nothing.\n", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectionChange"}}}}, "responses": {"200": {"description": "The connection as it is now", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Connection"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}, "delete": {"tags": ["Connections"], "summary": "Remove a connection", "operationId": "removeConnection", "security": [{"apiKey": []}], "description": "The account's tokens are withdrawn where its server allows, and its next call asks the\nperson to connect it again (`chat:connect`).\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/visitors/{id}/connections": {"parameters": [{"$ref": "#/components/parameters/PersonID"}], "get": {"tags": ["Connections"], "summary": "A visitor's connections", "operationId": "listVisitorConnections", "security": [{"apiKey": []}], "description": "As `GET /users/{id}/connections`, for a visitor. Only a user connects an account, so a\nvisitor's are only those they still have, which end when they're erased, or 30 days after\ntheir last use.\n", "responses": {"200": {"$ref": "#/components/responses/ConnectionList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/visitors/{id}/connections/{connector}": {"parameters": [{"$ref": "#/components/parameters/PersonID"}, {"$ref": "#/components/parameters/ConnectorID"}], "patch": {"tags": ["Connections"], "summary": "Change a visitor's connection", "operationId": "changeVisitorConnection", "security": [{"apiKey": []}], "description": "Whether the account's actions that change something ask the person first, and actions taken\nback from those it takes without asking, named by the words `always_allowed` shows. Words that\nname no such action change nothing.\n", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectionChange"}}}}, "responses": {"200": {"description": "The connection as it is now", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Connection"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}, "delete": {"tags": ["Connections"], "summary": "Remove a visitor's connection", "operationId": "removeVisitorConnection", "security": [{"apiKey": []}], "description": "The account's tokens are withdrawn where its server allows. A visitor connects no account\nagain: only a user does.\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/connectors": {"parameters": [{"$ref": "#/components/parameters/PersonID"}], "get": {"tags": ["Connections"], "summary": "List the accounts a user may connect", "operationId": "listUserConnectors", "security": [{"apiKey": []}], "description": "The accounts the user may connect at an agent, from your app's own menu: its connectors on each\nperson's own login, with how the user's account stands.\n", "parameters": [{"name": "agent", "in": "query", "required": true, "description": "The agent the user connects at", "schema": {"$ref": "#/components/schemas/ID"}}], "responses": {"200": {"description": "The accounts, in the agent's order", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectableList"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/users/{id}/connections/{connector}/link": {"parameters": [{"$ref": "#/components/parameters/PersonID"}, {"$ref": "#/components/parameters/ConnectorID"}], "post": {"tags": ["Connections"], "summary": "Make a link for a user to connect an account", "operationId": "makeUserConnectLink", "security": [{"apiKey": []}], "description": "A link your app opens for the user to connect this account at the agent, from your own menu,\nwith no turn waiting on it. It serves once, within 10 minutes: its page says whose chat it's\nfor, and its Continue sends them to their sign-in, bound to that page's window. When it ends,\nthe page posts `{\"type\": \"chat:connect\", \"status\": \"connected\"}` (or `not_connected`) to the\nwindow that opened it; read the user's connectors again to see it. `connector_not_offered` for an\naccount the agent doesn't connect for them.\n", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectLinkRequest"}}}}, "responses": {"201": {"description": "The link and when it closes", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectLink"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/connect/link/{tenant}/{token}": {"parameters": [{"name": "tenant", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "token", "in": "path", "required": true, "schema": {"type": "string"}}], "get": {"tags": ["Connections"], "summary": "An app's connect link's page", "operationId": "openMenuLink", "x-browser-page": true, "description": "The page of a link from `POST /users/{id}/connections/{connector}/link`: it says whose chat it's\nfor and which account, and starts nothing until its Continue. Used, closed, or for an account\nthe agent no longer connects for them, it's a page saying the link is no longer open. It speaks\nthe first of English and Simplified Chinese the browser's `Accept-Language` asks, English\notherwise, and so do the pages of the sign-in its Continue starts.\n", "security": [], "responses": {"200": {"description": "The page naming whose chat it's for, with Continue", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "410": {"description": "A page saying the link is no longer open", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}}}, "post": {"tags": ["Connections"], "summary": "Continue an app's connect link", "operationId": "continueMenuLink", "x-browser-page": true, "description": "The page's Continue, with the hash of the binding its window made: it uses the link once and\nsends the person to their provider's sign-in, with no referrer. One another site sends is\nanswered with the page, and one without the hash with a page saying it needs JavaScript.\n", "security": [], "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"type": "object", "properties": {"binding_hash": {"type": "string", "description": "The SHA-256 of the binding the page keeps in its window, base64url without padding"}}}}}}, "responses": {"200": {"description": "The link's page, for a Continue another site sent", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "302": {"description": "To the provider's sign-in", "headers": {"Location": {"schema": {"type": "string", "format": "uri"}}, "Request-Id": {"$ref": "#/components/headers/RequestId"}}}, "400": {"description": "A page saying it needs JavaScript, for a Continue without the binding's hash", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "410": {"description": "A page saying the link is no longer open", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}}}}, "/connect/{tenant}/{item}/{secret}": {"parameters": [{"name": "tenant", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "item", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "secret", "in": "path", "required": true, "schema": {"type": "string"}}], "get": {"tags": ["Connections"], "summary": "A connect link", "operationId": "openConnectLink", "x-browser-page": true, "description": "A `chat:connect` interrupt's `metadata.chat.url`: open it in a window of its own for the\nperson. Opening it starts nothing: its page says whose chat it's for, by the name your app\ntold for the person, with which agent and which account it connects, and goes on when they\nchoose Continue. That page is the guard against a link reaching someone else, who would\nconnect their own account to the person's chat: open the link only for the person, and keep\nit as private as the conversation. The page binds the sign-in to its own window, with\nJavaScript, so it finishes there alone: the provider's address it goes on to connects\nnothing anywhere else. It needs no key, and is the person's alone while the interrupt is\nopen; one no longer open is a page that says so. A link from any chat but your app's, such\nas the embed's, is opened from that chat alone: anywhere else its page says so. Its pages, and\nthe sign-in's its Continue starts, speak the first of English and Simplified Chinese the\nbrowser's `Accept-Language` asks, English otherwise.\n", "security": [], "responses": {"200": {"description": "The page saying whose chat it's for, with Continue; for any chat but your app's, a page saying to open it from the chat", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "410": {"description": "A page saying the link is no longer open", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "503": {"description": "A page saying whose chat it is can't be read just now", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"text/html": {"schema": {"type": "string"}}}}}}, "post": {"tags": ["Connections"], "summary": "Continue a connect link", "operationId": "continueConnectLink", "x-browser-page": true, "description": "The link's page's Continue, its form carrying the hash of the binding the page made in its\nwindow: the person's sign-in starts bound to that window and they go to their provider's,\nwith no referrer, so the link's secret goes nowhere. Only the page itself goes on: a Continue\nsent from another site's page is answered with the page, for the person to choose, and one\nwithout the hash with a page saying it needs JavaScript. A link from any chat but your app's\nis answered with the page saying to open it from the chat.\n", "security": [], "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"type": "object", "properties": {"binding_hash": {"type": "string", "description": "The SHA-256 of the binding the page keeps in its window, base64url without padding"}}}}}}, "responses": {"200": {"description": "The link's page, for a Continue another site sent, or the page saying to open it from its chat", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "302": {"description": "To the provider's sign-in", "headers": {"Location": {"schema": {"type": "string", "format": "uri"}}, "Request-Id": {"$ref": "#/components/headers/RequestId"}}}, "400": {"description": "A page saying it needs JavaScript, for a Continue without the binding's hash", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "409": {"description": "A page saying the account can't be connected until the tenant's team changes something, such as the connector's app, or for a visitor, who connects no account", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "410": {"description": "A page saying the link is no longer open", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "503": {"description": "A page saying the sign-in couldn't start just now", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"text/html": {"schema": {"type": "string"}}}}}}}, "/connect/start/{tenant}/{id}": {"parameters": [{"name": "tenant", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "get": {"tags": ["Connections"], "summary": "A chat's connect start page", "operationId": "openConnectStart", "x-browser-page": true, "description": "Where a chat opens its connect window, from `POST /me/connect`'s `url`: it serves once,\nwithin 10 minutes. The page takes the binding only from a window at the chat's own origins,\nkept when the connect started: this host's for the embed, and your chat app's addresses for\nyour chat app. That window posts `{type: \"chat:connect-binding\", binding}`; the page keeps the\nbinding in the window's session storage for the callback, answers\n`{type: \"chat:connect-bound\"}` to the window that sent it, and sends the person to their\nprovider's sign-in. A fragment in its address is erased unread. With no binding in 60 seconds\nit says to open the sign-in from the chat, with a Close button. It speaks the language the\nchat's connect sent (`lang`), else the browser's, and wears your brand. Opened again, or never\nmade, it's a page saying the link is no longer open.\n", "security": [], "responses": {"200": {"description": "The page that takes the chat's binding and goes on to the provider", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "410": {"description": "A page saying the link is no longer open", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}}}}, "/connect/callback": {"get": {"tags": ["Connections"], "summary": "The connect callback", "operationId": "connectCallback", "x-browser-page": true, "description": "Where the provider sends the person back: a page that finishes the sign-in from their window,\nsending what the provider's answer carries, with the binding the window kept, to\n`POST /connect/finish`, and says whether their account connected, in the language the\nsign-in started in and your brand. Connected, it says so for a moment and closes its window,\nor, where the browser keeps the window open, says it can be closed; not connected, it says\nwhy, with a Close button. When the window that opened it can still reach it, the page tells\nit with `postMessage({type: \"chat:connect\", status: \"connected\" | \"not_connected\"})`, and\none not connected closes at once; most providers isolate their sign-in pages, which cuts\nthat reach, so follow the conversation's stream, where the turn goes on once the account is\nconnected. A connector with its own OAuth client needs this address registered with its\nprovider too.\n", "security": [], "parameters": [{"name": "code", "in": "query", "schema": {"type": "string"}}, {"name": "state", "in": "query", "schema": {"type": "string"}}, {"name": "iss", "in": "query", "schema": {"type": "string"}}, {"name": "error", "in": "query", "schema": {"type": "string"}}], "responses": {"200": {"description": "The page that finishes the sign-in and says whether the account connected", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}, "400": {"description": "A page saying the account wasn't connected, for a provider's error or an answer with no code", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/html": {"schema": {"type": "string"}}}}}}}, "/connect/finish": {"post": {"tags": ["Connections"], "summary": "Finish a connect", "operationId": "finishConnect", "description": "The callback page's own call, with no key: it finishes the person's sign-in with what the\nprovider's answer carried and the binding its window kept. A sign-in finishes only with the\nbinding of the window it started in (`connect_open_from_chat` otherwise), once, within 10\nminutes (`sign_in_expired`). Every refusal's `detail` is in the person's words and in the\nlanguage the sign-in started in, else the one `Accept-Language` asks, for the page to show.\n", "security": [], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectFinishRequest"}}}}, "responses": {"200": {"description": "The account connected", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectFinished"}}}}, "400": {"description": "A body to fix (`invalid_request`), a sign-in used or past its time (`sign_in_expired`), or a sign-in\nthe provider didn't finish (`connect_failed`)\n", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "403": {"description": "A sign-in finished without the binding of the window it started in (`connect_open_from_chat`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/homes/{agent}": {"parameters": [{"$ref": "#/components/parameters/PersonID"}, {"$ref": "#/components/parameters/HomeAgentID"}], "delete": {"tags": ["People"], "summary": "Clear a home", "operationId": "clearHome", "security": [{"apiKey": []}], "description": "Their next conversation with the agent starts with an empty home.", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/memory": {"parameters": [{"$ref": "#/components/parameters/PersonID"}], "get": {"tags": ["Memory"], "summary": "A user's agents that remember them", "operationId": "listMemoryAgents", "security": [{"apiKey": []}], "description": "Each agent that remembers anything of someone signed in to your app, or whose switch they moved, with how many memories it keeps of them and how many changes wait for their word, in one slice. A visitor keeps no memory.\n", "responses": {"200": {"$ref": "#/components/responses/MemoryAgentList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Memory"], "summary": "Forget what every agent remembers of a user", "operationId": "forgetAllMemory", "security": [{"apiKey": []}], "description": "Every agent's memories of someone signed in to your app, and the changes waiting for their word, at once. Each\nagent's switch stays as they set it, and their earlier conversations stay. A visitor keeps no memory.\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/memory/{agent}": {"parameters": [{"$ref": "#/components/parameters/PersonID"}, {"$ref": "#/components/parameters/MemoryAgentID"}], "get": {"tags": ["Memory"], "summary": "What an agent remembers of them", "operationId": "getAgentMemory", "security": [{"apiKey": []}], "description": "Whether the agent remembers people now, the person's switch for it, and how many memories and waiting changes it keeps of them.\n", "responses": {"200": {"$ref": "#/components/responses/MemoryAgent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "patch": {"tags": ["Memory"], "summary": "Turn an agent's memory of them off or on", "operationId": "switchMemory", "security": [{"apiKey": []}], "description": "Off, the agent neither reads nor keeps anything of them, its earlier conversations with them included, and what it kept stays until they delete it; its answers go on as before. On again, it reads what it kept from their next turn. An agent whose team turned its memory off has no switch (`memory_unused`).\n", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MemorySwitch"}}}}, "responses": {"200": {"$ref": "#/components/responses/MemoryAgent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/MemoryConflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Memory"], "summary": "Forget everything an agent remembers of them", "operationId": "forgetMemory", "security": [{"apiKey": []}], "description": "Every memory the agent keeps of them goes at once, and so do the changes waiting for their word.\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/memories": {"parameters": [{"$ref": "#/components/parameters/PersonID"}], "get": {"tags": ["Memory"], "summary": "What an agent remembers of them", "operationId": "listMemories", "security": [{"apiKey": []}], "description": "Each memory one agent keeps of them, newest first, in the agent's words: a memory is a short note of one thing, at most 2,000 characters.\n", "parameters": [{"$ref": "#/components/parameters/MemoryAgentQuery"}, {"$ref": "#/components/parameters/Limit"}, {"$ref": "#/components/parameters/Cursor"}], "responses": {"200": {"$ref": "#/components/responses/MemoryList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/users/{id}/memories/{memory}": {"parameters": [{"$ref": "#/components/parameters/PersonID"}, {"$ref": "#/components/parameters/MemoryID"}], "get": {"tags": ["Memory"], "summary": "A memory", "operationId": "getMemory", "security": [{"apiKey": []}], "responses": {"200": {"$ref": "#/components/responses/Memory"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Memory"], "summary": "Forget a memory", "operationId": "deleteMemory", "security": [{"apiKey": []}], "description": "The agent no longer remembers it, from its next turn.\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/embed/sessions": {"post": {"tags": ["Embed"], "summary": "A session for the embed", "operationId": "startEmbedSession", "description": "Asked for by the embed's frame, with no credential: a session for one person with the agent\nnamed, its embed on. With a `user_token` from your identity provider or signing key, the person is the user it names,\ntold the token's name, email, language and time zone, and the session ends with the token, an\nhour at most; a token that doesn't verify is refused, never taken as a visitor, and an agent for signed-in\npeople whose embed takes only some sign-ins refuses one through any other (`403 sign_in_not_accepted`), telling\nno one. Without one, a visitor is made at an agent anyone may use, told the page's `details`, and the session\nlasts 30 days from its last use. The session is answered here alone. Visitor sessions are limited from\neach address and in all, and sessions asked for with a token from each address; a visitor's\nconversations, messages and files are limited too, and past a limit the call is `429 rate_limited`.\n", "security": [], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmbedSessionRequest"}}}}, "responses": {"201": {"$ref": "#/components/responses/EmbedSessionCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/UserTokenInvalid"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "429": {"$ref": "#/components/responses/RateLimited"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/preview": {"post": {"tags": ["Embed"], "summary": "A preview of your chat app", "operationId": "tradeChatAppPreview", "description": "Your chat app's own, on its address and with no credential: a team member's preview code, made in the console's\nDeliver → Chat app, for an hour's session of the app as a person would see it, open or not. A code works once,\nwithin a minute of being made, and on its own app's address alone. The API's host has no such route.\n", "security": [], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChatAppPreviewRequest"}}}}, "responses": {"201": {"$ref": "#/components/responses/EmbedSessionCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/PreviewInvalid"}, "404": {"$ref": "#/components/responses/NotFound"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/downloads/{tenant}/{secret}": {"parameters": [{"name": "tenant", "in": "path", "required": true, "description": "The tenant whose link it is", "schema": {"type": "string"}}, {"name": "secret", "in": "path", "required": true, "description": "The secret that opens the link", "schema": {"type": "string"}}], "get": {"tags": ["Files"], "summary": "Download a file through its link", "operationId": "downloadThroughLink", "description": "The file a link from `POST /conversations/{id}/files/{file}/download-link`,\n`POST /users/{id}/files/{file}/download-link` or `POST /me/files/{file}/download-link` names, read again as\nits person, as an attachment with its name and length, sent as `application/octet-stream` so nothing on the\nway compresses it, never to show as a page: a browser saves it by itself, with its own progress. It takes no\nkey or session. One byte `Range` is answered with that part, and with `If-Range` only while the file is the one its\n`ETag` named, so a download that broke off resumes where it stopped. A link that no longer opens, five minutes\non or once its person can't read the file, is `download_link_expired`; a browser is told why in a sentence, as\ntext, and a client that asks for JSON gets each refusal as a problem.\n", "security": [], "parameters": [{"$ref": "#/components/parameters/Range"}, {"$ref": "#/components/parameters/IfRange"}], "responses": {"200": {"$ref": "#/components/responses/FileContent"}, "206": {"$ref": "#/components/responses/FilePart"}, "404": {"$ref": "#/components/responses/DownloadLinkClosed"}, "416": {"$ref": "#/components/responses/RangeNotSatisfiable"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/FilesUnavailable"}}}}, "/me": {"get": {"tags": ["Embed"], "summary": "The session's person", "operationId": "getMe", "description": "Who an embed session is for, and whether a page's details told them.", "security": [{"embedSession": []}], "responses": {"200": {"$ref": "#/components/responses/Me"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "patch": {"tags": ["Embed"], "summary": "Set the session's user's time zone", "operationId": "patchMe", "description": "A signed-in person's time zone alone, an IANA zone: left out changes nothing, and `\"\"` clears it. Their name,\nlanguage and email are their account's. A visitor has none to set (`sign_in_required`).\n", "security": [{"embedSession": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MePatch"}}}}, "responses": {"200": {"$ref": "#/components/responses/Me"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/about": {"get": {"tags": ["Embed"], "summary": "The session's user's About you", "operationId": "getMyAbout", "description": "What a signed-in person wrote about themselves for agents: what to call them, about them and how they like\nanswers, with the switch that lets agents use it. Until they write, the switch is on and the rest is empty. A\nvisitor keeps none (`sign_in_required`).\n", "security": [{"embedSession": []}], "responses": {"200": {"$ref": "#/components/responses/About"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "put": {"tags": ["Embed"], "summary": "Write the session's user's About you", "operationId": "putMyAbout", "description": "About you, kept whole: a field left out is empty, and the switch is on unless `on` is false. Each field is\ntrimmed. What to call them is one line; the others keep their lines. A field past its length or holding another\ncontrol character is refused, naming it.\n", "security": [{"embedSession": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AboutPut"}}}}, "responses": {"200": {"$ref": "#/components/responses/About"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/photo": {"get": {"tags": ["Embed"], "summary": "The session's user's photo", "operationId": "getMyPhoto", "description": "The picture the signed-in person gave of themselves, a JPEG, PNG or WebP image, kept in the tenant's storage and never by\nanything between them and the page. A visitor keeps none (`sign_in_required`); none given is `photo_not_found`.\n", "security": [{"embedSession": []}], "responses": {"200": {"$ref": "#/components/responses/Photo"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/FilesUnavailable"}}}, "put": {"tags": ["Embed"], "summary": "Give the session's user's photo", "operationId": "putMyPhoto", "description": "The body is the image: a JPEG, PNG or WebP by its bytes, at most 5 MB. It replaces the one before, which is\nreleased. Anything else is `photo_invalid`; past 5 MB, `photo_too_large`.\n", "security": [{"embedSession": []}], "requestBody": {"required": true, "content": {"image/jpeg": {"schema": {"type": "string", "format": "binary"}}, "image/png": {"schema": {"type": "string", "format": "binary"}}, "image/webp": {"schema": {"type": "string", "format": "binary"}}}}, "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "413": {"$ref": "#/components/responses/PhotoTooLarge"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/FilesUnavailable"}}}, "delete": {"tags": ["Embed"], "summary": "Take the session's user's photo away", "operationId": "deleteMyPhoto", "description": "The photo is released; with none, there's nothing to do.\n", "security": [{"embedSession": []}], "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/conversations": {"delete": {"tags": ["Embed"], "summary": "Delete every one of the session's person's conversations", "operationId": "deleteMyConversations", "description": "Every conversation of the person an embed session is, with every agent and every way in, at once, as `DELETE\n/conversations/{id}` deletes one: each turn under way ends, running tasks are cancelled, sandboxes are let go,\nand its waiting changes to memory and its pins go. What agents remember of them stays.\n", "security": [{"embedSession": []}], "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/search": {"get": {"tags": ["Embed"], "summary": "Search the session's person's conversations", "operationId": "searchMine", "description": "The person's own conversations, with every agent and every way in, that the words they and the agent said, or\na conversation's title, match: every word typed, best first, each with a snippet of what was said around the\nwords and each match's range in its characters (Unicode code points), start inclusive, end exclusive. A turn's\nwords are searchable once it ends; a conversation made before search came is found from its next turn. Never a\nstep, a tool's output or the agent's thinking.\n", "security": [{"embedSession": []}], "parameters": [{"name": "q", "in": "query", "required": true, "description": "The words to search for", "schema": {"type": "string", "minLength": 1}}, {"name": "limit", "in": "query", "description": "How many to answer, 1 to 50", "schema": {"type": "integer", "minimum": 1, "maximum": 50, "default": 20}}], "responses": {"200": {"$ref": "#/components/responses/SearchHits"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/me/pins/{kind}/{id}": {"parameters": [{"name": "kind", "in": "path", "required": true, "schema": {"type": "string", "enum": ["agent", "conversation"]}}, {"name": "id", "in": "path", "required": true, "description": "The agent's or the conversation's ID", "schema": {"type": "string"}}], "put": {"tags": ["Embed"], "summary": "Pin an agent or a conversation", "operationId": "pinMine", "description": "Pins an agent your way in offers, or one of the session's user's own conversations, first among their pins;\npinning one already pinned changes nothing. A user keeps at most 50 (`too_many_pins`); a conversation that's\ngone and an agent deleted let go of their pins. Anything else is missing (`agent_not_found`, `conversation_not_found`), naming\nnothing of it. A visitor keeps none (`sign_in_required`).\n", "security": [{"embedSession": []}], "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Embed"], "summary": "Unpin an agent or a conversation", "operationId": "unpinMine", "description": "Takes one of the session's user's pins away; one they haven't pinned is `pin_not_found`.", "security": [{"embedSession": []}], "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/files": {"get": {"tags": ["Embed"], "summary": "The session's user's kept files", "operationId": "listMyKeptFiles", "description": "As `GET /users/{id}/files`, for the user an embed session is; a visitor keeps none (`sign_in_required`).", "security": [{"embedSession": []}], "parameters": [{"$ref": "#/components/parameters/Limit"}, {"$ref": "#/components/parameters/Cursor"}], "responses": {"200": {"$ref": "#/components/responses/KeptFileList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/files/{file}": {"parameters": [{"$ref": "#/components/parameters/KeptFileID"}], "get": {"tags": ["Embed"], "summary": "One of the session's user's kept files", "operationId": "getMyKeptFile", "security": [{"embedSession": []}], "responses": {"200": {"$ref": "#/components/responses/KeptFile"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Embed"], "summary": "Delete one of the session's user's kept files", "operationId": "deleteMyKeptFile", "description": "Gone from their kept files at once; the conversations it came from keep their own.", "security": [{"embedSession": []}], "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/files/{file}/content": {"parameters": [{"$ref": "#/components/parameters/KeptFileID"}], "get": {"tags": ["Embed"], "summary": "Download one of the session's user's kept files", "operationId": "downloadMyKeptFile", "security": [{"embedSession": []}], "parameters": [{"$ref": "#/components/parameters/Range"}, {"$ref": "#/components/parameters/IfRange"}], "responses": {"200": {"$ref": "#/components/responses/FileContent"}, "206": {"$ref": "#/components/responses/FilePart"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "416": {"$ref": "#/components/responses/RangeNotSatisfiable"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/FilesUnavailable"}}}}, "/me/files/{file}/download-link": {"parameters": [{"$ref": "#/components/parameters/KeptFileID"}], "post": {"tags": ["Embed"], "summary": "Get a link to download one of the session's user's kept files", "operationId": "createMyKeptFileDownloadLink", "description": "A link the browser saves the kept file from by itself, `GET /downloads/{tenant}/{secret}`, as a\nconversation's file's link is: five minutes, with no session, for this file read as this user.\n", "security": [{"embedSession": []}], "responses": {"201": {"$ref": "#/components/responses/DownloadLinkCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/files/{file}/preview": {"parameters": [{"$ref": "#/components/parameters/KeptFileID"}], "get": {"tags": ["Embed"], "summary": "A smaller copy of one of the session's user's kept pictures", "operationId": "previewMyKeptFile", "security": [{"embedSession": []}], "responses": {"200": {"$ref": "#/components/responses/FilePreview"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/memory": {"get": {"tags": ["Memory"], "summary": "The session's user's agents that remember them", "operationId": "listMyMemoryAgents", "security": [{"embedSession": []}], "description": "As `GET /users/{id}/memory`, for the user an embed session is; a visitor keeps none (`sign_in_required`).\n", "responses": {"200": {"$ref": "#/components/responses/MemoryAgentList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Memory"], "summary": "Forget what every agent remembers of the session's user", "operationId": "forgetAllMyMemory", "security": [{"embedSession": []}], "description": "As `DELETE /users/{id}/memory`, for the user an embed session is: each agent's switch stays; a visitor keeps\nnone (`sign_in_required`).\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/memory/{agent}": {"parameters": [{"$ref": "#/components/parameters/MemoryAgentID"}], "get": {"tags": ["Memory"], "summary": "What an agent remembers of them", "operationId": "getMyAgentMemory", "security": [{"embedSession": []}], "description": "As `GET /users/{id}/memory/{agent}`, for the user an embed session is; a visitor keeps none (`sign_in_required`).\n", "responses": {"200": {"$ref": "#/components/responses/MemoryAgent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "patch": {"tags": ["Memory"], "summary": "Turn an agent's memory of them off or on", "operationId": "switchMyMemory", "security": [{"embedSession": []}], "description": "As `PATCH /users/{id}/memory/{agent}`, for the user an embed session is; a visitor keeps none (`sign_in_required`).\n", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MemorySwitch"}}}}, "responses": {"200": {"$ref": "#/components/responses/MemoryAgent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/MemoryConflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Memory"], "summary": "Forget everything an agent remembers of them", "operationId": "forgetMyMemory", "security": [{"embedSession": []}], "description": "As `DELETE /users/{id}/memory/{agent}`, for the user an embed session is; a visitor keeps none (`sign_in_required`).\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/memories": {"get": {"tags": ["Memory"], "summary": "What an agent remembers of them", "operationId": "listMyMemories", "security": [{"embedSession": []}], "description": "As `GET /users/{id}/memories`, for the user an embed session is; a visitor keeps none (`sign_in_required`).\n", "parameters": [{"$ref": "#/components/parameters/MemoryAgentQuery"}, {"$ref": "#/components/parameters/Limit"}, {"$ref": "#/components/parameters/Cursor"}], "responses": {"200": {"$ref": "#/components/responses/MemoryList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/memories/{memory}": {"parameters": [{"$ref": "#/components/parameters/MemoryID"}], "get": {"tags": ["Memory"], "summary": "A memory", "operationId": "getMyMemory", "security": [{"embedSession": []}], "responses": {"200": {"$ref": "#/components/responses/Memory"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Memory"], "summary": "Forget a memory", "operationId": "deleteMyMemory", "security": [{"embedSession": []}], "description": "As `DELETE /users/{id}/memories/{memory}`, for the user an embed session is; a visitor keeps none (`sign_in_required`).\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/connections": {"get": {"tags": ["Embed"], "summary": "The session's person's connections", "operationId": "listMyConnections", "description": "As `GET /users/{id}/connections`, for the person an embed session is, a user or a visitor.", "security": [{"embedSession": []}], "responses": {"200": {"$ref": "#/components/responses/ConnectionList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/connections/{connector}": {"parameters": [{"$ref": "#/components/parameters/ConnectorID"}], "patch": {"tags": ["Embed"], "summary": "Change one of the session's person's connection", "operationId": "changeMyConnection", "security": [{"embedSession": []}], "description": "Whether the account's actions that change something ask the person first, and actions taken\nback from those it takes without asking, named by the words `always_allowed` shows. Words that\nname no such action change nothing.\n", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectionChange"}}}}, "responses": {"200": {"description": "The connection as it is now", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Connection"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}, "delete": {"tags": ["Embed"], "summary": "Remove one of the session's person's connections", "operationId": "removeMyConnection", "description": "The account's tokens are withdrawn where its server allows, and a user's next call on it asks\nthem to connect it again (`chat:connect`); a visitor connects no account again.\n", "security": [{"embedSession": []}], "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/me/connect": {"post": {"tags": ["Embed"], "summary": "Connect an account from the chat", "operationId": "startMyConnect", "description": "The embed's chat asks for a connect bound to the window it opens for the person's sign-in:\nit makes a binding, 32 random bytes, sends the `chat:connect` interrupt and the binding's\nSHA-256, and opens the window on `url`, the start page, which serves once within 10 minutes.\nIt posts the binding to that window, to this host's origin alone; the sign-in finishes only\nin a window holding it, so a link copied out of the chat connects no one else's account. The\ninterrupt must be the session's person's and open. Only a user connects an account: a\nvisitor's is `cant_connect`.\n\nFrom the person's menu, with no interrupt, it names the agent the chat shows and one of the\nconnectors `GET /me/connectors` lists instead: `connector_not_offered` for any other, and for\na visitor, who has none.\n\n`lang` is the chat's language: the start page and the callback's page speak it, and so does\nthe `detail` of a connect's refusal (`cant_connect`, `service_unavailable`); every other\nrefusal's `detail` stays in English. With none, the pages speak the browser's.\n", "security": [{"embedSession": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BoundConnectRequest"}}}}, "responses": {"200": {"description": "Where the chat opens its window", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BoundConnect"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"description": "The interrupt was answered (`interrupt_answered`) or is no longer open (`interrupt_expired`),\nor the connector can't sign people in until your team changes something, or the person is a\nvisitor (`cant_connect`)\n", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/me/connectors": {"get": {"tags": ["Embed"], "summary": "List the accounts the person may connect", "operationId": "listMyConnectors", "description": "The accounts the session's person may connect at the agent the chat shows, from their menu:\nits connectors on each person's own login, with how the person's account stands. Only a user\nconnects an account, so a visitor's list is empty.\n", "security": [{"embedSession": []}], "parameters": [{"name": "agent", "in": "query", "required": true, "description": "The agent the chat shows", "schema": {"$ref": "#/components/schemas/ID"}}], "responses": {"200": {"description": "The accounts, in the agent's order", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectableList"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/agents": {"get": {"tags": ["Agents"], "summary": "The agents you may reach", "operationId": "listAgents", "description": "With an API key, the agents shared through the API, oldest first; with an embed session, those whose embed is\non, oldest first, or a preview's own agent; on a chat app's address, those in it the person sees, in the order\nits team set, the one new chats start with marked `default`. With a person named, each says whether they may\nuse it.\n", "parameters": [{"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/Limit"}, {"$ref": "#/components/parameters/Cursor"}], "responses": {"200": {"$ref": "#/components/responses/AgentList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/agents/{id}": {"get": {"tags": ["Agents"], "summary": "One agent", "operationId": "getAgent", "parameters": [{"$ref": "#/components/parameters/AgentID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "responses": {"200": {"$ref": "#/components/responses/Agent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/agents/{id}/conversations": {"parameters": [{"$ref": "#/components/parameters/AgentID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "get": {"tags": ["Conversations"], "summary": "The person's conversations with an agent", "operationId": "listAgentConversations", "description": "Newest message first. The agent must be shared through the API and open to the person.", "parameters": [{"$ref": "#/components/parameters/Limit"}, {"$ref": "#/components/parameters/Cursor"}], "responses": {"200": {"$ref": "#/components/responses/ConversationList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "post": {"tags": ["Conversations"], "summary": "Start a conversation with an agent", "operationId": "startConversation", "description": "The person's new conversation, with nothing said yet; send its first message next. Sent\nwith an `Idempotency-Key`, a start sent again is the conversation the first made. With an\nembed session, `form` names the form it's shown in, else the session's is.\n", "parameters": [{"$ref": "#/components/parameters/IdempotencyKeyOptional"}], "requestBody": {"required": false, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConversationStart"}}}}, "responses": {"201": {"$ref": "#/components/responses/ConversationCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "422": {"$ref": "#/components/responses/KeyReused"}, "429": {"$ref": "#/components/responses/RateLimited"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations": {"get": {"tags": ["Conversations"], "summary": "The person's conversations", "operationId": "listConversations", "description": "Newest message first, with every agent, shared now or not; `agent` keeps one agent's.", "parameters": [{"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"name": "agent", "in": "query", "required": false, "description": "An agent's ID, to list only the conversations with it", "schema": {"$ref": "#/components/schemas/ID"}}, {"$ref": "#/components/parameters/Limit"}, {"$ref": "#/components/parameters/Cursor"}], "responses": {"200": {"$ref": "#/components/responses/ConversationList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "get": {"tags": ["Conversations"], "summary": "A conversation", "operationId": "getConversation", "responses": {"200": {"$ref": "#/components/responses/Conversation"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "patch": {"tags": ["Conversations"], "summary": "Rename a conversation", "operationId": "renameConversation", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Rename"}}}}, "responses": {"200": {"$ref": "#/components/responses/Conversation"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Conversations"], "summary": "Delete a conversation", "operationId": "deleteConversation", "description": "Its turn under way ends, it's gone from the person's conversations at once, and its requests' keys go with it.", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/messages": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "get": {"tags": ["Conversations"], "summary": "A conversation's history", "operationId": "listMessages", "description": "The conversation as the person sees it, as AG-UI 1.0's messages: their words, the agent's\nwith their citations, what the agent did as each stretch's `steps` activity, its thoughts\namong them, the files it gave as `file` activities, one for each turn and file, each change\nto what it remembers of the person as a `memory` activity, each surface it shows that's\nstill open as an `a2ui-surface` activity, whole as it stands now, where the turn that first\nshowed it put it (a closed one isn't in the history), each app a connector's tool showed as\nan `mcp-apps` activity, and its `plan`, as the stream\nshows them. The newest page comes first, its messages oldest first; `next_cursor` reads\nthe page before it, and stays\nwhere it was as the conversation grows. A page can hold fewer messages than `limit` with\nmore before it: an app no longer shown, or past what one page sends of apps, is left out of\nthe page it falls in. Steps and the plan show from the level `progress`\nup, the parts a thought names from `thinking`, and each call, what it was sent and what came\nback, with each summary the conversation kept and the agent's pins and notes, at `everything`\nalone; the answers level shows none of them. The\nlevel is the agent's for the way the call came (`view` on the agent), or the lower of it\nand `view=`. Files, changes to memory, surfaces and apps always show. A thought's words never do.\n", "parameters": [{"$ref": "#/components/parameters/HistoryLimit"}, {"$ref": "#/components/parameters/Cursor"}, {"$ref": "#/components/parameters/View"}], "responses": {"200": {"$ref": "#/components/responses/MessageList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "post": {"tags": ["Conversations"], "summary": "Send a message", "operationId": "sendMessage", "description": "With no turn under way, the message starts one. With one under way, `auto`, the default,\nhas the agent read it at its next step, or, while the agent waits on a question, ends that\nturn and starts one with this message; `queue` waits for the turn after; `interrupt` stops\nthe turn and starts one with this message. At most 20 messages wait.\n", "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SendMessage"}}}}, "responses": {"202": {"$ref": "#/components/responses/MessageAccepted"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "413": {"$ref": "#/components/responses/ContextTooLarge"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "422": {"$ref": "#/components/responses/KeyReused"}, "429": {"$ref": "#/components/responses/RateLimited"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/conversations/{id}/stop": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "post": {"tags": ["Conversations"], "summary": "Stop the turn under way", "operationId": "stopTurn", "description": "The turn ends at once, and none of the person's messages starts after it: those that waited, for\nthe turn after or to steer this one, are held in the conversation's `waiting`, each to send or\nremove. A task's late result that waited starts its own turn, as it would have a moment\nlater. Sent with an `Idempotency-Key`, a stop sent again answers the turn the first stopped.\n", "parameters": [{"$ref": "#/components/parameters/IdempotencyKeyOptional"}], "responses": {"200": {"$ref": "#/components/responses/Stopped"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "422": {"$ref": "#/components/responses/KeyReused"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/waiting/{message}/steer": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/WaitingMessageID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "post": {"tags": ["Conversations"], "summary": "Steer the turn under way with a waiting message", "operationId": "steerWaitingMessage", "description": "A message sent with `mode` `queue` waits for the turn after; this makes it steer the turn the\nperson saw under way, named by `turn`, which reads it at its next step, exactly once. A turn\npaused on the person reads it once it goes on, and still waits. `turn` is the turn's ID, or a\nstretch's `runId` as the stream names it (`<turn>.2`). A message that already started its turn\nor was read is refused (`message_taken`); one whose turn ended first is too (`turn_ended`), and\nwaits first instead, so it starts the next turn and steers no other, unless a stop held it: then\nit stays held, to start when it's sent (`message_held`).\n", "parameters": [{"$ref": "#/components/parameters/IdempotencyKeyOptional"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["turn"], "properties": {"turn": {"$ref": "#/components/schemas/ID"}}}}}}, "responses": {"202": {"$ref": "#/components/responses/ActedOn"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "422": {"$ref": "#/components/responses/KeyReused"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/waiting/{message}/send": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/WaitingMessageID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "post": {"tags": ["Conversations"], "summary": "Send a held message", "operationId": "sendHeldMessage", "description": "A stop holds the messages that waited (`held`); this sends one: with no turn under way it starts\none, named in `Location`, and with one under way it steers it, read at its next step. Like a\nsteer, it leaves a turn paused on the person as it is: the turn reads it once it goes on. A\nmessage no longer waiting is refused (`message_taken`), and one a stop didn't hold is too\n(`message_not_held`): it waits for the turn under way, to steer or remove.\n", "parameters": [{"$ref": "#/components/parameters/IdempotencyKeyOptional"}], "responses": {"202": {"$ref": "#/components/responses/ActedOn"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "422": {"$ref": "#/components/responses/KeyReused"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/conversations/{id}/waiting/{message}": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/WaitingMessageID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "delete": {"tags": ["Conversations"], "summary": "Remove a waiting message", "operationId": "removeWaitingMessage", "description": "Takes a message out of what waits, queued, steering or held, its files free to go with another.\nOne that already started its turn or was read is refused (`message_taken`).\n", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/retry": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}, {"$ref": "#/components/parameters/IdempotencyKey"}], "post": {"tags": ["Conversations"], "summary": "Try the last turn again", "operationId": "retryTurn", "description": "The conversation's last message is answered again as a new turn, once the last turn failed or was stopped and no turn is under way.", "responses": {"202": {"$ref": "#/components/responses/MessageAccepted"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "422": {"$ref": "#/components/responses/KeyReused"}, "429": {"$ref": "#/components/responses/RateLimited"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/conversations/{id}/resume": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "post": {"tags": ["Conversations"], "summary": "Answer what the turn waits on", "operationId": "resumeTurn", "description": "AG-UI 1.0's resume: an entry for each interrupt answered, `resolved` with a `payload` that\nkeeps to its `responseSchema`, or `cancelled`. A confirmation resolved with `approved: true`\ngoes ahead, and with `false` (and a `note` the agent reads, which only a `false` carries) or\ncancelled doesn't; a form\nresolved is sent with its values, and cancelled is declined; a page resolved with\n`done: true` is done; the person's own pause (`chat:paused`) resolved goes on, and cancelled\nstops the turn. Every entry is checked before any is answered, so one at fault answers none;\nthe turn goes on once nothing it waits on is left open. Sent with an `Idempotency-Key`, a\nresume sent again answers what the first did.\n", "parameters": [{"$ref": "#/components/parameters/IdempotencyKeyOptional"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ResumeRequest"}}}}, "responses": {"202": {"$ref": "#/components/responses/ActedOn"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "413": {"$ref": "#/components/responses/ContextTooLarge"}, "422": {"$ref": "#/components/responses/KeyReused"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/apps/{activity}/context": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"name": "activity", "in": "path", "required": true, "description": "The app's `mcp-apps` activity", "schema": {"type": "string"}}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "post": {"tags": ["Conversations"], "summary": "Tell the model what an app shows", "operationId": "keepAppContext", "description": "What an app shown in the person's chat tells the model it shows them now (MCP Apps'\n`ui/update-model-context`), kept until the person's next message, which carries it to the\nmodel: its text parts, then its `structuredContent` as JSON, set apart as the app's words and\nnever instructions. Each overwrites the app's last; one with neither clears it. The next\nmessage carries what apps told since the last one did, newest first, three frames' at most (a\nframe is one app shown under one call), each once; what the rest told since the last message is\nlet go unread. At most 4,000 characters as the model reads them, its angle brackets escaped\n(`app_context_too_large`); a part that isn't text is `invalid_request`; an activity the\nconversation doesn't show, or whose connector no longer shows its apps, is `app_not_found`. It\nshares the bound on an app's reads (`too_many_app_requests`).\n", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AppContextRequest"}}}}, "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "413": {"$ref": "#/components/responses/ContextTooLarge"}, "429": {"$ref": "#/components/responses/RateLimited"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/conversations/{id}/pause": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "post": {"tags": ["Conversations"], "summary": "Pause the turn under way", "operationId": "pauseTurn", "description": "The turn pauses at its next step, after any action already under way, and its run ends with\nthe interrupt `chat:paused`; continue, or resume that interrupt, sends it on. A turn already\npaused is answered as it is.\n", "parameters": [{"$ref": "#/components/parameters/IdempotencyKeyOptional"}], "responses": {"202": {"$ref": "#/components/responses/ActedOn"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "422": {"$ref": "#/components/responses/KeyReused"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/continue": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "post": {"tags": ["Conversations"], "summary": "Continue the turn the person paused", "operationId": "continueTurn", "description": "The paused turn goes on from where it stopped. A turn waiting on the person's answers is\n`interrupts_pending`: answer them with resume.\n", "parameters": [{"$ref": "#/components/parameters/IdempotencyKeyOptional"}], "responses": {"202": {"$ref": "#/components/responses/ActedOn"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "422": {"$ref": "#/components/responses/KeyReused"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/stream": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "get": {"tags": ["Conversations"], "summary": "Follow a conversation live", "operationId": "streamConversation", "description": "The conversation as it happens, as AG-UI 1.0 events over server-sent events: the person's\nwords and the agent's as it writes them, what it's doing, what it's thinking about when its\nagent shows it, the files it gives (one `file` activity for each turn and file), the\nsurfaces it shows (one `a2ui-surface` activity for each, at every level), the apps its\nconnectors' tools show (one `mcp-apps` activity for each call, at every level), citations,\nand anything it waits on the person for. At the level `answers`, where no steps come, what\nit's doing is one line, `CUSTOM` `chat:working`: show the newest in place of the one before,\nand clear it when the agent's text comes or the run ends. At the level `everything`, each\ncall comes as AG-UI's `TOOL_CALL_START`, `TOOL_CALL_ARGS` and `TOOL_CALL_END` as the agent\nmakes it, under the step whose `call` names it, and `TOOL_CALL_RESULT` once it's done, so an\nAG-UI client draws them as it draws any tool call; a command's output as it runs, an `output`\nactivity that `ACTIVITY_DELTA` grows; each summary the conversation kept; and the agent's pins\nand notes as they change. A turn is one AG-UI run until it waits for the\nperson, and the next once they answer: its `runId` is the turn's ID, then `<turn>.2` and\non. Each ends in `RUN_FINISHED`, its outcome `success`, `cancelled` for a Stop or a question\nleft unanswered, or `interrupt` with what it waits for, or in `RUN_ERROR` with code `failed`\nand words for the person. A run that ends its turn also says how in `metadata.chat.outcome`,\nthe turn's `outcome` as `GET /turns/{id}` gives it: `answered`, `quiet`, `stopped`, `limit`\nor `expired` on `RUN_FINISHED`, `failed` on `RUN_ERROR`; one that waits for the person says\nnone. It may be absent from an end the stream couldn't follow, such as a run that ended\nwhile the stream was away and is told again without its end: read AG-UI's own outcome\nthen. A `RUN_FINISHED` `success` with `metadata.chat.waiting` true and no outcome ended no\nturn: it waits on nothing the person can answer here, and its turn's end comes later. A\n`quiet` turn, whose `metadata.chat.quiet` is true too, wrote nothing: a background job's\nend the agent had nothing new to tell of. A turn that ends while it waits for the\nperson, its question unanswered (`expired`), stopped or failed, ends in a run of its own,\nthe turn's next `runId`, which starts and ends at once: what it waited for no longer waits.\nNothing comes between runs. What a task still running asks the person is a run of its\nown, its `runId` the question's, that ends at once in `interrupt`: it comes after a turn's run\nunder way, and again on each reconnect while it's open, so show one card per interrupt `id`.\n\nEach commit's last event carries the commit's number as its `id`, and a run's end carries\nthe newest commit and the run, `12:<runId>`; send the last `id` back as `Last-Event-ID` to\ngo on from there. A reconnect that missed something gets the conversation whole in one\n`MESSAGES_SNAPSHOT`, inside a run, whose `timestamp` is when that copy was made; inside a run\nunder way, the run's `RUN_STARTED` `timestamp` is when that part of the turn began, so the\ndifference of the two, both the server's times, is how long it has worked, whatever the\nclient's clock says. One to a conversation at rest whose last `id` wasn't the\nnewest run's end gets that run's start and end again, so a client cut off before it learns\nhow the turn ended; one that missed nothing gets nothing until the next turn. The stream\nopens with `retry: 1000` and ends after 9 minutes, and the client reconnects; keep-alives\nare comments every 15 seconds.\n", "parameters": [{"$ref": "#/components/parameters/LastEventID"}, {"$ref": "#/components/parameters/After"}, {"$ref": "#/components/parameters/View"}], "responses": {"200": {"$ref": "#/components/responses/EventStream"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/agents/{id}/agui": {"parameters": [{"$ref": "#/components/parameters/AgentID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "post": {"tags": ["Conversations"], "summary": "Run the agent as AG-UI's HttpAgent does", "operationId": "runAgent", "description": "AG-UI 1.0's HTTP transport, for an AG-UI client such as `@ag-ui/client`'s `HttpAgent`: a\n`RunAgentInput` in, and out, as server-sent events, the one run it starts or resumes, from\nits `RUN_STARTED` to its end, after which the stream closes. The events are the stream's\n(`GET /conversations/{id}/stream`), the run named by the client's `threadId` and `runId`.\n\n`threadId` names the conversation: one of the person's with this agent by its ID, or by a\nthread ID your app chose, which a new conversation keeps. The person's new message is the\nlast of `messages` when it's theirs, its `id` its own and its text the words (a part that\nisn't text is `attachments_not_supported`: attach files through the conversation's files);\na message the conversation already has, by its `id` or by the `client_message_id` the\nserver's copy carries in `metadata.chat`, is never sent twice, so the history a client sends\non every run is safe to send. That history is also the client's copy: a run whose copy isn't\nthe conversation's (a reply it lacks, an answer cut short, a surface whose `a2ui_operations`\nleave it otherwise than it stands, or one the agent has closed) starts with the conversation\nwhole in a `MESSAGES_SNAPSHOT`, and a surface whose `a2ui-surface` activity the copy lacks comes\nwhole when it changes, never as a delta. `resume` answers what the turn waits on, as\n`POST /conversations/{id}/resume` does, and as 1.0 asks, a run while it waits needs an\nentry for each of its interrupts (`interrupts_pending`); a task's question is a run of its\nown and holds nothing up. A turn already under way is `conversation_busy`, unless the run's\nanswers send it on: follow it on the stream, or steer it with `POST /conversations/{id}/messages`.\nAn entry giving the answer its interrupt has already is no change. `RUN_STARTED` names the\nconversation in `metadata.chat.conversation_id`.\n\n`runId` is the run's key: the same run sent again follows what it started, as it stands\nnow, and is marked `Idempotent-Replayed`; a run whose last message went already does the same. A run that\nstarts nothing, its answers all for tasks or its stop ending the turn, ends at once. The\nstream ends in `RUN_FINISHED`, or `RUN_ERROR` with code `failed` and words for the person,\nor `stream_ended` when it closes before the run does (after 9 minutes at most): the turn\ngoes on, on the conversation's stream.\n\nOf `forwardedProps`, the run reads `a2uiClientCapabilities`, what the person's app draws, kept with the run's\nnew message as on `POST /conversations/{id}/messages`, and `a2uiAction`, a button the person pressed in a\nsurface the agent showed (`userAction`, CopilotKit's name for it, when `a2uiAction` is absent). A pressed button\ngoes with the person's new message, its words the message's when the message has none; with no new message of\nthe person's, or beside one the conversation holds already, it is the message, named by the `runId`, its words the\nbutton's `userMessage`: a button is never dropped. It starts a turn as any new message does, so one pressed while\na turn is under way is `conversation_busy`; a surface the conversation never showed, or closed since, or a\nbutton it doesn't show sending that event, is `invalid_action`. `forwardedProps.app` (`{\"activity\": …}`) marks the\nperson's new message as sent for them by an app in their chat (MCP Apps' `ui/message`): the activity must be one\nof the conversation's `mcp-apps` activities whose connector still shows its apps (`invalid_app`), and the message\ncomes back with `metadata.chat.app`, `{activity, from}`. `tools`, `context`, `state`, what else `forwardedProps`\nholds and `parentRunId` are taken and left: the agent's tools are the ones its builder chose.\n\n**An app's requests.** A connector's app shown in the person's chat (an `mcp-apps` activity) asks its host for its\nserver through this endpoint, as CopilotKit's renderer does: `forwardedProps.__proxiedMCPRequest` is\n`{serverId or serverHash, method, params, activity}`, `serverId` and `serverHash` the activity's (both given, they\nmust agree), `activity` the activity a call belongs to (when absent, the newest kept result of that connector in\nthe conversation names it, whichever of its apps that was: a connector with two apps sees the call under the\nother's activity if that one showed last). With it the\nrequest is that and nothing else: `messages` are left, no turn starts, and the `threadId` must be a conversation\nof this person with this agent, else `conversation_not_found`; no conversation is made. Only four methods are\ntaken; anything else is `method_not_allowed_for_apps`, before anything is read. The connector must have shown an\napp in this conversation and still show its apps, else `app_not_found`. The run starts with `RUN_STARTED` and ends\nwith `RUN_FINISHED`, whose `result` is MCP's:\n- `ping`, and `notifications/message` (a log line of at most 8,000 characters as JSON, taken and kept nowhere):\n  `{}`.\n- `resources/read` `{uri}`: the document this conversation kept for that connector and address, `{contents:\n  [{uri, mimeType: \"text/html;profile=mcp-app\", text, _meta: {ui: {csp: {connectDomains, resourceDomains,\n  frameDomains, baseUriDomains}, prefersBorder}}}]}`, `frameDomains` always empty since an app frames nothing;\n  the connector's server is never asked. An address the conversation kept no document for is\n  `app_not_found`.\n- `tools/call` `{name, arguments}`: the call made for the person through the agent's rules, as the agent's own\n  call would go, under the `runId` as its key. Its `result` is the tool's `CallToolResult` as it came; a call that\n  ended without one (declined, never confirmed, not run, may have run, too large, a tool that can't be used from\n  here, no account) is `{isError: true, content: [{type: \"text\", text}]}`, its words for the app; a call that asks\n  first or needs the person's sign-in ends with `outcome: {type: \"interrupt\", interrupts}`, each as a turn's pause\n  gives it with `metadata.chat.app` naming the activity, `{activity}`. Send the same request with `resume` to answer it\n  (`resume` alone does too): that call runs or is declined and this run ends as above; an answer given already,\n  by the person or their sign-in, changes nothing and still ends with the call's end; one the conversation moved\n  on from is `interrupt_expired`; beside the request of another call, a read, a ping or a log line it is\n  `invalid_request` at `/resume`, and carrying a new message of the person's it is `invalid_request` at\n  `/messages`. A call may be `conversation_busy` (a turn, or another app's call, under way: an app's call waiting\n  on its person is moved on from), `too_many_app_calls` (30 a minute, every request that starts, answers or\n  follows an app's call counted, the same `runId` sent again included: a `tools/call` before the call it names\n  is read, once a thread named by your own key is found; a resume alone once the interrupt it answers is found\n  to be an app's call's), `app_tool_not_offered`, `app_tool_unavailable` (a tool the agent has turned off),\n  `app_other_connector`, `apps_not_shown`, `app_arguments_invalid` or `idempotency_key_reused`.\n\nAn app's call waiting on its person never holds the conversation up: a new message of the person's on this\nendpoint needs no entry for its interrupt and moves on from it (its call cancelled, an answer after\n`interrupt_expired`), then starts its turn; a call still running is `conversation_busy`, as a turn is.\n\nReads, pings, log lines and an app's contexts (`POST /conversations/{id}/apps/{activity}/context`) share a bound\nof 120 a minute for a person in a conversation (`too_many_app_requests`). While a call runs, its stream sends a\nkeep-alive comment every 15 seconds and reads the call as the call's own events say it changed; it ends after the\ntool's own time limit and a minute for the call to be taken up, never past 9 minutes (a response can't outlast\nthe server's 10-minute write deadline), with `RUN_ERROR` `{\"code\": \"stream_ended\"}` after its `RUN_STARTED`: the\ncall goes on, and the end's `message` says so in words fit to show a person. A client given that end sends the\nsame request with the same `runId` again: it follows the same call, to its end, or answers that end at once if\nthe call ended meanwhile. A call can take a while: it may wait up to an hour for one of the tenant's turns to\nfree, then run for its tool's own limit (ten minutes at most). So a host follows a call until it ends, for 71\nminutes at most from its first send; it pauses before sending again when a response ended at once (a second,\ndoubling to thirty), since each follow counts against the 30 calls a minute; and it stops following when the\napp's frame leaves. A lost connection loses no call: for a call, or an answer to one, a send that failed, a\nstream that ended with no end event at all, or a body that broke is followed as `stream_ended` is, the same\nrequest again, paced the same way, within the same 71 minutes, since the run's key keeps its one call. A\nrefusal, and any other end, is the answer at once; a read, a ping or a log line that loses its connection\nfails at once, as nothing runs on behind it.\n\n**Your own app as the app's host.** A CopilotKit app, or any AG-UI client, hosts a connector's app as MCP Apps\nasks: it gets the app on the stream, an `mcp-apps` activity whose content holds the `resourceUri`, the\n`serverId` and `serverHash`, the `toolInput`, the tool's `result` and a `frame` with the policy the document\ndeclared; it reads the document with `resources/read`, runs it, and sends what the app asks (its calls, its\nreads, its log lines, its pings) here, as above, a run each, following a call that outlasts its response as\nabove and no longer than its frame. A message the app sends for the person goes as their\nnew message with `forwardedProps.app`, and what it tells the model to `POST\n/conversations/{id}/apps/{activity}/context`. Your app sandboxes the app itself: run it in a frame of another\norigin than your page's, with `sandbox=\"allow-scripts allow-same-origin\"` and a content security policy built\nfrom the declared domains and nothing looser. CopilotKit's renderer has no card for a call that asks first: such\na call ends with an interrupt its renderer reads as an empty result, so answer it from your own card.\n", "parameters": [{"$ref": "#/components/parameters/View"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunAgentInput"}}}}, "responses": {"200": {"$ref": "#/components/responses/RunStream"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "413": {"$ref": "#/components/responses/ContextTooLarge"}, "422": {"$ref": "#/components/responses/KeyReused"}, "429": {"$ref": "#/components/responses/RateLimited"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/conversations/{id}/files": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "get": {"tags": ["Files"], "summary": "A conversation's files", "operationId": "listFiles", "description": "The files the person attached and the files the agent gave them, newest first.", "parameters": [{"$ref": "#/components/parameters/Limit"}, {"$ref": "#/components/parameters/Cursor"}], "responses": {"200": {"$ref": "#/components/responses/FileList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "post": {"tags": ["Files"], "summary": "Attach a file", "operationId": "attachFile", "description": "The body is the file itself, at most 500 MB, sent with its `Content-Length`, and its name goes\nin `X-File-Name`, percent-encoded UTF-8. A conversation keeps any file but a program: pictures,\ndocuments such as PDF, Word, PowerPoint and Excel, text files, archives, recordings and any\nother kind, each as its name and its bytes say, and at most 100 files. A message may carry a\nfile still being read: its turn waits for it. A file goes with a message by its `id` in the\nmessage's `files` as soon as it's kept, whatever its `state`: `reading` while it's read,\n`ready` once read, or `failed`, its `failure` saying why. Sent with an `Idempotency-Key`, a\nfile sent again is attached once. An embed session whose agent's embed has Attachments off is refused\n(`403 attachments_off`, \"This chat takes no files.\"), its preview too; your chat app and your API keys never are.\n", "parameters": [{"$ref": "#/components/parameters/FileName"}, {"$ref": "#/components/parameters/IdempotencyKeyOptional"}], "requestBody": {"required": true, "description": "The file's bytes, its type in `Content-Type`", "content": {"*/*": {}}}, "responses": {"201": {"$ref": "#/components/responses/FileCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "411": {"$ref": "#/components/responses/LengthRequired"}, "413": {"$ref": "#/components/responses/BodyTooLarge"}, "415": {"$ref": "#/components/responses/FileUnsupported"}, "422": {"$ref": "#/components/responses/KeyReused"}, "429": {"$ref": "#/components/responses/RateLimited"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/FilesUnavailable"}}}}, "/conversations/{id}/files/check": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "post": {"tags": ["Files"], "summary": "Ask whether a file would be kept, before sending it", "operationId": "checkFile", "description": "The body is the file's first bytes, at most 64 KB (the first 4 KB are all that's read), its name in\n`X-File-Name` and its whole size in `X-File-Size`. The answer is the upload's own: 204 when it would keep\nthe file, else the problem the upload would give, from its name, its size, the conversation, a visitor's\nday and the kind its bytes are. Ask before sending a large file, so one that would be refused is refused at\nonce rather than after it has all arrived. Nothing is kept, and nothing of a visitor's day is counted.\nAn embed session whose agent's embed has Attachments off is refused as its upload is (`403 attachments_off`).\n", "parameters": [{"$ref": "#/components/parameters/FileName"}, {"$ref": "#/components/parameters/FileSize"}], "requestBody": {"required": true, "description": "The file's first bytes", "content": {"*/*": {}}}, "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "413": {"$ref": "#/components/responses/BodyTooLarge"}, "415": {"$ref": "#/components/responses/FileUnsupported"}, "429": {"$ref": "#/components/responses/RateLimited"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/files/{file}": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/FileID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "get": {"tags": ["Files"], "summary": "A file", "operationId": "getFile", "responses": {"200": {"$ref": "#/components/responses/File"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Files"], "summary": "Delete a file", "operationId": "deleteFile", "description": "The person's or the agent's; a message that carried it still names it.", "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/files/{file}/content": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/FileID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "get": {"tags": ["Files"], "summary": "Download a file", "operationId": "downloadFile", "description": "The file as it was attached or given, as an attachment with its name, never to show as a page. A person's\nbrowser saves it best through its link, from `POST /conversations/{id}/files/{file}/download-link`.\n", "parameters": [{"$ref": "#/components/parameters/Range"}, {"$ref": "#/components/parameters/IfRange"}], "responses": {"200": {"$ref": "#/components/responses/FileContent"}, "206": {"$ref": "#/components/responses/FilePart"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "416": {"$ref": "#/components/responses/RangeNotSatisfiable"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/FilesUnavailable"}}}}, "/conversations/{id}/files/{file}/download-link": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/FileID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "post": {"tags": ["Files"], "summary": "Get a link to download a file", "operationId": "createFileDownloadLink", "description": "A link a browser saves the file from by itself, `GET /downloads/{tenant}/{secret}`, with its own progress,\nspeed, pause and resume, and the file never held in a page. It takes no key or session, so hand it to the\nperson rather than passing the bytes through your servers: it opens for five minutes, for this file read\nas this person while they still can, and a download it started goes on past then.\n", "responses": {"201": {"$ref": "#/components/responses/DownloadLinkCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/files/{file}/preview": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/FileID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "get": {"tags": ["Files"], "summary": "A picture's smaller copy", "operationId": "previewFile", "description": "A ready picture, re-encoded at most 1,568 pixels on its longer side, to show inline. A file that will never\nhave one, not a picture, a picture too large to show small or one that couldn't be read, is 404\n`preview_unavailable`; a picture still being read is 404 `file_not_found` until it's read.\n", "responses": {"200": {"$ref": "#/components/responses/FilePreview"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/turns": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "get": {"tags": ["Conversations"], "summary": "A conversation's turns", "operationId": "listTurns", "description": "Each turn the agent took in it, newest first, with what became of it and what it used.", "parameters": [{"$ref": "#/components/parameters/Limit"}, {"$ref": "#/components/parameters/Cursor"}], "responses": {"200": {"$ref": "#/components/responses/TurnList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/turns/{id}": {"parameters": [{"$ref": "#/components/parameters/TurnID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "get": {"tags": ["Conversations"], "summary": "A turn", "operationId": "getTurn", "description": "A message's `202` names its turn here, in `Location`, once the message is in one.", "responses": {"200": {"$ref": "#/components/responses/Turn"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/processes": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "get": {"tags": ["Conversations"], "summary": "A conversation's background jobs", "operationId": "listJobs", "description": "What the agent left running in the background for the person, such as a long build or a server, and those\nthat ended in the last day, newest first. A job's end reaches the agent on its own.\n", "responses": {"200": {"$ref": "#/components/responses/ProcessList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/processes/{n}/stop": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/ProcessNumber"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "post": {"tags": ["Conversations"], "summary": "Stop a background job", "operationId": "stopJob", "description": "The stop is under way; the job's `state` says `stopping` until it has `stopped`.", "parameters": [{"$ref": "#/components/parameters/IdempotencyKeyOptional"}], "responses": {"202": {"$ref": "#/components/responses/ProcessStopping"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "422": {"$ref": "#/components/responses/KeyReused"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/conversations/{id}/tasks": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}, {"$ref": "#/components/parameters/AcceptLanguage"}], "get": {"tags": ["Conversations"], "summary": "A conversation's tasks", "operationId": "listTasks", "description": "The actions the agent started that run on after its turn, such as a long report another\nsystem makes, still running or ended in the last day without its result. A task named in\nwords, in the request's language (`Accept-Language`), by its own ID. One that asks the person something shows it among the conversation's\n`interrupts`, and on the stream as a run of its own that ends with that interrupt; answer it\nwith resume. A task's result opens a turn of its own.\n", "responses": {"200": {"$ref": "#/components/responses/TaskList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/tasks/{task}/cancel": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/TaskID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "post": {"tags": ["Conversations"], "summary": "Cancel a task", "operationId": "cancelTask", "description": "The task ends cancelled, the system it runs on told; its result would open no turn.", "parameters": [{"$ref": "#/components/parameters/IdempotencyKeyOptional"}], "responses": {"200": {"$ref": "#/components/responses/TaskCancelled"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/Conflict"}, "422": {"$ref": "#/components/responses/KeyReused"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/conversations/{id}/memory-asks": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "get": {"tags": ["Memory"], "summary": "A conversation's changes to memory", "operationId": "listMemoryAsks", "description": "Once a conversation has read something from outside it, such as a page, a web page, a file\nor a tool's result, a change the agent makes to what it remembers waits for the person to\nconfirm its exact words: these, waiting or answered, oldest first, in one slice. One unanswered\nfor 7 days goes. The stream shows each as it comes, and every change made at once, as a\n`memory` activity; a conversation read alone carries those still waiting in `memory_asks`.\n", "responses": {"200": {"$ref": "#/components/responses/MemoryAskList"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/conversations/{id}/memory-asks/{ask}": {"parameters": [{"$ref": "#/components/parameters/ConversationID"}, {"$ref": "#/components/parameters/MemoryAskID"}, {"$ref": "#/components/parameters/UserID"}, {"$ref": "#/components/parameters/VisitorID"}], "post": {"tags": ["Memory"], "summary": "Answer a change to memory", "operationId": "answerMemoryAsk", "description": "The person's answer, once: `save` makes the change as the agent wrote it, `false` drops it.\nOnly the person answers: show them its words and send what they choose, never what someone\ntyped in the chat. A change that can't be made any more is refused in words, and waits still.\n", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MemoryAnswer"}}}}, "responses": {"200": {"$ref": "#/components/responses/MemoryAsk"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/MemoryConflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/people": {"get": {"tags": ["Admin"], "summary": "The chat app's people", "operationId": "adminListPeople", "description": "Newest first, a page at a time. `q` matches names and the address; `role`, `status`, `group` and `way` filter,\neach with `q` too. `way` is how they sign in: `password`, `passkey`, `two_step` (an authenticator) or `code`,\nneither a password nor a passkey.\n", "security": [{"chatAppAccount": []}], "parameters": [{"name": "q", "in": "query", "schema": {"type": "string"}}, {"name": "role", "in": "query", "schema": {"type": "string", "enum": ["admin", "user"]}}, {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["active", "suspended"]}}, {"name": "group", "in": "query", "description": "A group's ID; the people in it", "schema": {"type": "string"}}, {"name": "way", "in": "query", "schema": {"type": "string", "enum": ["password", "passkey", "code", "two_step"]}}, {"$ref": "#/components/parameters/AdminPage"}, {"$ref": "#/components/parameters/AdminPageSize"}], "responses": {"200": {"$ref": "#/components/responses/AdminPeoplePage"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}}, "/admin/people/{id}": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "get": {"tags": ["Admin"], "summary": "A person", "operationId": "adminGetPerson", "description": "The person and how they sign in.", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminPersonDetail"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "patch": {"tags": ["Admin"], "summary": "Change a person's role or groups", "operationId": "adminChangePerson", "description": "A role, groups (the whole list), or both, each checked before either changes. An admin can't change their own\nrole (`not_yourself`); a group your chat app doesn't hold changes nothing (`group_unknown`).\n", "security": [{"chatAppAccount": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminPersonPatch"}}}}, "responses": {"200": {"$ref": "#/components/responses/AdminPerson"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "422": {"$ref": "#/components/responses/AdminGroupUnknown"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Admin"], "summary": "Remove a person", "operationId": "adminRemovePerson", "description": "Erases the person and everything they hold, their conversations, memories, files and homes, then their account,\nat once. An admin can't remove themselves (`not_yourself`).\n", "security": [{"chatAppAccount": []}], "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/people/{id}/suspend": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "post": {"tags": ["Admin"], "summary": "Suspend a person", "operationId": "adminSuspendPerson", "description": "Shuts them out at once, every sign-in of theirs ended. An admin can't suspend themselves (`not_yourself`).", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminPerson"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/people/{id}/restore": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "post": {"tags": ["Admin"], "summary": "Restore a suspended person", "operationId": "adminRestorePerson", "description": "They can sign in again.", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminPerson"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/invitations": {"get": {"tags": ["Admin"], "summary": "The chat app's invitations", "operationId": "adminListInvitations", "description": "Newest first, each saying whether it lapsed; `q` matches the address.", "security": [{"chatAppAccount": []}], "parameters": [{"name": "q", "in": "query", "schema": {"type": "string"}}, {"name": "role", "in": "query", "schema": {"type": "string", "enum": ["admin", "user"]}}, {"name": "expired", "in": "query", "schema": {"type": "boolean"}}, {"$ref": "#/components/parameters/AdminPage"}, {"$ref": "#/components/parameters/AdminPageSize"}], "responses": {"200": {"$ref": "#/components/responses/AdminInvitationPage"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "500": {"$ref": "#/components/responses/ServerError"}, "503": {"$ref": "#/components/responses/Unavailable"}}}, "post": {"tags": ["Admin"], "summary": "Invite people", "operationId": "adminInvite", "description": "Up to 100 addresses, each emailed in your chat app's name with a link to its sign-up for 14 days, each account\njoining `groups` when it signs up. An address it can't invite is skipped with why: `invalid`, `has_account`,\n`invited` (resend it), `rate_limited` (300 invitation emails an hour) or `too_many_pending`.\n", "security": [{"chatAppAccount": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminInviteRequest"}}}}, "responses": {"200": {"$ref": "#/components/responses/AdminInvited"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "422": {"$ref": "#/components/responses/AdminGroupUnknown"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/invitations/{id}/resend": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "post": {"tags": ["Admin"], "summary": "Resend an invitation", "operationId": "adminResendInvitation", "description": "Another 14 days, emailed again, at most once a minute (`invitation_just_sent`); never to an address that has an\naccount by now (`has_account`).\n", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminInvitation"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "429": {"$ref": "#/components/responses/AdminTooManyInvitations"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/invitations/{id}": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "delete": {"tags": ["Admin"], "summary": "Revoke an invitation", "operationId": "adminRevokeInvitation", "security": [{"chatAppAccount": []}], "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/groups": {"get": {"tags": ["Admin"], "summary": "The chat app's groups", "operationId": "adminListGroups", "description": "Every group by name, each with how many of your people are in it.", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminGroupList"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "post": {"tags": ["Admin"], "summary": "Make a group", "operationId": "adminCreateGroup", "description": "A name of 1 to 60 characters, your chat app's alone whatever its case (`group_exists`), and a description of at\nmost 280; at most 100 groups (`too_many_groups`).\n", "security": [{"chatAppAccount": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminGroupRequest"}}}}, "responses": {"201": {"$ref": "#/components/responses/AdminGroupCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/groups/{id}": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "patch": {"tags": ["Admin"], "summary": "Rename or describe a group", "operationId": "adminChangeGroup", "description": "A member left out stays as it is; never another group's name.", "security": [{"chatAppAccount": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminGroupRequest"}}}}, "responses": {"200": {"$ref": "#/components/responses/AdminGroup"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Admin"], "summary": "Delete a group", "operationId": "adminDeleteGroup", "description": "The group comes off its people and its agents; an agent it alone narrowed leaves the chat app rather than become\neveryone's, and is named in `agents_off`.\n", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminGroupDeleted"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/groups/{id}/agents": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "get": {"tags": ["Admin"], "summary": "The agents this group sees", "operationId": "adminGroupAgents", "description": "The agents your agency put in the chat app, by name, each narrowed to this group (`sees`) or every account's\n(`everyone`).\n", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminGroupAgents"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "put": {"tags": ["Admin"], "summary": "Choose the agents this group sees", "operationId": "adminSetGroupAgents", "description": "The whole list, among the chat app's agents: this group goes on each agent named and comes off each other. An\nagent every account sees, named here, is then this group's and its other groups' alone. An agent this group\nalone narrows can't lose it (`last_group`), which would make it everyone's: nothing changes.\n", "security": [{"chatAppAccount": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminGroupAgentsRequest"}}}}, "responses": {"200": {"$ref": "#/components/responses/AdminGroupAgents"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/sign-in": {"get": {"tags": ["Admin"], "summary": "How people join and sign in", "operationId": "adminSignInRules", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminSignInRules"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "patch": {"tags": ["Admin"], "summary": "Change how people join and sign in", "operationId": "adminChangeSignInRules", "description": "A member left out stays as it is, and `domains` replaces the whole list. A change that would leave no way to sign\nin is refused, naming the member; another admin's change saved first answers `sign_in_busy`.\n", "security": [{"chatAppAccount": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminSignInPatch"}}}}, "responses": {"200": {"$ref": "#/components/responses/AdminSignInRules"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/sign-in/providers": {"get": {"tags": ["Admin"], "summary": "Your identity providers", "operationId": "adminListIdentityProviders", "description": "The identity providers your people sign in with, oldest first: each one's issuer, its kind, whether single sign-on\ncan work through it (`sso_ready`, else what it lacks) and its single sign-on, never its secret.\n", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminProviderList"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "post": {"tags": ["Admin"], "summary": "Add an identity provider", "operationId": "adminAddIdentityProvider", "description": "Its domain, its address or its discovery document's address: the document and its keys are read before it's\nkept (`issuer_unreachable`), for single sign-on alone, its `sso` set up empty and off, or, with `client_id` and\n`secret`, holding that OAuth client, checked at the provider's token endpoint before anything is kept. One whose document lacks\nwhat single sign-on needs (an authorization endpoint, a token endpoint, and openid where it lists scopes) isn't\nkept (`sso_unsupported`). An issuer is added once (`issuer_taken`), and your chat app keeps at most 5\n(`too_many_issuers`).\n", "security": [{"chatAppAccount": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminProviderRequest"}}}}, "responses": {"201": {"$ref": "#/components/responses/AdminProviderCreated"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "422": {"$ref": "#/components/responses/AdminProviderUnreachable"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/sign-in/providers/read": {"post": {"tags": ["Admin"], "summary": "Read an identity provider", "operationId": "adminReadIdentityProvider", "description": "Reads an identity provider as an add would, keeping nothing: its issuer, its kind, whether single sign-on can work\nthrough it, what to set up at it (the redirect URIs and scopes) and the claims its document lists. For a form\nthat shows what it found before you save (`issuer_unreachable` when there's nothing to read). Keeping nothing,\nit never asks a sign-in of the last hour, as a change does.\n", "security": [{"chatAppAccount": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminProviderRequest"}}}}, "responses": {"200": {"$ref": "#/components/responses/AdminProviderRead"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "422": {"$ref": "#/components/responses/AdminProviderUnreachable"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/sign-in/setup": {"get": {"tags": ["Admin"], "summary": "What to set up at any identity provider", "operationId": "adminSSOSetup", "description": "What single sign-on asks of any identity provider: the redirect URIs to add at it and the scopes to allow. For a\nform that has read no provider yet, such as one whose endpoints are typed in.\n", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminSSOSetup"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/sign-in/providers/{id}": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "get": {"tags": ["Admin"], "summary": "An identity provider", "operationId": "adminIdentityProvider", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminProvider"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/sign-in/providers/{id}/sso": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "put": {"tags": ["Admin"], "summary": "Set up single sign-on", "operationId": "adminSetSingleSignOn", "description": "A member left out stays as it is, a change of nothing writes nothing, and `secret` is never answered, only\nwhether one is kept (`has_secret`). The client is checked at the provider's token endpoint once it has both its\nID and its secret and whenever either changes, and single sign-on turns on only once it works\n(`sso_not_working`); a client changed for one that doesn't work turns it off. Each email domain is one\nprovider's (`sso_domain_taken`), `required` and `make_accounts` need a domain, and `group_map` names your\ngroups (`group_unknown`). Other changes to it saved first, again and again, are `sso_busy`.\n", "security": [{"chatAppAccount": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminSSORequest"}}}}, "responses": {"200": {"$ref": "#/components/responses/AdminProvider"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "415": {"$ref": "#/components/responses/UnsupportedMediaType"}, "422": {"$ref": "#/components/responses/AdminGroupUnknown"}, "500": {"$ref": "#/components/responses/ServerError"}}}, "delete": {"tags": ["Admin"], "summary": "End single sign-on", "operationId": "adminRemoveSingleSignOn", "description": "A provider you added for single sign-on goes with it, unless your agency's site took it on meanwhile; one the site\nalso signs your people in with keeps that.\n", "security": [{"chatAppAccount": []}], "responses": {"204": {"$ref": "#/components/responses/NoContent"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/sign-in/providers/{id}/sso/check": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "post": {"tags": ["Admin"], "summary": "Check single sign-on's client again", "operationId": "adminCheckSingleSignOn", "description": "Asks the provider's token endpoint about the client and keeps what it found in `works` and `check_words`,\nleaving single sign-on on or off as it was. A provider with no client yet is a request to fix.\n", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminProvider"}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/sign-in/providers/{id}/sso/test": {"parameters": [{"$ref": "#/components/parameters/AdminID"}], "post": {"tags": ["Admin"], "summary": "Test single sign-on", "operationId": "adminTestSingleSignOn", "description": "A test of the provider's single sign-on, on or off, while your chat app is open or closed: its ID, and the link\nthat starts it, to open in a window. The person signs in at the provider; nothing is made or changed. A provider\nwhose client isn't set up, or that lacks what the flow uses, is `sso_not_working`.\n", "security": [{"chatAppAccount": []}], "responses": {"201": {"$ref": "#/components/responses/AdminSSOTestStarted"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "409": {"$ref": "#/components/responses/AdminConflict"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/sign-in/providers/{id}/sso/tests/{test}": {"parameters": [{"$ref": "#/components/parameters/AdminID"}, {"name": "test", "in": "path", "required": true, "schema": {"type": "string"}}], "get": {"tags": ["Admin"], "summary": "A single sign-on test", "operationId": "adminSingleSignOnTest", "description": "Waiting until the person has signed in at the provider, then what it read of them and what would happen: `sign_in`\ntheir account, `link` the account with their email, `make` one, or `refuse` with the reason. Kept fifteen\nminutes; another provider's, or one lapsed, is `sso_test_not_found`.\n", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminSSOTest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/usage": {"get": {"tags": ["Admin"], "summary": "The chat app's last 30 days", "operationId": "adminUsage", "description": "Its active people, conversations and turns, by day and by its busiest agents; never what anything cost.", "security": [{"chatAppAccount": []}], "responses": {"200": {"$ref": "#/components/responses/AdminUsage"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}, "/admin/activity": {"get": {"tags": ["Admin"], "summary": "What changed about people, groups and sign-in", "operationId": "adminActivity", "description": "Newest first, whoever made the change: an admin by their account, your agency's team as the setup team.\nNothing about agents or keys.\n", "security": [{"chatAppAccount": []}], "parameters": [{"$ref": "#/components/parameters/AdminPage"}, {"$ref": "#/components/parameters/AdminPageSize"}], "responses": {"200": {"$ref": "#/components/responses/AdminActivityPage"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/AdminForbidden"}, "500": {"$ref": "#/components/responses/ServerError"}}}}},"webhooks":{"turn.created": {"post": {"tags": ["Webhooks"], "summary": "A turn began", "operationId": "turnCreated", "description": "A person's turn exists: for their message, at once or after it waited for the turn before it,\nfor a retry, or for a task's or a background job's result the agent answers on its own. Read\nit with `GET /turns/{id}`, and follow it with `GET /conversations/{conversation_id}/stream`.\n", "security": [], "parameters": [{"$ref": "#/components/parameters/WebhookID"}, {"$ref": "#/components/parameters/WebhookTimestamp"}, {"$ref": "#/components/parameters/WebhookSignature"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TurnCreatedEvent"}}}}, "responses": {"2XX": {"$ref": "#/components/responses/WebhookReceived"}, "410": {"$ref": "#/components/responses/WebhookGone"}, "default": {"$ref": "#/components/responses/WebhookFailed"}}}}, "turn.ended": {"post": {"tags": ["Webhooks"], "summary": "A turn ended", "operationId": "turnEnded", "description": "A person's turn ended, whatever became of it. Read its `outcome` with `GET /turns/{id}`, and\nwhat the agent said with `GET /conversations/{conversation_id}/messages`; a `quiet` turn said nothing new.\n", "security": [], "parameters": [{"$ref": "#/components/parameters/WebhookID"}, {"$ref": "#/components/parameters/WebhookTimestamp"}, {"$ref": "#/components/parameters/WebhookSignature"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TurnEndedEvent"}}}}, "responses": {"2XX": {"$ref": "#/components/responses/WebhookReceived"}, "410": {"$ref": "#/components/responses/WebhookGone"}, "default": {"$ref": "#/components/responses/WebhookFailed"}}}}, "conversation.waiting": {"post": {"tags": ["Webhooks"], "summary": "A conversation waits for its person", "operationId": "conversationWaiting", "description": "The agent waits on the person: to confirm what it would do, fill in a form, open a page,\nconnect an account, or answer a task's question. Read what it waits for in the conversation's\n`interrupts` with `GET /conversations/{id}`, and answer with\n`POST /conversations/{id}/resume`. A pause the person asks for isn't announced: your app asked\nfor it.\n", "security": [], "parameters": [{"$ref": "#/components/parameters/WebhookID"}, {"$ref": "#/components/parameters/WebhookTimestamp"}, {"$ref": "#/components/parameters/WebhookSignature"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConversationWaitingEvent"}}}}, "responses": {"2XX": {"$ref": "#/components/responses/WebhookReceived"}, "410": {"$ref": "#/components/responses/WebhookGone"}, "default": {"$ref": "#/components/responses/WebhookFailed"}}}}, "webhook.test": {"post": {"tags": ["Webhooks"], "summary": "A test", "operationId": "webhookTest", "description": "Sent from the console to see how the endpoint answers; `data.id` is the endpoint's. Answer it as\nany event. A test changes nothing: it's sent whether the endpoint is on or off, and its `410`\ndoesn't turn it off.\n", "security": [], "parameters": [{"$ref": "#/components/parameters/WebhookID"}, {"$ref": "#/components/parameters/WebhookTimestamp"}, {"$ref": "#/components/parameters/WebhookSignature"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookTestEvent"}}}}, "responses": {"2XX": {"$ref": "#/components/responses/WebhookReceived"}, "410": {"$ref": "#/components/responses/WebhookGone"}, "default": {"$ref": "#/components/responses/WebhookFailed"}}}}},"components":{"securitySchemes": {"chatAppAccount": {"type": "http", "scheme": "bearer", "description": "A person's sign-in to your chat app, on its own address; the admin area takes an admin's."}, "apiKey": {"type": "http", "scheme": "bearer", "description": "One of your API keys, `ak_…`, made in the console. Keep it on your servers."}, "embedSession": {"type": "http", "scheme": "bearer", "description": "An embed session, `es_…`, from `POST /embed/sessions`, for one person; the embed's own, in a browser."}}, "headers": {"RequestId": {"description": "The request's ID, as a problem's `request_id` and our logs name it", "schema": {"type": "string"}}, "Location": {"description": "Where the resource it made is", "schema": {"type": "string", "format": "uri-reference"}}, "IdempotentReplayed": {"description": "`true` on an answer kept from the first request sent with its Idempotency-Key", "schema": {"type": "string", "enum": ["true"]}}, "RetryAfter": {"description": "How many seconds to wait before sending it again", "schema": {"type": "integer", "minimum": 0}}, "ContentDisposition": {"description": "`attachment` or `inline`, with the file's name", "schema": {"type": "string"}}, "AcceptRanges": {"description": "`bytes`: a `Range` gets that part of the file", "schema": {"type": "string"}}, "ETag": {"description": "The file's digest, quoted, for a resume's `If-Range`; the agent's own text has none", "schema": {"type": "string"}}, "ContentRange": {"description": "The part sent and the file's length, as `bytes 0-1023/4096`; `bytes */4096` past its end", "schema": {"type": "string"}}, "WWWAuthenticate": {"description": "`Bearer`, with `error=\"invalid_token\"` when a bearer token was sent and refused", "schema": {"type": "string"}}}, "parameters": {"AcceptLanguage": {"name": "Accept-Language", "in": "header", "description": "The language the response's words are said in: a step's title, a turn's `words`, a question the agent waits on the\nperson with. The API speaks English (`en-US`, which any `en` tag reads as) and Simplified Chinese (`zh-CN`, which any\n`zh` tag reads as). The language is chosen in this order: the highest-weighted tag of this header that the API\nspeaks, else the language recorded for the person, else English. What the person, the agent or a connector wrote\nstays as written, and a problem's `detail` stays English. The response sends `Vary: Accept-Language`.\n", "schema": {"type": "string", "example": "zh-CN,zh;q=0.9,en;q=0.8"}}, "AdminID": {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}, "AdminPage": {"name": "page", "in": "query", "description": "The page, from 1", "schema": {"type": "integer", "minimum": 1}}, "AdminPageSize": {"name": "page_size", "in": "query", "description": "How many a page holds, 20 unless asked, 100 at most", "schema": {"type": "integer", "minimum": 1, "maximum": 100}}, "AgentID": {"name": "id", "in": "path", "required": true, "description": "An agent's ID; one not shared through the API is not found, and with an embed session one whose embed is off is `embed_off`", "schema": {"$ref": "#/components/schemas/ID"}}, "ConversationID": {"name": "id", "in": "path", "required": true, "description": "A conversation's ID; anyone else's is not found", "schema": {"$ref": "#/components/schemas/ID"}}, "WaitingMessageID": {"name": "message", "in": "path", "required": true, "description": "The waiting message's `client_message_id`", "schema": {"type": "string", "maxLength": 100}}, "IdempotencyKey": {"name": "Idempotency-Key", "in": "header", "required": true, "description": "Your key for this request, a Structured Fields string; the same request sent again with it is taken once", "schema": {"$ref": "#/components/schemas/IdempotencyKey"}}, "IdempotencyKeyOptional": {"name": "Idempotency-Key", "in": "header", "required": false, "description": "Your key for this request, a Structured Fields string; the same request sent again with it answers what the first did", "schema": {"$ref": "#/components/schemas/IdempotencyKey"}}, "FileID": {"name": "file", "in": "path", "required": true, "description": "A file's ID; another conversation's is not found", "schema": {"$ref": "#/components/schemas/ID"}}, "ProcessNumber": {"name": "n", "in": "path", "required": true, "description": "A background job's number in its conversation", "schema": {"type": "integer", "minimum": 1}}, "TaskID": {"name": "task", "in": "path", "required": true, "description": "A task's ID, as the conversation's tasks list it", "schema": {"$ref": "#/components/schemas/ID"}}, "TurnID": {"name": "id", "in": "path", "required": true, "description": "A turn's ID; one of anyone else's conversations is not found", "schema": {"$ref": "#/components/schemas/ID"}}, "KeptFileID": {"name": "file", "in": "path", "required": true, "description": "A kept file's ID; another person's is not found", "schema": {"$ref": "#/components/schemas/ID"}}, "MemoryAgentID": {"name": "agent", "in": "path", "required": true, "description": "The agent whose memory of the person this is", "schema": {"$ref": "#/components/schemas/ID"}}, "MemoryAgentQuery": {"name": "agent", "in": "query", "required": true, "description": "The agent whose memories to list", "schema": {"$ref": "#/components/schemas/ID"}}, "MemoryID": {"name": "memory", "in": "path", "required": true, "description": "A memory's ID; another person's is not found", "schema": {"$ref": "#/components/schemas/ID"}}, "MemoryAskID": {"name": "ask", "in": "path", "required": true, "description": "A change to memory's ID; another conversation's is not found", "schema": {"$ref": "#/components/schemas/ID"}}, "HomeAgentID": {"name": "agent", "in": "path", "required": true, "description": "The agent whose sandboxes kept the home", "schema": {"$ref": "#/components/schemas/ID"}}, "ConnectorID": {"name": "connector", "in": "path", "required": true, "description": "The connector the account is on, as the connection's `connector_id` names it", "schema": {"$ref": "#/components/schemas/ID"}}, "FileName": {"name": "X-File-Name", "in": "header", "required": true, "description": "The file's name, percent-encoded UTF-8, such as `Q3%20report.pdf`", "schema": {"type": "string", "minLength": 1}}, "Range": {"name": "Range", "in": "header", "description": "One byte range, such as `bytes=1048576-`, to resume a download; several, or one malformed, get the whole file", "schema": {"type": "string"}}, "IfRange": {"name": "If-Range", "in": "header", "description": "The `ETag` the download began with, so another file is sent whole rather than in part", "schema": {"type": "string"}}, "FileSize": {"name": "X-File-Size", "in": "header", "required": true, "description": "The whole file's size, in bytes", "schema": {"type": "integer", "format": "int64", "minimum": 1}}, "PersonID": {"name": "id", "in": "path", "required": true, "description": "Your ID for the person, 1 to 200 characters, percent-encoded in the path", "schema": {"type": "string", "minLength": 1}}, "UserID": {"name": "X-User-ID", "in": "header", "required": false, "description": "Someone signed in to your app, by your ID for them; a conversation's calls name the person with this or `X-Visitor-ID`, with an API key alone", "schema": {"type": "string", "minLength": 1, "maxLength": 200}}, "VisitorID": {"name": "X-Visitor-ID", "in": "header", "required": false, "description": "Someone who isn't signed in, by an ID your app keeps for them, with an API key alone", "schema": {"type": "string", "minLength": 1, "maxLength": 200}}, "Limit": {"name": "limit", "in": "query", "required": false, "description": "How many rows a slice holds", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 20}}, "Cursor": {"name": "cursor", "in": "query", "required": false, "description": "The `next_cursor` of the slice before; leave it out for the first", "schema": {"type": "string"}}, "HistoryLimit": {"name": "limit", "in": "query", "required": false, "description": "How many messages a page holds", "schema": {"type": "integer", "minimum": 1, "maximum": 200, "default": 50}}, "LastEventID": {"name": "Last-Event-ID", "in": "header", "required": false, "description": "The `id` of the last event the client has, which the stream goes on from", "schema": {"$ref": "#/components/schemas/StreamCursor"}}, "View": {"name": "view", "in": "query", "required": false, "description": "Ask to see less of the agent's work: `answers`, `progress`, `thinking` or `everything`. The\nlower of this and the agent's level for the way the call came is shown; a higher one is\nlowered, never an error. A word that is no level is `invalid_request`.\n", "schema": {"type": "string", "enum": ["answers", "progress", "thinking", "everything"]}}, "After": {"name": "after", "in": "query", "required": false, "description": "The `id` the stream goes on from, for a client that can't send `Last-Event-ID`", "schema": {"$ref": "#/components/schemas/StreamCursor"}}, "WebhookID": {"name": "webhook-id", "in": "header", "required": true, "description": "The event's ID, the same on every attempt and at every endpoint; take each event once", "schema": {"type": "string", "pattern": "^evt_[0-9a-f]{24}$"}}, "WebhookTimestamp": {"name": "webhook-timestamp", "in": "header", "required": true, "description": "When this attempt was sent, in Unix seconds", "schema": {"type": "integer", "format": "int64"}}, "WebhookSignature": {"name": "webhook-signature", "in": "header", "required": true, "description": "`v1,` and the base64 HMAC-SHA256 of `{webhook-id}.{webhook-timestamp}.{body}` under your\nendpoint's secret; for a day after the secret is rotated, one under each, separated by a space\n", "schema": {"type": "string"}}}, "schemas": {"AdminGroupRef": {"type": "object", "required": ["id", "name"], "properties": {"id": {"type": "string"}, "name": {"type": "string"}}}, "AdminPerson": {"type": "object", "required": ["id", "email", "first_name", "last_name", "display_name", "role", "groups", "status", "created_at", "last_login_at", "last_active_at"], "properties": {"id": {"type": "string"}, "email": {"type": "string"}, "first_name": {"type": "string"}, "last_name": {"type": "string"}, "display_name": {"type": "string"}, "role": {"type": "string", "enum": ["admin", "user"]}, "groups": {"type": "array", "description": "The groups they're in, by name", "items": {"$ref": "#/components/schemas/AdminGroupRef"}}, "status": {"type": "string", "enum": ["active", "suspended"]}, "created_at": {"type": "integer", "format": "int64"}, "last_login_at": {"type": "integer", "format": "int64"}, "last_active_at": {"type": "integer", "format": "int64", "description": "When they last used the chat app; 0 for never"}}}, "AdminPersonDetail": {"allOf": [{"$ref": "#/components/schemas/AdminPerson"}, {"type": "object", "required": ["sign_in"], "properties": {"sign_in": {"type": "object", "required": ["password", "passkeys", "two_step"], "properties": {"password": {"type": "boolean"}, "passkeys": {"type": "integer"}, "two_step": {"type": "boolean"}}}}}]}, "AdminPersonPatch": {"type": "object", "minProperties": 1, "properties": {"role": {"type": "string", "enum": ["admin", "user"]}, "groups": {"type": "array", "description": "The groups' IDs, the whole list", "items": {"type": "string"}}}}, "AdminInvitation": {"type": "object", "required": ["id", "email", "role", "groups", "inviter_name", "created_at", "expires_at", "last_sent_at", "expired"], "properties": {"id": {"type": "string"}, "email": {"type": "string"}, "role": {"type": "string", "enum": ["admin", "user"]}, "groups": {"type": "array", "description": "The groups the account joins, by name", "items": {"$ref": "#/components/schemas/AdminGroupRef"}}, "inviter_name": {"type": "string"}, "created_at": {"type": "integer", "format": "int64"}, "expires_at": {"type": "integer", "format": "int64"}, "last_sent_at": {"type": "integer", "format": "int64"}, "expired": {"type": "boolean", "description": "Past its 14 days; it admits no one until it's resent"}}}, "AdminInviteRequest": {"type": "object", "required": ["emails", "role"], "properties": {"emails": {"type": "array", "maxItems": 100, "items": {"type": "string"}}, "role": {"type": "string", "enum": ["admin", "user"]}, "groups": {"type": "array", "description": "The IDs of the groups each account joins", "items": {"type": "string"}}}}, "AdminInvited": {"type": "object", "required": ["invited", "skipped"], "properties": {"invited": {"type": "array", "items": {"$ref": "#/components/schemas/AdminInvitation"}}, "skipped": {"type": "array", "items": {"type": "object", "required": ["email", "reason"], "properties": {"email": {"type": "string"}, "reason": {"type": "string", "enum": ["invalid", "has_account", "invited", "rate_limited", "too_many_pending"]}}}}}}, "AdminGroup": {"type": "object", "required": ["id", "name", "description", "members", "created_at", "updated_at"], "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "description": {"type": "string"}, "members": {"type": "integer", "description": "How many of your people are in it"}, "created_at": {"type": "integer", "format": "int64"}, "updated_at": {"type": "integer", "format": "int64"}}}, "AdminGroupRequest": {"type": "object", "properties": {"name": {"type": "string", "maxLength": 60}, "description": {"type": "string", "maxLength": 280}}}, "AdminGroupDeleted": {"type": "object", "required": ["deleted", "agents_off"], "properties": {"deleted": {"type": "boolean", "const": true}, "agents_off": {"type": "array", "description": "The agents it alone narrowed, which left the chat app", "items": {"$ref": "#/components/schemas/AdminGroupRef"}}}}, "AdminGroupAgent": {"type": "object", "required": ["id", "name", "sees", "everyone"], "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "sees": {"type": "boolean", "description": "Narrowed to this group"}, "everyone": {"type": "boolean", "description": "Every account sees it"}}}, "AdminGroupAgentsRequest": {"type": "object", "required": ["agents"], "properties": {"agents": {"type": "array", "description": "The agents' IDs, the whole list", "items": {"type": "string"}}}}, "AdminSignInRules": {"type": "object", "required": ["join", "domains", "methods", "two_step", "updated_at"], "properties": {"join": {"type": "string", "enum": ["invited", "domains", "anyone"]}, "domains": {"type": "array", "items": {"type": "string"}}, "methods": {"type": "object", "required": ["code", "password", "passkey"], "properties": {"code": {"type": "boolean"}, "password": {"type": "boolean"}, "passkey": {"type": "boolean"}}}, "two_step": {"type": "string", "enum": ["off", "admins", "everyone"]}, "updated_at": {"type": "integer", "format": "int64"}}}, "AdminSignInPatch": {"type": "object", "properties": {"join": {"type": "string", "enum": ["invited", "domains", "anyone"]}, "domains": {"type": "array", "items": {"type": "string"}}, "methods": {"type": "object", "properties": {"code": {"type": "boolean"}, "password": {"type": "boolean"}, "passkey": {"type": "boolean"}}}, "two_step": {"type": "string", "enum": ["off", "admins", "everyone"]}}}, "AdminProvider": {"type": "object", "required": ["id", "issuer", "provider", "sso_ready", "sso", "sso_redirect_uris", "sso_scopes"], "properties": {"id": {"type": "string"}, "issuer": {"type": "string", "description": "The issuer, as its discovery document names it"}, "provider": {"type": "object", "required": ["id", "name"], "description": "The identity provider its address is known as, `oidc` for any other", "properties": {"id": {"type": "string"}, "name": {"type": "string"}}}, "sso_ready": {"type": "boolean", "description": "Its discovery document offers what single sign-on uses: an authorization endpoint, a token endpoint, and\nopenid where it lists scopes\n"}, "sso_lacks": {"type": "string", "enum": ["unread", "authorization_endpoint", "token_endpoint", "openid"], "description": "What it lacks when it isn't ready; `unread` until its document is read"}, "sso": {"description": "Its single sign-on; none until it's set up", "oneOf": [{"$ref": "#/components/schemas/AdminSSO"}, {"type": "null"}]}, "sso_redirect_uris": {"type": "array", "items": {"type": "string"}, "description": "Where the chat app takes single sign-on's answers, each to add at the provider as a redirect URI"}, "sso_scopes": {"type": "array", "items": {"type": "string"}, "description": "What single sign-on asks the provider, `openid email profile` and the groups claim's scope where the provider lists it"}, "claims_supported": {"type": "array", "items": {"type": "string"}, "description": "The claims its document says its tokens may carry, for choosing the groups claim"}, "endpoints": {"type": "object", "description": "Where it signs people in, read from its discovery document or typed in", "required": ["authorization_endpoint", "token_endpoint", "userinfo_endpoint"], "properties": {"authorization_endpoint": {"type": "string"}, "token_endpoint": {"type": "string"}, "userinfo_endpoint": {"type": "string"}}}, "endpoints_manual": {"type": "boolean", "description": "Its endpoints were typed in rather than read from a discovery document"}}}, "AdminSSO": {"type": "object", "required": ["on", "client_id", "has_secret", "domains", "required", "make_accounts", "groups_claim", "group_map", "checked_at", "works", "check_words", "check_result"], "properties": {"on": {"type": "boolean", "description": "Your people sign in with it; on only once its client works"}, "client_id": {"type": "string"}, "has_secret": {"type": "boolean", "description": "A secret is kept; it's never answered"}, "domains": {"type": "array", "description": "The email domains whose people it signs in", "items": {"type": "string"}}, "required": {"type": "boolean", "description": "Its domains' people sign in with it alone"}, "make_accounts": {"type": "boolean", "description": "A person at its domains gets an account on their first sign-in"}, "groups_claim": {"type": "string", "description": "The claim its ID tokens list a person's groups in; empty for none"}, "group_map": {"type": "array", "items": {"$ref": "#/components/schemas/AdminSSOGroup"}}, "checked_at": {"type": "integer", "format": "int64", "description": "When its client was last checked; 0 never"}, "works": {"type": "boolean", "description": "Its token endpoint accepted the client when last checked"}, "check_words": {"type": "string", "description": "What the last check found, in words"}, "check_result": {"type": "string", "enum": ["", "accepted", "refused", "unreached", "answered", "unread", "authorization_endpoint", "token_endpoint", "openid"], "description": "What the last check found, as a code to say in your own words: the token endpoint accepted the client,\nrefused it, couldn't be reached or answered otherwise (`check_answer`), or the provider lacks what single\nsign-on needs. Empty before a check.\n"}, "check_answer": {"type": "string", "description": "What the token endpoint answered when the result is `answered`, its status and any error code, such as `500 server_error`"}}}, "AdminSSOGroup": {"type": "object", "required": ["value", "group_id"], "properties": {"value": {"type": "string", "maxLength": 200, "description": "A value of its groups claim"}, "group_id": {"type": "string", "description": "The group it puts a person in"}}}, "AdminSSORequest": {"type": "object", "properties": {"on": {"type": "boolean"}, "client_id": {"type": "string", "maxLength": 255}, "secret": {"type": "string", "maxLength": 1024, "writeOnly": true}, "domains": {"type": "array", "maxItems": 20, "description": "Each typed with its @ or in its own script if you like; kept as DNS names it", "items": {"type": "string"}}, "required": {"type": "boolean"}, "make_accounts": {"type": "boolean"}, "groups_claim": {"type": "string", "maxLength": 100}, "group_map": {"type": "array", "maxItems": 50, "description": "A value may put people in several groups, each pair counted once; a map needs `groups_claim`", "items": {"$ref": "#/components/schemas/AdminSSOGroup"}}}}, "AdminSSOTestStarted": {"type": "object", "required": ["id", "url"], "properties": {"id": {"type": "string"}, "url": {"type": "string", "format": "uri", "description": "Where the test starts, on your chat app's address"}}}, "AdminSSOTest": {"type": "object", "required": ["state"], "properties": {"state": {"type": "string", "enum": ["waiting", "done"]}, "would": {"type": "string", "enum": ["sign_in", "link", "make", "refuse"]}, "reason": {"type": "string", "description": "Why it would refuse, a code your chat app's sign-in page says in words"}, "read": {"type": "object", "required": ["subject", "email", "email_verified", "name", "groups"], "properties": {"subject": {"type": "string", "description": "The provider's ID for the person"}, "email": {"type": "string"}, "email_verified": {"type": "boolean", "description": "The provider vouches for the email"}, "name": {"type": "string"}, "groups": {"type": "array", "items": {"type": "string"}}, "userinfo": {"type": "string", "enum": ["read", "unusable"], "description": "What came of asking the provider's UserInfo endpoint for what the ID token lacked; absent when it wasn't asked"}}}}}, "AdminProviderRequest": {"type": "object", "required": ["issuer"], "properties": {"issuer": {"type": "string", "description": "Its domain, its address or its discovery document's address"}, "client_id": {"type": "string", "maxLength": 255, "description": "An add only, with `secret`. Single sign-on's OAuth client at the provider, kept with it in this one request"}, "secret": {"type": "string", "maxLength": 1024, "writeOnly": true, "description": "An add only, with `client_id`. The OAuth client's secret, never answered"}, "manual": {"type": "object", "description": "Endpoints typed in for an OpenID Connect provider that publishes no discovery document, by the document's\nmember names: read instead of a discovery document, the issuer kept exactly as given (its ID tokens'\n`iss`), the keys read from `jwks_uri` at once and on every read again. `jwks_uri` is required; single sign-on\nalso needs `authorization_endpoint` and `token_endpoint`. Each is an http or https address with no user name,\npassword or fragment; it may carry a query (RFC 6749 §3.1), which the flow keeps.\n", "required": ["jwks_uri"], "properties": {"authorization_endpoint": {"type": "string", "maxLength": 2048}, "token_endpoint": {"type": "string", "maxLength": 2048}, "userinfo_endpoint": {"type": "string", "maxLength": 2048}, "jwks_uri": {"type": "string", "maxLength": 2048}}}}}, "AdminProviderRead": {"type": "object", "required": ["issuer", "provider", "sso_ready", "sso_redirect_uris", "sso_scopes", "claims_supported"], "properties": {"issuer": {"type": "string", "description": "Its issuer, as its document names it"}, "provider": {"type": "object", "required": ["id", "name"], "description": "The identity provider its address is known as, `oidc` for any other", "properties": {"id": {"type": "string"}, "name": {"type": "string"}}}, "sso_ready": {"type": "boolean", "description": "Single sign-on can work through it"}, "sso_lacks": {"type": "string", "description": "What it lacks for single sign-on, when it isn't ready"}, "sso_redirect_uris": {"type": "array", "items": {"type": "string"}, "description": "Where the chat app takes single sign-on's answers, each to add at the provider as a redirect URI"}, "sso_scopes": {"type": "array", "items": {"type": "string"}, "description": "What single sign-on asks the provider"}, "claims_supported": {"type": "array", "items": {"type": "string"}, "description": "The claims its document says its tokens may carry"}}}, "AdminSSOSetup": {"type": "object", "required": ["sso_redirect_uris", "sso_scopes"], "properties": {"sso_redirect_uris": {"type": "array", "items": {"type": "string"}, "description": "Where the chat app takes single sign-on's answers, each to add at the provider as a redirect URI"}, "sso_scopes": {"type": "array", "items": {"type": "string"}, "description": "What single sign-on asks the provider"}}}, "AdminUsage": {"type": "object", "required": ["from", "to", "people", "conversations", "turns", "days", "agents"], "properties": {"from": {"type": "integer", "format": "int64"}, "to": {"type": "integer", "format": "int64"}, "people": {"type": "integer"}, "conversations": {"type": "integer"}, "turns": {"type": "integer"}, "days": {"type": "array", "items": {"type": "object", "required": ["day", "people", "conversations", "turns"], "properties": {"day": {"type": "string", "description": "A UTC day, such as 2026-11-01"}, "people": {"type": "integer"}, "conversations": {"type": "integer"}, "turns": {"type": "integer"}}}}, "agents": {"type": "array", "description": "The busiest agents, the most turns first; a deleted agent's name is empty", "items": {"type": "object", "required": ["id", "name", "turns", "conversations"], "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "turns": {"type": "integer"}, "conversations": {"type": "integer"}}}}}}, "AdminActivity": {"type": "object", "required": ["id", "action", "actor", "meta", "created_at"], "properties": {"id": {"type": "string"}, "action": {"type": "string", "description": "What changed, such as `person.role_changed`, `group.created` or `sign_in.changed`"}, "actor": {"type": "object", "required": ["kind", "name"], "properties": {"kind": {"type": "string", "enum": ["account", "setup_team", "provider", "other"], "description": "An admin's account, your agency's team, your identity provider setting a person's groups as they signed in, or another, such as your app"}, "id": {"type": "string", "description": "An admin's account's ID"}, "name": {"type": "string", "description": "Their name when they acted"}}}, "target_label": {"type": "string", "description": "Who or what it changed, as it was named then"}, "meta": {"type": "object", "additionalProperties": {"type": "string"}}, "created_at": {"type": "integer", "format": "int64"}}}, "ID": {"type": "string", "pattern": "^[0-9a-f]{24}$"}, "StreamCursor": {"type": "string", "description": "An event's `id` as the stream sent it: a commit's number, or after a run's end the newest\ncommit and that run's `runId`.\n", "pattern": "^(0|[1-9][0-9]*)(:[0-9a-f]{24}(\\.([2-9]|[1-9][0-9]+))?)?$", "examples": ["12", "12:6650c5e1a2b3c4d5e6f70812.2"]}, "IdempotencyKey": {"type": "string", "description": "A Structured Fields string holding 1 to 100 visible ASCII characters, or those characters bare", "minLength": 1, "examples": ["\"8e03978e-40d5-43e8-bc93-6894a57f9324\""]}, "Person": {"type": "object", "required": ["kind", "id", "name", "email", "language", "time_zone", "created_at", "last_seen_at"], "properties": {"kind": {"type": "string", "enum": ["user", "visitor"]}, "id": {"type": "string", "description": "Your ID for them"}, "name": {"type": "string"}, "email": {"type": "string"}, "language": {"type": "string", "description": "A BCP 47 tag, such as de or pt-BR"}, "time_zone": {"type": "string", "description": "An IANA zone, such as Europe/Berlin"}, "created_at": {"type": "integer", "format": "int64"}, "last_seen_at": {"type": "integer", "format": "int64", "description": "When a call last named them, to the minute"}}}, "PersonPut": {"type": "object", "properties": {"name": {"type": ["string", "null"], "maxLength": 120}, "email": {"type": ["string", "null"], "format": "email"}, "language": {"type": ["string", "null"]}, "time_zone": {"type": ["string", "null"]}}}, "MePatch": {"type": "object", "properties": {"time_zone": {"type": "string", "description": "An IANA zone, such as Europe/Berlin; `\"\"` clears it"}}}, "About": {"type": "object", "required": ["on", "call", "about", "answers", "updated_at"], "properties": {"on": {"type": "boolean", "description": "Whether agents use it"}, "call": {"type": "string", "maxLength": 60, "description": "What agents should call them"}, "about": {"type": "string", "maxLength": 1500, "description": "About them"}, "answers": {"type": "string", "maxLength": 1500, "description": "How agents should answer them"}, "updated_at": {"type": "integer", "format": "int64", "description": "When they last wrote it, in Unix milliseconds; 0 until then"}}}, "AboutPut": {"type": "object", "properties": {"on": {"type": "boolean", "default": true}, "call": {"type": "string", "maxLength": 60}, "about": {"type": "string", "maxLength": 1500}, "answers": {"type": "string", "maxLength": 1500}}}, "ChatAppPreviewRequest": {"type": "object", "description": "A preview code from the console's Deliver → Chat app, as its link carries it.", "required": ["code"], "properties": {"code": {"type": "string", "description": "The `preview` parameter of the link the console opened."}}}, "EmbedSessionRequest": {"type": "object", "required": ["agent", "form"], "properties": {"agent": {"$ref": "#/components/schemas/ID"}, "form": {"$ref": "#/components/schemas/EmbedForm"}, "user_token": {"type": "string", "description": "A token from your identity provider or signing key for someone signed in, as the console's Access → Single sign-on page sets it up"}, "details": {"type": "object", "description": "What the page says of a visitor, each kept as the page's words; one that isn't valid is left out, and with a user token all are", "properties": {"name": {"type": "string"}, "email": {"type": "string"}, "language": {"type": "string", "description": "A BCP 47 tag, such as de or pt-BR"}, "time_zone": {"type": "string", "description": "An IANA zone, such as Europe/Berlin"}}}}}, "BoundConnectRequest": {"type": "object", "required": ["binding_hash"], "properties": {"item": {"$ref": "#/components/schemas/ID", "description": "The `chat:connect` interrupt's `id`; left out for a connect from the person's menu"}, "agent": {"$ref": "#/components/schemas/ID", "description": "For a connect from the menu, the agent the chat shows"}, "connector": {"$ref": "#/components/schemas/ID", "description": "For a connect from the menu, one of the connectors `GET /me/connectors` lists"}, "binding_hash": {"type": "string", "minLength": 43, "maxLength": 43, "pattern": "^[A-Za-z0-9_-]{43}$", "description": "The SHA-256 of the binding's text, base64url without padding; the binding itself never leaves the chat's window but to the start page"}, "lang": {"type": "string", "examples": ["zh-CN"], "description": "The chat's language, `en-US` or `zh-CN`, which the window's pages and a connect's refusal\n(`cant_connect`, `service_unavailable`) speak: any Chinese tag is `zh-CN`, and any other\nEnglish\n"}}}, "Connectable": {"type": "object", "required": ["connector_id", "connector"], "properties": {"connector_id": {"$ref": "#/components/schemas/ID"}, "connector": {"type": "string", "description": "The connector's name"}, "state": {"type": "string", "enum": ["connected", "reconnect"], "description": "How the person's account stands; left out when they haven't connected one"}}}, "ConnectLinkRequest": {"type": "object", "required": ["agent"], "properties": {"agent": {"$ref": "#/components/schemas/ID", "description": "The agent the person connects at"}}}, "ConnectLink": {"type": "object", "required": ["url", "expires_at"], "properties": {"url": {"type": "string", "format": "uri", "description": "The link to open for the person, once"}, "expires_at": {"type": "integer", "format": "int64", "description": "When it closes, Unix milliseconds"}}}, "ConnectableList": {"type": "object", "required": ["data"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Connectable"}}}}, "BoundConnect": {"type": "object", "required": ["url"], "properties": {"url": {"type": "string", "format": "uri", "description": "The start page, where the chat opens its window, once, within 10 minutes"}}}, "ConnectFinishRequest": {"type": "object", "required": ["code", "state"], "properties": {"code": {"type": "string", "description": "The provider's answer's `code`"}, "state": {"type": "string", "description": "The provider's answer's `state`"}, "iss": {"type": "string", "description": "The provider's answer's `iss`, when it sent one"}, "binding": {"type": "string", "description": "The binding the window kept, which its page or its chat gave it"}}}, "ConnectFinished": {"type": "object", "required": ["connector"], "properties": {"connector": {"type": "string", "description": "The connector whose account connected"}}}, "EmbedForm": {"type": "string", "enum": ["bubble", "inline", "page"], "description": "The form the embed shows in"}, "EmbedSession": {"type": "object", "required": ["session", "expires_at", "person"], "properties": {"session": {"type": "string", "description": "The session, `es_…`, sent as `Authorization: Bearer es_…`; answered here alone"}, "expires_at": {"type": "integer", "format": "int64", "description": "When it ends; a visitor's moves on as it's used"}, "person": {"$ref": "#/components/schemas/SessionPerson"}}}, "SessionPerson": {"type": "object", "required": ["kind", "id", "name"], "properties": {"kind": {"type": "string", "enum": ["user", "visitor"]}, "id": {"type": "string", "description": "Your ID for a user; for a visitor, the embed's own, `v_…`"}, "name": {"type": "string"}}}, "Me": {"type": "object", "required": ["kind", "id", "name", "language", "time_zone", "pins", "photo"], "properties": {"kind": {"type": "string", "enum": ["user", "visitor"]}, "id": {"type": "string", "description": "Your ID for a user; for a visitor, the embed's own, `v_…`"}, "name": {"type": "string"}, "language": {"type": "string", "description": "A BCP 47 tag, such as de or pt-BR"}, "time_zone": {"type": "string", "description": "An IANA zone, such as Europe/Berlin"}, "told_by": {"type": "string", "enum": ["page"], "description": "`page` when a page's details told them who they are"}, "role": {"type": "string", "enum": ["admin", "user"], "description": "A chat app account's role; an admin sees the admin area. A visitor, a preview and a person your app names have none."}, "pins": {"type": "array", "description": "What a signed-in user pinned, newest first; a visitor's are none", "maxItems": 50, "items": {"$ref": "#/components/schemas/Pin"}}, "photo": {"type": "boolean", "description": "Whether a signed-in user gave a photo, read at `/me/photo`; a visitor's is false"}}}, "SearchHit": {"type": "object", "required": ["conversation", "snippet"], "properties": {"conversation": {"type": "object", "required": ["id", "title", "agent_id", "channel", "last_message_at"], "properties": {"id": {"$ref": "#/components/schemas/ID"}, "title": {"type": "string"}, "agent_id": {"$ref": "#/components/schemas/ID"}, "channel": {"$ref": "#/components/schemas/EventChannel"}, "last_message_at": {"type": "integer", "format": "int64"}}}, "snippet": {"type": "object", "required": ["text", "marks"], "properties": {"text": {"type": "string", "description": "What was said around the words, cropped with `…`; its start when only the title matched"}, "marks": {"type": "array", "description": "Each match's range in `text`, in characters, start inclusive and end exclusive", "items": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "integer", "minimum": 0}}}}}}}, "SearchHitList": {"type": "object", "required": ["data"], "properties": {"data": {"type": "array", "maxItems": 50, "items": {"$ref": "#/components/schemas/SearchHit"}}}}, "Pin": {"type": "object", "required": ["kind", "id", "at"], "properties": {"kind": {"type": "string", "enum": ["agent", "conversation"]}, "id": {"type": "string"}, "at": {"type": "integer", "format": "int64", "description": "When they pinned it, in Unix milliseconds"}}}, "ConversationStart": {"type": "object", "properties": {"form": {"$ref": "#/components/schemas/EmbedForm", "description": "With an embed session, the form the conversation is shown in, the session's when left out; unused with an API key"}}}, "Agent": {"type": "object", "required": ["id", "name", "title", "description", "avatar_url", "starter_prompts", "access", "memory", "abilities", "view"], "properties": {"id": {"$ref": "#/components/schemas/ID"}, "name": {"type": "string"}, "title": {"type": "string", "maxLength": 40, "description": "One line people read beside the name, such as Client onboarding; empty when it has none"}, "description": {"type": "string"}, "avatar_url": {"type": "string"}, "starter_prompts": {"type": "array", "items": {"type": "string"}}, "access": {"type": "string", "enum": ["signed_in", "anyone"], "description": "`signed_in` refuses visitors; `anyone` admits them"}, "memory": {"type": "boolean", "description": "Whether it remembers the signed-in people it talks to, each person's own memory, which they see and change"}, "view": {"type": "string", "enum": ["answers", "progress", "thinking", "everything"], "description": "What people see of its work through the way this call came, `answers` (its answers alone), `progress` (its steps and plan too), `thinking` (the headings of its thoughts too) or `everything` (each call too); `view=` on a stream, history or run asks for less"}, "usable": {"type": "boolean", "description": "Whether the person the call names may use it; absent when it names no one"}, "default": {"type": "boolean", "description": "On a chat app's address, true for the agent its new chats start with; absent on every other agent"}, "abilities": {"type": "object", "description": "What it can do, for the person to read", "required": ["web", "computer", "memory", "interactive", "connectors"], "properties": {"web": {"type": "boolean", "description": "It searches the web and reads its pages"}, "computer": {"type": "boolean", "description": "It has a computer of its own, where it makes files and runs code; every agent reads the files people attach"}, "memory": {"type": "boolean", "description": "It remembers the signed-in people it talks to"}, "interactive": {"type": "boolean", "description": "It can show choices, cards with buttons or a small form beside its reply, for the person to pick from or act on, where the person's app can draw one"}, "connectors": {"type": "array", "description": "The tools it uses, by name", "items": {"type": "object", "required": ["name"], "properties": {"name": {"type": "string"}}}}}}}}, "WaitingMessage": {"type": "object", "description": "A message of the person's that the conversation hasn't taken yet", "required": ["client_message_id", "text", "mode", "at"], "properties": {"client_message_id": {"type": "string", "description": "Its ID, the one the message was sent with"}, "text": {"type": "string"}, "mode": {"type": "string", "enum": ["steer", "queue"], "description": "`steer` while it waits to steer the turn under way, read at its next step; `queue` while it waits for the turn after"}, "held": {"type": "boolean", "description": "Held by a stop, it starts only when sent"}, "files": {"type": "array", "description": "The conversation's files it carries, by their IDs", "items": {"$ref": "#/components/schemas/ID"}}, "at": {"type": "integer", "format": "int64"}}}, "Conversation": {"type": "object", "required": ["id", "agent_id", "title", "channel", "created_at", "last_message_at", "turns", "state"], "properties": {"id": {"$ref": "#/components/schemas/ID"}, "agent_id": {"$ref": "#/components/schemas/ID"}, "title": {"type": "string", "description": "Empty until the agent names it after its first turn, or the person renames it"}, "channel": {"$ref": "#/components/schemas/EventChannel"}, "created_at": {"type": "integer", "format": "int64"}, "last_message_at": {"type": "integer", "format": "int64"}, "turns": {"type": "integer", "description": "How many turns it has taken"}, "state": {"type": "string", "enum": ["idle", "working", "waiting"], "description": "`working` while a turn is under way, `waiting` while the agent waits on the person, else `idle`"}, "waiting": {"type": "array", "description": "The person's messages still waiting, oldest first, on a conversation read alone or after a\nchange to it; absent from lists.\n", "items": {"$ref": "#/components/schemas/WaitingMessage"}}, "interrupts": {"type": "array", "description": "What its turn and its tasks still running wait on the person for, on a conversation read\nalone or after a resume, a pause or a continue; absent from lists, where `state` says\n`waiting` for a turn's.\n", "items": {"$ref": "#/components/schemas/Interrupt"}}, "memory_asks": {"type": "array", "description": "The changes to memory waiting for the person's word, oldest first, on a conversation read alone;\nabsent from lists. Answer each with `POST /conversations/{id}/memory-asks/{ask}`.\n", "items": {"$ref": "#/components/schemas/MemoryAsk"}}}}, "MemoryAgent": {"type": "object", "description": "What one agent keeps of a person", "required": ["agent_id", "agent_name", "remembers", "off", "memories", "asks"], "properties": {"agent_id": {"$ref": "#/components/schemas/ID"}, "agent_name": {"type": ["string", "null"], "description": "The agent's name; null once it's deleted, when what it kept goes within a day"}, "remembers": {"type": "boolean", "description": "Whether the agent remembers people now; when its team turned memory off, what it kept stays to delete"}, "off": {"type": "boolean", "description": "The person turned the agent's memory of them off"}, "memories": {"type": "integer", "description": "How many memories it keeps of them"}, "asks": {"type": "integer", "description": "How many of its changes to memory wait for their word"}}}, "MemoryAgentList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/MemoryAgent"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"]}}}, "Memory": {"type": "object", "description": "One thing an agent remembers of a person, in its words", "required": ["id", "agent_id", "text", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/ID"}, "agent_id": {"$ref": "#/components/schemas/ID"}, "text": {"type": "string", "maxLength": 2000, "description": "Its words, its first line saying what it's about"}, "created_at": {"type": "integer", "format": "int64"}, "updated_at": {"type": "integer", "format": "int64"}}}, "MemoryList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Memory"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"]}}}, "MemoryAsk": {"type": "object", "description": "A change to memory waiting for the person's word, or answered", "required": ["id", "change", "words", "why", "state", "created_at", "expires_at"], "properties": {"id": {"$ref": "#/components/schemas/ID"}, "change": {"type": "string", "enum": ["save", "update", "rename", "forget", "forget_all"], "description": "Remember something new, change a memory, rename one, forget one, or forget everything"}, "words": {"type": "string", "description": "The words to save, or the memory's words as they stand for a rename or a forget; empty for forget_all"}, "new_name": {"type": "string", "description": "A rename's new name"}, "why": {"type": "string", "enum": ["tool", "web", "command", "file", "page", "earlier", "conversation"], "description": "What the conversation read from outside it, which makes changes wait for the person: a tool's result,\nthe web, a command's output, a file, the page, a conversation from before memory counted it, or an\nearlier conversation of theirs with the agent\n"}, "state": {"type": "string", "enum": ["waiting", "saved", "declined"]}, "created_at": {"type": "integer", "format": "int64"}, "answered_at": {"type": "integer", "format": "int64"}, "expires_at": {"type": "integer", "format": "int64", "description": "When it goes, unanswered"}}}, "MemoryAskList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/MemoryAsk"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"]}}}, "MemorySwitch": {"type": "object", "required": ["off"], "properties": {"off": {"type": "boolean"}}}, "MemoryAnswer": {"type": "object", "required": ["save"], "properties": {"save": {"type": "boolean", "description": "Save makes the change; false drops it"}}}, "RunAgentInput": {"type": "object", "description": "AG-UI 1.0's run request; what else it carries is taken and left", "required": ["threadId", "runId", "messages"], "properties": {"threadId": {"type": "string", "minLength": 1, "maxLength": 100, "pattern": "^[!-~]+$", "description": "The conversation, by its ID or a thread ID of your own"}, "runId": {"type": "string", "minLength": 1, "maxLength": 100, "pattern": "^[!-~]+$", "description": "This run's own ID, and its key"}, "messages": {"type": "array", "description": "The conversation as the client holds it; the person's new message last", "items": {"type": "object", "required": ["id", "role"], "properties": {"id": {"type": "string", "maxLength": 100}, "role": {"type": "string"}, "content": {"description": "The words, or parts of type `text`"}}}}, "forwardedProps": {"type": ["object", "null"], "description": "What the client forwards; the run reads these members, and takes and leaves the rest", "properties": {"a2uiClientCapabilities": {"$ref": "#/components/schemas/A2UIClientCapabilities"}, "a2uiAction": {"$ref": "#/components/schemas/A2UIAction"}, "userAction": {"$ref": "#/components/schemas/A2UIAction"}, "app": {"$ref": "#/components/schemas/AppMark"}, "__proxiedMCPRequest": {"$ref": "#/components/schemas/AppRequest"}}}, "resume": {"type": "array", "description": "Answers to what the turn, or an app's call, waits on", "items": {"type": "object", "required": ["interruptId", "status"], "properties": {"interruptId": {"type": "string"}, "status": {"type": "string", "enum": ["resolved", "cancelled"]}, "payload": {"description": "For `resolved`, the answer its interrupt's `responseSchema` describes"}}}}}, "additionalProperties": true}, "AppMark": {"type": "object", "description": "The app in the person's chat that sent the message for them", "required": ["activity"], "properties": {"activity": {"type": "string", "description": "Its `mcp-apps` activity's ID, `app-` and 24 hexadecimal digits"}}}, "AppRequest": {"type": "object", "description": "What a connector's app asks its host for its server, as CopilotKit's renderer forwards it", "required": ["method"], "properties": {"serverId": {"type": "string", "description": "The activity's `serverId`; this or `serverHash` names the connector"}, "serverHash": {"type": "string", "description": "The activity's `serverHash`"}, "method": {"type": "string", "enum": ["tools/call", "resources/read", "notifications/message", "ping"]}, "params": {"description": "MCP's params: `{uri}` for a read, `{name, arguments}` for a call, the log line for a message"}, "activity": {"type": "string", "description": "The activity a call belongs to; the newest of its connector when absent"}}}, "AppContextRequest": {"type": "object", "description": "What an app tells the model it shows (MCP Apps' `ui/update-model-context`); neither member clears it", "properties": {"content": {"type": "array", "description": "MCP's content blocks, of type `text` alone", "items": {"type": "object", "required": ["type", "text"], "properties": {"type": {"type": "string", "enum": ["text"]}, "text": {"type": "string"}}}}, "structuredContent": {"type": "object", "description": "What it shows as data, read as JSON after the text"}}}, "ResumeRequest": {"type": "object", "required": ["resume"], "properties": {"resume": {"type": "array", "minItems": 1, "items": {"type": "object", "required": ["interruptId", "status"], "properties": {"interruptId": {"type": "string", "description": "The interrupt's `id`"}, "status": {"type": "string", "enum": ["resolved", "cancelled"]}, "payload": {"description": "For `resolved`, the answer its interrupt's `responseSchema` describes"}}}}, "context": {"$ref": "#/components/schemas/PageContext"}}}, "Rename": {"type": "object", "required": ["title"], "properties": {"title": {"type": "string", "minLength": 1, "maxLength": 200}}}, "SendMessage": {"type": "object", "description": "Some text, files, or both", "properties": {"text": {"type": "string", "maxLength": 32000}, "files": {"type": "array", "description": "The conversation's files the person attached, by their IDs, in the order they go, read or still being read; each goes with one message", "items": {"$ref": "#/components/schemas/ID"}}, "mode": {"type": "string", "enum": ["auto", "queue", "interrupt"], "default": "auto"}, "client_message_id": {"type": "string", "maxLength": 100, "description": "Your ID for the message, which the conversation shows it by; the Idempotency-Key when left out"}, "context": {"$ref": "#/components/schemas/PageContext"}, "a2uiClientCapabilities": {"$ref": "#/components/schemas/A2UIClientCapabilities"}, "a2uiAction": {"$ref": "#/components/schemas/A2UIAction"}, "app": {"$ref": "#/components/schemas/AppMark"}}}, "A2UIClientCapabilities": {"type": ["object", "null"], "description": "What the person's app draws, as A2UI's renderer says it: its catalogs by version, 2 KB at most. An app that\nlists A2UI 1.0's basic catalog, `https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json`, under `1.0`\ndraws the small forms and choices an agent with interactive answers may show; one that lists another catalog or\nversion, or none, doesn't. Sent, it stays the conversation's until a message says otherwise; leaving it out, or\n`null`, leaves it as it was. A conversation whose app never said draws nothing. Another shape is\n`invalid_request`.\n", "additionalProperties": {"type": "object", "properties": {"supportedCatalogIds": {"type": "array", "items": {"type": "string"}}}}, "examples": [{"1.0": {"supportedCatalogIds": ["https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"]}}]}, "A2UIAction": {"type": ["object", "null"], "description": "A button the person pressed in a surface the agent showed, as A2UI's renderer sends it. The message's words are\nits `text`, or when it has none the button's `userMessage`: a message from a button always has words\n(`invalid_action` without). The agent reads the button and its `context` beside the words, as data from the\nperson's app and never as instructions; the person sees their words, and their message names the surface and the\nbutton's name (`metadata.chat.action`). A surface the conversation never showed, or closed since, is\n`invalid_action`, as are a `sourceComponentId` that isn't one of its Buttons, a `name` other than the event\nthat Button sends, and a member of another shape; a `context` past 8 KB as sent, or past 16 KB as the agent\nreads it with its angle brackets escaped, is `context_too_large`.\n", "required": ["name", "surfaceId", "sourceComponentId"], "properties": {"name": {"type": "string", "minLength": 1, "maxLength": 128, "description": "The button's event name, as the agent wrote it"}, "surfaceId": {"type": "string", "minLength": 1, "maxLength": 128, "description": "The surface it was pressed in, one the conversation holds open"}, "sourceComponentId": {"type": "string", "minLength": 1, "maxLength": 128, "description": "The component pressed"}, "context": {"type": ["object", "null"], "description": "What the button sends with it, as the surface resolved it: 8 KB at most as sent, and 16 KB at most as the\nagent reads it, its angle brackets escaped. Kept compacted and otherwise as sent, duplicate keys and all.\n"}, "userMessage": {"type": ["string", "null"], "maxLength": 32000, "description": "The words the person said by pressing it, held to a message's rules; null, or blank, is none"}, "timestamp": {"description": "When it was pressed, as the renderer says; the message's time is the server's"}}}, "PageContext": {"type": ["object", "null"], "description": "What the page says the person is looking at, for the agent to read as the page's words: a JSON object of\n8 KB at most, as sent and as kept with its angle brackets escaped, its members strings, numbers, booleans or\nobjects of them, two levels at most, a null member left out. Sent through an embed session, the agent weighs\nit as no surer than what the person types, since it comes from their browser. Sent, it stays the conversation's page until another replaces it; `null` clears it, and leaving it\nout leaves it as it was. The agent resolves \"this order\" from it and confirms before acting on it; the person\nnever sees it.\n", "additionalProperties": {"anyOf": [{"type": ["string", "number", "boolean", "null"]}, {"type": "object", "additionalProperties": {"type": ["string", "number", "boolean", "null"]}}]}, "examples": [{"page": "Orders", "order": "SO-1042", "status": "awaiting payment"}]}, "MessageResult": {"type": "object", "required": ["status"], "properties": {"status": {"type": "string", "enum": ["started", "steering", "queued"], "description": "`started` a turn; `steering` the turn under way, which reads it next; `queued` for the turn after"}, "run_id": {"$ref": "#/components/schemas/RunID"}}}, "RunID": {"description": "The turn the message is in, once there is one; a queued message has none until its turn starts", "type": "string", "pattern": "^[0-9a-f]{24}$"}, "StoppedTurn": {"type": "object", "required": ["run_id"], "properties": {"run_id": {"type": "string", "pattern": "^[0-9a-f]{24}$", "description": "The turn the stop ended"}}}, "AgentList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Agent"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"], "description": "The cursor for the next slice; null on the last"}}}, "ConversationList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Conversation"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"], "description": "The cursor for the next slice; null on the last"}}}, "DownloadLink": {"type": "object", "description": "A link a browser saves one file from by itself, with no credential, until it expires", "required": ["url", "expires_at"], "properties": {"url": {"type": "string", "format": "uri-reference", "description": "The link, `GET /downloads/{tenant}/{secret}`: the API's address, or a path on your chat app's own"}, "expires_at": {"type": "integer", "format": "int64", "description": "When it stops opening, in Unix milliseconds; a download it started goes on"}}}, "File": {"type": "object", "description": "A file of a conversation, the person's or the agent's", "required": ["id", "name", "kind", "content_type", "size", "by", "state", "sent", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/ID"}, "name": {"type": "string", "description": "Its name, which holds the folders the agent put it in, such as `reports/q3.md`; a file the person attaches is at the top. It downloads under the part after the last `/`"}, "kind": {"type": "string", "enum": ["picture", "document", "text", "archive", "recording", "other"], "description": "An archive, a recording or another kind is kept as it is; the agent opens it when it works on it"}, "content_type": {"type": "string"}, "size": {"type": "integer", "format": "int64", "description": "Its size in bytes"}, "by": {"type": "string", "enum": ["person", "agent"], "description": "`person` for a file the person attached, `agent` for one the agent gave them"}, "state": {"type": "string", "enum": ["reading", "ready", "failed"], "description": "`reading` while it's read, `ready` once read, or `failed`; a message may carry it in any of them"}, "failure": {"type": "string", "description": "Why it failed, in words to show the person"}, "pages": {"type": "integer", "description": "A document's pages"}, "width": {"type": "integer", "description": "A picture's width, upright"}, "height": {"type": "integer", "description": "A picture's height, upright"}, "sent": {"type": "boolean", "description": "Whether it went with a message"}, "created_at": {"type": "integer", "format": "int64"}, "updated_at": {"type": "integer", "format": "int64"}}}, "FileList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/File"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"], "description": "The cursor for the next slice; null on the last"}}}, "KeptFile": {"type": "object", "description": "A file the agent kept for a user across their conversations", "required": ["id", "name", "kind", "content_type", "size", "by", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/ID"}, "name": {"type": "string", "description": "Its name, which holds the folders the agent put it in, such as `reports/q3.md`. It downloads under the part after the last `/`"}, "kind": {"type": "string", "enum": ["picture", "document", "text", "archive", "recording", "other"]}, "content_type": {"type": "string"}, "size": {"type": "integer", "format": "int64"}, "by": {"type": "string", "enum": ["person", "agent"], "description": "`person` for a file they attached, `agent` for one the agent made or gave: written, saved on its computer, or returned by a connector's tool as a picture, a sound or a file"}, "pages": {"type": "integer"}, "width": {"type": "integer"}, "height": {"type": "integer"}, "created_at": {"type": "integer", "format": "int64"}, "updated_at": {"type": "integer", "format": "int64"}}}, "KeptFileList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/KeptFile"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"], "description": "The cursor for the next slice; null on the last"}}}, "Home": {"type": "object", "description": "A user's home in an agent's sandboxes", "required": ["agent_id", "size", "full", "created_at", "updated_at"], "properties": {"agent_id": {"$ref": "#/components/schemas/ID"}, "size": {"type": "integer", "format": "int64", "description": "Its size in bytes when it was last kept"}, "full": {"type": "boolean", "description": "Its last save found it past its size limit, so nothing new was kept until it's smaller"}, "created_at": {"type": "integer", "format": "int64"}, "updated_at": {"type": "integer", "format": "int64", "description": "When it was last kept"}}}, "ConnectionChange": {"type": "object", "properties": {"asks_first": {"type": "boolean", "description": "Whether its actions that change something ask the person first"}, "always_allowed_remove": {"type": "array", "items": {"type": "string"}, "description": "Actions to take back from those it takes without asking, as `always_allowed` words them"}}}, "Connection": {"type": "object", "description": "An account a user connected for agents' tools to use as them", "required": ["connector_id", "connector", "status", "connected_at", "asks_first", "always_allowed"], "properties": {"connector_id": {"$ref": "#/components/schemas/ID"}, "connector": {"type": "string", "description": "The connector's name"}, "status": {"type": "string", "enum": ["connected", "reconnect"], "description": "Whether it works, or needs signing in again (its next call asks with `chat:connect`)"}, "account": {"type": "string", "description": "The account's name, when the provider gave one"}, "connected_at": {"type": "integer", "format": "int64"}, "used_at": {"type": "integer", "format": "int64", "description": "When a call last went out on it"}, "asks_first": {"type": "boolean", "description": "Whether its calls that change something ask the person first"}, "always_allowed": {"type": "array", "items": {"type": "string"}, "description": "The actions it takes without asking, in words"}, "renews": {"type": "boolean", "description": "Whether it renews by itself; when false, the person signs in again once its access ends, about an hour at some providers"}}}, "ConnectionList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Connection"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"]}}}, "HomeList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Home"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"]}}}, "Process": {"type": "object", "description": "A job the agent left running in the background", "required": ["number", "state", "started_at"], "properties": {"number": {"type": "integer", "description": "Its number in the conversation"}, "state": {"type": "string", "enum": ["running", "stopping", "ended", "stopped", "failed"], "description": "`running`, `stopping` once asked to stop, or once it ended: `ended` by itself, `stopped`, or `failed`"}, "started_at": {"type": "integer", "format": "int64"}, "ended_at": {"type": "integer", "format": "int64"}}}, "Task": {"type": "object", "description": "An action the agent started that runs on after its turn, named in words", "required": ["id", "title", "status", "running", "started_at"], "properties": {"id": {"$ref": "#/components/schemas/ID"}, "title": {"type": "string", "description": "The action and the system it runs on, such as \"Make a report on Reports\", in the request's language (`Accept-Language`); \"A task\" when that system is gone, and for every task where the agent shows `answers` to the way you came"}, "status": {"type": "string", "enum": ["working", "input_required", "completed", "failed", "cancelled", "lapsed"], "description": "`working`, or `input_required` while it waits on the person; once ended, `completed`, `failed`, `cancelled`, or `lapsed` when it ran past its time or its system lost it"}, "running": {"type": "boolean"}, "started_at": {"type": "integer", "format": "int64"}, "ended_at": {"type": "integer", "format": "int64"}}}, "TaskList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Task"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"]}}}, "ProcessList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Process"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"]}}}, "Turn": {"type": "object", "description": "One turn of the agent's, from the message that started it to its last words", "required": ["id", "conversation_id", "state", "created_at"], "properties": {"id": {"$ref": "#/components/schemas/ID"}, "conversation_id": {"$ref": "#/components/schemas/ID"}, "state": {"type": "string", "enum": ["queued", "working", "waiting", "ended"], "description": "`queued` behind the turn before, `working`, `waiting` on the person, or `ended`"}, "outcome": {"type": "string", "enum": ["answered", "quiet", "stopped", "limit", "failed", "expired"], "description": "What became of it, once it ended: `answered`; `quiet`, a background job's end the agent had nothing new\nto tell of, so it wrote nothing; `stopped` by the person or a new message; `limit`, stopped at one of the\nagent's limits, its last words saying so; `failed`, to try again; `expired`, a question to the person left\nunanswered\n"}, "words": {"type": "string", "description": "The outcome in words to show the person, for every outcome but `answered` and `quiet`"}, "version": {"type": "integer", "description": "The agent's version the turn ran"}, "created_at": {"type": "integer", "format": "int64"}, "started_at": {"type": "integer", "format": "int64"}, "finished_at": {"type": "integer", "format": "int64"}, "usage": {"$ref": "#/components/schemas/TurnUsage"}}}, "TurnUsage": {"type": "object", "description": "What the turn used, for your own billing and monitoring; it comes only with an API key, never to an embed session or the person", "required": ["input_tokens", "cached_tokens", "output_tokens", "reasoning_tokens", "cost"], "properties": {"input_tokens": {"type": "integer", "format": "int64"}, "cached_tokens": {"type": "integer", "format": "int64", "description": "The input tokens read from the model's cache"}, "output_tokens": {"type": "integer", "format": "int64"}, "reasoning_tokens": {"type": "integer", "format": "int64"}, "cost": {"type": "string", "description": "The turn's cost as a decimal, in `currency`, such as `\"0.001234567\"`", "examples": ["0.001234567"]}, "currency": {"type": "string", "description": "An ISO 4217 code, such as `USD`"}}}, "TurnList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Turn"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"], "description": "The cursor for the next slice; null on the last"}}}, "MessageList": {"type": "object", "required": ["data", "has_more", "next_cursor"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Message"}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"], "description": "The cursor of the page before; null on the oldest"}}}, "Message": {"type": "object", "description": "A message of the conversation as AG-UI 1.0 has it: the person's (`user`), the agent's\n(`assistant`), or an `activity`: `steps`, what the agent did in one stretch of a turn,\n`{state, steps: [{kind, title, group, state, name, connector, tool, ms, headings, call, cut}], messages:\n[{id, after}]}`, where a step's `title` is in the request's language and reads its finished\nform once the step is done (\"Read q3.pdf\"), and its `group`, its words while it runs, is the\nsame for steps a client may show as one line and doesn't change with its state: neither is\nan identity; a step that used a connector's tool names both in `connector` and `tool`, for a\nclient of your own to use (the chat app and the embed draw neither); a step of kind\n`thought` is the agent thinking, with how long it\ntook in `ms` once it's whole and, when its agent shows its thinking, the parts its model\nnamed in `headings`, never its words; and `messages` places each of the stretch's\nmessages, the person's and the agent's, among its steps, after how many, so a client can\nshow what the agent said along the way inside its work and split the work where the person\nsteered it; `plan`, its checklist, `{tasks: [{text, done}]}`; `file`, a file it gave,\n`{file_id, name, kind, size}`; or `memory`, a change to what it remembers of the person,\n`{change, words, memory_id, ask_id}`: `change` is `save`, `update`, `rename`, `forget` or\n`forget_all`, `words` the memory's words after it or, for a forget, before; `memory_id`\nthe memory it left, to forget with `DELETE /users/{id}/memories/{memory}`; and `ask_id`,\nwhen the change waits for the person's word, the change to answer with\n`POST /conversations/{id}/memory-asks/{ask}`; or `a2ui-surface`, a surface the agent shows\nthe person beside its words, at every level, `{a2ui_operations: [...]}`, A2UI v1.0's\nmessages over its basic catalog for a client that draws it itself: in a copy, one\n`createSurface` holding the surface whole as it stands now. Its `id` is `ui-`, the turn\nthat first showed it, `-` and the surface's own `surfaceId`: one activity for the surface's\nwhole life, where that turn put it, however many later turns change it. Draw it there, among\nthe turn's messages in their order: the agent shows, then writes, so the words that follow a\nsurface are written as standing under it, and those before it as above. A surface the agent\nclosed isn't in a copy. A picture or a recording it shows is a file of the conversation,\nits address `file:` and the file's ID, read through the conversation's own file routes. Or\n`mcp-apps`, an app a connector's tool showed, at every level, its `id` `app-` and 24 hex\ndigits, `{resourceUri, serverId, serverHash, toolInput, result, frame: {policy, border,\nfrom}}` as the stream's event describes it.\n\nAt the level `everything`, the agent's message also lists the calls it made in `toolCalls`,\nand each call's result is a `tool` message, `{id, toolCallId, content}`, whose\n`metadata.chat` says how the call ended; a step of its `steps` activity names its call in\n`call` and, when what the call was sent was cut, its full length in `cut`, whether or not\na result ever comes. A call shows what the person may read of what it was sent and what came\nback, each cut at 20,000 characters: never the platform's words to the agent, its\ndescriptions of its tools or a skill's text, and every internal address in the person's\nterms. A call's ID, `call-` and 16 hex digits, and its result's message's, `t-` and 16, are\nthis stream's own names for them, the same live, in the history and on a reconnect: never\nthe model's own ID. Four more activities come at `everything` alone: `summary`, a summary\nthe conversation kept where it did, `{summary, ms}`, its text and, when it was timed, how\nlong it took (`ms` is optional), never its tokens; `pins` and `notes`, the agent's own,\n`{text}`, as they stand now, where each was first written; and, in a copy the stream sends\nwhile a command runs, `output`, `{state: \"running\", chunks, cut}`, the command's output so\nfar as one chunk. The history never holds an `output`: a command's result holds its output.\n", "required": ["id", "role"], "properties": {"id": {"type": "string"}, "role": {"type": "string", "enum": ["user", "assistant", "activity", "tool"]}, "content": {"description": "The words, an activity's content, or a call's result as JSON text, empty when none of it shows", "type": ["string", "object"]}, "toolCalls": {"type": "array", "description": "At the level `everything`, the calls the agent's message made", "items": {"$ref": "#/components/schemas/ToolCall"}}, "toolCallId": {"type": "string", "description": "The call a `tool` message is the result of"}, "activityType": {"type": "string", "enum": ["steps", "plan", "file", "memory", "output", "summary", "pins", "notes", "a2ui-surface", "mcp-apps"]}, "metadata": {"type": "object", "properties": {"chat": {"$ref": "#/components/schemas/MessageChat"}}}}}, "ToolCall": {"type": "object", "description": "A call the agent made, at the level `everything`", "required": ["id", "type", "function"], "properties": {"id": {"type": "string"}, "type": {"type": "string", "const": "function"}, "function": {"type": "object", "required": ["name", "arguments"], "properties": {"name": {"type": "string", "description": "A connector's tool by its own name, such as `shop.lookup_order`; any other by its step's words\nwhile it runs, in the request's language, such as \"Reading q3.pdf\"\n"}, "arguments": {"type": "string", "description": "What the call was sent, as JSON text, `{}` when none of it shows"}}}}}, "MessageChat": {"type": "object", "description": "What the API adds to a message", "properties": {"client_message_id": {"type": "string", "description": "The ID the person's message was sent with"}, "files": {"type": "array", "description": "The files the person's message carries", "items": {"$ref": "#/components/schemas/MessageFile"}}, "action": {"type": "object", "description": "On the person's message from a button they pressed in a surface the agent showed, at every level: the\nsurface and the button's event name. What else the button sent is the agent's to read, never shown.\n", "required": ["surfaceId", "name"], "properties": {"surfaceId": {"type": "string"}, "name": {"type": "string"}}}, "steered": {"type": "boolean", "description": "On the person's message, at every level: true once the turn under way read it while it worked. A message\nthat began its turn, or one a Stop held that the turn never read, has none.\n"}, "citations": {"type": "array", "description": "What the agent's message cites, by the numbers it writes. Through an embed session whose agent's embed has\nSources off, each citation is its `n` alone, so the answer's markers still match; your chat app and your\nAPI keys get them whole. Only citations are withheld: the steps follow the level the embed shows.\n", "items": {"$ref": "#/components/schemas/Citation"}}, "state": {"type": "string", "enum": ["done", "failed", "not_done", "unknown", "running", "stopped"], "description": "On a call's result, at the level `everything`: how the call ended. `not_done` is a call the agent couldn't\nmake as it asked, `unknown` one whose outcome nobody knows, `running` one still going, such as a command\nrun as a background job, and `stopped` a command that was stopped. A command that exited is `done`,\nwhatever its `exit`.\n"}, "ms": {"type": "integer", "description": "On a call's result, how long the call ran, in milliseconds, when it was timed"}, "exit": {"type": "integer", "description": "On a command's result, the code it exited with"}, "job": {"type": "integer", "description": "On a command's result, the background job it runs as"}, "cut": {"type": "object", "description": "On a call's result, when what it shows was cut, the full length in characters of what it was sent, what came back, or both", "properties": {"args": {"type": "integer"}, "result": {"type": "integer"}}}}}, "EventChat": {"description": "What the API adds to a stream's event", "allOf": [{"$ref": "#/components/schemas/MessageChat"}, {"type": "object", "properties": {"outcome": {"type": "string", "enum": ["answered", "quiet", "stopped", "limit", "failed", "expired"], "description": "On the end of a run that ended its turn, `RUN_FINISHED` or `RUN_ERROR`, how the turn ended: its\n`outcome` as `GET /turns/{id}` gives it. A run that waits for the person has none. It may be absent\nfrom an end the stream couldn't follow (a run that ended while the stream was away, told again\nwithout its end): read AG-UI's own outcome then.\n"}, "quiet": {"type": "boolean", "description": "True on a `quiet` turn's `RUN_FINISHED`, which wrote nothing"}, "waiting": {"type": "boolean", "description": "True on a `RUN_FINISHED` that ended no turn: the turn waits on nothing the person can answer here,\nand its end comes later, as a run of its own. It carries no `outcome`.\n"}}}]}, "MessageFile": {"type": "object", "required": ["name", "kind"], "properties": {"file_id": {"type": "string"}, "name": {"type": "string"}, "kind": {"type": "string", "enum": ["picture", "document", "text", "archive", "recording", "other"]}}}, "Citation": {"type": "object", "required": ["n"], "properties": {"n": {"type": "integer", "description": "The number the agent's words cite it by"}, "title": {"type": "string", "description": "The section, the Q&A entry's question, or the page's title"}, "source": {"type": "string", "description": "The document's name"}, "location": {"type": "string", "description": "Where in the document, such as \"page 12\" or a section's path"}, "url": {"type": "string", "format": "uri", "description": "A web page's address"}}}, "WorkingLine": {"type": "object", "description": "The `value` of `CUSTOM` `chat:working`: the one line the level `answers` shows of the work\nunder way, in place of the steps the other levels show.\n", "required": ["kind", "title"], "properties": {"kind": {"$ref": "#/components/schemas/WorkingKind"}, "title": {"type": "string", "description": "The kind of work in plain words, to show as it is, such as \"Searching\" or \"Reading\"; never a file's, a connector's or a tool's name"}}}, "WorkingKind": {"type": "string", "description": "The kind of work under way: searching knowledge (`search`), reading a document (`read`),\nsearching the web (`web`), using a connector (`tool`), writing a file (`write`), thinking\n(`thought`), or any other work (`work`).\n", "enum": ["search", "read", "web", "tool", "write", "thought", "work"]}, "StreamEvent": {"type": "object", "description": "One AG-UI 1.0 event: `RUN_STARTED` (`threadId`, `runId`, `protocolVersion`),\n`RUN_FINISHED` (`threadId`, `runId`, `outcome`, `metadata.chat.outcome` when it ended the turn,\nand `metadata.chat.quiet` when the turn wrote nothing), `RUN_ERROR` (`message`, the words for the\nperson; `code`, for a client of your own to branch on, which the chat app and the embed never show;\n`metadata.chat.outcome`),\n`TEXT_MESSAGE_START` (`messageId`, `role`, the person's `metadata.chat`),\n`TEXT_MESSAGE_CONTENT` (`messageId`, `delta`), `TEXT_MESSAGE_END` (`messageId`),\n`ACTIVITY_SNAPSHOT` (`messageId`, `activityType`, `content`, `replace`), `MESSAGES_SNAPSHOT`\n(`messages`), or `CUSTOM`: `chat:citations` (`value: {message_id, citations}`);\n`chat:working` (`value: {kind, title}`, a `WorkingLine`), sent at the level `answers` alone,\nwhere no steps come: the work under way as one line, the current words only, told again\nwhen they change and in no snapshot and no history page; or `chat:reading`\n(`value: {files}`), the names of the person's files the turn waits to read, then `[]` once\nit has, at every level. The person's message the turn under way read while it worked says so\nin its `TEXT_MESSAGE_START`'s `metadata.chat.steered`, at every level. A\nthought is a step of its stretch's `steps` activity alone, its\nwords never sent: no reasoning event comes.\n\nAt the level `everything` alone, each call too: `TOOL_CALL_START` (`toolCallId`,\n`toolCallName`, `parentMessageId`, the agent's message that made it), `TOOL_CALL_ARGS`\n(`toolCallId`, `delta`: what it was sent as JSON text, in one delta) and `TOOL_CALL_END`\n(`toolCallId`) together as the agent makes it, then `TOOL_CALL_RESULT` (`messageId`,\n`toolCallId`, `content`: what came back as JSON text, empty when none of it shows, `role`\n`tool`, and `metadata.chat` with how it ended: `state`, `ms`, a command's `exit` and `job`,\nand `cut` when either was cut) once it's done. `toolCallName` is a connector's tool's own\nname, or for any other its step's words in the request's language, as a `ToolCall` names it.\n`toolCallId` is the stream's own name for the call, the one its step's `call` and the\nhistory give it, never the model's own ID.\nA command's output as it runs is the activity `output`, `{state: \"running\", chunks, cut}`,\nits `messageId` `o-` and its call's `toolCallId`: when the person first gets it, `chunks`\nholds the output so far as one chunk; after that, `ACTIVITY_DELTA` (`messageId`,\n`activityType`, `patch`) adds each new piece to the end of `chunks` (`add /chunks/-`), so\nnothing is sent twice, and adds `/cut` once it reaches the 65,536 characters that stream; a\nchunk `…` stands where some never came. The output is `chunks` joined. When the call's\nresult comes, or the run ends without one (a Stop, a failure), one last\n`{state: \"done\"}`, with no chunks: the result, when it comes, holds the output. A client may\ndrop an output once it says `done`, as a person joining and the history never hold one. A\nkept summary is the activity `summary`, `{summary, ms}`, `ms` when it was timed, and the\nagent's pins and notes the activities `pins` and `notes`, `{text}`, each sent whole again\nas it changes.\n\nAt every level, a surface the agent shows the person beside its words, choices, cards with\nbuttons or a small form, for a client that draws it itself: the activity `a2ui-surface`,\nits `messageId` `ui-`, the turn that first showed it, `-` and the surface's own\n`surfaceId`, its content `{a2ui_operations: [...]}`, A2UI v1.0's messages over its basic\ncatalog, which a client feeds its A2UI renderer in order. Shown, it is an\n`ACTIVITY_SNAPSHOT` holding one `createSurface` with the surface whole. A change, in that\nturn or a later one, is an `ACTIVITY_DELTA` on the same activity whose patch appends each\nof the change's own messages (`updateComponents`, `updateDataModel`) to\n`a2ui_operations` (`add /a2ui_operations/-`), so what the person typed stays wherever the\nchange doesn't write; a close is one appending A2UI's `deleteSurface`. A surface shown again\nafter its close in the same turn is a snapshot of the same activity, replacing it whole;\nin a later turn, a new activity. A join's catch-up (`MESSAGES_SNAPSHOT`) and the history\nhold each open surface once, whole as it stands, where the turn that first showed it put\nit, and no closed one; what changes after a join comes as deltas on that copy. A picture or\na recording a surface shows is a file of the conversation, its address `file:` and the\nfile's ID, read through the conversation's own file routes. A surface's messages come as\nthe checker stamped them: media as `file:<id>`, the same at every level; no address of the\nagent's own is in one.\n\nAt every level, an app a connector's tool showed when the agent called it (an MCP App, on a\nconnector your team set to show its apps): the activity `mcp-apps`, one\n`ACTIVITY_SNAPSHOT` for each call, where its call's result is, live, in a join's catch-up\nand in the history alike. Its `messageId` is `app-` and 24 hex digits, the same everywhere,\nwhich names the app when it asks for a call of its own. Its content is MCP Apps' as\nCopilotKit's renderer reads it: `resourceUri`, the app's `ui://` address; `serverId`, the\nconnector's ID, as `/me/connections/{connector}` takes it; `serverHash`, the SHA-256 of\nthe tenant's ID, `/` and the connector's ID, in lowercase hex, the same for the connector in\nevery conversation; `toolInput`, the call's arguments, `{}` for none; `result`, the tool's\n`CallToolResult` as its server gave it; both exactly as they were kept, numbers and the\norder of keys as written, but where a string or key in one holds an address of the agent's\nown: that one comes with each such address in your terms, as the agent's other calls show\nit, its keys in order of their names and its numbers as written, a key written twice keeping\nits last value. Where a key read so would read like another key of its object, no activity\ncomes for that call, since the app would take one key's value for the other's. And `frame`,\nwhat a client that runs the app itself needs:\n`policy`, the sources the app's document declared, `{connect, resource, frame, base}`, each\na list of `https://host` (or `wss://host` in `connect`) sources, every list there, empty for\nnone, and `frame` always empty: an app frames nothing, whatever its document declares, so\nits own code can't open other sites inside it; `border`, the app's own word on a border\naround it, absent when it gave none; and\n`from`, the connector's name, to label it with. No activity comes, and nothing is said, for a\ncall whose app is no longer kept with the conversation, or whose connector was deleted or no\nlonger shows its apps: turning that off takes its apps out of the stream and the history,\npast calls included. A catch-up or a page of the history holds the newest calls' apps, as\nlong as their results add up to at most 2,000,000 characters; older ones come without.\n\nIn the chat app, the embed and the console's Playground, which always draw it, the agent is told that such a\ntool's result is shown to the person as an interactive view, so it doesn't draw the same again and may make a\ncall for itself alone, for which no activity comes. Through this API it is told nothing of the view, since\nnothing says your app draws the activity: it writes its answer as if the person saw its words alone. So draw\neach `mcp-apps` activity where it stands in the stream, beside what the agent writes.\n", "required": ["type"], "properties": {"type": {"type": "string", "enum": ["RUN_STARTED", "RUN_FINISHED", "RUN_ERROR", "TEXT_MESSAGE_START", "TEXT_MESSAGE_CONTENT", "TEXT_MESSAGE_END", "ACTIVITY_SNAPSHOT", "ACTIVITY_DELTA", "MESSAGES_SNAPSHOT", "CUSTOM", "TOOL_CALL_START", "TOOL_CALL_ARGS", "TOOL_CALL_END", "TOOL_CALL_RESULT"]}, "timestamp": {"type": "integer", "description": "When what it tells of happened, in Unix milliseconds"}, "threadId": {"type": "string"}, "runId": {"type": "string"}, "protocolVersion": {"type": "string", "const": "1.0"}, "outcome": {"$ref": "#/components/schemas/Outcome"}, "message": {"type": "string"}, "code": {"type": "string", "const": "failed"}, "messageId": {"type": "string"}, "role": {"type": "string", "enum": ["user", "assistant", "tool"]}, "delta": {"type": "string"}, "toolCallId": {"type": "string"}, "toolCallName": {"type": "string"}, "parentMessageId": {"type": "string"}, "activityType": {"type": "string", "enum": ["steps", "plan", "file", "memory", "output", "summary", "pins", "notes", "a2ui-surface", "mcp-apps"]}, "patch": {"type": "array", "description": "On `ACTIVITY_DELTA`, the change to the activity's content as an RFC 6902 patch: for an `output`,\n`add` to `/chunks/-` with a chunk of text, or `add` to `/cut` with `true`, once; for an\n`a2ui-surface`, `add` to `/a2ui_operations/-` with each A2UI message to apply, in order\n", "items": {"type": "object", "required": ["op", "path", "value"], "properties": {"op": {"type": "string", "const": "add"}, "path": {"type": "string", "enum": ["/chunks/-", "/cut", "/a2ui_operations/-"]}, "value": {"description": "A chunk of the output's text for `/chunks/-`; `true` for `/cut`; one A2UI v1.0 message for\n`/a2ui_operations/-`\n", "type": ["string", "boolean", "object"]}}}}, "content": {"description": "An activity's content, or a call's result as JSON text", "type": ["object", "string"]}, "replace": {"type": "boolean"}, "messages": {"type": "array", "items": {"$ref": "#/components/schemas/Message"}}, "name": {"type": "string", "enum": ["chat:citations", "chat:working", "chat:reading"]}, "value": {"description": "What the event carries: `chat:citations` `{message_id, citations}`, `chat:working` a `WorkingLine`,\n`chat:reading` `{files}`.\n", "anyOf": [{"$ref": "#/components/schemas/WorkingLine"}, {"type": "object"}]}, "metadata": {"type": "object", "properties": {"chat": {"$ref": "#/components/schemas/EventChat"}}}}}, "Outcome": {"type": "object", "required": ["type"], "properties": {"type": {"type": "string", "enum": ["success", "cancelled", "interrupt"]}, "interrupts": {"type": "array", "items": {"$ref": "#/components/schemas/Interrupt"}}}}, "Interrupt": {"type": "object", "description": "Something a turn waits on the person for: a yes to an action (`confirmation`, its call's\ndetails in `metadata.chat.details`; on their own account, `always` allows it from then\non, and is refused on any other), details to fill in (`input_required`, its form as\n`responseSchema`), a page to open (`chat:open_page`, at `metadata.chat.url`), their own\naccount to connect (`chat:connect`: open `metadata.chat.url`, a connect link, for them to\nsign in; the turn goes on once they have, and resuming it then changes nothing; `metadata.chat.reconnect`\nis true when they sign in again, and `metadata.chat.more_access` when the account needs more access, which\nonly a new sign-in asking for it gives, as the link's does: until then, `connected: true` is `not_connected`,\nthough the account works), or the person's own pause (`chat:paused`), which goes on when they continue.\nAnswer each with `POST /conversations/{id}/resume`. One an app's call waits on (a `confirmation` or a\n`chat:connect`) names the app's activity in `metadata.chat.app`, `{activity}`, the object a message an app sent\ncarries with its `from`: it's among the conversation's `interrupts` while it waits, never on its stream, and the\napp's request sent again with `resume` answers it and its call's end.\n", "required": ["id", "reason"], "properties": {"id": {"type": "string"}, "reason": {"type": "string", "enum": ["confirmation", "input_required", "chat:open_page", "chat:connect", "chat:paused"]}, "message": {"type": "string"}, "responseSchema": {"type": "object", "description": "The JSON Schema an answer keeps to. A form's is an object whose properties are its fields, written in\nthe order they were asked in, which is the order to show them in, each with a\n`title` and, where it has one, a `description` and the `default` it starts with: a string (`format`\n`email`, `uri` or `date`; `password` with `writeOnly` for a secret), a number or an integer with its\nbounds, a boolean, a choice as `oneOf` of `{const, title}` (each with a `description` where the option\nhas a line of its own; `anyOf` with a plain string beside them where the person may write an answer of\ntheir own), or a choice of several as an `array` whose `items.anyOf` holds the options, as many as\n`minItems` and `maxItems` allow, answered with a list of the `const`s picked.\n"}, "expiresAt": {"type": "string", "format": "date-time"}, "metadata": {"type": "object", "properties": {"chat": {"type": "object", "properties": {"app": {"type": "object", "description": "The app whose call waits on this, by its activity's ID", "required": ["activity"], "properties": {"activity": {"type": "string"}}}}}}}}}, "EventPerson": {"type": "object", "description": "The person an event is about, by your ID for them", "required": ["kind", "id"], "properties": {"kind": {"type": "string", "enum": ["user", "visitor"]}, "id": {"type": "string", "description": "Your ID for them"}}}, "EventChannel": {"type": "string", "description": "The way the conversation came, through the API, the embed or your chat app", "enum": ["api", "embed", "chat_app"]}, "TurnEventData": {"type": "object", "required": ["id", "conversation_id", "agent_id", "person", "channel"], "properties": {"id": {"$ref": "#/components/schemas/ID", "description": "The turn's"}, "conversation_id": {"$ref": "#/components/schemas/ID"}, "agent_id": {"$ref": "#/components/schemas/ID"}, "person": {"$ref": "#/components/schemas/EventPerson"}, "channel": {"$ref": "#/components/schemas/EventChannel"}}}, "ConversationEventData": {"type": "object", "required": ["id", "agent_id", "person", "channel"], "properties": {"id": {"$ref": "#/components/schemas/ID", "description": "The conversation's"}, "agent_id": {"$ref": "#/components/schemas/ID"}, "person": {"$ref": "#/components/schemas/EventPerson"}, "channel": {"$ref": "#/components/schemas/EventChannel"}}}, "TestEventData": {"type": "object", "required": ["id"], "properties": {"id": {"$ref": "#/components/schemas/ID", "description": "The endpoint's"}}}, "TurnCreatedEvent": {"type": "object", "required": ["type", "timestamp", "data"], "properties": {"type": {"type": "string", "const": "turn.created"}, "timestamp": {"type": "string", "format": "date-time", "description": "When it happened, in UTC to the millisecond"}, "data": {"$ref": "#/components/schemas/TurnEventData"}}}, "TurnEndedEvent": {"type": "object", "required": ["type", "timestamp", "data"], "properties": {"type": {"type": "string", "const": "turn.ended"}, "timestamp": {"type": "string", "format": "date-time", "description": "When it happened, in UTC to the millisecond"}, "data": {"$ref": "#/components/schemas/TurnEventData"}}}, "ConversationWaitingEvent": {"type": "object", "required": ["type", "timestamp", "data"], "properties": {"type": {"type": "string", "const": "conversation.waiting"}, "timestamp": {"type": "string", "format": "date-time", "description": "When it happened, in UTC to the millisecond"}, "data": {"$ref": "#/components/schemas/ConversationEventData"}}}, "WebhookTestEvent": {"type": "object", "required": ["type", "timestamp", "data"], "properties": {"type": {"type": "string", "const": "webhook.test"}, "timestamp": {"type": "string", "format": "date-time", "description": "When it happened, in UTC to the millisecond"}, "data": {"$ref": "#/components/schemas/TestEventData"}}}, "ProblemCode": {"type": "string", "description": "A problem's stable code. `invalid_request`, `person_required`, `person_conflict`,\n`idempotency_key_required` and `idempotency_key_invalid` are a request to fix;\n`api_key_invalid` a key to fix; `session_invalid` and `session_expired` an embed session to ask for\nagain, and `user_token_invalid` a user token to refresh; `person_header_not_here` a person header to\nleave out beside a session; `tenant_suspended`, `sign_in_required` and `sign_in_not_accepted` refusals of who\nis calling, `attachments_off` a file sent to an embed that takes none, and\n`chat_app_closed` a chat app not yet open; `admin_only`, `two_step_required` and `recent_sign_in_required`\nthe admin area's, for an admin with two-step, signed in within the hour to change something, and its\n`invitation_just_sent`, `has_account`, `sign_in_busy`, `group_exists`, `too_many_groups`, `last_group`,\n`not_yourself`, `group_unknown` and `too_many_invitations` the state of the chat app's people and groups, and\n`issuer_taken`, `too_many_issuers`, `sso_domain_taken`, `sso_not_working`, `sso_unsupported`, `sso_busy` and\n`issuer_unreachable` the state of its identity providers;\n`embed_off` an agent whose embed isn't open; the `*_not_found` codes and `not_found` nothing of yours there; `download_link_expired` a download link to ask for again;\n`answer_invalid` a resume's payload to fix; `photo_invalid` and `photo_too_large` a photo to choose again;\n`attachments_not_supported` a run's message to\nsend as text; `invalid_action` a pressed button to fix; `method_not_allowed` another method;\n`conversation_busy`, `too_many_waiting`, `nothing_to_stop`, `message_taken`, `turn_ended`,\n`message_held`, `message_not_held`, `run_not_retryable`, `process_not_running`, `task_not_running`, `interrupt_answered`, `interrupt_expired`, `nothing_to_pause`,\n`not_paused`, `interrupts_pending` and `idempotency_key_in_use` a conversation's state; `not_connected` an\naccount not ready yet, which its person hasn't connected, or hasn't allowed the more access its card asks;\n`too_many_files`, `file_sent` and `file_name_taken` its files' state; `too_many_pins` the person's pins;\n`memory_ask_answered`, `memory_gone`,\n`memory_full`, `memory_taken`, `memory_name`, `memory_too_long`, `memory_never_kept` and `memory_unused`\nwhat the agent remembers;\n`length_required`, `body_too_large`, `context_too_large`, `unsupported_media_type` and `file_unsupported` a\nbody to fix; `range_not_satisfiable` a download's range to fix; `idempotency_key_reused` a key to change; `internal_error` our fault;\n`rate_limited`, `agents_unavailable`, `files_unavailable`, `search_unavailable` and `service_unavailable` a wait of\n`Retry-After` seconds; `connect_open_from_chat`, `sign_in_expired`, `connect_failed` and `cant_connect` a\nconnect that connected nothing, in the person's words.\n", "enum": ["invalid_request", "person_required", "person_conflict", "person_header_not_here", "idempotency_key_required", "idempotency_key_invalid", "answer_invalid", "attachments_not_supported", "method_not_allowed_for_apps", "app_arguments_invalid", "invalid_app", "invalid_action", "sign_in_expired", "connect_failed", "api_key_invalid", "session_invalid", "session_expired", "preview_invalid", "user_token_invalid", "tenant_suspended", "chat_app_closed", "sign_in_required", "sign_in_not_accepted", "attachments_off", "site_not_allowed", "admin_only", "two_step_required", "recent_sign_in_required", "connect_open_from_chat", "app_other_connector", "app_tool_not_offered", "app_tool_unavailable", "not_found", "app_not_found", "person_not_found", "pin_not_found", "issuer_not_found", "sso_test_not_found", "photo_invalid", "photo_too_large", "photo_not_found", "agent_not_found", "embed_off", "conversation_not_found", "run_not_found", "file_not_found", "download_link_expired", "preview_unavailable", "home_not_found", "process_not_found", "interrupt_not_found", "connector_not_offered", "task_not_found", "connection_not_found", "memory_not_found", "memory_ask_not_found", "invitation_not_found", "group_not_found", "method_not_allowed", "conversation_busy", "too_many_waiting", "nothing_to_stop", "apps_not_shown", "message_taken", "turn_ended", "message_held", "message_not_held", "run_not_retryable", "process_not_running", "task_not_running", "interrupt_answered", "interrupt_expired", "nothing_to_pause", "not_paused", "interrupts_pending", "not_connected", "cant_connect", "memory_ask_answered", "memory_gone", "memory_full", "memory_taken", "memory_name", "memory_too_long", "memory_never_kept", "memory_unused", "too_many_pins", "too_many_files", "file_sent", "file_name_taken", "invitation_just_sent", "has_account", "sign_in_busy", "group_exists", "too_many_groups", "last_group", "issuer_taken", "too_many_issuers", "sso_domain_taken", "sso_not_working", "sso_unsupported", "sso_busy", "not_yourself", "idempotency_key_in_use", "length_required", "body_too_large", "context_too_large", "app_context_too_large", "unsupported_media_type", "file_unsupported", "range_not_satisfiable", "issuer_unreachable", "group_unknown", "idempotency_key_reused", "too_many_invitations", "too_many_app_calls", "too_many_app_requests", "rate_limited", "internal_error", "agents_unavailable", "service_unavailable", "app_calls_unavailable", "app_requests_unavailable", "files_unavailable", "search_unavailable"]}, "ProblemField": {"type": "object", "required": ["detail"], "properties": {"detail": {"type": "string"}, "pointer": {"type": "string", "description": "The body member at fault, as a JSON Pointer"}, "parameter": {"type": "string", "description": "The query parameter at fault"}, "header": {"type": "string", "description": "The header at fault"}}}, "Problem": {"type": "object", "description": "A problem detail (RFC 9457)", "required": ["type", "title", "status", "code"], "properties": {"type": {"type": "string", "format": "uri", "description": "The problem's page, which says what it means and what to do"}, "title": {"type": "string"}, "status": {"type": "integer"}, "detail": {"type": "string"}, "code": {"$ref": "#/components/schemas/ProblemCode"}, "request_id": {"type": "string", "description": "The request's ID, as its answer's `Request-Id` names it"}, "errors": {"type": "array", "description": "Each member at fault, for `invalid_request`", "items": {"$ref": "#/components/schemas/ProblemField"}}}}}, "responses": {"AdminPeoplePage": {"description": "A page of the chat app's people", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"type": "object", "required": ["data", "page", "page_size", "total"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/AdminPerson"}}, "page": {"type": "integer"}, "page_size": {"type": "integer"}, "total": {"type": "integer"}}}}}}, "AdminPerson": {"description": "The person", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminPerson"}}}}, "AdminPersonDetail": {"description": "The person and how they sign in", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminPersonDetail"}}}}, "AdminInvitationPage": {"description": "A page of the chat app's invitations", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"type": "object", "required": ["data", "page", "page_size", "total"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/AdminInvitation"}}, "page": {"type": "integer"}, "page_size": {"type": "integer"}, "total": {"type": "integer"}}}}}}, "AdminInvited": {"description": "What was invited, and why each other address wasn't", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminInvited"}}}}, "AdminInvitation": {"description": "The invitation", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminInvitation"}}}}, "AdminGroupList": {"description": "Every group, by name", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"type": "object", "required": ["data"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/AdminGroup"}}}}}}}, "AdminGroup": {"description": "The group", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminGroup"}}}}, "AdminGroupCreated": {"description": "The group, made by this call", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminGroup"}}}}, "AdminGroupDeleted": {"description": "The group was deleted; the agents that left the chat app with it", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminGroupDeleted"}}}}, "AdminGroupAgents": {"description": "The chat app's agents as this group sees them", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"type": "object", "required": ["data"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/AdminGroupAgent"}}}}}}}, "AdminSignInRules": {"description": "How people join and sign in", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminSignInRules"}}}}, "AdminProviderList": {"description": "Your identity providers, oldest first", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"type": "object", "required": ["data"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/AdminProvider"}}}}}}}, "AdminProvider": {"description": "The identity provider", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminProvider"}}}}, "AdminProviderRead": {"description": "The identity provider as read, nothing kept", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminProviderRead"}}}}, "AdminSSOSetup": {"description": "What single sign-on asks of any identity provider", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminSSOSetup"}}}}, "AdminProviderCreated": {"description": "The identity provider, added by this call", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminProvider"}}}}, "AdminSSOTestStarted": {"description": "The test, begun by this call", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminSSOTestStarted"}}}}, "AdminSSOTest": {"description": "The test", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminSSOTest"}}}}, "AdminProviderUnreachable": {"description": "The identity provider's discovery document or keys didn't answer as they must (`issuer_unreachable`), or its document lacks what single sign-on needs (`sso_unsupported`), so nothing was added", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "AdminUsage": {"description": "The chat app's last 30 days", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminUsage"}}}}, "AdminActivityPage": {"description": "A page of what changed", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"type": "object", "required": ["data", "page", "page_size", "total"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/AdminActivity"}}, "page": {"type": "integer"}, "page_size": {"type": "integer"}, "total": {"type": "integer"}}}}}}, "AdminForbidden": {"description": "Not the chat app's admin (`admin_only`), an admin who must set up two-step first (`two_step_required`), or a change whose sign-in is over an hour old (`recent_sign_in_required`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "AdminConflict": {"description": "The state of your people or identity providers refuses it (`not_yourself`, `group_exists`, `too_many_groups`, `last_group`, `invitation_just_sent`, `has_account`, `sign_in_busy`, `issuer_taken`, `too_many_issuers`, `sso_domain_taken`, `sso_not_working`, `sso_busy`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "AdminGroupUnknown": {"description": "A group your chat app doesn't hold, so nothing changed (`group_unknown`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "AdminTooManyInvitations": {"description": "The hour's invitations are spent (`too_many_invitations`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "Person": {"description": "The person", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Person"}}}}, "PersonCreated": {"description": "The person, made by this call", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Person"}}}}, "EmbedSessionCreated": {"description": "The session, made by this call", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmbedSession"}}}}, "Me": {"description": "The session's person", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Me"}}}}, "SearchHits": {"description": "The person's conversations the words found, best first", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SearchHitList"}}}}, "About": {"description": "What the person wrote about themselves for agents", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/About"}}}}, "PreviewInvalid": {"description": "The preview code was spent, is past its minute, or is no code of this app's (`preview_invalid`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "UserTokenInvalid": {"description": "The user token didn't verify (`user_token_invalid`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "Agent": {"description": "The agent", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Agent"}}}}, "AgentList": {"description": "A slice of the agents", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentList"}}}}, "Conversation": {"description": "The conversation", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Conversation"}}}}, "ConversationCreated": {"description": "The new conversation; sent again with its Idempotency-Key, the one the first made, replayed", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotent-Replayed": {"$ref": "#/components/headers/IdempotentReplayed"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Conversation"}}}}, "ConversationList": {"description": "A slice of the person's conversations", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConversationList"}}}}, "MessageAccepted": {"description": "What became of the message, its turn's address in `Location` once it's in one; sent again with its Idempotency-Key, the first's answer, replayed", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotent-Replayed": {"$ref": "#/components/headers/IdempotentReplayed"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageResult"}}}}, "ActedOn": {"description": "The conversation as it is now, with what it still waits on, and in `Location` the turn the answers went to, none when they all went to tasks; sent again with its Idempotency-Key, the first's answer, replayed", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotent-Replayed": {"$ref": "#/components/headers/IdempotentReplayed"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Conversation"}}}}, "Stopped": {"description": "The turn the stop ended; sent again with its Idempotency-Key, the first's answer, replayed", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Idempotent-Replayed": {"$ref": "#/components/headers/IdempotentReplayed"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StoppedTurn"}}}}, "File": {"description": "The file", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/File"}}}}, "FileCreated": {"description": "The file, attached and being read; sent again with its Idempotency-Key, the first's answer, replayed", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotent-Replayed": {"$ref": "#/components/headers/IdempotentReplayed"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/File"}}}}, "KeptFile": {"description": "The kept file", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KeptFile"}}}}, "KeptFileList": {"description": "A slice of the user's kept files", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KeptFileList"}}}}, "ConnectionList": {"description": "The user's connections, in one slice", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectionList"}}}}, "HomeList": {"description": "The user's homes, in one slice", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HomeList"}}}}, "ProcessList": {"description": "The conversation's background jobs, in one slice", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProcessList"}}}}, "TaskList": {"description": "The conversation's tasks, in one slice", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TaskList"}}}}, "TaskCancelled": {"description": "The task, cancelled; sent again with its Idempotency-Key, the first's answer, replayed", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Idempotent-Replayed": {"$ref": "#/components/headers/IdempotentReplayed"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Task"}}}}, "ProcessStopping": {"description": "The job, stopping; sent again with its Idempotency-Key, the first's answer, replayed", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Idempotent-Replayed": {"$ref": "#/components/headers/IdempotentReplayed"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Process"}}}}, "Turn": {"description": "The turn", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Turn"}}}}, "TurnList": {"description": "A slice of the conversation's turns", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TurnList"}}}}, "MessageList": {"description": "A page of the conversation's history", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageList"}}}}, "EventStream": {"description": "The conversation's events, as server-sent events", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/event-stream": {"itemSchema": {"type": "object", "required": ["data"], "properties": {"id": {"type": "string", "description": "The commit's number, on its last event"}, "data": {"type": "string", "contentMediaType": "application/json", "contentSchema": {"$ref": "#/components/schemas/StreamEvent"}}}}}}}, "RunStream": {"description": "The run's events, as server-sent events, until its end", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Idempotent-Replayed": {"$ref": "#/components/headers/IdempotentReplayed"}}, "content": {"text/event-stream": {"itemSchema": {"type": "object", "required": ["data"], "properties": {"data": {"type": "string", "contentMediaType": "application/json", "contentSchema": {"$ref": "#/components/schemas/StreamEvent"}}}}}}}, "FileList": {"description": "A slice of the conversation's files", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FileList"}}}}, "FileContent": {"description": "The file's bytes, in its own type, with their length", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Content-Disposition": {"$ref": "#/components/headers/ContentDisposition"}, "Accept-Ranges": {"$ref": "#/components/headers/AcceptRanges"}, "ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"*/*": {}}}, "FilePart": {"description": "The part of the file the `Range` asked for", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Content-Disposition": {"$ref": "#/components/headers/ContentDisposition"}, "Content-Range": {"$ref": "#/components/headers/ContentRange"}, "ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"*/*": {}}}, "RangeNotSatisfiable": {"description": "The `Range` starts past the file's end (`range_not_satisfiable`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Content-Range": {"$ref": "#/components/headers/ContentRange"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "DownloadLinkCreated": {"description": "Where a browser saves the file from, and until when", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DownloadLink"}}}}, "DownloadLinkClosed": {"description": "The link no longer opens (`download_link_expired`), or the file was deleted since it was made\n(`file_not_found`): in a sentence to a browser, as a problem to a client that asks for JSON\n", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"text/plain": {"schema": {"type": "string"}}, "application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "FilePreview": {"description": "The picture's smaller copy", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Content-Disposition": {"$ref": "#/components/headers/ContentDisposition"}}, "content": {"image/jpeg": {}, "image/png": {}}}, "MemoryAgentList": {"description": "The agents that remember the person, in one slice", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MemoryAgentList"}}}}, "MemoryAgent": {"description": "What the agent keeps of the person", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MemoryAgent"}}}}, "MemoryList": {"description": "A slice of what the agent remembers of the person, newest first", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MemoryList"}}}}, "Memory": {"description": "The memory", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Memory"}}}}, "MemoryAskList": {"description": "The conversation's changes to memory, in one slice", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MemoryAskList"}}}}, "MemoryAsk": {"description": "The change to memory, answered", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MemoryAsk"}}}}, "MemoryConflict": {"description": "What the agent remembers refuses the change: an answer already given (`memory_ask_answered`), a memory\ngone since (`memory_gone`), 200 memories kept already (`memory_full`), a name taken (`memory_taken`),\na memory its rules refuse (`memory_name`, `memory_too_long`, `memory_never_kept`), or a switch for an\nagent that doesn't remember people now (`memory_unused`)\n", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "Photo": {"description": "The person's photo", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Cache-Control": {"description": "`private, no-store`", "schema": {"type": "string"}}}, "content": {"image/jpeg": {"schema": {"type": "string", "format": "binary"}}, "image/png": {"schema": {"type": "string", "format": "binary"}}, "image/webp": {"schema": {"type": "string", "format": "binary"}}}}, "PhotoTooLarge": {"description": "A photo past 5 MB (`photo_too_large`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "NoContent": {"description": "Done", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}}, "BadRequest": {"description": "A request to fix (`invalid_request`, `person_required`, `person_conflict`, `person_header_not_here`, `idempotency_key_required`, `idempotency_key_invalid`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "Unauthorized": {"description": "A missing, revoked or wrong key (`api_key_invalid`), or an embed session that isn't good (`session_invalid`) or has ended (`session_expired`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "WWW-Authenticate": {"$ref": "#/components/headers/WWWAuthenticate"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "Forbidden": {"description": "A suspended account (`tenant_suspended`), a visitor where only someone signed in may be (`sign_in_required`), an embed session's person signed in through a sign-in the agent doesn't take (`sign_in_not_accepted`), or a file sent through an embed session to an agent whose embed takes none (`attachments_off`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "NotFound": {"description": "Nothing of yours there (`not_found`, `agent_not_found`, `embed_off`, `person_not_found`, `conversation_not_found`, `run_not_found`, `file_not_found`, `preview_unavailable`, `home_not_found`, `process_not_found`, `pin_not_found`, `invitation_not_found`, `group_not_found`, `issuer_not_found`, `sso_test_not_found`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "Conflict": {"description": "The conversation's state refuses the call (`conversation_busy`, `too_many_waiting`,\n`nothing_to_stop`, `message_taken`, `turn_ended`, `message_held`, `message_not_held`, `run_not_retryable`,\n`process_not_running`, `too_many_files`,\n`file_sent`, `file_name_taken`), the person's pins are full (`too_many_pins`), or a request with its Idempotency-Key is\nstill being answered\n(`idempotency_key_in_use`, with `Retry-After`)\n", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "RateLimited": {"description": "The embed's anonymous traffic is past one of its limits (`rate_limited`): its visitors' sessions,\nconversations, messages, connects and files, and the sessions pages ask for with a user token. Send it again\nafter `Retry-After` seconds.\n", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "KeyReused": {"description": "The Idempotency-Key was sent with another request (`idempotency_key_reused`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "LengthRequired": {"description": "The body was sent without its length (`length_required`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "ContextTooLarge": {"description": "The page's context is larger than 8 KB, or a pressed button's is larger than 8 KB as sent or 16 KB as the agent reads\nit (`context_too_large`)\n", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "BodyTooLarge": {"description": "The body is larger than the call takes (`body_too_large`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "FileUnsupported": {"description": "The file isn't a kind a conversation keeps, or isn't what its name says (`file_unsupported`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "FilesUnavailable": {"description": "Files can't be kept or read right now (`files_unavailable`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "UnsupportedMediaType": {"description": "The body isn't application/json (`unsupported_media_type`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "ServerError": {"description": "Our fault (`internal_error`); send it again, with its Idempotency-Key where it takes one", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "Unavailable": {"description": "Turns can't run right now (`agents_unavailable`), search is unavailable (`search_unavailable`), or the service is unavailable (`service_unavailable`)", "headers": {"Request-Id": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/problem+json": {"schema": {"$ref": "#/components/schemas/Problem"}}}}, "WebhookReceived": {"description": "Taken; answer within 15 seconds, before the work it starts"}, "WebhookGone": {"description": "The endpoint is gone; it's turned off at once and sent nothing more"}, "WebhookFailed": {"description": "Any other answer, or none within 15 seconds; the event is sent again later"}}}}