{"openapi":"3.1.0","info":{"title":"Innmail for Agents API","version":"2.0.0","description":"Email inboxes, drafts, events, webhooks, lists, domains, calendar and files for AI agents. Bearer API keys (`im_live_…`) or the Innmail session cookie. Responses are camelCase JSON; errors are `{ error, code }`. Webhooks are signed with `X-Innmail-Signature: t=…,v1=hex(HMAC-SHA256(secret, \"t.body\"))`."},"servers":[{"url":"https://www.innmail.app/api/v1"}],"security":[{"bearer":[]}],"tags":[{"name":"Workspace"},{"name":"Members"},{"name":"Agents"},{"name":"Inboxes"},{"name":"Messages"},{"name":"Approvals"},{"name":"Threads"},{"name":"Drafts"},{"name":"Attachments"},{"name":"Files"},{"name":"Events"},{"name":"Webhooks"},{"name":"Lists"},{"name":"Domains"},{"name":"Metrics"},{"name":"API keys"},{"name":"Pods"},{"name":"Calendar"},{"name":"Audit"},{"name":"MCP"},{"name":"Inbound"}],"paths":{"/workspace":{"get":{"operationId":"workspace_get","summary":"Workspace, policies, transport and counts","description":"","tags":["Workspace"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"workspace_update","summary":"Rename; change outbound policies and inbound security","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Workspace"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"policies":{"type":"object"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace/inbound-secret":{"post":{"operationId":"workspace_rotateInboundSecret","summary":"Rotate the custom-domain inbound signing secret","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Workspace"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces":{"get":{"operationId":"workspaces_list","summary":"Workspaces the signed-in person can switch to","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Workspace"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/select":{"post":{"operationId":"workspaces_select","summary":"Switch the UI to another workspace","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Workspace"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspaceId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/members":{"get":{"operationId":"members_list","summary":"List members","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Members"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"members_invite","summary":"Invite by email (admin or member)","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Members"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["admin","member"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/members/{id}":{"patch":{"operationId":"members_update","summary":"Change a role","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Members"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","member"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"members_remove","summary":"Remove a member","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Members"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents":{"get":{"operationId":"agents_list","summary":"List agents with their inboxes","description":"Scope: `agents:read`.","tags":["Agents"],"parameters":[{"name":"podId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"agents_create","summary":"Create an agent and its inbox","description":"Scope: `agents:write`.","tags":["Agents"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"purpose":{"type":"string"},"slug":{"type":"string","description":"Local part of the address"},"domain":{"type":"string","description":"A verified workspace domain"},"podId":{"type":"string"},"timezone":{"type":"string"},"metadata":{"type":"object"},"status":{"type":"string","enum":["active","paused"]},"sendPolicy":{"type":"object","properties":{"requireApproval":{"type":"string","enum":["never","external","always"]},"dailyCap":{"type":"integer"}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}":{"get":{"operationId":"agents_get","summary":"Agent, inbox, keys, recent activity","description":"Scope: `agents:read`.","tags":["Agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"agents_update","summary":"Rename, pause/resume, policy, pod, metadata","description":"Scope: `agents:write`.","tags":["Agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"purpose":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"sendPolicy":{"type":"object"},"podId":{"type":"string","nullable":true},"metadata":{"type":"object"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"agents_delete","summary":"Delete an agent (keys stop working at once)","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Agents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes":{"get":{"operationId":"inboxes_list","summary":"List inboxes","description":"Scope: `inboxes:read`.","tags":["Inboxes"],"parameters":[{"name":"podId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"inboxes_create","summary":"Create an inbox (= an agent): username, domain, displayName, clientId","description":"Scope: `agents:write`.","tags":["Inboxes"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"domain":{"type":"string"},"displayName":{"type":"string"},"clientId":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"metadata":{"type":"object"},"timezone":{"type":"string"},"podId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/search":{"get":{"operationId":"inboxes_search","summary":"Search inboxes by address or name","description":"Scope: `inboxes:read`.","tags":["Inboxes"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}":{"get":{"operationId":"inboxes_get","summary":"One inbox","description":"Scope: `inboxes:read`.","tags":["Inboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"inboxes_update","summary":"Display name, pause/resume, time zone, metadata merge","description":"Scope: `agents:write`.","tags":["Inboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"timezone":{"type":"string"},"metadata":{"type":"object","nullable":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"inboxes_delete","summary":"Delete an inbox and its agent","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Inboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/messages":{"get":{"operationId":"messages_list","summary":"Messages in an inbox, newest first","description":"Scope: `messages:read`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"direction","in":"query","schema":{"type":"string"}},{"name":"unread","in":"query","schema":{"type":"string"}},{"name":"labels","in":"query","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string"}},{"name":"to","in":"query","schema":{"type":"string"}},{"name":"subject","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string"}},{"name":"after","in":"query","schema":{"type":"string"}},{"name":"ascending","in":"query","schema":{"type":"string"}},{"name":"include_spam","in":"query","schema":{"type":"string"}},{"name":"include_blocked","in":"query","schema":{"type":"string"}},{"name":"include_unauthenticated","in":"query","schema":{"type":"string"}},{"name":"include_trash","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"messages_send","summary":"Send (Idempotency-Key header honoured; 202 = held for a human; sendAt schedules)","description":"Scope: `messages:send`. Send `Idempotency-Key` to make retries safe.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"cc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"bcc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"subject":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"replyTo":{"type":"string"},"attachmentIds":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"X-* headers only"},"trackOpens":{"type":"boolean"},"sendAt":{"type":"string","format":"date-time","description":"Schedule instead of sending: the response is a draft"},"replyToMessageId":{"type":"string"},"forwardOfMessageId":{"type":"string"}}}}}},"responses":{"200":{"description":"Idempotent replay","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Sent or delivered","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Held for approval, or scheduled (draft)","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/messages/search":{"get":{"operationId":"messages_search","summary":"Full-text search in one inbox","description":"Scope: `messages:read`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string"}},{"name":"after","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/messages/batch-get":{"post":{"operationId":"messages_batchGet","summary":"Up to 500 messages by id","description":"Scope: `messages:read`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"messageIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/messages/batch-update":{"post":{"operationId":"messages_batchUpdate","summary":"One label change on up to 50 messages","description":"Scope: `threads:write`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"messageIds":{"type":"array","items":{"type":"string"}},"addLabels":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"removeLabels":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}":{"get":{"operationId":"messages_get","summary":"Message with delivery events and attachments","description":"Scope: `messages:read`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"messages_update","summary":"Read state and labels","description":"Scope: `threads:write`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"read":{"type":"boolean"},"addLabels":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"removeLabels":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"messages_delete","summary":"Permanently delete","description":"Scope: `threads:write`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/raw":{"get":{"operationId":"messages_getRaw","summary":"RFC 822 bytes","description":"Scope: `messages:read`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/codes":{"get":{"operationId":"messages_codes","summary":"Verification codes and links in a message","description":"Scope: `messages:read`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/attachments/{aid}":{"get":{"operationId":"messages_getAttachment","summary":"Download an attachment","description":"Scope: `messages:read`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"aid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/reply":{"post":{"operationId":"messages_reply","summary":"Reply (all: true for reply-all)","description":"Scope: `messages:send`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"cc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"bcc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"subject":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"replyTo":{"type":"string"},"attachmentIds":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"X-* headers only"},"trackOpens":{"type":"boolean"},"sendAt":{"type":"string","format":"date-time","description":"Schedule instead of sending: the response is a draft"},"all":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/reply-all":{"post":{"operationId":"messages_replyAll","summary":"Reply to everyone","description":"Scope: `messages:send`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"cc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"bcc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"subject":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"replyTo":{"type":"string"},"attachmentIds":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"X-* headers only"},"trackOpens":{"type":"boolean"},"sendAt":{"type":"string","format":"date-time","description":"Schedule instead of sending: the response is a draft"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/forward":{"post":{"operationId":"messages_forward","summary":"Forward with attachments","description":"Scope: `messages:send`.","tags":["Messages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"cc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"bcc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"subject":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"replyTo":{"type":"string"},"attachmentIds":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"X-* headers only"},"trackOpens":{"type":"boolean"},"sendAt":{"type":"string","format":"date-time","description":"Schedule instead of sending: the response is a draft"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/approve":{"post":{"operationId":"messages_approve","summary":"Approve a held send (people only)","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Approvals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/reject":{"post":{"operationId":"messages_reject","summary":"Reject a held send (people only)","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Approvals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/release":{"post":{"operationId":"messages_release","summary":"Release an inbound message held by inbound security (people only)","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Approvals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/security-feedback":{"post":{"operationId":"messages_securityFeedback","summary":"Say whether the inbound verdict was right","description":"Scope: `messages:read`.","tags":["Approvals"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"feedback":{"type":"string","enum":["correct_review","incorrect_review","missed_threat","legitimate_agent_instruction","spam_or_phishing"]},"notes":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/approvals":{"get":{"operationId":"approvals_list","summary":"Sends waiting for a person","description":"Scope: `messages:read`.","tags":["Approvals"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/threads":{"get":{"operationId":"threads_list","summary":"Threads across inboxes","description":"Scope: `messages:read`.","tags":["Threads"],"parameters":[{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"inboxId","in":"query","schema":{"type":"string"}},{"name":"agentId","in":"query","schema":{"type":"string"}},{"name":"podId","in":"query","schema":{"type":"string"}},{"name":"unread","in":"query","schema":{"type":"string"}},{"name":"labels","in":"query","schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"senders","in":"query","schema":{"type":"string"}},{"name":"recipients","in":"query","schema":{"type":"string"}},{"name":"subject","in":"query","schema":{"type":"string"}},{"name":"after","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"ascending","in":"query","schema":{"type":"string"}},{"name":"include_spam","in":"query","schema":{"type":"string"}},{"name":"include_blocked","in":"query","schema":{"type":"string"}},{"name":"include_unauthenticated","in":"query","schema":{"type":"string"}},{"name":"include_trash","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/threads/search":{"get":{"operationId":"threads_search","summary":"Full-text search over threads","description":"Scope: `messages:read`.","tags":["Threads"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"inboxId","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string"}},{"name":"after","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/threads":{"get":{"operationId":"inboxes_threads_list","summary":"Threads in one inbox","description":"Scope: `messages:read`.","tags":["Threads"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"unread","in":"query","schema":{"type":"string"}},{"name":"labels","in":"query","schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"senders","in":"query","schema":{"type":"string"}},{"name":"recipients","in":"query","schema":{"type":"string"}},{"name":"subject","in":"query","schema":{"type":"string"}},{"name":"after","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"ascending","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/threads/search":{"get":{"operationId":"inboxes_threads_search","summary":"Full-text search in one inbox","description":"Scope: `messages:read`.","tags":["Threads"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/threads/{id}":{"get":{"operationId":"threads_get","summary":"A thread with all messages","description":"Scope: `messages:read`.","tags":["Threads"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"threads_update","summary":"Read state and labels","description":"Scope: `threads:write`.","tags":["Threads"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"read":{"type":"boolean"},"labels":{"type":"array","items":{"type":"string"}},"addLabels":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"removeLabels":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"threads_delete","summary":"Permanently delete a thread","description":"Scope: `threads:write`.","tags":["Threads"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/drafts":{"get":{"operationId":"drafts_list","summary":"Drafts across inboxes","description":"Scope: `messages:read`.","tags":["Drafts"],"parameters":[{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/drafts/{id}":{"get":{"operationId":"drafts_get","summary":"One draft","description":"Scope: `messages:read`.","tags":["Drafts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/drafts":{"get":{"operationId":"inboxes_drafts_list","summary":"Drafts in an inbox","description":"Scope: `messages:read`.","tags":["Drafts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"labels","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"ascending","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"inboxes_drafts_create","summary":"Create a draft; sendAt schedules it","description":"Scope: `messages:send`.","tags":["Drafts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"cc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"bcc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"subject":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"replyTo":{"type":"string"},"attachmentIds":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"X-* headers only"},"trackOpens":{"type":"boolean"},"sendAt":{"type":"string","format":"date-time","description":"Schedule instead of sending: the response is a draft"},"inReplyTo":{"type":"string"},"forwardOf":{"type":"string"},"replyAll":{"type":"boolean"},"clientId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/drafts/{did}":{"get":{"operationId":"inboxes_drafts_get","summary":"One draft","description":"Scope: `messages:read`.","tags":["Drafts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"did","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"inboxes_drafts_update","summary":"Edit; null clears; sendAt: null un-schedules","description":"Scope: `messages:send`.","tags":["Drafts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"did","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"cc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"bcc":{"type":"array","items":{"type":"string"},"description":"Addresses: `a@b.com` or `Name <a@b.com>`; a comma-separated string is accepted too."},"subject":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"replyTo":{"type":"string"},"attachmentIds":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"X-* headers only"},"trackOpens":{"type":"boolean"},"sendAt":{"type":"string","format":"date-time","description":"Schedule instead of sending: the response is a draft"},"inReplyTo":{"type":"string"},"forwardOf":{"type":"string"},"replyAll":{"type":"boolean"},"clientId":{"type":"string"},"addAttachmentIds":{"type":"array","items":{"type":"string"}},"removeAttachmentIds":{"type":"array","items":{"type":"string"}},"addLabels":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"removeLabels":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"inboxes_drafts_delete","summary":"Delete a draft","description":"Scope: `messages:send`.","tags":["Drafts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"did","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/drafts/{did}/send":{"post":{"operationId":"inboxes_drafts_send","summary":"Send a draft now","description":"Scope: `messages:send`.","tags":["Drafts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"did","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/attachments":{"post":{"operationId":"attachments_upload","summary":"Upload a file (multipart `file`) to attach to a later send","description":"Scope: `messages:send`.","tags":["Attachments"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/files":{"get":{"operationId":"files_list","summary":"The inbox drive, in path order","description":"Scope: `files:read`.","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"pathPrefix","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"ascending","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"files_create","summary":"Upload (multipart `file` + `path`)","description":"Scope: `files:write`.","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/files/{fid}":{"get":{"operationId":"files_get","summary":"Metadata, or bytes with ?download=1","description":"Scope: `files:read`.","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"fid","in":"path","required":true,"schema":{"type":"string"}},{"name":"download","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"files_delete","summary":"Delete a file","description":"Scope: `files:write`.","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"fid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/search":{"get":{"operationId":"search","summary":"Full-text search over messages","description":"Scope: `messages:read`.","tags":["Messages"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"inboxId","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events":{"get":{"operationId":"events_list","summary":"Event feed after a cursor (polling alternative to webhooks)","description":"Scope: `events:read`.","tags":["Events"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"types","in":"query","schema":{"type":"string"}},{"name":"inboxId","in":"query","schema":{"type":"string"}},{"name":"agentId","in":"query","schema":{"type":"string"}},{"name":"podId","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events/stream":{"get":{"operationId":"events_stream","summary":"Server-sent events; reconnect with Last-Event-ID","description":"Scope: `events:read`.","tags":["Events"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"types","in":"query","schema":{"type":"string"}},{"name":"inboxId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks":{"get":{"operationId":"webhooks_list","summary":"List endpoints","description":"Scope: `webhooks:read`.","tags":["Webhooks"],"parameters":[{"name":"inboxId","in":"query","schema":{"type":"string"}},{"name":"podId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"webhooks_create","summary":"Create an endpoint; the secret is returned once","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Webhooks"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["message.received","message.received.spam","message.received.blocked","message.received.unauthenticated","message.security.completed","message.security.review","message.security.override","message.sent","message.delivered","message.simulated","message.held","message.approved","message.rejected","message.bounced","message.complained","message.failed","message.opened","draft.scheduled","draft.sent","draft.failed","agent.created","agent.updated","domain.verified","calendar.event.created","calendar.event.updated","calendar.event.deleted","calendar.event.responded","calendar.event.starting","calendar.event.ending","test.ping"]}},"inboxIds":{"type":"array","items":{"type":"string"}},"podIds":{"type":"array","items":{"type":"string"}},"headers":{"type":"object","additionalProperties":{"type":"string"}},"clientId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}":{"get":{"operationId":"webhooks_get","summary":"One endpoint","description":"Scope: `webhooks:read`.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"webhooks_update","summary":"url, events, active, add/remove inbox and pod subscriptions","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"addInboxIds":{"type":"array","items":{"type":"string"}},"removeInboxIds":{"type":"array","items":{"type":"string"}},"addPodIds":{"type":"array","items":{"type":"string"}},"removePodIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"webhooks_delete","summary":"Delete an endpoint","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}/headers":{"get":{"operationId":"webhooks_getHeaders","summary":"Custom delivery header names (values are write-only)","description":"Scope: `webhooks:read`.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"webhooks_updateHeaders","summary":"Set or remove custom delivery headers","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"headers":{"type":"object","additionalProperties":{"type":"string"}},"removeHeaders":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}/deliveries":{"get":{"operationId":"webhooks_deliveries","summary":"Delivery log","description":"Scope: `webhooks:read`.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}/test":{"post":{"operationId":"webhooks_test","summary":"Send a signed test.ping now","description":"Scope: `webhooks:write`.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/lists/{direction}/{type}":{"get":{"operationId":"lists_list","summary":"Workspace allow/block list (direction: send|receive, type: allow|block)","description":"Scope: `lists:read`.","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"lists_create","summary":"Add an email or domain","description":"Scope: `lists:write`.","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"string"},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/lists/{direction}/{type}/{entry}":{"get":{"operationId":"lists_get","summary":"One entry","description":"Scope: `lists:read`.","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}},{"name":"entry","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"lists_delete","summary":"Remove an entry","description":"Scope: `lists:write`.","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}},{"name":"entry","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/lists/{direction}/{type}":{"get":{"operationId":"inboxes_lists_list","summary":"Inbox-scoped list","description":"Scope: `lists:read`.","tags":["Lists"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"direction","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"inboxes_lists_create","summary":"Add an inbox-scoped entry","description":"Scope: `lists:write`.","tags":["Lists"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"direction","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"string"},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/lists/{direction}/{type}/{entry}":{"get":{"operationId":"inboxes_lists_get","summary":"One inbox-scoped entry","description":"Scope: `lists:read`.","tags":["Lists"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"direction","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}},{"name":"entry","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"inboxes_lists_delete","summary":"Remove an inbox-scoped entry","description":"Scope: `lists:write`.","tags":["Lists"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"direction","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}},{"name":"entry","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains":{"get":{"operationId":"domains_list","summary":"Custom domains","description":"Scope: `domains:read`.","tags":["Domains"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"domains_create","summary":"Register a domain; returns the DNS records to publish","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Domains"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string"},"inboundEnabled":{"type":"boolean"},"trackingEnabled":{"type":"boolean"},"feedbackEnabled":{"type":"boolean"},"subdomainsEnabled":{"type":"boolean"},"podId":{"type":"string"},"clientId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}":{"get":{"operationId":"domains_get","summary":"One domain with record status","description":"Scope: `domains:read`.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"domains_update","summary":"Toggle inbound, tracking, feedback, subdomains","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"inboundEnabled":{"type":"boolean"},"trackingEnabled":{"type":"boolean"},"feedbackEnabled":{"type":"boolean"},"subdomainsEnabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"domains_delete","summary":"Remove a domain","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}/verify":{"post":{"operationId":"domains_verify","summary":"Check the DNS records now","description":"Scope: `domains:write`.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}/zone-file":{"get":{"operationId":"domains_zoneFile","summary":"BIND zone file with every record","description":"Scope: `domains:read`.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics/events":{"get":{"operationId":"metrics_events","summary":"Counts of sent, delivered, received, bounced… per period","description":"Scope: `metrics:read`.","tags":["Metrics"],"parameters":[{"name":"inboxId","in":"query","schema":{"type":"string"}},{"name":"event_types","in":"query","schema":{"type":"string"}},{"name":"start","in":"query","schema":{"type":"string"}},{"name":"end","in":"query","schema":{"type":"string"}},{"name":"period","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics/usage":{"get":{"operationId":"metrics_usage","summary":"Cumulative message, thread, storage, inbox and domain counts","description":"Scope: `metrics:read`.","tags":["Metrics"],"parameters":[{"name":"inboxId","in":"query","schema":{"type":"string"}},{"name":"usage_types","in":"query","schema":{"type":"string"}},{"name":"start","in":"query","schema":{"type":"string"}},{"name":"end","in":"query","schema":{"type":"string"}},{"name":"period","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics/rates":{"get":{"operationId":"metrics_rates","summary":"Rolling bounce and complaint rates","description":"Scope: `metrics:read`.","tags":["Metrics"],"parameters":[{"name":"inboxId","in":"query","schema":{"type":"string"}},{"name":"rate_types","in":"query","schema":{"type":"string"}},{"name":"start","in":"query","schema":{"type":"string"}},{"name":"end","in":"query","schema":{"type":"string"}},{"name":"period","in":"query","schema":{"type":"string"}},{"name":"window","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/keys":{"get":{"operationId":"keys_list","summary":"API keys (no secrets)","description":"Scope: `keys:read`.","tags":["API keys"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"keys_create","summary":"Create a workspace, pod or agent key; the secret is returned once","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["API keys"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"agentId":{"type":"string"},"podId":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["agents:read","agents:write","inboxes:read","messages:read","messages:send","threads:write","webhooks:read","webhooks:write","keys:read","audit:read","events:read","metrics:read","lists:read","lists:write","domains:read","domains:write","calendar:read","calendar:write","files:read","files:write","pods:read","pods:write"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/keys/{id}":{"get":{"operationId":"keys_get","summary":"One key","description":"Scope: `keys:read`.","tags":["API keys"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"keys_update","summary":"Rename or change scopes","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["API keys"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"keys_rotate","summary":"Rotate: new secret, old one revoked","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["API keys"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"keys_revoke","summary":"Revoke","description":"Signed-in people only (admin or owner). API keys get 403.","tags":["API keys"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pods":{"get":{"operationId":"pods_list","summary":"Pods (tenants)","description":"Scope: `pods:read`.","tags":["Pods"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"pods_create","summary":"Create a pod (clientId is idempotent)","description":"Scope: `pods:write`.","tags":["Pods"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"clientId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pods/{id}":{"get":{"operationId":"pods_get","summary":"A pod and its agents","description":"Scope: `pods:read`.","tags":["Pods"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"pods_update","summary":"Rename","description":"Scope: `pods:write`.","tags":["Pods"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"pods_delete","summary":"Delete; agents are detached, pod keys revoked","description":"Scope: `pods:write`.","tags":["Pods"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/calendar":{"get":{"operationId":"calendar_get","summary":"The inbox calendar","description":"Scope: `calendar:read`.","tags":["Calendar"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"calendar_update","summary":"Default time zone","description":"Scope: `calendar:write`.","tags":["Calendar"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"timezone":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/calendar/events":{"get":{"operationId":"calendar_listEvents","summary":"Stored events, most recently updated first","description":"Scope: `calendar:read`.","tags":["Calendar"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"calendar_createEvent","summary":"Create a one-off or recurring event","description":"Scope: `calendar:write`.","tags":["Calendar"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"location":{"type":"string"},"status":{"type":"string","enum":["confirmed","tentative","cancelled"]},"allDay":{"type":"boolean"},"start":{"type":"string","description":"YYYY-MM-DDTHH:mm:ss (or YYYY-MM-DD all-day) in `timezone`"},"end":{"type":"string"},"timezone":{"type":"string"},"recurrence":{"type":"object","properties":{"freq":{"type":"string","enum":["daily","weekly","monthly","yearly"]},"interval":{"type":"integer"},"count":{"type":"integer"},"until":{"type":"string","format":"date-time"},"byDay":{"type":"array","items":{"type":"string"}}}},"attendees":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["required","optional"]}}}},"sendInvites":{"type":"boolean"},"metadata":{},"clientId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/calendar/agenda":{"get":{"operationId":"calendar_agenda","summary":"Every date in a window","description":"Scope: `calendar:read`.","tags":["Calendar"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"after","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/calendar/events/{eid}":{"get":{"operationId":"calendar_getEvent","summary":"An event, or one date by dated id","description":"Scope: `calendar:read`.","tags":["Calendar"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"eid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"calendar_updateEvent","summary":"Update","description":"Scope: `calendar:write`.","tags":["Calendar"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"eid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"location":{"type":"string"},"status":{"type":"string","enum":["confirmed","tentative","cancelled"]},"allDay":{"type":"boolean"},"start":{"type":"string","description":"YYYY-MM-DDTHH:mm:ss (or YYYY-MM-DD all-day) in `timezone`"},"end":{"type":"string"},"timezone":{"type":"string"},"recurrence":{"type":"object","properties":{"freq":{"type":"string","enum":["daily","weekly","monthly","yearly"]},"interval":{"type":"integer"},"count":{"type":"integer"},"until":{"type":"string","format":"date-time"},"byDay":{"type":"array","items":{"type":"string"}}}},"attendees":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["required","optional"]}}}},"sendInvites":{"type":"boolean"},"metadata":{},"clientId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"calendar_deleteEvent","summary":"Delete (?send_invites=true emails a cancellation)","description":"Scope: `calendar:write`.","tags":["Calendar"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"eid","in":"path","required":true,"schema":{"type":"string"}},{"name":"send_invites","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/calendar/events/{eid}/instances":{"get":{"operationId":"calendar_listInstances","summary":"Dates of a recurring event","description":"Scope: `calendar:read`.","tags":["Calendar"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"eid","in":"path","required":true,"schema":{"type":"string"}},{"name":"after","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inboxes/{id}/calendar/events/{eid}/respond":{"post":{"operationId":"calendar_respond","summary":"Accept, decline or tentatively accept an emailed invitation","description":"Scope: `calendar:write`.","tags":["Calendar"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"eid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["accepted","declined","tentative"]},"comment":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/audit":{"get":{"operationId":"audit_list","summary":"Audit log","description":"Scope: `audit:read`.","tags":["Audit"],"parameters":[{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"agentId","in":"query","schema":{"type":"string"}},{"name":"action","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp":{"post":{"operationId":"mcp","summary":"MCP server (JSON-RPC 2.0, Streamable HTTP)","description":"","tags":["MCP"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inbound/{workspaceId}":{"post":{"operationId":"inbound_workspace","summary":"Custom-domain inbound: raw MIME signed with the workspace inbound secret","description":"","tags":["Inbound"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inbound/shared":{"post":{"operationId":"inbound_shared","summary":"Shared-domain inbound: raw MIME signed with AGENTS_INBOUND_SECRET","description":"","tags":["Inbound"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Error: `{ error, code }`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]},"Address":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":"string"}},"required":["address"]},"Message":{"type":"object","description":"id, inboxId, threadId, agentId, direction, messageId, from/to/cc/bcc, subject, textBody, htmlBody, extractedText, snippet, headers, status, heldReason, labels, classification, review, trackOpens, openedAt, sizeBytes, read, sentAt, receivedAt, createdAt"},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message.received","message.received.spam","message.received.blocked","message.received.unauthenticated","message.security.completed","message.security.review","message.security.override","message.sent","message.delivered","message.simulated","message.held","message.approved","message.rejected","message.bounced","message.complained","message.failed","message.opened","draft.scheduled","draft.sent","draft.failed","agent.created","agent.updated","domain.verified","calendar.event.created","calendar.event.updated","calendar.event.deleted","calendar.event.responded","calendar.event.starting","calendar.event.ending","test.ping"]},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string"},"inboxId":{"type":"string","nullable":true},"agentId":{"type":"string","nullable":true},"podId":{"type":"string","nullable":true},"data":{"type":"object"}}}}}}