{ "openapi": "3.1.0", "info": { "title": "Agent Outbox Caller API", "version": "0.8.2", "summary": "Durable human decisions for software agents", "description": "Send structured work to a person, continue asynchronously, and retrieve a typed decision when it is ready. This document intentionally includes only the caller-facing data plane and status operations." }, "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema", "servers": [ { "url": "https://app.agent-outbox.dev" } ], "tags": [ { "name": "Inputs", "description": "Create, replace, remove, list, and read live human review work." }, { "name": "Outputs", "description": "Check, read, download, and acknowledge human decisions." }, { "name": "Status", "description": "Inspect non-secret caller, account, storage, and limit state." } ], "paths": { "/api/input/send": { "post": { "operationId": "sendInput", "tags": ["Inputs"], "summary": "Send a review request", "description": "Creates a pending human review request. Repeating the same caller item and normalized content is an idempotent success.\n\n- Use a stable caller_item_id for the logical work item.\n- A same-content retry is safe; different content for the same pending id returns a conflict.\n- Account and caller identity always come from the bearer credential.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InputSendResponse" }, "example": { "ok": true, "request_id": "req_123", "correlation_id": "corr_123", "data": { "caller_item_id": "email:thread_123", "status": "pending", "revision": 1, "created": true, "duplicate": false } } } } }, "400": { "description": "The request is malformed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "402": { "description": "The requested capability requires an upgrade.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "409": { "description": "The request conflicts with current lifecycle state.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "413": { "description": "The request body exceeds its byte limit.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "422": { "description": "The request failed field or content validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "500": { "description": "An unexpected server error occurred.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InputSubmission" }, "example": { "caller_item_id": "email:thread_123", "priority": "high", "row_type": { "display": "Email draft", "icon": "mail" }, "title": "Reply to Acme Corp", "subtitle": "A customer response is ready for review.", "summary": "Approve the prepared response before it is sent.", "link_buttons": [], "actions": [ { "display": "Approve to send", "icon": "send", "value": "approve_send", "overflow": false, "tone": "success", "style": "solid", "popup": { "kind": "none" } } ] } } } } } }, "/api/input/replace": { "post": { "operationId": "replaceInput", "tags": ["Inputs"], "summary": "Replace a pending request", "description": "Replaces the complete content of a still-pending request and advances its revision only when normalized content changes.\n\n- Send the complete replacement, not a partial patch.\n- Answered or missing items cannot be replaced.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InputReplaceResponse" } } } }, "400": { "description": "The request is malformed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "402": { "description": "The requested capability requires an upgrade.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "The live resource is unavailable to this caller.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "409": { "description": "The request conflicts with current lifecycle state.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "413": { "description": "The request body exceeds its byte limit.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "422": { "description": "The request failed field or content validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "500": { "description": "An unexpected server error occurred.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InputSubmission" }, "example": { "caller_item_id": "email:thread_123", "priority": "high", "row_type": { "display": "Email draft", "icon": "mail" }, "title": "Reply to Acme Corp", "subtitle": "A customer response is ready for review.", "summary": "Approve the prepared response before it is sent.", "link_buttons": [], "actions": [ { "display": "Approve to send", "icon": "send", "value": "approve_send", "overflow": false, "tone": "success", "style": "solid", "popup": { "kind": "none" } } ] } } } } } }, "/api/input/delete": { "post": { "operationId": "deleteInput", "tags": ["Inputs"], "summary": "Delete a pending request", "description": "Deletes a request only while it is pending. This cleanup operation remains available after monthly quota exhaustion.\n\n- Answered items and output results are not deleted by this route.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InputDeleteResponse" } } } }, "400": { "description": "The request is malformed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "The live resource is unavailable to this caller.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "409": { "description": "The request conflicts with current lifecycle state.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "413": { "description": "The request body exceeds its byte limit.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "422": { "description": "The request failed field or content validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InputDelete" }, "example": { "caller_item_id": "email:thread_123" } } } } } }, "/api/input/list": { "get": { "operationId": "listInputs", "tags": ["Inputs"], "summary": "List live retained inputs", "description": "Returns metadata for live retained inputs owned by the authenticated caller in stable opaque-cursor order.\n\n- Pending and answered-but-unacknowledged inputs are visible; deleted, acknowledged, expired, and retention-cleaned inputs are not.\n- This route is non-mutating and does not return input bodies.\n- Page size is 1 to 100 and defaults to 25.\n- Follow next_cursor while has_more is true.\n- Shares the output_check_read per-minute limit and consumes monthly API request quota.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InputListResponse" }, "example": { "ok": true, "request_id": "req_126", "correlation_id": "corr_126", "data": { "items": [ { "caller_item_id": "email:thread_123", "status": "pending", "revision": 1, "created_at": "2026-06-30T19:00:00Z", "updated_at": "2026-06-30T19:00:00Z", "answered_at": null } ], "has_more": false, "next_cursor": null, "returned_count": 1, "page_limit": 25 } } } } }, "400": { "description": "The request is malformed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "422": { "description": "The request failed field or content validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "parameters": [ { "name": "limit", "in": "query", "required": false, "description": "Page size from 1 to 100. Defaults to 25.", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 25 } }, { "name": "cursor", "in": "query", "required": false, "description": "Opaque next_cursor from the preceding page.", "schema": { "type": "string", "minLength": 1 } } ] } }, "/api/input/read": { "post": { "operationId": "readInput", "tags": ["Inputs"], "summary": "Read one live retained input", "description": "Returns one complete canonical accepted input for a live caller_item_id owned by the authenticated caller.\n\n- raw_input is the validated, sanitized, default-expanded submission Agent Outbox accepted, not the original request JSON.\n- A JSON body is required because caller_item_id is arbitrary caller-owned text and is not URL-safe.\n- Missing live items return not_found. This route is non-mutating.\n- Shares the output_check_read per-minute limit and consumes monthly API request quota.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InputReadResponse" }, "example": { "ok": true, "request_id": "req_127", "correlation_id": "corr_127", "data": { "caller_item_id": "email:thread_123", "status": "pending", "revision": 1, "created_at": "2026-06-30T19:00:00Z", "updated_at": "2026-06-30T19:00:00Z", "answered_at": null, "raw_input": { "caller_item_id": "email:thread_123", "priority": "high", "row_type": { "display": "Email draft", "icon": "mail" }, "title": "Reply to Acme Corp", "subtitle": "A customer response is ready for review.", "summary": "Approve the prepared response before it is sent.", "link_buttons": [], "actions": [ { "display": "Approve to send", "icon": "send", "value": "approve_send", "overflow": false, "tone": "success", "style": "solid", "popup": { "kind": "none" } } ], "row_accent_color": null, "corner": null, "card_time": null, "details": null, "card_visual": null, "skip_disabled": false } } } } } }, "400": { "description": "The request is malformed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "The live resource is unavailable to this caller.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "413": { "description": "The request body exceeds its byte limit.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "422": { "description": "The request failed field or content validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InputReadRequest" }, "example": { "caller_item_id": "email:thread_123" } } } } } }, "/api/output/check": { "get": { "operationId": "checkOutput", "tags": ["Outputs"], "summary": "Check whether decisions are ready", "description": "Returns readiness metadata without returning answers, marking results read, or disabling human undo.\n\n- Poll only when your caller is ready to continue.\n- ready_count includes every live unacknowledged result, even if it was already read.\n- Follow next_cursor while has_more is true.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OutputCheckResponse" }, "example": { "ok": true, "request_id": "req_124", "correlation_id": "corr_124", "data": { "items": [ { "output_result_id": "out_123", "caller_item_id": "email:thread_123", "answered_at": "2026-06-30T20:00:00Z" } ], "ready_count": 1, "has_more": false, "next_cursor": null, "returned_count": 1, "page_limit": 25 } } } } }, "400": { "description": "The request is malformed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "422": { "description": "The request failed field or content validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "parameters": [ { "name": "limit", "in": "query", "required": false, "description": "Page size from 1 to 100. Defaults to 25.", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 25 } }, { "name": "cursor", "in": "query", "required": false, "description": "Opaque next_cursor from the preceding page.", "schema": { "type": "string", "minLength": 1 } } ] } }, "/api/output/{output_result_id}/read": { "post": { "operationId": "readOutput", "tags": ["Outputs"], "summary": "Read one human decision", "description": "Returns one complete decision and the matching canonical accepted input. The first successful read marks it read and permanently disables human undo.\n\n- The same result remains readable until acknowledgement.\n- raw_input is the canonical accepted submission for the matching live input.\n- Use output_result_id as the idempotency key for downstream work.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OutputResultResponse" }, "example": { "ok": true, "request_id": "req_125", "correlation_id": "corr_125", "data": { "output_result_id": "out_123", "caller_id": "caller_123", "caller_item_id": "email:thread_123", "action_value": "approve_send", "response": { "kind": "none" }, "answered_at": "2026-06-30T20:00:00Z", "answered_by": "user_123", "raw_input": { "caller_item_id": "email:thread_123", "priority": "high", "row_type": { "display": "Email draft", "icon": "mail" }, "title": "Reply to Acme Corp", "subtitle": "A customer response is ready for review.", "summary": "Approve the prepared response before it is sent.", "link_buttons": [], "actions": [ { "display": "Approve to send", "icon": "send", "value": "approve_send", "overflow": false, "tone": "success", "style": "solid", "popup": { "kind": "none" } } ], "row_accent_color": null, "corner": null, "card_time": null, "details": null, "card_visual": null, "skip_disabled": false } } } } } }, "400": { "description": "The request is malformed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "The live resource is unavailable to this caller.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "422": { "description": "The request failed field or content validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "parameters": [ { "name": "output_result_id", "in": "path", "required": true, "description": "The result id returned by output/check.", "schema": { "type": "string", "minLength": 1 } } ] } }, "/api/output/read-all": { "post": { "operationId": "readAllOutputs", "tags": ["Outputs"], "summary": "Read a page of human decisions", "description": "Returns full decisions and matching canonical accepted inputs in oldest-first order, and marks only returned items read.\n\n- Each returned item includes raw_input for the matching live input.\n- Unavailable file metadata is reported separately and does not mark that result read.\n- File-metadata degradation stays isolated; it does not require canonical input reconstruction.\n- Because each item includes the full canonical input, choose a smaller limit when submissions are large.\n- Follow next_cursor while has_more is true.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OutputReadPageResponse" } } } }, "400": { "description": "The request is malformed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "413": { "description": "The request body exceeds its byte limit.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "422": { "description": "The request failed field or content validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OutputReadAllRequest" }, "example": { "limit": 25, "cursor": null } } } } } }, "/api/output/{output_result_id}/ack": { "post": { "operationId": "acknowledgeOutput", "tags": ["Outputs"], "summary": "Acknowledge durable handling", "description": "Idempotently confirms that downstream handling is durable, then removes the live input/output pair and attached files.\n\n- Acknowledge only after your side effect or record is durable.\n- Duplicate acknowledgement is a successful no-op when retained audit data proves the prior acknowledgement.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OutputAckResponse" } } } }, "400": { "description": "The request is malformed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "The live resource is unavailable to this caller.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "422": { "description": "The request failed field or content validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "parameters": [ { "name": "output_result_id", "in": "path", "required": true, "description": "The result id that has been handled durably.", "schema": { "type": "string", "minLength": 1 } } ] } }, "/api/output/{output_result_id}/files/{file_id}": { "get": { "operationId": "downloadOutputFile", "tags": ["Outputs"], "summary": "Download response file bytes", "description": "Returns authenticated raw bytes for a file described in an output result. File content never appears in JSON.\n\n- Treat the stored MIME type as advisory.\n- Downloads are unavailable after acknowledgement or retention cleanup.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Authenticated file bytes.", "headers": { "Content-Disposition": { "description": "Attachment disposition with a sanitized filename.", "schema": { "type": "string" } }, "X-Request-ID": { "description": "Request identifier for support and tracing.", "schema": { "type": "string" } }, "X-Correlation-ID": { "description": "Server correlation identifier.", "schema": { "type": "string" } } }, "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "description": "The request is malformed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "The live resource is unavailable to this caller.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "422": { "description": "The request failed field or content validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "parameters": [ { "name": "output_result_id", "in": "path", "required": true, "description": "The result containing the file response.", "schema": { "type": "string", "minLength": 1 } }, { "name": "file_id", "in": "path", "required": true, "description": "The file id from response.file.", "schema": { "type": "string", "minLength": 1 } } ] } }, "/api/caller/status": { "get": { "operationId": "getCallerStatus", "tags": ["Status"], "summary": "Inspect caller and account status", "description": "Returns non-secret caller credential metadata plus account tier, storage, and active limit information.\n\n- last_used_at may lag recent valid requests by up to 15 minutes.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CallerStatusResponse" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/account/status": { "get": { "operationId": "getAccountStatus", "tags": ["Status"], "summary": "Inspect account status", "description": "Returns the bearer credential's non-secret account tier, storage, and active limit information.\n\n- This route still requires an existing caller bearer credential.", "security": [ { "callerBearer": [] } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountStatusResponse" } } } }, "401": { "description": "The caller credential is missing or unusable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "429": { "description": "A rate, quota, concurrency, or storage limit blocked the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "503": { "description": "The operation is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } } }, "components": { "securitySchemes": { "callerBearer": { "type": "http", "scheme": "bearer", "bearerFormat": "Agent Outbox caller key", "description": "A display-once caller credential. Keep it out of source control, request bodies, logs, and model prompts." } }, "schemas": { "Icon": { "type": "string", "enum": [ "archive", "at-sign", "calendar", "check", "chevron-down", "clock", "credit-card", "download", "external-link", "file", "flask-conical", "inbox", "mail", "message-square", "paperclip", "rocket", "send", "trash", "upload", "user-plus", "x" ], "description": "A supported Lucide icon name. Arbitrary SVG and HTML are rejected." }, "InputAction": { "type": "object", "required": ["display", "icon", "value", "overflow", "popup"], "properties": { "display": { "type": "string", "minLength": 1 }, "icon": { "$ref": "#/components/schemas/Icon" }, "value": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,128}$", "description": "A caller-owned stable value used for programmatic branching. Keep it separate from display text." }, "overflow": { "type": "boolean" }, "tone": { "type": "string", "enum": ["neutral", "brand", "success", "warning", "danger"], "description": "A fixed semantic color token. Supply tone and style together, or omit both for the legacy placement-based appearance." }, "style": { "type": "string", "enum": ["solid", "outline", "ghost"], "description": "A fixed button treatment. Supply tone and style together, or omit both for the legacy placement-based appearance." }, "popup": { "oneOf": [ { "type": "object", "required": ["kind"], "properties": { "kind": { "type": "string", "const": "none" } }, "additionalProperties": true }, { "$ref": "#/components/schemas/FreeTextPopup" }, { "$ref": "#/components/schemas/SingleSelectPopup" }, { "$ref": "#/components/schemas/MultiSelectPopup" }, { "$ref": "#/components/schemas/DatePickerPopup" }, { "$ref": "#/components/schemas/FileUploadPopup" } ], "discriminator": { "propertyName": "kind" }, "description": "The interaction shown after a human selects this action. The response uses the same kind." } }, "dependentRequired": { "tone": ["style"], "style": ["tone"] }, "additionalProperties": true }, "FreeTextPopup": { "type": "object", "required": ["kind", "label", "multiline"], "properties": { "kind": { "type": "string", "const": "free_text" }, "label": { "type": "string", "minLength": 1 }, "placeholder": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "default_value": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "multiline": { "type": "boolean" }, "min_length": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] }, "max_length": { "oneOf": [ { "type": "integer", "minimum": 1 }, { "type": "null" } ] } }, "additionalProperties": true }, "SingleSelectPopup": { "type": "object", "required": ["kind", "label", "options"], "properties": { "kind": { "type": "string", "const": "single_select" }, "label": { "type": "string", "minLength": 1 }, "options": { "type": "array", "items": { "type": "object", "required": ["display", "value"], "properties": { "display": { "type": "string", "minLength": 1 }, "value": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,128}$", "description": "A caller-owned stable value used for programmatic branching. Keep it separate from display text." }, "icon": { "oneOf": [ { "$ref": "#/components/schemas/Icon" }, { "type": "null" } ] } }, "additionalProperties": true }, "minItems": 1, "maxItems": 64 } }, "additionalProperties": true }, "MultiSelectPopup": { "type": "object", "required": ["kind", "label", "options"], "properties": { "kind": { "type": "string", "const": "multi_select" }, "label": { "type": "string", "minLength": 1 }, "options": { "type": "array", "items": { "type": "object", "required": ["display", "value"], "properties": { "display": { "type": "string", "minLength": 1 }, "value": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,128}$", "description": "A caller-owned stable value used for programmatic branching. Keep it separate from display text." }, "icon": { "oneOf": [ { "$ref": "#/components/schemas/Icon" }, { "type": "null" } ] } }, "additionalProperties": true }, "minItems": 1, "maxItems": 64 }, "min_selected": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] }, "max_selected": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] } }, "additionalProperties": true }, "DatePickerPopup": { "type": "object", "required": ["kind", "label", "mode"], "properties": { "kind": { "type": "string", "const": "date_picker" }, "label": { "type": "string", "minLength": 1 }, "mode": { "oneOf": [ { "type": "string", "const": "date" }, { "type": "string", "const": "datetime" } ] }, "placeholder": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "display_timezone": { "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "min_value": { "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "max_value": { "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] } }, "additionalProperties": true }, "FileUploadPopup": { "type": "object", "required": ["kind", "label"], "properties": { "kind": { "type": "string", "const": "file_upload" }, "label": { "type": "string", "minLength": 1 }, "accept_mime_types": { "oneOf": [ { "type": "array", "items": { "type": "string", "minLength": 3 }, "minItems": 1 }, { "type": "null" } ] } }, "additionalProperties": true }, "ActionResponse": { "oneOf": [ { "type": "object", "required": ["kind"], "properties": { "kind": { "type": "string", "const": "none" }, "feedback": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "required": ["kind", "text"], "properties": { "kind": { "type": "string", "const": "free_text" }, "text": { "type": "string" }, "feedback": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "required": ["kind", "value"], "properties": { "kind": { "type": "string", "const": "single_select" }, "feedback": { "type": "string" }, "value": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,128}$", "description": "A caller-owned stable value used for programmatic branching. Keep it separate from display text." } }, "additionalProperties": false }, { "type": "object", "required": ["kind", "values"], "properties": { "kind": { "type": "string", "const": "multi_select" }, "feedback": { "type": "string" }, "values": { "type": "array", "items": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,128}$", "description": "A caller-owned stable value used for programmatic branching. Keep it separate from display text." } } }, "additionalProperties": false }, { "type": "object", "required": ["kind", "mode", "value_date", "display_timezone"], "properties": { "feedback": { "type": "string" }, "kind": { "type": "string", "const": "date_picker" }, "mode": { "type": "string", "const": "date" }, "value_date": { "type": "string", "format": "date" }, "display_timezone": { "oneOf": [ { "type": "string" }, { "type": "null" } ] } }, "additionalProperties": false }, { "type": "object", "required": ["kind", "mode", "value_utc", "display_timezone"], "properties": { "feedback": { "type": "string" }, "kind": { "type": "string", "const": "date_picker" }, "mode": { "type": "string", "const": "datetime" }, "value_utc": { "type": "string", "format": "date-time" }, "display_timezone": { "oneOf": [ { "type": "string" }, { "type": "null" } ] } }, "additionalProperties": false }, { "type": "object", "required": ["kind", "file"], "properties": { "kind": { "type": "string", "const": "file_upload" }, "feedback": { "type": "string" }, "file": { "type": "object", "required": [ "file_id", "filename", "mime_type", "size_bytes", "sha256" ], "properties": { "file_id": { "type": "string", "minLength": 1 }, "filename": { "type": "string", "minLength": 1 }, "mime_type": { "type": "string", "minLength": 1 }, "size_bytes": { "type": "integer", "minimum": 0 }, "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" } }, "additionalProperties": false } }, "additionalProperties": false } ], "description": "The human response, with optional feedback accompanying the selected answer. Date-picker responses share a kind and are distinguished by mode." }, "InputSubmission": { "type": "object", "required": [ "caller_item_id", "row_type", "title", "subtitle", "summary", "link_buttons", "actions" ], "properties": { "caller_item_id": { "type": "string", "minLength": 1, "description": "Caller-owned stable logical item id. Input send returns 422 validation_failed if the id cannot fit the item uniqueness index." }, "priority": { "oneOf": [ { "oneOf": [ { "type": "string", "const": "low" }, { "type": "string", "const": "normal" }, { "type": "string", "const": "high" }, { "type": "string", "const": "urgent" } ] }, { "type": "null" } ] }, "row_type": { "type": "object", "required": ["display", "icon"], "properties": { "display": { "type": "string", "minLength": 1 }, "icon": { "$ref": "#/components/schemas/Icon" } }, "additionalProperties": true }, "row_accent_color": { "oneOf": [ { "type": "string", "enum": [ "red", "orange", "yellow", "green", "blue", "purple", "pink", "teal" ], "description": "A named color from the Agent Outbox product palette." }, { "type": "null" } ] }, "title": { "type": "string", "minLength": 1 }, "subtitle": { "type": "string", "minLength": 1 }, "corner": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "card_time": { "oneOf": [ { "type": "string", "format": "date-time", "pattern": "^(?!0000)\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?Z$", "description": "Optional caller-owned event time, separate from Outbox creation and update times. UTC only, years 0001–9999, at most millisecond precision. Omission or null clears it on replacement." }, { "type": "null" } ] }, "summary": { "type": "string", "minLength": 1 }, "details": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "link_buttons": { "type": "array", "items": { "type": "object", "required": ["display", "icon", "url"], "properties": { "display": { "type": "string", "minLength": 1 }, "icon": { "$ref": "#/components/schemas/Icon" }, "url": { "type": "string", "minLength": 1 } }, "additionalProperties": true }, "maxItems": 32 }, "card_visual": { "oneOf": [ { "oneOf": [ { "type": "object", "required": [ "kind", "label", "value", "display", "min_value", "max_value" ], "properties": { "kind": { "type": "string", "const": "numeric_bar" }, "label": { "type": "string", "minLength": 1 }, "value": { "type": "number" }, "display": { "type": "string", "minLength": 1 }, "unit": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "min_value": { "type": "number" }, "max_value": { "type": "number" } }, "additionalProperties": true }, { "type": "object", "required": [ "kind", "label", "value", "display", "min_value", "max_value" ], "properties": { "kind": { "type": "string", "const": "progress_ring" }, "label": { "type": "string", "minLength": 1 }, "value": { "type": "number" }, "display": { "type": "string", "minLength": 1 }, "unit": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "min_value": { "type": "number" }, "max_value": { "type": "number" }, "color": { "oneOf": [ { "type": "string", "enum": [ "red", "orange", "yellow", "green", "blue", "purple", "pink", "teal" ], "description": "A named color from the Agent Outbox product palette." }, { "type": "null" } ] } }, "additionalProperties": true }, { "type": "object", "required": ["kind", "text", "color"], "properties": { "kind": { "type": "string", "const": "pill" }, "text": { "type": "string", "minLength": 1 }, "icon": { "oneOf": [ { "$ref": "#/components/schemas/Icon" }, { "type": "null" } ] }, "color": { "type": "string", "enum": [ "red", "orange", "yellow", "green", "blue", "purple", "pink", "teal" ], "description": "A named color from the Agent Outbox product palette." } }, "additionalProperties": true } ], "discriminator": { "propertyName": "kind" } }, { "type": "null" } ] }, "skip_disabled": { "oneOf": [ { "type": "boolean" }, { "type": "null" } ] }, "actions": { "type": "array", "items": { "$ref": "#/components/schemas/InputAction" }, "minItems": 1, "maxItems": 32 } }, "title": "Input submission", "description": "A complete, caller-owned review request. The server derives account and caller identity from the bearer credential. Optional fields may be omitted; the server stores and later returns the default-expanded canonical form.", "additionalProperties": true }, "CanonicalRawInput": { "type": "object", "required": [ "caller_item_id", "priority", "row_type", "row_accent_color", "title", "subtitle", "corner", "card_time", "summary", "details", "link_buttons", "card_visual", "skip_disabled", "actions" ], "properties": { "caller_item_id": { "type": "string", "minLength": 1 }, "priority": { "oneOf": [ { "type": "string", "const": "low" }, { "type": "string", "const": "normal" }, { "type": "string", "const": "high" }, { "type": "string", "const": "urgent" } ] }, "row_type": { "type": "object", "required": ["display", "icon"], "properties": { "display": { "type": "string", "minLength": 1 }, "icon": { "$ref": "#/components/schemas/Icon" } }, "additionalProperties": true }, "row_accent_color": { "oneOf": [ { "type": "string", "enum": [ "red", "orange", "yellow", "green", "blue", "purple", "pink", "teal" ], "description": "A named color from the Agent Outbox product palette." }, { "type": "null" } ] }, "title": { "type": "string", "minLength": 1 }, "subtitle": { "type": "string", "minLength": 1 }, "corner": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "card_time": { "oneOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "summary": { "type": "string", "minLength": 1 }, "details": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "link_buttons": { "type": "array", "items": { "type": "object", "required": ["display", "icon", "url"], "properties": { "display": { "type": "string", "minLength": 1 }, "icon": { "$ref": "#/components/schemas/Icon" }, "url": { "type": "string", "minLength": 1 } }, "additionalProperties": true }, "maxItems": 32 }, "card_visual": { "oneOf": [ { "oneOf": [ { "type": "object", "required": [ "kind", "label", "value", "display", "min_value", "max_value" ], "properties": { "kind": { "type": "string", "const": "numeric_bar" }, "label": { "type": "string", "minLength": 1 }, "value": { "type": "number" }, "display": { "type": "string", "minLength": 1 }, "unit": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "min_value": { "type": "number" }, "max_value": { "type": "number" } }, "additionalProperties": true }, { "type": "object", "required": [ "kind", "label", "value", "display", "min_value", "max_value" ], "properties": { "kind": { "type": "string", "const": "progress_ring" }, "label": { "type": "string", "minLength": 1 }, "value": { "type": "number" }, "display": { "type": "string", "minLength": 1 }, "unit": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "min_value": { "type": "number" }, "max_value": { "type": "number" }, "color": { "oneOf": [ { "type": "string", "enum": [ "red", "orange", "yellow", "green", "blue", "purple", "pink", "teal" ], "description": "A named color from the Agent Outbox product palette." }, { "type": "null" } ] } }, "additionalProperties": true }, { "type": "object", "required": ["kind", "text", "color"], "properties": { "kind": { "type": "string", "const": "pill" }, "text": { "type": "string", "minLength": 1 }, "icon": { "oneOf": [ { "$ref": "#/components/schemas/Icon" }, { "type": "null" } ] }, "color": { "type": "string", "enum": [ "red", "orange", "yellow", "green", "blue", "purple", "pink", "teal" ], "description": "A named color from the Agent Outbox product palette." } }, "additionalProperties": true } ], "discriminator": { "propertyName": "kind" } }, { "type": "null" } ] }, "skip_disabled": { "type": "boolean" }, "actions": { "type": "array", "items": { "$ref": "#/components/schemas/InputAction" }, "minItems": 1, "maxItems": 32 } }, "title": "Canonical accepted input", "description": "The default-expanded submission Agent Outbox accepted and returns as raw_input. Request InputSubmission remains weaker so callers may omit defaults; this response shape always includes them.", "additionalProperties": false }, "InputDelete": { "type": "object", "required": ["caller_item_id"], "properties": { "caller_item_id": { "type": "string", "minLength": 1 } }, "title": "Delete pending input", "additionalProperties": true }, "InputReadRequest": { "type": "object", "required": ["caller_item_id"], "properties": { "caller_item_id": { "type": "string", "minLength": 1 } }, "title": "Read live input", "additionalProperties": true }, "OutputReadAllRequest": { "type": "object", "properties": { "limit": { "oneOf": [ { "type": "integer", "minimum": 1, "maximum": 100, "default": 25 }, { "type": "null" } ] }, "cursor": { "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] } }, "title": "Read-all page request", "additionalProperties": true }, "InputSendResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": [ "caller_item_id", "status", "revision", "created", "duplicate" ], "properties": { "caller_item_id": { "type": "string", "minLength": 1 }, "status": { "type": "string", "const": "pending" }, "revision": { "type": "integer", "minimum": 1 }, "created": { "type": "boolean" }, "duplicate": { "type": "boolean" } }, "additionalProperties": false } }, "additionalProperties": false }, "InputReplaceResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": [ "caller_item_id", "status", "revision", "replaced", "changed" ], "properties": { "caller_item_id": { "type": "string", "minLength": 1 }, "status": { "type": "string", "const": "pending" }, "revision": { "type": "integer", "minimum": 1 }, "replaced": { "type": "boolean" }, "changed": { "type": "boolean" } }, "additionalProperties": false } }, "additionalProperties": false }, "InputDeleteResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": ["caller_item_id", "deleted"], "properties": { "caller_item_id": { "type": "string", "minLength": 1 }, "deleted": { "type": "boolean", "const": true } }, "additionalProperties": false } }, "additionalProperties": false }, "InputListResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": [ "items", "has_more", "next_cursor", "returned_count", "page_limit" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "caller_item_id", "status", "revision", "created_at", "updated_at", "answered_at" ], "properties": { "caller_item_id": { "type": "string", "minLength": 1 }, "status": { "oneOf": [ { "type": "string", "const": "pending" }, { "type": "string", "const": "answered" } ] }, "revision": { "type": "integer", "minimum": 1 }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "answered_at": { "oneOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } }, "additionalProperties": false } }, "has_more": { "type": "boolean" }, "next_cursor": { "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "returned_count": { "type": "integer", "minimum": 0 }, "page_limit": { "type": "integer", "minimum": 1 } }, "title": "Input list page", "additionalProperties": false } }, "additionalProperties": false }, "InputReadResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": [ "caller_item_id", "status", "revision", "created_at", "updated_at", "answered_at", "raw_input" ], "properties": { "caller_item_id": { "type": "string", "minLength": 1 }, "status": { "oneOf": [ { "type": "string", "const": "pending" }, { "type": "string", "const": "answered" } ] }, "revision": { "type": "integer", "minimum": 1 }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "answered_at": { "oneOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "raw_input": { "$ref": "#/components/schemas/CanonicalRawInput" } }, "title": "Live input", "additionalProperties": false } }, "additionalProperties": false }, "OutputCheckResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": [ "items", "ready_count", "has_more", "next_cursor", "returned_count", "page_limit" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "output_result_id", "caller_item_id", "answered_at" ], "properties": { "output_result_id": { "type": "string", "minLength": 1 }, "caller_item_id": { "type": "string", "minLength": 1 }, "answered_at": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "ready_count": { "type": "integer", "minimum": 0, "description": "Total live results awaiting acknowledgement, including results already read." }, "has_more": { "type": "boolean" }, "next_cursor": { "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "returned_count": { "type": "integer", "minimum": 0 }, "page_limit": { "type": "integer", "minimum": 1 } }, "title": "Output readiness page", "additionalProperties": false } }, "additionalProperties": false }, "OutputResultResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": [ "output_result_id", "caller_id", "caller_item_id", "action_value", "response", "answered_at", "answered_by", "raw_input" ], "properties": { "output_result_id": { "type": "string", "minLength": 1 }, "caller_id": { "type": "string", "minLength": 1 }, "caller_item_id": { "type": "string", "minLength": 1 }, "action_value": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,128}$", "description": "A caller-owned stable value used for programmatic branching. Keep it separate from display text." }, "response": { "$ref": "#/components/schemas/ActionResponse" }, "answered_at": { "type": "string", "format": "date-time" }, "answered_by": { "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "raw_input": { "$ref": "#/components/schemas/CanonicalRawInput" } }, "title": "Output result", "additionalProperties": false } }, "additionalProperties": false }, "OutputReadPageResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": [ "items", "unavailable_outputs", "unavailable_count", "has_more", "next_cursor", "returned_count", "page_limit" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "output_result_id", "caller_id", "caller_item_id", "action_value", "response", "answered_at", "answered_by", "raw_input" ], "properties": { "output_result_id": { "type": "string", "minLength": 1 }, "caller_id": { "type": "string", "minLength": 1 }, "caller_item_id": { "type": "string", "minLength": 1 }, "action_value": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,128}$", "description": "A caller-owned stable value used for programmatic branching. Keep it separate from display text." }, "response": { "$ref": "#/components/schemas/ActionResponse" }, "answered_at": { "type": "string", "format": "date-time" }, "answered_by": { "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "raw_input": { "$ref": "#/components/schemas/CanonicalRawInput" } }, "title": "Output result", "additionalProperties": false } }, "unavailable_outputs": { "type": "array", "items": { "type": "object", "required": ["output_result_id", "code", "message"], "properties": { "output_result_id": { "type": "string", "minLength": 1 }, "code": { "type": "string", "const": "temporary_unavailable" }, "message": { "type": "string", "const": "Output file metadata is temporarily unavailable." } }, "additionalProperties": false } }, "unavailable_count": { "type": "integer", "minimum": 0 }, "has_more": { "type": "boolean" }, "next_cursor": { "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "returned_count": { "type": "integer", "minimum": 0 }, "page_limit": { "type": "integer", "minimum": 1 } }, "title": "Output result page", "additionalProperties": false } }, "additionalProperties": false }, "OutputAckResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": [ "output_result_id", "acknowledged", "already_acknowledged" ], "properties": { "output_result_id": { "type": "string", "minLength": 1 }, "acknowledged": { "type": "boolean", "const": true }, "already_acknowledged": { "type": "boolean" } }, "additionalProperties": false } }, "additionalProperties": false }, "CallerStatusResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": ["caller", "account"], "properties": { "caller": { "type": "object", "required": [ "caller_id", "caller_slug", "display_name", "status", "key" ], "properties": { "caller_id": { "type": "string", "minLength": 1 }, "caller_slug": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "display_name": { "type": "string", "minLength": 1 }, "status": { "oneOf": [ { "type": "string", "const": "pending_activation" }, { "type": "string", "const": "active" }, { "type": "string", "const": "revoked" }, { "type": "string", "const": "expired" } ] }, "key": { "type": "object", "required": [ "key_id", "prefix", "last_chars", "created_at", "last_used_at" ], "properties": { "key_id": { "type": "string", "minLength": 1 }, "prefix": { "type": "string", "minLength": 1 }, "last_chars": { "type": "string", "minLength": 1 }, "created_at": { "type": "string", "format": "date-time" }, "last_used_at": { "oneOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } }, "additionalProperties": false } }, "additionalProperties": false }, "account": { "type": "object", "required": [ "account_id", "label", "tier", "effective_tier", "billing_status", "grace_ends_at", "file_upload_enabled", "storage", "active_limit_blocks" ], "properties": { "account_id": { "type": "string", "minLength": 1 }, "label": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "tier": { "oneOf": [ { "type": "string", "const": "hosted_free" }, { "type": "string", "const": "hosted_paid" }, { "type": "string", "const": "self_hosted" } ] }, "effective_tier": { "oneOf": [ { "type": "string", "const": "free" }, { "type": "string", "const": "paid" } ] }, "billing_status": { "oneOf": [ { "type": "string", "const": "not_applicable" }, { "type": "string", "const": "active" }, { "type": "string", "const": "grace" }, { "type": "string", "const": "past_due" }, { "type": "string", "const": "canceled" } ] }, "grace_ends_at": { "oneOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "file_upload_enabled": { "type": "boolean" }, "storage": { "type": "object", "required": ["stored_bytes", "limit_name", "limit_bytes"], "properties": { "stored_bytes": { "type": "integer", "minimum": 0 }, "limit_name": { "type": "string", "minLength": 1 }, "limit_bytes": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] } }, "additionalProperties": false }, "active_limit_blocks": { "type": "array", "items": { "type": "object", "required": [ "operation_kind", "limit_name", "limit_reason_code", "limit_reason", "limit_resets_at", "used_units", "limit_units" ], "properties": { "operation_kind": { "type": "string", "minLength": 1 }, "limit_name": { "type": "string", "minLength": 1 }, "limit_reason_code": { "type": "string", "minLength": 1 }, "limit_reason": { "type": "string", "minLength": 1 }, "limit_resets_at": { "oneOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "used_units": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] }, "limit_units": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] } }, "additionalProperties": false } } }, "additionalProperties": false } }, "additionalProperties": false } }, "additionalProperties": false }, "AccountStatusResponse": { "type": "object", "required": ["ok", "request_id", "correlation_id", "data"], "properties": { "ok": { "type": "boolean", "const": true }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "data": { "type": "object", "required": [ "account_id", "label", "tier", "effective_tier", "billing_status", "grace_ends_at", "file_upload_enabled", "storage", "active_limit_blocks" ], "properties": { "account_id": { "type": "string", "minLength": 1 }, "label": { "oneOf": [ { "type": "string" }, { "type": "null" } ] }, "tier": { "oneOf": [ { "type": "string", "const": "hosted_free" }, { "type": "string", "const": "hosted_paid" }, { "type": "string", "const": "self_hosted" } ] }, "effective_tier": { "oneOf": [ { "type": "string", "const": "free" }, { "type": "string", "const": "paid" } ] }, "billing_status": { "oneOf": [ { "type": "string", "const": "not_applicable" }, { "type": "string", "const": "active" }, { "type": "string", "const": "grace" }, { "type": "string", "const": "past_due" }, { "type": "string", "const": "canceled" } ] }, "grace_ends_at": { "oneOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "file_upload_enabled": { "type": "boolean" }, "storage": { "type": "object", "required": ["stored_bytes", "limit_name", "limit_bytes"], "properties": { "stored_bytes": { "type": "integer", "minimum": 0 }, "limit_name": { "type": "string", "minLength": 1 }, "limit_bytes": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] } }, "additionalProperties": false }, "active_limit_blocks": { "type": "array", "items": { "type": "object", "required": [ "operation_kind", "limit_name", "limit_reason_code", "limit_reason", "limit_resets_at", "used_units", "limit_units" ], "properties": { "operation_kind": { "type": "string", "minLength": 1 }, "limit_name": { "type": "string", "minLength": 1 }, "limit_reason_code": { "type": "string", "minLength": 1 }, "limit_reason": { "type": "string", "minLength": 1 }, "limit_resets_at": { "oneOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "used_units": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] }, "limit_units": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] } }, "additionalProperties": false } } }, "additionalProperties": false } }, "additionalProperties": false }, "ErrorEnvelope": { "type": "object", "required": ["ok", "request_id", "correlation_id", "error"], "properties": { "ok": { "type": "boolean", "const": false }, "request_id": { "type": "string", "minLength": 1 }, "correlation_id": { "type": "string", "minLength": 1 }, "error": { "type": "object", "required": ["code", "message"], "properties": { "code": { "type": "string", "enum": [ "invalid_request", "invalid_json", "request_too_large", "validation_failed", "unsupported_icon", "unsafe_html", "unsafe_color", "upgrade_required", "retention_limit_exceeded", "billing_grace_expired", "authentication_required", "invalid_caller_credentials", "not_found", "pending_content_conflict", "answered_unacknowledged", "input_not_pending", "rate_limit_exceeded", "quota_limit_exceeded", "storage_limit_exceeded", "temporary_unavailable", "internal_error" ] }, "message": { "type": "string", "minLength": 1 }, "fields": { "type": "array", "items": { "type": "object", "required": ["path", "code", "message"], "properties": { "path": { "type": "string" }, "code": { "type": "string", "minLength": 1 }, "message": { "type": "string", "minLength": 1 } }, "additionalProperties": false } }, "retry_after_seconds": { "type": "integer", "minimum": 0 }, "limit": {}, "upgrade": {}, "error_id": { "type": "string", "minLength": 1 } }, "additionalProperties": true } }, "title": "Error response", "additionalProperties": false } } } }