{"openapi":"3.1.0","info":{"title":"DakNode API","description":"API-first email engine for AI agents. Ingests, parses, threads, indexes, and delivers — the customer's own codebase does the deciding.","version":"1.0.0"},"paths":{"/v1/inboxes":{"post":{"tags":["inboxes"],"summary":"Create Inbox","operationId":"create_inbox","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["inboxes"],"summary":"List Inboxes","description":"Live inboxes in the key's Workspace, newest first.\n\nWorkspace-scoped keys only: `/v1/inboxes` is deliberately absent from the\ninbox-scope table, because listing it would also open `POST /v1/inboxes`.","operationId":"list_inboxes","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inboxes/{inbox_id}/webhook":{"put":{"tags":["inboxes"],"summary":"Register Webhook","description":"Register or replace an inbox's webhook destination.\n\nIdempotent (PUT): registering the same URL twice is a no-op, and returns no\nsecret. Pointing the inbox at a **different** destination mints a fresh\nsecret and returns it once — a new destination is a new party, and it must\nnot inherit the credential the previous one holds (specs/04_webhooks.md §3a).","operationId":"register_webhook","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRegisterRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inboxes/{inbox_id}/webhook/rotate":{"post":{"tags":["inboxes"],"summary":"Rotate Webhook Secret","description":"Mint a new signing secret for the same destination, returned once.\n\nThis exists because `PUT` cannot serve the purpose: `PUT` with the same URL\nis a no-op by design, so without this endpoint a customer whose secret\nleaked had no way to replace it short of moving to a different URL.\n\nThe destination is unchanged, so `webhook_registration_id` is **not**\ntouched and pending events stay deliverable — they will be signed with the\nnew secret, which the same receiving party has just been handed. Cancelling\nthem would discard legitimate undelivered events over a credential change\nthe receiver initiated (specs/04_webhooks.md §3c).","operationId":"rotate_webhook_secret","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inboxes/{inbox_id}":{"get":{"tags":["inboxes"],"summary":"Get Inbox","operationId":"get_inbox","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__v1__inboxes__InboxOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["inboxes"],"summary":"Update Inbox","operationId":"update_inbox","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__v1__inboxes__InboxOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["inboxes"],"summary":"Delete Inbox","description":"Deactivate an inbox — `specs/inbox_lifecycle_api.md#delete-semantics`.\n\n**Workspace-scoped keys only.** This route shares its template with GET and\nPATCH, which an inbox-scoped key may use, so the refusal is made here: a\nkey scoped to one inbox must not be able to destroy it.","operationId":"delete_inbox","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxDeleted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sns/inbound":{"post":{"tags":["ingestion"],"summary":"Sns Inbound","operationId":"sns_inbound","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/sns/ses-events":{"post":{"tags":["outbound-events"],"summary":"Sns Ses Events","operationId":"sns_ses_events","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/webhooks/dead-letters":{"get":{"tags":["dead-letters"],"summary":"List Dead Letters","description":"Undeliverable events for the caller's organization, newest first.","operationId":"list_dead_letters","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeadLetterResponse"},"title":"Response List Dead Letters"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/dead-letters/{outbox_id}/replay":{"post":{"tags":["dead-letters"],"summary":"Replay Dead Letter","description":"Return one dead-lettered event to the delivery queue.\n\nExplicit and audited: nothing automatic ever revives a dead-lettered row,\nbecause exhaustion was a conclusion and re-litigating it without a human\nwould be an endless loop with more steps.\n\n**The logic lives in `app/services/webhook_replay.py`**, shared with the\nsession-authenticated console route. This endpoint's contract — refusals,\nstatus codes and response fields — is unchanged.","operationId":"replay_dead_letter","security":[{"HTTPBearer":[]}],"parameters":[{"name":"outbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Outbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/consents":{"post":{"tags":["consent"],"summary":"Create Consent","description":"Record a declared consent for one recipient.\n\n`created_by_key_id` comes from the authenticated context, never from the\nbody — otherwise attribution would be self-reported too.","operationId":"create_consent","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/consents/revoke":{"post":{"tags":["consent"],"summary":"Revoke","description":"Withdraw consent. The row is revoked, never deleted — deleting it would\nerase the record that consent was ever claimed.","operationId":"revoke","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Revoke"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/send":{"post":{"tags":["send"],"summary":"Send","description":"Accept one outbound message — to one recipient (unchanged) or several.\n\nThe header is **mandatory**. An endpoint that sends email on a retryable\nverb without one has no way to tell a retry from a second request, and the\ncaller cannot add idempotency afterwards.","operationId":"send","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Send"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/messages/{message_id}/forward":{"post":{"tags":["send"],"summary":"Forward Message","description":"MULTI-RCPT-A3: forward a received message from the inbox it arrived at.\n\nThe message is read through the same scoped, live-inbox read as\n`GET /v1/messages/{id}`, so a scoped key can forward only its own inbox's\nmail and a deleted inbox's mail cannot be forwarded. Attachments are\ntext-only by default; attachment_ids explicitly selects signed-SES-PASS files.","operationId":"forward_message","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForwardRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Forward Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inboxes/{inbox_id}/block-rules":{"post":{"tags":["block-rules"],"summary":"Create Inbox Block Rule","description":"Refuse inbound mail from a sender, for this inbox only.","operationId":"create_inbox_block_rule","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockRuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockRuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["block-rules"],"summary":"List Inbox Block Rules","description":"Everything blocking this inbox, including Workspace-wide rules.","operationId":"list_inbox_block_rules","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockRulePage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/block-rules":{"post":{"tags":["block-rules"],"summary":"Create Block Rule","description":"Refuse inbound mail from a sender across the whole Workspace.","operationId":"create_block_rule","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockRuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockRuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["block-rules"],"summary":"List Block Rules","description":"Workspace-wide rules only. Use the inbox route to see what applies there.","operationId":"list_block_rules","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockRulePage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/block-rules/{rule_id}":{"delete":{"tags":["block-rules"],"summary":"Delete Block Rule","description":"Stop a rule blocking. **Soft delete — block records are preserved.**\n\nHard-deleting would strand the evidence that mail was refused. The audit\ntrail outlives the rule that created it.","operationId":"delete_block_rule","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/mail-policy":{"get":{"tags":["mail-policy"],"summary":"Get Mail Policy","operationId":"get_mail_policy","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyOut"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["mail-policy"],"summary":"Update Mail Policy","operationId":"update_mail_policy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyChange"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/inboxes/{inbox_id}/mail-policy":{"get":{"tags":["mail-policy"],"summary":"Get Inbox Mail Policy","operationId":"get_inbox_mail_policy","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["mail-policy"],"summary":"Update Inbox Mail Policy","operationId":"update_inbox_mail_policy","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/mail-policy/rules":{"get":{"tags":["mail-policy"],"summary":"List Mail Policy Rules","operationId":"list_mail_policy_rules","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RuleOut"},"type":"array","title":"Response List Mail Policy Rules"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["mail-policy"],"summary":"Create Mail Policy Rule","operationId":"create_mail_policy_rule","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/inboxes/{inbox_id}/mail-policy/rules":{"get":{"tags":["mail-policy"],"summary":"List Inbox Mail Policy Rules","operationId":"list_inbox_mail_policy_rules","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleOut"},"title":"Response List Inbox Mail Policy Rules"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["mail-policy"],"summary":"Create Inbox Mail Policy Rule","operationId":"create_inbox_mail_policy_rule","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/mail-policy-rules/{rule_id}":{"delete":{"tags":["mail-policy"],"summary":"Delete Mail Policy Rule","operationId":"delete_mail_policy_rule","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/drafts":{"get":{"tags":["drafts"],"summary":"List Drafts","operationId":"list_drafts","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"enum":["draft","approved","scheduled","queued","cancelled","rejected"],"type":"string"},{"type":"null"}],"title":"State"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["drafts"],"summary":"Create Draft","operationId":"create_draft","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/drafts/{draft_id}":{"get":{"tags":["drafts"],"summary":"Get Draft","operationId":"get_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["drafts"],"summary":"Update Draft","operationId":"update_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftEdit"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["drafts"],"summary":"Delete Draft","operationId":"delete_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Revision"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/drafts/{draft_id}/cancel":{"post":{"tags":["drafts"],"summary":"Cancel Draft","operationId":"cancel_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Revision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/drafts/{draft_id}/schedule":{"post":{"tags":["drafts"],"summary":"Schedule Draft","operationId":"schedule_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftSchedule"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/drafts/{draft_id}/send":{"post":{"tags":["drafts"],"summary":"Send Draft","operationId":"send_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Revision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Send Draft"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows":{"get":{"tags":["console"],"summary":"Workflow Overview","operationId":"console_workflow_overview","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowOverview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/policy":{"patch":{"tags":["console"],"summary":"Change Workflow Policy","operationId":"console_change_workflow_policy","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyMutation"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/rules":{"post":{"tags":["console"],"summary":"Add Workflow Rule","operationId":"console_add_workflow_rule","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleMutation"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/rules/{rule_id}":{"delete":{"tags":["console"],"summary":"Remove Workflow Rule","operationId":"console_remove_workflow_rule","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/preview":{"post":{"tags":["console"],"summary":"Preview Workflow Policy","operationId":"console_preview_workflow_policy","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/subscriptions":{"post":{"tags":["console"],"summary":"Create Workflow Subscription","operationId":"console_create_workflow_subscription","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionMutation"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/subscriptions/{subscription_id}":{"patch":{"tags":["console"],"summary":"Change Workflow Subscription","operationId":"console_change_workflow_subscription","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Subscription Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["console"],"summary":"Remove Workflow Subscription","operationId":"console_remove_workflow_subscription","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Subscription Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/subscriptions/{subscription_id}/rotate":{"post":{"tags":["console"],"summary":"Rotate Workflow Subscription","operationId":"console_rotate_workflow_subscription","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Subscription Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/drafts":{"post":{"tags":["console"],"summary":"Create Workflow Draft","operationId":"console_create_workflow_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/drafts/{draft_id}":{"patch":{"tags":["console"],"summary":"Edit Workflow Draft","operationId":"console_edit_workflow_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftEdit"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/drafts/{draft_id}/approval":{"post":{"tags":["console"],"summary":"Approve Workflow Draft","operationId":"console_approve_workflow_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/drafts/{draft_id}/send":{"post":{"tags":["console"],"summary":"Send Workflow Draft","operationId":"console_send_workflow_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Revision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Console Send Workflow Draft"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/drafts/{draft_id}/schedule":{"post":{"tags":["console"],"summary":"Schedule Workflow Draft","operationId":"console_schedule_workflow_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftSchedule"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/workflows/drafts/{draft_id}/cancel":{"post":{"tags":["console"],"summary":"Cancel Workflow Draft","operationId":"console_cancel_workflow_draft","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Revision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/retention":{"get":{"tags":["console"],"summary":"Get Retention","operationId":"console_get_retention","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["console"],"summary":"Change Retention","operationId":"console_change_retention","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionPolicyChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/retention/preview":{"post":{"tags":["console"],"summary":"Preview Retention","operationId":"console_preview_retention","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionPeriod"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/agents/{inbox_id}/branding":{"get":{"tags":["console"],"summary":"Get Branding","operationId":"console_get_branding","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["console"],"summary":"Update Branding","operationId":"console_update_branding","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inboxes/{inbox_id}/webhook-subscriptions":{"get":{"tags":["webhook-subscriptions"],"summary":"List Webhook Subscriptions","operationId":"list_webhook_subscriptions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionOut"},"title":"Response List Webhook Subscriptions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["webhook-subscriptions"],"summary":"Create Webhook Subscription","operationId":"create_webhook_subscription","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhook-subscriptions/{subscription_id}":{"get":{"tags":["webhook-subscriptions"],"summary":"Get Webhook Subscription","operationId":"get_webhook_subscription","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["webhook-subscriptions"],"summary":"Update Webhook Subscription","operationId":"update_webhook_subscription","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Subscription Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["webhook-subscriptions"],"summary":"Delete Webhook Subscription","operationId":"delete_webhook_subscription","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Subscription Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhook-subscriptions/{subscription_id}/rotate":{"post":{"tags":["webhook-subscriptions"],"summary":"Rotate Webhook Subscription","operationId":"rotate_webhook_subscription","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inboxes/{inbox_id}/messages":{"get":{"tags":["messages"],"summary":"List Messages","description":"Newest first. Keyset pagination per `specs/12` §3.","operationId":"list_messages","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"label","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},{"name":"is_read","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Read"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/messages/{message_id}/state":{"patch":{"tags":["messages"],"summary":"Update Message State","operationId":"update_message_state","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StateChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inboxes/{inbox_id}/threads":{"get":{"tags":["messages"],"summary":"List Threads","description":"Most recently active first, NULL `last_message_at` last.","operationId":"list_threads","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/messages/{message_id}":{"get":{"tags":["messages"],"summary":"Get Message","operationId":"get_message","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/messages/{message_id}/attachments":{"get":{"tags":["messages"],"summary":"List Received Attachments","operationId":"list_received_attachments","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentOut"},"title":"Response List Received Attachments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/attachments/{attachment_id}/content":{"get":{"tags":["messages"],"summary":"Download Received Attachment","operationId":"download_received_attachment","security":[{"HTTPBearer":[]}],"parameters":[{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attachment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/messages/{message_id}/raw":{"get":{"tags":["messages"],"summary":"Download Raw Message","description":"Download retained original MIME, only with confirmed PASS scan evidence.","operationId":"download_raw_message","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/threads/{thread_id}":{"get":{"tags":["messages"],"summary":"Get Thread","description":"Follows one merge alias, so a thread id already sent in a webhook still resolves.","operationId":"get_thread","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadDetailOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit-events":{"get":{"tags":["security"],"summary":"List Audit Events","operationId":"list_audit_events","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/messages/{message_id}/risk-feedback":{"get":{"tags":["security"],"summary":"Get Risk Feedback","operationId":"get_risk_feedback","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FeedbackOut"},{"type":"null"}],"title":"Response Get Risk Feedback"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["security"],"summary":"Record Risk Feedback","operationId":"record_risk_feedback","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/security/audit":{"get":{"tags":["console"],"summary":"Console Audit Events","operationId":"console_console_audit_events","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"inbox_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/activity/{message_id}/risk-feedback":{"get":{"tags":["console"],"summary":"Console Get Feedback","operationId":"console_console_get_feedback","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FeedbackOut"},{"type":"null"}],"title":"Response Console Console Get Feedback"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["console"],"summary":"Console Record Feedback","operationId":"console_console_record_feedback","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/metrics":{"get":{"tags":["metrics"],"summary":"Workspace Metrics","description":"Usage facts and observed delivery outcomes; inbox keys see only their inbox.","operationId":"workspace_metrics","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":92,"minimum":1,"default":30,"title":"Days"}},{"name":"include_today","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Today"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inboxes/{inbox_id}/metrics":{"get":{"tags":["metrics"],"summary":"Inbox Metrics","description":"Metrics for an own live inbox, with the same UTC window as workspace metrics.","operationId":"inbox_metrics","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":92,"minimum":1,"default":30,"title":"Days"}},{"name":"include_today","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Today"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inboxes/{inbox_id}/events":{"get":{"tags":["events"],"summary":"Poll Inbox Events","description":"Poll retained inbound message availability; persist next_cursor and deduplicate IDs.\n\nNo webhook registration needed. An empty response still has a tail cursor.\nCursors expire after one hour: restart from beginning and deduplicate on id.\nThis is not a complete webhook/audit catalogue; fetch content via the message API.","operationId":"poll_inbox_events","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Cursor"}},{"name":"start","in":"query","required":false,"schema":{"enum":["beginning","latest"],"type":"string","default":"beginning","title":"Start"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"wait_seconds","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":0,"default":0,"title":"Wait Seconds"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxEventPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/search":{"post":{"tags":["search"],"summary":"Search","description":"Nearest neighbours within the caller's own mail.\n\nOrdering is by similarity and is **not stable between calls** — an\napproximate index re-ranks as content changes. There is no cursor; see\nspec §5 for why keyset pagination does not apply.","operationId":"search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/unsubscribe/{token}":{"get":{"tags":["unsubscribe"],"summary":"Describe","description":"Describe the action. **No side effect, deliberately.**\n\nMail security scanners and link prefetchers follow `GET` URLs found in\nheaders. If `GET` unsubscribed, every recipient behind such a scanner would\nbe silently opted out of mail they never asked to stop — which is the reason\nRFC 8058 specifies a `POST`.","operationId":"describe","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","maxLength":512,"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Describe"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["unsubscribe"],"summary":"Unsubscribe","description":"Suppress the recipient named by the token's digest.\n\nThe address is never learned: the digest IS the enforcement key (§3e), so\nthere is nothing to reverse and nothing to look up.","operationId":"unsubscribe","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","maxLength":512,"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Unsubscribe"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/privacy/erasure-requests":{"post":{"tags":["privacy"],"summary":"Create Erasure Request","description":"Accept an erasure request for one subject.\n\n`202` for a new request, `200` when an open one already existed — a client\nthat timed out and retried gets the original back rather than a second sweep\nover the same records.","operationId":"create_erasure_request","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErasureRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Erasure Request"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/privacy/erasure-requests/{request_id}":{"get":{"tags":["privacy"],"summary":"Read Erasure Request","description":"Report progress. Takes the **request id**, never the address.\n\nA cross-tenant read is a `404` *and* a security event. Unlike a wrong\n`inbox_id` — a plausible client bug — a request naming another tenant's\nerasure record is an attempt to reach data the caller does not own.","operationId":"read_erasure_request","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Read Erasure Request"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/public/waitlist":{"post":{"tags":["waitlist"],"summary":"Join Waitlist","description":"Record a waitlist submission, or deliberately discard it as abuse.\n\nThe ORDER below is the security design and is asserted by tests:\n\n  1. body ceiling      — refused before identification or limiter construction\n  2. client identity   — fails closed BEFORE any bucket is consumed\n  3. ALL THREE buckets — exactly one visitor, one hourly and one daily\n  4. limit decision\n  5. decode a JSON OBJECT, far enough to read `website`\n  6. honeypot          — if filled, the fixed 202; nothing validated, nothing stored\n  7. full validation\n  8. one idempotent INSERT\n\n**The honeypot is answered before validation, deliberately.** If a filled\nhoneypot were checked after the fields were validated, a bot could combine\nit with an invalid email, a false consent or an over-length field and read\nthe difference: a 422 means the honeypot was ignored, a 202 means it was\ncaught. Answering it first makes every filled-honeypot submission\nindistinguishable from a good one, whatever else it contains.\n\nMalformed JSON and a non-object body are the exception, and still return the\nnormal validation error: no trustworthy `website` can be extracted from\nsomething that never parsed, so there is nothing to answer.\n\nSteps 5-8 are reached only by a request that has already paid for itself.","operationId":"join_waitlist","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/public/agents/signup":{"post":{"tags":["public"],"summary":"Agent Signup","description":"Register an agent and mail its human a verification code.","operationId":"agent_signup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/public/agents/verify":{"post":{"tags":["public"],"summary":"Agent Verify","description":"Check a code. Every failure answers identically.","operationId":"agent_verify","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/billing":{"get":{"tags":["console"],"summary":"Read Billing","description":"What this Account currently has. Never says \"paid\" from an intent (§8).\n\nReadable by **any** member: a developer hitting an inbox ceiling needs to\nsee the plan and the purchased quantity to understand why, and hiding it\nbehind `billing.manage` turned that into a support question. Only CHANGING\nthe plan is privileged.","operationId":"console_read_billing","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/billing/checkout":{"post":{"tags":["console"],"summary":"Start Checkout","description":"Create a durable intent, then ask Dodo for a hosted checkout URL.\n\nOrder matters and is not stylistic. The intent is committed BEFORE the\nnetwork call (§3), so a webhook that arrives while the HTTP response is\nstill in flight can still be correlated. The network call then happens with\nno transaction open.","operationId":"console_start_checkout","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutStarted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/billing/quantity":{"post":{"tags":["console"],"summary":"Change Quantity","description":"Resize the paid mailbox allowance (W7a-7).\n\nAn increase uses **Dodo's** proration, never one computed here -- a locally\ncomputed credit is a number the customer's invoice will disagree with. A\ndecrease is scheduled for renewal, because the current period is paid, and\nis refused outright if it would fall below the Inboxes actually in use:\nthe only alternative is deleting someone's inbox to make the numbers agree.\n\nLike checkout, this grants nothing. The signed `subscription.plan_changed`\nis what moves the allowance.","operationId":"console_change_quantity","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuantityRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuantityAccepted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/billing/portal":{"post":{"tags":["console"],"summary":"Open Billing Portal","description":"Hand the customer to Dodo's own portal for payment method and invoices.\n\nDakNode never collects or stores a card. Building a payment form here would\nmean handling details we have no reason to touch and no licence to keep;\nthe provider already has a hosted surface for exactly this.\n\n**The customer ID is taken from the stored subscription, never from the\ncaller.** That matters more than it looks: Dodo's portal endpoint returns a\nsession link for a customer ID that does not exist (measured 2026-10-13\nagainst a deliberately invented ID), so it is not validating the subject.\nThe only thing standing between that and a mis-scoped link is that this\npasses an ID written by a signed activation event.","operationId":"console_open_billing_portal","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSession"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/public/demo-inbox":{"post":{"tags":["demo-inbox"],"summary":"Allocate Demo Inbox","description":"Allocate a 15-minute inbox and return its token exactly once.\n\nThe ORDER is the design and is asserted by test:\n\n  1. empty-body check   — before identification, before a limiter exists\n  2. client identity    — fails closed BEFORE any bucket is consumed\n  3. all three buckets  — one visitor, one hourly, one daily\n  4. limit decision\n  5. concurrent backstop — counted in PostgreSQL, where the truth lives\n  6. one bounded, collision-safe INSERT","operationId":"allocate_demo_inbox","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/public/demo-inbox/{inbox_id}/messages":{"get":{"tags":["demo-inbox"],"summary":"List Demo Messages","description":"Return this inbox's sanitized messages, or the uniform 404.\n\nExpiry is evaluated HERE, server-side, on every request. Physical deletion\nis asynchronous and on a cadence; revocation is not. A row still on disk\nafter `expires_at` is unreachable, and that is the guarantee.","operationId":"list_demo_messages","parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","title":"Inbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/public/demo-inbox/sns":{"post":{"tags":["demo-inbox"],"summary":"Demo Sns","operationId":"demo_sns","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/console/session":{"get":{"tags":["console"],"summary":"Read Session","description":"The caller and every Account they belong to.\n\n**This listing is deliberately its own query, not `SessionContext.accounts`.**\nThat context is filtered to *active* Accounts because it is the input to\nauthorization (W-ROUTE-1), and it must stay that way. The console, though,\nhas to *show* a closed Account as un-enterable. So closed Accounts appear\nhere with their lifecycle status and **no child data** — listing an Account\ngrants nothing, and every scope decision still goes through W-ROUTE-1.","operationId":"console_read_session","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/console/signup":{"post":{"tags":["console"],"summary":"Signup","description":"Provision this verified identity on first sight. **Idempotent.**\n\n**Adds no second provisioning service.** It calls W3f's `provision_signup`,\nwhich owns the whole transaction including the concurrency handling. A\nsecond implementation here would be a second place for the Account\ncontrol-plane to be created slightly differently.\n\nDeliberately `POST` returning **200, not 201**: the common case after the\nvery first call is that nothing was created, and a client that branches on\nthe status code would be wrong most of the time. `created` reports it\nhonestly in the body instead.\n\nAuthenticated by `require_identity` rather than `require_session`, because\nthe whole point is that no DakNode user exists yet — `require_session`\nwould 401 the exact caller this route serves.","operationId":"console_signup","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/console/resolve":{"get":{"tags":["console"],"summary":"Resolve Entry","description":"Resolve the bare `/` route from membership, every time.\n\n**No persistent selection** (§15.4a). There is no session-global \"selected\nAccount\", no last-used column and no hint table. The consequence is\ndeliberate and is the reason the decision was made: two browser tabs cannot\ndesynchronise, because there is no shared server-side value for the second\ntab to overwrite. A returning user with several Accounts sees a picker\nrather than landing where they were last, and that cost was accepted.\n\n**Closed and inaccessible resources are never candidates.** The query is\nrestricted to active memberships, active Accounts and active Workspaces, so\na closed Account can never be the thing `/` redirects into.","operationId":"console_resolve_entry","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/console/accounts/{account_id}/workspaces":{"get":{"tags":["console"],"summary":"List Workspaces","description":"Workspaces inside one Account the caller belongs to.\n\nThe Account row is joined and its lifecycle checked here for the same\nreason W-ROUTE-1 does it: a closed Account keeps its membership rows, and\nits Workspace list is child data.","operationId":"console_list_workspaces","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["console"],"summary":"Create Workspace","description":"Create a Workspace. Requires `account.manage`.\n\n**Idempotent when `external_client_id` is supplied**: a repeat returns the\nexisting Workspace with **200**, not 201, so a client can tell whether it\ncreated anything.\n\n**No plan limit is enforced** — W6-BOUNDARY defers that to W7a, and\nadditional customer-created Workspaces must not become production-available\nuntil it lands.","operationId":"console_create_workspace","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/credentials":{"get":{"tags":["console"],"summary":"List Account Credentials","description":"Control-plane credentials of an Account. Requires `account.credentials`,\nwhich GATE D5/caps assigns to **owner only** — issuing a machine identity\nthat can provision Workspaces is an ownership act.","operationId":"console_list_account_credentials","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["console"],"summary":"Create Account Credential","description":"Issue a control-plane credential. **The plaintext is returned once.**\n\nOnly a human session may do this. A credential cannot mint another —\notherwise a leaked one becomes permanent, since revoking it would not\nremove the ones it made.","operationId":"console_create_account_credential","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCredentialRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedCredentialResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/credentials/{credential_id}/revoke":{"post":{"tags":["console"],"summary":"Revoke Account Credential","description":"Revoke one. Terminal, and idempotent.","operationId":"console_revoke_account_credential","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"credential_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Credential Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}":{"get":{"tags":["console"],"summary":"Read Workspace","description":"One Workspace. Requires `account.read`.","operationId":"console_read_workspace","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["console"],"summary":"Update Workspace","description":"Rename, or set `external_client_id` once. Requires `account.manage`.","operationId":"console_update_workspace","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkspaceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/close":{"post":{"tags":["console"],"summary":"Close Workspace","description":"Close a Workspace. Requires `account.manage`.\n\nA lifecycle transition, not a delete. Refused with live children, and\nrefused when it is the Account's default (specs/09 §8a.4).","operationId":"console_close_workspace","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/access":{"get":{"tags":["console"],"summary":"Read Access","description":"What the caller may do in this Workspace, and which sections to render.\n\nThe capabilities come from the closed matrix via W-ROUTE-1's resolution —\nthey are not recomputed here, and no role name is inspected.\n\nSuspension is reported as **data**, never as a refusal: it restricts\nsending only, while reads continue and inbound is unaffected (invariant 12).","operationId":"console_read_access","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/enterprise-inquiry":{"post":{"tags":["console"],"summary":"Submit Enterprise Inquiry","description":"Record a Contact Sales request. Requires `account.manage`.\n\n**The Account's plan is not changed** (§8h.2). This records what the\ncustomer wants; what they have is unaffected until somebody agrees terms\nand provisions a bespoke plan deliberately.\n\nOwner-level because agreeing commercial terms is an ownership act — and\nbecause an authenticated-only form is what stops this being a spam target.","operationId":"console_submit_enterprise_inquiry","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseInquiryRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseInquiryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["console"],"summary":"Read Enterprise Inquiry","description":"The outstanding inquiry, or `null`. Requires `account.read`.\n\nSo the console shows \"we will contact you shortly\" instead of the form to\nsomebody who already asked.","operationId":"console_read_enterprise_inquiry","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/EnterpriseInquiryResponse"},{"type":"null"}],"title":"Response Console Read Enterprise Inquiry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}":{"get":{"tags":["console"],"summary":"Read Account","description":"Account metadata. Requires `account.read`.","operationId":"console_read_account","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__v1__console__AccountDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["console"],"summary":"Rename Account","description":"Rename an Account. Requires `account.manage`.\n\nThe name is display metadata only (§8d). `status` is **not** reachable\nhere: suspension and closure are lifecycle transitions with outbound\nconsequences, not settings fields.","operationId":"console_rename_account","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameAccountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__v1__console__AccountDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/members":{"get":{"tags":["console"],"summary":"List Members","description":"Who belongs to this Account. Requires `account.read`.\n\nRevoked memberships are included — the status column would be a constant\nwithout them, and the people who lost access are what an access review is\nlooking for (§8c). No raw email address is returned.","operationId":"console_list_members","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/members/{user_id}":{"patch":{"tags":["console"],"summary":"Change Member Role","description":"Change a member's Account role. Requires `account.manage`.\n\nRefused with `last_owner` when it would demote the final active owner\n(invariant 18). The check is serialized on the Account — see §8c.1 for why\na read-then-check implementation is wrong here.","operationId":"console_change_member_role","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["console"],"summary":"Remove Member","description":"Revoke a membership. Requires `account.manage`.\n\nThe row is kept with `status='revoked'` (§8c.2), so the response still\ndescribes the member. Idempotent. Refused with `last_owner` when it would\nremove the final active owner.","operationId":"console_remove_member","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/invitations":{"post":{"tags":["console"],"summary":"Invite Member","operationId":"console_invite_member","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["console"],"summary":"Get Invitations","operationId":"console_get_invitations","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InviteView"},"title":"Response Console Get Invitations"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/invitations/{invitation_id}":{"delete":{"tags":["console"],"summary":"Revoke Invite","operationId":"console_revoke_invite","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invitation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Console Revoke Invite"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/invitations/{invitation_id}/accept":{"post":{"tags":["console"],"summary":"Accept Invite","operationId":"console_accept_invite","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invitation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteAccepted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workspaces":{"get":{"tags":["control-plane"],"summary":"List Workspaces","description":"Active Workspaces of the credential's own Account.","operationId":"list_workspaces","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceListOut"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["control-plane"],"summary":"Create Workspace","description":"Provision a Workspace. **Idempotent on `external_client_id`** — a repeat\nreturns the existing Workspace with 200, so a retrying provisioner can tell\nwhether it created anything.\n\n**No plan limit is enforced** (W6-BOUNDARY): additional customer-created\nWorkspaces must not become production-available until W7a lands.","operationId":"create_workspace","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/workspaces/{workspace_id}":{"get":{"tags":["control-plane"],"summary":"Read Workspace","operationId":"read_workspace","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["control-plane"],"summary":"Update Workspace","operationId":"update_workspace","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workspaces/{workspace_id}/close":{"post":{"tags":["control-plane"],"summary":"Close Workspace","description":"Refused with live children, and refused when it is the default (§8a.4).","operationId":"close_workspace","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/overview":{"get":{"tags":["console"],"summary":"Read Overview","description":"The Workspace's own numbers, counted now.\n\nMessage-level counters require `messages.read` and are simply **absent**\nfor a caller without it — not present-and-zero, and not present-and-denied.\nAn absent counter is indistinguishable from one that does not exist, which\nis the same non-enumeration rule the rest of the console follows.","operationId":"console_read_overview","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/agents":{"get":{"tags":["console"],"summary":"List Agents","description":"Inboxes in this Workspace, newest first.\n\nDeliberately **not** paginated by cursor yet: the D5 cursor machinery\nexists, but a Workspace's Inbox count is bounded by an entitlement rather\nthan by traffic, so a first page of 100 with `has_more` is honest and\nadding a cursor here would be machinery for a list that does not grow\nwithout limit. `has_more` tells a client when that stops being true.","operationId":"console_list_agents","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["console"],"summary":"Create Agent","description":"Create one Agent — an Inbox — in this Workspace.\n\n**`workspace.manage`, not `workspace.read`.** Listing agents is a read;\nminting a globally unique address that consumes an Account-wide entitlement\nis not. A reader can see the page and cannot create.\n\n**No webhook is registered here.** Creation takes an alias and a name;\npointing the agent at a destination is a separate act with its own URL\nvalidation, and folding it in would make this route resolve DNS on behalf of\nthe caller.\n\n**No SES dependency.** This mints an address and a row. Receiving mail needs\nproduction email access; creating the agent does not.","operationId":"console_create_agent","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/domains":{"get":{"tags":["domains"],"summary":"List Domains","operationId":"list_domains","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["domains"],"summary":"Register Domain","operationId":"register_domain","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDomainRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/domains/{domain_id}":{"get":{"tags":["domains"],"summary":"Get Domain","operationId":"get_domain","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/domains/{domain_id}/verify":{"post":{"tags":["domains"],"summary":"Verify Domain","operationId":"verify_domain","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckDomainRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/domains/{domain_id}/disable":{"post":{"tags":["domains"],"summary":"Disable Domain","operationId":"disable_domain","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/domains/{domain_id}/diagnostics":{"get":{"tags":["console"],"summary":"Domain Diagnostics Console","operationId":"console_domain_diagnostics_console","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainDiagnostics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/domains":{"get":{"tags":["console"],"summary":"List Domains Console","operationId":"console_list_domains_console","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["console"],"summary":"Register Domain Console","operationId":"console_register_domain_console","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDomainRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/domains/{domain_id}":{"get":{"tags":["console"],"summary":"Get Domain Console","operationId":"console_get_domain_console","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/domains/{domain_id}/verify":{"post":{"tags":["console"],"summary":"Verify Domain Console","operationId":"console_verify_domain_console","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckDomainRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/domains/{domain_id}/disable":{"post":{"tags":["console"],"summary":"Disable Domain Console","operationId":"console_disable_domain_console","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/activity":{"get":{"tags":["console"],"summary":"List Activity","description":"Messages in this Workspace, newest first, keyset-paginated.","operationId":"console_list_activity","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"inbox_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"}},{"name":"label","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},{"name":"is_read","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Read"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/activity/{message_id}":{"get":{"tags":["console"],"summary":"Read Message","description":"One message, for debugging. `org_id` is a predicate term, never a check.\n\nA row belonging to another Workspace is therefore **not read at all**,\nrather than read and then rejected.","operationId":"console_read_message","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/activity/{message_id}/state":{"patch":{"tags":["console"],"summary":"Console Update Message State","operationId":"console_console_update_message_state","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StateChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/keys":{"get":{"tags":["console"],"summary":"List Keys","description":"Keys for this Workspace. Revoked ones stay listed, as history.","operationId":"console_list_keys","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["console"],"summary":"Create Key","description":"Mint a key. **The plaintext is returned once and never again.**\n\n201 here, unlike signup's 200: this genuinely creates something every time\nit is called, and there is no idempotent reading of it.","operationId":"console_create_key","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/keys/{key_id}/revoke":{"post":{"tags":["console"],"summary":"Revoke Key","description":"Revoke a key. **Terminal** — there is no un-revoke.\n\n`org_id` is a term in the UPDATE predicate, so a key belonging to another\nWorkspace is not modified and not distinguishable from one that does not\nexist. Idempotent: revoking an already-revoked key is a no-op that returns\nthe same row, because a retried click must not be an error.","operationId":"console_revoke_key","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeySummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/keys/{key_id}/rotate":{"post":{"tags":["console"],"summary":"Rotate Key","description":"Mint a replacement key and start the old one's expiry (W9a, §10a).\n\n**This does not revoke.** Revocation stays separate and immediate, because\nan operator responding to a compromise must not have to choose between\n\"immediate\" and \"safe for my fleet\". The overlap exists so a fleet can be\nmigrated while both credentials authenticate.\n\nReturns `CreatedKeyResponse` — the same one-time boundary `create_key` uses,\nso the replacement's plaintext is carried by a type that only ever appears\non a response that is meant to contain one. It is shown once and is not\nretrievable again.","operationId":"console_rotate_key","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RotateKeyRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/usage":{"get":{"tags":["console"],"summary":"Read Workspace Usage","description":"Usage for one Workspace. Requires `usage.read` on that Workspace.\n\nAbsent capability is `scope_denied` — identical to a nonexistent resource\nand naming no capability, because naming one would confirm the Workspace\nexists.","operationId":"console_read_workspace_usage","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":92,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUsage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/usage":{"get":{"tags":["console"],"summary":"Read Account Usage","description":"Account roll-up. Requires **`usage.read` and `account.read`**.\n\nMembership and Account lifecycle are resolved from PostgreSQL here, in one\npredicate — `account_id` is a term in it, so an Account the caller does not\nbelong to is never read.","operationId":"console_read_account_usage","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":92,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUsage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/allowance":{"get":{"tags":["console"],"summary":"Read Account Allowance","operationId":"console_read_account_allowance","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountAllowance"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/outbound/health":{"get":{"tags":["console"],"summary":"Read Outbound Health","operationId":"console_read_outbound_health","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverabilityHealth"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/outbound/suppression-lookup":{"post":{"tags":["console"],"summary":"Perform Suppression Lookup","operationId":"console_perform_suppression_lookup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/webhooks":{"get":{"tags":["console"],"summary":"Read Webhooks","description":"Destination status per inbox, plus the dead-letter count.","operationId":"console_read_webhooks","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookOverview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/webhooks/deliveries":{"get":{"tags":["console"],"summary":"List Deliveries","description":"Every webhook event in this Workspace, newest first, keyset-paginated.\n\n`specs/ui_allowance_and_webhook_health.md#webhook-history`. Same gate as the\ndead-letter list. Attribution goes outbox → message → inbox on the\ntenant-scoped composite keys, and every join and filter carries `org_id`.","operationId":"console_list_deliveries","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"inbox_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["queued","retrying","delivered","undelivered","cancelled"],"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/webhooks/dead-letters":{"get":{"tags":["console"],"summary":"List Dead Letters","operationId":"console_list_dead_letters","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeadLetterPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/webhooks/dead-letters/{outbox_id}/replay":{"post":{"tags":["console"],"summary":"Replay","description":"Explicitly return one dead-lettered event to the queue.\n\nA **mutation**, and the only one on this surface. It requires\n`workspace.manage`, so a reader who may see the DLQ cannot act on it.\n\n`workspace_id` is a predicate term inside the service, so a dead letter\nbelonging to another Workspace is not fetched and then rejected — it is\nnever read. Two concurrent replays race on a conditional UPDATE and exactly\none wins, so one human decision cannot become two queue entries.\n\n**Delivery remains at-least-once.** Requeuing once does not mean the\nreceiver is contacted once: retries, lease expiry and receiver timeouts can\nall produce a repeat request. The `event_id` is preserved precisely so the\nreceiver can deduplicate.","operationId":"console_replay","security":[{"HTTPBearer":[]}],"parameters":[{"name":"outbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Outbox Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/console/accounts/{account_id}/workspaces/{workspace_id}/agents/{inbox_id}/webhook":{"put":{"tags":["console"],"summary":"Set Destination Route","description":"Set or replace an agent's webhook destination.\n\n**Nothing is sent.** Saving a destination validates and stores it; it does\nnot deliver a test payload, an email or any other request to the customer's\nendpoint. The only network activity is the DNS resolution validation\nperforms.\n\nThe response deliberately carries no secret and no URL: the console shows\n*whether* a destination is configured, and a signing secret returned into a\nbrowser would be a credential in a place that cannot hold one safely. A\ncaller that needs the secret uses the API-key route, which returns it once.","operationId":"console_set_destination_route","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["console"],"summary":"Remove Destination Route","description":"Remove an agent's webhook destination. Idempotent.\n\nRemoving is a destination *change*, so it takes the same rule: the\nregistration id rotates and events queued against the old one are\ncancelled. The stored secret is cleared — a destination that no longer\nexists must not keep a credential beside it.","operationId":"console_remove_destination_route","security":[{"HTTPBearer":[]}],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inbox Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/bootstrap":{"post":{"tags":["operator"],"summary":"Bootstrap First Operator","description":"Create the first operator from a proven identity. **Idempotent.**\n\nReturns 200 rather than 201 for the same reason `/v1/console/signup` does:\nafter the first call the common outcome is that nothing was created, and a\nclient branching on the status code would be wrong most of the time.\n`created` reports it honestly in the body instead.","operationId":"operator_bootstrap_first_operator","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Operator-Bootstrap","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Operator-Bootstrap"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootstrapRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootstrapResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/me":{"get":{"tags":["operator"],"summary":"Read Own Operator","description":"The caller's own operator status and grants. **Post-seed verification.**\n\nBehind the ordinary `require_operator` chain — it cannot bootstrap anything,\nbecause that chain refuses an identity with no row. It exists to prove the\nseed worked end to end: separate Clerk instance, MFA claim,\n`(issuer, subject)` lookup, capability grant.\n\nReturns no operator id, subject, issuer or token. A caller learning their own\ninternal UUID gains nothing and risks pasting it somewhere.","operationId":"operator_read_own_operator","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorMeResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/operator/invitations":{"get":{"tags":["operator"],"summary":"Get Operator Invitations","operationId":"operator_get_operator_invitations","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/OperatorInviteView"},"type":"array","title":"Response Operator Get Operator Invitations"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["operator"],"summary":"Invite Operator","operationId":"operator_invite_operator","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorInviteRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorInviteCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/operator/invitations/{invitation_id}":{"delete":{"tags":["operator"],"summary":"Withdraw Operator Invitation","operationId":"operator_withdraw_operator_invitation","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invitation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorAdminReason"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Operator Withdraw Operator Invitation"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/invitations/{invitation_id}/accept":{"post":{"tags":["operator"],"summary":"Accept Operator Invitation","operationId":"operator_accept_operator_invitation","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invitation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorAcceptRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Operator Accept Operator Invitation"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/operators":{"get":{"tags":["operator"],"summary":"List Operators","operationId":"operator_list_operators","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorAdminList"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/operator/operators/{target_id}/disable":{"post":{"tags":["operator"],"summary":"Disable Operator","operationId":"operator_disable_operator","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Target Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorAdminReason"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Operator Disable Operator"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/operators/{target_id}/enable":{"post":{"tags":["operator"],"summary":"Enable Operator","operationId":"operator_enable_operator","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Target Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorAdminReason"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Operator Enable Operator"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/operators/{target_id}/capabilities":{"post":{"tags":["operator"],"summary":"Grant Operator Capability","operationId":"operator_grant_operator_capability","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Target Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorGrantRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Operator Grant Operator Capability"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/operators/{target_id}/capabilities/{capability}":{"delete":{"tags":["operator"],"summary":"Revoke Operator Capability","operationId":"operator_revoke_operator_capability","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Target Id"}},{"name":"capability","in":"path","required":true,"schema":{"type":"string","title":"Capability"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorAdminReason"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Operator Revoke Operator Capability"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/suspensions":{"get":{"tags":["operator"],"summary":"List Suspended Workspaces","description":"The review queue, in two parts (spec §6.4b).\n\n**Account-level suspensions are grouped once**, with the count of Workspaces\nthey block. Previously an Account hold produced one row per Workspace — N\nidentical entries offering N identical decisions, none of which the\nWorkspace remedy could actually take.\n\n**Workspace-level suspensions are listed individually**, because each is its\nown decision with its own cause.\n\nBoth newest first: the queue is worked from the top, and the newest\nsuspension is the one still surprising somebody.","operationId":"operator_list_suspended_workspaces","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspensionQueue"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/suspensions/{org_id}":{"get":{"tags":["operator"],"summary":"Read Suspension","description":"One Workspace's lifecycle facts. Straight through to the service.","operationId":"operator_read_suspension","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspensionDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/suspensions/{org_id}/suppressions":{"get":{"tags":["operator"],"summary":"List Suppressions","description":"Recipient suppressions for one Workspace, BY DIGEST.\n\nThe Workspace is resolved through the service first, so a nonexistent one\nand another tenant's produce the same refusal as everywhere else — rather\nthan an empty list, which would confirm the id does not exist.","operationId":"operator_list_suppressions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Org Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/suspensions/{org_id}/reactivate":{"post":{"tags":["operator"],"summary":"Reactivate Workspace","description":"Lift a Workspace's outbound suspension. Idempotent.\n\nThe service performs the conditional UPDATE and writes the audit event in\nthis transaction; this route commits it. One commit, so the state change and\nits evidence cannot diverge.","operationId":"operator_reactivate_workspace","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemedyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemedyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/suspensions/{org_id}/suppressions/{recipient_digest}/release":{"post":{"tags":["operator"],"summary":"Release Recipient Suppression","description":"Release one suppression, addressed by digest. Idempotent.\n\nA digest, never an address — see `SuppressionEntry`.","operationId":"operator_release_recipient_suppression","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Org Id"}},{"name":"recipient_digest","in":"path","required":true,"schema":{"type":"string","title":"Recipient Digest"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemedyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemedyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/accounts/{account_id}":{"get":{"tags":["operator"],"summary":"Read Account Suspension","description":"One Account's lifecycle facts. Straight through to the service.","operationId":"operator_read_account_suspension","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__v1__operator__AccountDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/accounts/{account_id}/reactivate":{"post":{"tags":["operator"],"summary":"Reactivate Account","description":"Lift an ACCOUNT-wide outbound suspension (spec §6.4b).\n\nClears the Account flag and **nothing else**. Workspaces suspended in their\nown right stay suspended and stay in the queue — the response reports how\nmany, so the operator learns the job is not finished from the same call that\nfinished the part they asked for.\n\nBehind the SAME capability as the Workspace remedy: this is the same job at\nthe scope directly above, and an operator trusted to lift a Workspace\nsuspension is not a different person from one trusted to lift the Account\nhold that shadows it.","operationId":"operator_reactivate_account","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemedyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemedyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["ops"],"summary":"Health","description":"Liveness only — does not touch dependencies.\n\nKept dependency-free on purpose: an ECS liveness probe that fails because\nthe database is briefly slow would kill healthy containers and turn a\ndatabase blip into an outage.","operationId":"health","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Health"}}}}}}},"/health/ready":{"get":{"tags":["ops"],"summary":"Readiness","description":"Readiness — Postgres, pgvector, Redis, the suppression key ring, and the\npost-restore erasure gate.\n\nReturns **503 when anything is not ready**, and 200 only when everything is.\n\nThe status code is the answer, not the body. A load balancer, an ALB target\ngroup and an ECS health check all route on the code alone — so an earlier\nversion of this endpoint, which returned 200 with `status: not_ready`, would\nhave sent live traffic to an instance still replaying erasures. That is the\nprecise failure the restore gate exists to prevent, arriving through the\nprobe meant to report it (P5/E6).\n\nThe body is retained for humans and stays exactly as it was.","operationId":"readiness","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Readiness"}}}}}}}},"components":{"schemas":{"AcceptInviteRequest":{"properties":{"token":{"type":"string","maxLength":128,"minLength":32,"title":"Token"}},"additionalProperties":false,"type":"object","required":["token"],"title":"AcceptInviteRequest"},"AccessResponse":{"properties":{"account_id":{"type":"string","format":"uuid","title":"Account Id"},"account_name":{"type":"string","title":"Account Name"},"account_role":{"type":"string","title":"Account Role"},"account_outbound_suspended":{"type":"boolean","title":"Account Outbound Suspended"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"workspace_name":{"type":"string","title":"Workspace Name"},"workspace_is_default":{"type":"boolean","title":"Workspace Is Default"},"workspace_outbound_suspended":{"type":"boolean","title":"Workspace Outbound Suspended"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities"},"visible_sections":{"items":{"type":"string"},"type":"array","title":"Visible Sections"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["account_id","account_name","account_role","account_outbound_suspended","workspace_id","workspace_name","workspace_is_default","workspace_outbound_suspended","capabilities","visible_sections","generated_at"],"title":"AccessResponse"},"AccountAllowance":{"properties":{"account_id":{"type":"string","format":"uuid","title":"Account Id"},"plan_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Code"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"degraded":{"type":"boolean","title":"Degraded"},"inboxes":{"$ref":"#/components/schemas/AllowanceItem"},"workspaces":{"$ref":"#/components/schemas/AllowanceItem"},"outbound_month":{"$ref":"#/components/schemas/AllowanceItem"},"inbound_month":{"$ref":"#/components/schemas/AllowanceItem"}},"type":"object","required":["account_id","plan_code","period_start","period_end","generated_at","degraded","inboxes","workspaces","outbound_month","inbound_month"],"title":"AccountAllowance"},"AccountUsage":{"properties":{"account_id":{"type":"string","format":"uuid","title":"Account Id"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"degraded":{"type":"boolean","title":"Degraded"},"totals":{"additionalProperties":{"$ref":"#/components/schemas/UsageDimension"},"type":"object","title":"Totals"},"workspaces":{"items":{"$ref":"#/components/schemas/AccountUsageWorkspace"},"type":"array","title":"Workspaces"}},"type":"object","required":["account_id","period_start","period_end","generated_at","degraded","totals","workspaces"],"title":"AccountUsage"},"AccountUsageWorkspace":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"dimensions":{"additionalProperties":{"$ref":"#/components/schemas/UsageDimension"},"type":"object","title":"Dimensions"}},"type":"object","required":["workspace_id","dimensions"],"title":"AccountUsageWorkspace","description":"Roll-up NEVER loses Workspace attribution — that is the point of\ncarrying `org_id` on every fact rather than only an Account id."},"ActivityItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"thread_id":{"type":"string","format":"uuid","title":"Thread Id"},"channel":{"type":"string","title":"Channel"},"sender":{"type":"string","title":"Sender"},"recipient":{"type":"string","title":"Recipient"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"is_automated":{"type":"boolean","title":"Is Automated"},"is_bulk":{"type":"boolean","title":"Is Bulk"},"risk_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Risk Level"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","default":[]},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read At"}},"type":"object","required":["id","created_at","inbox_id","thread_id","channel","sender","recipient","subject","is_automated","is_bulk","risk_level"],"title":"ActivityItem","description":"The approved list contract. Nothing outside these fields is returned."},"ActivityPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ActivityItem"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["items","next_cursor","has_more","generated_at"],"title":"ActivityPage"},"AgentBreakdown":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/AgentUsage"},"type":"array","title":"Agents"},"unattributed":{"additionalProperties":{"$ref":"#/components/schemas/UsageDimension"},"type":"object","title":"Unattributed"},"unavailable":{"type":"boolean","title":"Unavailable","default":false}},"type":"object","required":["agents","unattributed"],"title":"AgentBreakdown","description":"The per-agent view, plus what could not be attributed.\n\n**`agents` + `unattributed` reconciles with the Workspace totals.** That is\nthe contract, asserted by test: a breakdown that does not add up teaches a\nreader to distrust the total, and the total is the number that matters."},"AgentCreateRequest":{"properties":{"domain_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Domain Id"},"alias":{"type":"string","maxLength":64,"minLength":1,"title":"Alias"},"display_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["alias"],"title":"AgentCreateRequest"},"AgentListResponse":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/AgentSummary"},"type":"array","title":"Agents"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"degraded":{"type":"boolean","title":"Degraded"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["agents","generated_at","degraded","has_more"],"title":"AgentListResponse"},"AgentSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"address":{"type":"string","title":"Address"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"avatar_preset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Preset"},"channel":{"type":"string","title":"Channel"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"webhook_configured":{"type":"boolean","title":"Webhook Configured"},"messages_received":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Messages Received"}},"type":"object","required":["id","address","display_name","channel","created_at","webhook_configured"],"title":"AgentSummary"},"AgentUsage":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"deleted":{"type":"boolean","title":"Deleted","default":false},"dimensions":{"additionalProperties":{"$ref":"#/components/schemas/UsageDimension"},"type":"object","title":"Dimensions"}},"type":"object","required":["agent_id","dimensions"],"title":"AgentUsage","description":"One agent's share of a Workspace's usage.\n\n`agent_id` is an Inbox id, because in this product an agent IS an Inbox.\n\n**No address, alias, subject or recipient appears here.** A usage fact\ncarries none, and the display name is read from the Inbox itself — so a\nsoft-deleted agent returns `deleted: true` and no name rather than\nresurrecting an address the tenant removed. Deleting an agent must not make\nits history vanish, and reading usage must not undo a deletion."},"AllowanceItem":{"properties":{"used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Used"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"},"unlimited":{"type":"boolean","title":"Unlimited"},"enforced":{"type":"boolean","title":"Enforced"}},"type":"object","required":["used","limit","unlimited","enforced"],"title":"AllowanceItem"},"Approval":{"properties":{"expected_revision":{"type":"string","format":"uuid","title":"Expected Revision"},"approve":{"type":"boolean","title":"Approve"}},"additionalProperties":false,"type":"object","required":["expected_revision","approve"],"title":"Approval"},"AttachmentOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"filename":{"type":"string","title":"Filename"},"content_type_detected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type Detected"},"size_bytes":{"type":"integer","title":"Size Bytes"},"extraction_status":{"type":"string","title":"Extraction Status"},"downloadable":{"type":"boolean","title":"Downloadable"}},"type":"object","required":["id","filename","content_type_detected","size_bytes","extraction_status","downloadable"],"title":"AttachmentOut"},"AttentionItem":{"properties":{"kind":{"type":"string","title":"Kind"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"}},"type":"object","required":["kind"],"title":"AttentionItem"},"AuditOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"inbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"},"actor_type":{"type":"string","title":"Actor Type"},"actor_id":{"type":"string","format":"uuid","title":"Actor Id"},"action":{"type":"string","title":"Action"},"resource_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Resource Id"},"outcome":{"type":"string","title":"Outcome"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"}},"type":"object","required":["id","occurred_at","inbox_id","actor_type","actor_id","action","resource_id","outcome","reason","request_id"],"title":"AuditOut"},"AuditPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AuditOut"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"coverage":{"type":"string","title":"Coverage","default":"Supported authenticated mutations only, recorded after rollout. General reads and background processing are not included."}},"type":"object","required":["items","has_more","next_cursor"],"title":"AuditPage"},"BillingView":{"properties":{"plan_code":{"type":"string","title":"Plan Code"},"plan_version":{"type":"integer","title":"Plan Version"},"mailbox_quantity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mailbox Quantity"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"pending_plan_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pending Plan Code"},"pending_mailbox_quantity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pending Mailbox Quantity"},"pending_effective_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pending Effective At"},"live_inbox_count":{"type":"integer","title":"Live Inbox Count"},"purchase_available":{"type":"boolean","title":"Purchase Available"}},"type":"object","required":["plan_code","plan_version","mailbox_quantity","status","current_period_end","pending_plan_code","pending_mailbox_quantity","pending_effective_at","live_inbox_count","purchase_available"],"title":"BillingView"},"BlockRuleCreate":{"properties":{"pattern":{"type":"string","maxLength":320,"minLength":1,"title":"Pattern"},"reason":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Reason"}},"type":"object","required":["pattern"],"title":"BlockRuleCreate","description":"`kind` is deliberately absent.\n\nIt is DERIVED from the pattern — presence of `@` decides address versus\ndomain. A client that could assert `kind` could mislabel a rule and make the\nmatcher silently wrong; not accepting the field means the conflict cannot\narise, rather than relying on the CHECK constraint to catch it later."},"BlockRuleOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"pattern":{"type":"string","title":"Pattern"},"kind":{"type":"string","title":"Kind"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"scope":{"type":"string","title":"Scope"},"inbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","pattern","kind","reason","scope","inbox_id","created_at"],"title":"BlockRuleOut"},"BlockRulePage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BlockRuleOut"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","next_cursor","has_more"],"title":"BlockRulePage"},"BootstrapRequest":{"properties":{"reason":{"type":"string","maxLength":1000,"minLength":8,"title":"Reason"}},"type":"object","required":["reason"],"title":"BootstrapRequest","description":"Everything the caller may supply — deliberately almost nothing.\n\nNo issuer, no subject, no email, no capability. Those come from the verified\ntoken and from this module's own constant."},"BootstrapResponse":{"properties":{"created":{"type":"boolean","title":"Created"},"status":{"type":"string","title":"Status"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities"}},"type":"object","required":["created","status","capabilities"],"title":"BootstrapResponse","description":"Safe to return, and nothing more.\n\nNo operator id, no subject, no issuer, no token. The caller already knows\nwho they are; echoing an internal identifier would put it in their shell\nhistory and in any transcript of the seeding session."},"BrandingChange":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Display Name"},"avatar_preset":{"anyOf":[{"type":"string","enum":["signal","orbit","relay","spark","pulse","grid"]},{"type":"null"}],"title":"Avatar Preset"}},"additionalProperties":false,"type":"object","required":["display_name","avatar_preset"],"title":"BrandingChange"},"BrandingOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"address":{"type":"string","title":"Address"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"avatar_preset":{"anyOf":[{"type":"string","enum":["signal","orbit","relay","spark","pulse","grid"]},{"type":"null"}],"title":"Avatar Preset"}},"type":"object","required":["id","address","display_name","avatar_preset"],"title":"BrandingOut"},"ChangeRoleRequest":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"ChangeRoleRequest"},"CheckDomainRequest":{"properties":{"enable":{"type":"boolean","title":"Enable","default":false}},"type":"object","title":"CheckDomainRequest"},"ChecklistItem":{"properties":{"kind":{"type":"string","title":"Kind"},"done":{"type":"boolean","title":"Done"}},"type":"object","required":["kind","done"],"title":"ChecklistItem"},"CheckoutRequest":{"properties":{"plan_code":{"type":"string","maxLength":64,"minLength":1,"title":"Plan Code"},"period":{"type":"string","maxLength":16,"minLength":1,"title":"Period"},"mailbox_quantity":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Mailbox Quantity"}},"additionalProperties":false,"type":"object","required":["plan_code","period","mailbox_quantity"],"title":"CheckoutRequest"},"CheckoutStarted":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"},"intent_id":{"type":"string","format":"uuid","title":"Intent Id"}},"type":"object","required":["checkout_url","intent_id"],"title":"CheckoutStarted"},"ConsentRequest":{"properties":{"recipient":{"type":"string","maxLength":320,"title":"Recipient"},"source":{"type":"string","title":"Source","description":"One of: api_signup, contract, offline_import, web_form"},"collected_at":{"type":"string","format":"date-time","title":"Collected At","description":"When consent was collected. Must be in the past."},"evidence_ref":{"type":"string","maxLength":500,"minLength":1,"title":"Evidence Ref","description":"Form URL, contract id or import batch identifying the evidence retained for this consent."}},"type":"object","required":["recipient","source","collected_at","evidence_ref"],"title":"ConsentRequest"},"ConsentResponse":{"properties":{"consent_id":{"type":"string","format":"uuid","title":"Consent Id"},"recipient":{"type":"string","title":"Recipient"},"source":{"type":"string","title":"Source"},"basis":{"type":"string","title":"Basis","default":"tenant_declared"}},"type":"object","required":["consent_id","recipient","source"],"title":"ConsentResponse"},"Counter":{"properties":{"value":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Value"},"state":{"type":"string","title":"State"},"windowed":{"type":"boolean","title":"Windowed","default":false}},"type":"object","required":["value","state"],"title":"Counter","description":"`value` is null **if and only if** `state` is `unavailable`."},"CreateCredentialRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"CreateCredentialRequest"},"CreateIn":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"external_client_id":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"External Client Id"},"workspace_slug":{"anyOf":[{"type":"string","maxLength":63},{"type":"null"}],"title":"Workspace Slug"}},"type":"object","required":["name"],"title":"CreateIn"},"CreateKeyRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"inbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"},"permissions":{"anyOf":[{"items":{"type":"string","enum":["inboxes.read","inboxes.write","messages.read","messages.write","messages.send","search.read","metrics.read","webhooks.read","webhooks.write","rules.read","rules.write","consents.write","privacy.read","privacy.write","domains.read","domains.write","drafts.read","drafts.write","audit.read","messages.feedback.write"]},"type":"array","maxItems":20},{"type":"null"}],"title":"Permissions"}},"type":"object","required":["name"],"title":"CreateKeyRequest"},"CreateWorkspaceRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"external_client_id":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"External Client Id"},"workspace_slug":{"anyOf":[{"type":"string","maxLength":63},{"type":"null"}],"title":"Workspace Slug"}},"type":"object","required":["name"],"title":"CreateWorkspaceRequest"},"CreatedCredentialResponse":{"properties":{"credential":{"$ref":"#/components/schemas/CredentialSummary"},"plaintext":{"type":"string","title":"Plaintext"}},"type":"object","required":["credential","plaintext"],"title":"CreatedCredentialResponse","description":"The **only** shape that ever carries a control-plane secret."},"CreatedKeyResponse":{"properties":{"key":{"$ref":"#/components/schemas/KeySummary"},"plaintext":{"type":"string","title":"Plaintext"}},"type":"object","required":["key","plaintext"],"title":"CreatedKeyResponse","description":"The **only** response that ever carries a plaintext key.\n\nA separate model from `KeySummary` on purpose: the one-time boundary is a\ntype, not a convention, so a handler cannot accidentally return a secret\nfrom the list endpoint."},"CredentialListResponse":{"properties":{"credentials":{"items":{"$ref":"#/components/schemas/CredentialSummary"},"type":"array","title":"Credentials"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["credentials","generated_at"],"title":"CredentialListResponse"},"CredentialSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","name","prefix","status","created_at","last_used_at","revoked_at"],"title":"CredentialSummary","description":"**No `secret`, `plaintext` or `secret_hash` field.** The one-time\nboundary is a type, exactly as it is for tenant API keys."},"DailyUsage":{"properties":{"outbound_accepted":{"type":"integer","title":"Outbound Accepted","default":0},"outbound_delivered":{"type":"integer","title":"Outbound Delivered","default":0},"inbound_stored":{"type":"integer","title":"Inbound Stored","default":0},"day":{"type":"string","format":"date-time","title":"Day"}},"type":"object","required":["day"],"title":"DailyUsage"},"DeadLetterPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DeadLetterRow"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["items","has_more","generated_at"],"title":"DeadLetterPage"},"DeadLetterResponse":{"properties":{"outbox_id":{"type":"string","format":"uuid","title":"Outbox Id"},"event_id":{"type":"string","title":"Event Id"},"destination_url":{"type":"string","title":"Destination Url"},"attempt_count":{"type":"integer","title":"Attempt Count"},"last_response_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Response Code"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Failed At"},"replay_count":{"type":"integer","title":"Replay Count"},"last_replayed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Replayed At"}},"type":"object","required":["outbox_id","event_id","destination_url","attempt_count","last_response_code","last_error","failed_at","replay_count","last_replayed_at"],"title":"DeadLetterResponse","description":"Everything needed to understand a failure — and nothing more.\n\nDeliberately excludes `payload`: it carries the tenant's message content,\nand a list endpoint is the wrong place to spray it. It is still stored, and\nstill what gets replayed."},"DeadLetterRow":{"properties":{"outbox_id":{"type":"string","format":"uuid","title":"Outbox Id"},"event_id":{"type":"string","title":"Event Id"},"destination_url":{"type":"string","title":"Destination Url"},"attempt_count":{"type":"integer","title":"Attempt Count"},"last_response_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Response Code"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Failed At"},"replay_count":{"type":"integer","title":"Replay Count"},"last_replayed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Replayed At"}},"type":"object","required":["outbox_id","event_id","destination_url","attempt_count","last_response_code","last_error","failed_at","replay_count","last_replayed_at"],"title":"DeadLetterRow","description":"Mirrors the shipped Phase 4 shape. Deliberately excludes `payload`: it\ncarries the tenant's message content and a list is the wrong place for it."},"DeliverabilityHealth":{"properties":{"account_id":{"type":"string","format":"uuid","title":"Account Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"outbound_suspended":{"type":"boolean","title":"Outbound Suspended"},"suspension_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suspension Reason"},"accepted_sends_window":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Accepted Sends Window"},"permanent_bounces_window":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Permanent Bounces Window"},"complained_sends_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Complained Sends Total"},"bounce_rate_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bounce Rate Percent"},"bounce_rate_window_hours":{"type":"integer","title":"Bounce Rate Window Hours"},"feedback_path_healthy":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Feedback Path Healthy"},"feedback_path_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback Path Reason"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"degraded":{"type":"boolean","title":"Degraded"}},"type":"object","required":["account_id","workspace_id","outbound_suspended","bounce_rate_window_hours","generated_at","degraded"],"title":"DeliverabilityHealth"},"DeliveryCohort":{"properties":{"accepted_sends":{"type":"integer","title":"Accepted Sends"},"current_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"Current Status"},"provider_outcomes":{"additionalProperties":{"type":"integer"},"type":"object","title":"Provider Outcomes"},"observed_delivery_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Observed Delivery Rate"},"coverage":{"type":"string","title":"Coverage","default":"retained outbound sends accepted in the window"},"outcomes_observed_through":{"type":"string","format":"date-time","title":"Outcomes Observed Through"},"final":{"type":"boolean","title":"Final","default":false},"outcomes_can_overlap":{"type":"boolean","title":"Outcomes Can Overlap","default":true}},"type":"object","required":["accepted_sends","current_status","provider_outcomes","observed_delivery_rate","outcomes_observed_through"],"title":"DeliveryCohort"},"DeliveryPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DeliveryRow"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["items","next_cursor","has_more","generated_at"],"title":"DeliveryPage"},"DeliveryRow":{"properties":{"outbox_id":{"type":"string","format":"uuid","title":"Outbox Id"},"event_id":{"type":"string","title":"Event Id"},"event_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"},"inbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"status":{"type":"string","enum":["queued","retrying","delivered","undelivered","cancelled"],"title":"Status"},"attempt_count":{"type":"integer","title":"Attempt Count"},"last_response_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Response Code"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"queued_at":{"type":"string","format":"date-time","title":"Queued At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Attempt At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"cancelled_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancelled Reason"},"replay_count":{"type":"integer","title":"Replay Count"},"current_destination":{"type":"boolean","title":"Current Destination"}},"type":"object","required":["outbox_id","event_id","event_type","inbox_id","address","status","attempt_count","last_response_code","last_error","queued_at","delivered_at","next_attempt_at","updated_at","cancelled_reason","replay_count","current_destination"],"title":"DeliveryRow","description":"One webhook event and what happened to it.\n\n**No destination URL, payload body or secret.** `event_type` is read from\nthe payload's `event_type` key alone; `cancelled_reason` is the outbox's\nclosed vocabulary. `current_destination` says whether the row was addressed\nto the inbox's current registration, so history from a replaced endpoint is\nshown and labelled rather than mixed in silently."},"DestinationHealth":{"properties":{"last_delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Delivered At"},"last_failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Failed At"},"undelivered":{"type":"integer","title":"Undelivered"},"retrying":{"type":"integer","title":"Retrying"}},"type":"object","required":["last_delivered_at","last_failed_at","undelivered","retrying"],"title":"DestinationHealth","description":"What happened to events addressed to the current destination.\n\nCounted only over outbox rows whose registration is the inbox's current one,\nso failures against a replaced endpoint never describe the new one.\n`specs/ui_allowance_and_webhook_health.md#webhook-health`."},"DestinationRequest":{"properties":{"webhook_url":{"type":"string","maxLength":2048,"minLength":1,"title":"Webhook Url"}},"type":"object","required":["webhook_url"],"title":"DestinationRequest","description":"Only the URL. The Workspace, the inbox and the caller's rights all come\nfrom the resolved session and the path — never from the body."},"DestinationSummary":{"properties":{"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"address":{"type":"string","title":"Address"},"configured":{"type":"boolean","title":"Configured"},"health":{"anyOf":[{"$ref":"#/components/schemas/DestinationHealth"},{"type":"null"}]}},"type":"object","required":["inbox_id","address","configured"],"title":"DestinationSummary","description":"Per-inbox delivery health.\n\n**No secret and no URL.** Whether a destination is configured is what the\npage needs; where it points is not, and the signing secret never is."},"DnsRecord":{"properties":{"type":{"type":"string","title":"Type"},"name":{"type":"string","title":"Name"},"value":{"type":"string","title":"Value"},"purpose":{"type":"string","title":"Purpose"}},"type":"object","required":["type","name","value","purpose"],"title":"DnsRecord"},"DomainDiagnostics":{"properties":{"domain":{"type":"string","title":"Domain"},"checked_at":{"type":"string","format":"date-time","title":"Checked At"},"state":{"type":"string","enum":["daknode_only","other_provider","mixed","no_mx","null_mx","unavailable"],"title":"State"},"provider":{"type":"string","enum":["google","microsoft","other","daknode","mixed","none","unknown"],"title":"Provider"},"records":{"items":{"$ref":"#/components/schemas/ObservedMx"},"type":"array","title":"Records"},"expected_host":{"type":"string","title":"Expected Host"}},"type":"object","required":["domain","checked_at","state","provider","records","expected_host"],"title":"DomainDiagnostics"},"DomainOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"domain":{"type":"string","title":"Domain"},"status":{"type":"string","title":"Status"},"verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Verified At"},"check_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Check Reason"},"dns_records":{"items":{"$ref":"#/components/schemas/DnsRecord"},"type":"array","title":"Dns Records"}},"type":"object","required":["id","domain","status","verified_at","check_reason","dns_records"],"title":"DomainOut"},"DomainPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DomainOut"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items","has_more","next_cursor"],"title":"DomainPage"},"DraftCreate":{"properties":{"message":{"$ref":"#/components/schemas/SendRequest"},"require_human_approval":{"type":"boolean","title":"Require Human Approval","default":true}},"additionalProperties":false,"type":"object","required":["message"],"title":"DraftCreate"},"DraftEdit":{"properties":{"expected_revision":{"type":"string","format":"uuid","title":"Expected Revision"},"message":{"$ref":"#/components/schemas/SendRequest"},"require_human_approval":{"type":"boolean","title":"Require Human Approval","default":true}},"additionalProperties":false,"type":"object","required":["expected_revision","message"],"title":"DraftEdit"},"DraftFileOut":{"properties":{"filename":{"type":"string","title":"Filename"},"content_type":{"type":"string","title":"Content Type"},"size":{"type":"integer","title":"Size"}},"type":"object","required":["filename","content_type","size"],"title":"DraftFileOut"},"DraftMessageOut":{"properties":{"to":{"items":{"type":"string"},"type":"array","title":"To"},"cc":{"items":{"type":"string"},"type":"array","title":"Cc"},"bcc":{"items":{"type":"string"},"type":"array","title":"Bcc"},"subject":{"type":"string","title":"Subject"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"thread_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Thread Id"}},"type":"object","required":["to","cc","bcc","subject","body_text","body_html","thread_id"],"title":"DraftMessageOut"},"DraftOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"revision":{"type":"string","format":"uuid","title":"Revision"},"state":{"type":"string","enum":["draft","approved","scheduled","queued","cancelled","rejected"],"title":"State"},"message":{"anyOf":[{"$ref":"#/components/schemas/DraftMessageOut"},{"type":"null"}]},"attachments":{"items":{"$ref":"#/components/schemas/DraftFileOut"},"type":"array","title":"Attachments"},"attachment_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attachment State"},"require_human_approval":{"type":"boolean","title":"Require Human Approval"},"approved_revision":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Approved Revision"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"queued_send_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Queued Send Id"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","inbox_id","revision","state","message","attachments","attachment_state","require_human_approval","approved_revision","approved_at","scheduled_at","queued_send_id","last_error","created_at","updated_at"],"title":"DraftOut"},"DraftPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DraftOut"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items","has_more","next_cursor"],"title":"DraftPage"},"DraftSchedule":{"properties":{"expected_revision":{"type":"string","format":"uuid","title":"Expected Revision"},"scheduled_at":{"type":"string","format":"date-time","title":"Scheduled At"}},"additionalProperties":false,"type":"object","required":["expected_revision","scheduled_at"],"title":"DraftSchedule"},"EnterpriseInquiryRequest":{"properties":{"company":{"type":"string","maxLength":255,"minLength":1,"title":"Company"},"expected_volume":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Expected Volume"},"use_case":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Use Case"}},"type":"object","required":["company"],"title":"EnterpriseInquiryRequest"},"EnterpriseInquiryResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"plan_unchanged":{"type":"boolean","title":"Plan Unchanged","default":true}},"type":"object","required":["id","status","created_at"],"title":"EnterpriseInquiryResponse"},"ErasureRequestBody":{"properties":{"subject_email":{"type":"string","maxLength":320,"title":"Subject Email"}},"additionalProperties":false,"type":"object","required":["subject_email"],"title":"ErasureRequestBody","description":"The address is in the BODY, never the path or a query parameter.\n\nA URL is written to every proxy, load balancer and access log on the path\nand leaks through `Referer`. Putting a data subject's address there would\nscatter it across systems this erasure cannot reach."},"FeedbackChange":{"properties":{"assessment":{"type":"string","enum":["confirmed_suspicious","false_positive","unsure"],"title":"Assessment"}},"additionalProperties":false,"type":"object","required":["assessment"],"title":"FeedbackChange"},"FeedbackOut":{"properties":{"assessment":{"type":"string","enum":["confirmed_suspicious","false_positive","unsure"],"title":"Assessment"},"detector_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detector Version"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["assessment","detector_version","updated_at"],"title":"FeedbackOut"},"ForwardRequest":{"properties":{"to":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"To"},"cc":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Cc"},"bcc":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Bcc"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"attachment_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":10},{"type":"null"}],"title":"Attachment Ids"}},"additionalProperties":false,"type":"object","required":["to"],"title":"ForwardRequest","description":"MULTI-RCPT-A3. Same identity rules as `SendRequest`: no From field."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InboxCreateRequest":{"properties":{"domain_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Domain Id","description":"Verified custom domain in this workspace; omit for the managed domain."},"alias":{"type":"string","maxLength":64,"minLength":1,"title":"Alias","description":"Local part of the address, e.g. 'support' for support@…"},"display_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Display Name"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"HTTPS destination for inbound message events. Validated against the egress policy before it is stored."}},"type":"object","required":["alias"],"title":"InboxCreateRequest"},"InboxDeleted":{"properties":{"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"address":{"type":"string","title":"Address"},"deleted_at":{"type":"string","format":"date-time","title":"Deleted At"}},"type":"object","required":["inbox_id","address","deleted_at"],"title":"InboxDeleted"},"InboxEvent":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"type":{"type":"string","const":"message.received","title":"Type","default":"message.received"},"message_id":{"type":"string","format":"uuid","title":"Message Id"},"thread_id":{"type":"string","format":"uuid","title":"Thread Id"},"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"sequence_number":{"type":"integer","title":"Sequence Number"},"channel":{"type":"string","title":"Channel"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"}},"type":"object","required":["id","message_id","thread_id","inbox_id","sequence_number","channel","occurred_at"],"title":"InboxEvent"},"InboxEventPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InboxEvent"},"type":"array","title":"Items"},"next_cursor":{"type":"string","title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"},"poll_after_seconds":{"type":"integer","title":"Poll After Seconds"}},"type":"object","required":["items","next_cursor","has_more","poll_after_seconds"],"title":"InboxEventPage"},"InboxPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__api__v1__inboxes__InboxOut"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","next_cursor","has_more"],"title":"InboxPage"},"InboxResponse":{"properties":{"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"address":{"type":"string","title":"Address"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"channel":{"type":"string","title":"Channel"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret"}},"type":"object","required":["inbox_id","address","display_name","channel","webhook_url"],"title":"InboxResponse"},"InboxUpdateRequest":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Display Name"}},"type":"object","title":"InboxUpdateRequest","description":"Only the display name. The address is immutable; webhooks have their own\nroute."},"InviteAccepted":{"properties":{"account_id":{"type":"string","format":"uuid","title":"Account Id"},"accepted":{"type":"boolean","title":"Accepted"}},"type":"object","required":["account_id","accepted"],"title":"InviteAccepted"},"InviteCreated":{"properties":{"invitation_id":{"type":"string","format":"uuid","title":"Invitation Id"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"delivery_queued":{"type":"boolean","title":"Delivery Queued"}},"type":"object","required":["invitation_id","expires_at","delivery_queued"],"title":"InviteCreated"},"InviteRequest":{"properties":{"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email"},"role":{"type":"string","title":"Role"}},"additionalProperties":false,"type":"object","required":["email","role"],"title":"InviteRequest"},"InviteView":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"recipient_display":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Display"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"delivered":{"type":"boolean","title":"Delivered"}},"type":"object","required":["id","role","status","recipient_display","expires_at","delivered"],"title":"InviteView"},"KeyListResponse":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/KeySummary"},"type":"array","title":"Keys"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["keys","generated_at"],"title":"KeyListResponse"},"KeySummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"scope_type":{"type":"string","title":"Scope Type","default":"workspace"},"inbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"},"permissions":{"anyOf":[{"items":{"type":"string","enum":["inboxes.read","inboxes.write","messages.read","messages.write","messages.send","search.read","metrics.read","webhooks.read","webhooks.write","rules.read","rules.write","consents.write","privacy.read","privacy.write","domains.read","domains.write","drafts.read","drafts.write","audit.read","messages.feedback.write"]},"type":"array"},{"type":"null"}],"title":"Permissions"},"prefix":{"type":"string","title":"Prefix"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"superseded":{"type":"boolean","title":"Superseded","default":false}},"type":"object","required":["id","name","prefix","status","created_at","last_used_at","revoked_at"],"title":"KeySummary","description":"What a key looks like after creation.\n\n**There is deliberately no `key`, `plaintext` or `key_hash` field.** The\nhash is a credential verifier and publishing it would let an offline\nattacker test guesses; the plaintext no longer exists anywhere. `prefix` is\nthe short display fragment that identifies a key without authenticating it."},"LookupRequest":{"properties":{"recipient":{"type":"string","title":"Recipient"}},"type":"object","required":["recipient"],"title":"LookupRequest"},"LookupResponse":{"properties":{"suppressed":{"type":"boolean","title":"Suppressed"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"suppressed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Suppressed At"}},"type":"object","required":["suppressed"],"title":"LookupResponse"},"Member":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"display":{"type":"string","title":"Display"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"workspaces":{"items":{"$ref":"#/components/schemas/MemberWorkspace"},"type":"array","title":"Workspaces"}},"type":"object","required":["user_id","display","role","status","workspaces"],"title":"Member"},"MemberList":{"properties":{"members":{"items":{"$ref":"#/components/schemas/Member"},"type":"array","title":"Members"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["members","generated_at"],"title":"MemberList"},"MemberWorkspace":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["workspace_id","name"],"title":"MemberWorkspace"},"MessageDetail":{"properties":{"virus_verdict":{"anyOf":[{"type":"string","enum":["PASS","FAIL","GRAY","PROCESSING_FAILED"]},{"type":"null"}],"title":"Virus Verdict"},"spam_verdict":{"anyOf":[{"type":"string","enum":["PASS","FAIL","GRAY","PROCESSING_FAILED"]},{"type":"null"}],"title":"Spam Verdict"},"id":{"type":"string","format":"uuid","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"thread_id":{"type":"string","format":"uuid","title":"Thread Id"},"channel":{"type":"string","title":"Channel"},"sender":{"type":"string","title":"Sender"},"recipient":{"type":"string","title":"Recipient"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"is_automated":{"type":"boolean","title":"Is Automated"},"is_bulk":{"type":"boolean","title":"Is Bulk"},"risk_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Risk Level"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","default":[]},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read At"},"sequence_number":{"type":"integer","title":"Sequence Number"},"message_id_header":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id Header"},"in_reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"In Reply To"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"suppression_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suppression Reason"},"risk_signals":{"anyOf":[{"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"Risk Signals"},"risk_detector_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Risk Detector Version"}},"type":"object","required":["id","created_at","inbox_id","thread_id","channel","sender","recipient","subject","is_automated","is_bulk","risk_level","sequence_number","message_id_header","in_reply_to","body_text","suppression_reason","risk_signals","risk_detector_version"],"title":"MessageDetail","description":"Adds only what a debugging view needs beyond the row.\n\n**No `raw_s3_key`.** It is an internal storage location; a tenant debugging\ntheir own mail has no use for it, and publishing it hands an attacker a\nmap. `body_text` is the tenant's own message content and is returned to a\ncaller who already holds `messages.read` on this Workspace."},"MessageOut":{"properties":{"virus_verdict":{"anyOf":[{"type":"string","enum":["PASS","FAIL","GRAY","PROCESSING_FAILED"]},{"type":"null"}],"title":"Virus Verdict"},"spam_verdict":{"anyOf":[{"type":"string","enum":["PASS","FAIL","GRAY","PROCESSING_FAILED"]},{"type":"null"}],"title":"Spam Verdict"},"id":{"type":"string","format":"uuid","title":"Id"},"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"thread_id":{"type":"string","format":"uuid","title":"Thread Id"},"channel":{"type":"string","title":"Channel"},"sequence_number":{"type":"integer","title":"Sequence Number"},"sender":{"type":"string","title":"Sender"},"recipient":{"type":"string","title":"Recipient"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"is_automated":{"type":"boolean","title":"Is Automated"},"is_bulk":{"type":"boolean","title":"Is Bulk"},"list_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"List Id"},"risk_level":{"type":"string","title":"Risk Level"},"risk_signals":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Risk Signals"},"risk_detector_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Risk Detector Version"},"message_id_header":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id Header"},"in_reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"In Reply To"},"references_message_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"References Message Ids"},"to_addresses":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"To Addresses"},"cc_addresses":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Cc Addresses"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","default":[]},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read At"}},"type":"object","required":["id","inbox_id","thread_id","channel","sequence_number","sender","recipient","subject","body_text","created_at","is_automated","is_bulk","list_id","risk_level","risk_signals","message_id_header","in_reply_to","references_message_ids"],"title":"MessageOut","description":"`specs/18` §5.1.\n\n`org_id`, `raw_s3_key`, `revision_id`, `event_id`, `deleted_at`,\n`suppress_auto_reply` and `suppression_reason` are absent on purpose, each\nfor its own reason recorded in the spec. `risk_level`/`risk_signals` ARE\npresent: `architecture.md` §9 makes injection risk advisory metadata for\nthe developer's downstream agent, and withholding it defeats its purpose."},"MessagePage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MessageOut"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","next_cursor","has_more"],"title":"MessagePage"},"MessageState":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read At"}},"type":"object","required":["id","labels","read_at"],"title":"MessageState"},"MetricsOut":{"properties":{"inbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"},"window":{"$ref":"#/components/schemas/MetricsWindow"},"totals":{"$ref":"#/components/schemas/UsageCounts"},"unattributed":{"$ref":"#/components/schemas/UsageCounts"},"daily":{"items":{"$ref":"#/components/schemas/DailyUsage"},"type":"array","title":"Daily"},"delivery":{"$ref":"#/components/schemas/DeliveryCohort"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["inbox_id","window","totals","unattributed","daily","delivery"],"title":"MetricsOut"},"MetricsWindow":{"properties":{"start":{"type":"string","format":"date-time","title":"Start"},"end":{"type":"string","format":"date-time","title":"End"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"partial":{"type":"boolean","title":"Partial"},"timezone":{"type":"string","title":"Timezone","default":"UTC"}},"type":"object","required":["start","end","generated_at","partial"],"title":"MetricsWindow"},"ObservedMx":{"properties":{"host":{"type":"string","title":"Host"},"priority":{"type":"integer","title":"Priority"}},"type":"object","required":["host","priority"],"title":"ObservedMx"},"OperatorAcceptRequest":{"properties":{"token":{"type":"string","maxLength":128,"minLength":32,"title":"Token"}},"type":"object","required":["token"],"title":"OperatorAcceptRequest"},"OperatorAdminList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OperatorAdminView"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"OperatorAdminList"},"OperatorAdminReason":{"properties":{"reason":{"type":"string","maxLength":1000,"minLength":8,"title":"Reason"}},"type":"object","required":["reason"],"title":"OperatorAdminReason"},"OperatorAdminView":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"label":{"type":"string","title":"Label"},"status":{"type":"string","title":"Status"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities"}},"type":"object","required":["id","label","status","capabilities"],"title":"OperatorAdminView"},"OperatorGrantRequest":{"properties":{"reason":{"type":"string","maxLength":1000,"minLength":8,"title":"Reason"},"capability":{"type":"string","title":"Capability"}},"type":"object","required":["reason","capability"],"title":"OperatorGrantRequest"},"OperatorInviteCreated":{"properties":{"invitation_id":{"type":"string","format":"uuid","title":"Invitation Id"},"identity_invited":{"type":"boolean","title":"Identity Invited"},"delivery_queued":{"type":"boolean","title":"Delivery Queued"}},"type":"object","required":["invitation_id","identity_invited","delivery_queued"],"title":"OperatorInviteCreated"},"OperatorInviteRequest":{"properties":{"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email"},"reason":{"type":"string","maxLength":1000,"minLength":8,"title":"Reason"}},"type":"object","required":["email","reason"],"title":"OperatorInviteRequest"},"OperatorInviteView":{"properties":{"invitation_id":{"type":"string","format":"uuid","title":"Invitation Id"},"status":{"type":"string","title":"Status"},"recipient_display":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Display"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"identity_invited":{"type":"boolean","title":"Identity Invited"},"delivery_confirmed":{"type":"boolean","title":"Delivery Confirmed"}},"type":"object","required":["invitation_id","status","recipient_display","expires_at","identity_invited","delivery_confirmed"],"title":"OperatorInviteView"},"OperatorMeResponse":{"properties":{"status":{"type":"string","title":"Status"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities"}},"type":"object","required":["status","capabilities"],"title":"OperatorMeResponse"},"OutgoingAttachment":{"properties":{"filename":{"type":"string","maxLength":255,"title":"Filename"},"content_type":{"type":"string","maxLength":127,"title":"Content Type","default":"application/octet-stream"},"content_base64":{"type":"string","maxLength":6990508,"title":"Content Base64"}},"additionalProperties":false,"type":"object","required":["filename","content_base64"],"title":"OutgoingAttachment"},"OverviewResponse":{"properties":{"account_id":{"type":"string","format":"uuid","title":"Account Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"window":{"$ref":"#/components/schemas/Window"},"degraded":{"type":"boolean","title":"Degraded"},"counters":{"additionalProperties":{"$ref":"#/components/schemas/Counter"},"type":"object","title":"Counters"},"checklist":{"items":{"$ref":"#/components/schemas/ChecklistItem"},"type":"array","title":"Checklist"},"attention":{"items":{"$ref":"#/components/schemas/AttentionItem"},"type":"array","title":"Attention"}},"type":"object","required":["account_id","workspace_id","generated_at","window","degraded","counters","checklist","attention"],"title":"OverviewResponse"},"PolicyChange":{"properties":{"inbound_allowlist_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Inbound Allowlist Enabled"},"outbound_allowlist_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Outbound Allowlist Enabled"}},"additionalProperties":false,"type":"object","title":"PolicyChange"},"PolicyMutation":{"properties":{"inbound_allowlist_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Inbound Allowlist Enabled"},"outbound_allowlist_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Outbound Allowlist Enabled"},"inbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"}},"additionalProperties":false,"type":"object","title":"PolicyMutation"},"PolicyOut":{"properties":{"inbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"},"inbound_allowlist_enabled":{"type":"boolean","title":"Inbound Allowlist Enabled"},"outbound_allowlist_enabled":{"type":"boolean","title":"Outbound Allowlist Enabled"}},"type":"object","required":["inbox_id","inbound_allowlist_enabled","outbound_allowlist_enabled"],"title":"PolicyOut"},"PolicyPanel":{"properties":{"policy":{"$ref":"#/components/schemas/PolicyOut"},"rules":{"items":{"$ref":"#/components/schemas/RuleOut"},"type":"array","title":"Rules"}},"type":"object","required":["policy","rules"],"title":"PolicyPanel"},"PortalSession":{"properties":{"portal_url":{"type":"string","title":"Portal Url"}},"type":"object","required":["portal_url"],"title":"PortalSession"},"Preview":{"properties":{"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"address":{"type":"string","maxLength":320,"minLength":1,"title":"Address"}},"additionalProperties":false,"type":"object","required":["inbox_id","address"],"title":"Preview"},"PreviewOut":{"properties":{"inbound_allowed":{"type":"boolean","title":"Inbound Allowed"},"outbound_allowed":{"type":"boolean","title":"Outbound Allowed"}},"type":"object","required":["inbound_allowed","outbound_allowed"],"title":"PreviewOut"},"QuantityAccepted":{"properties":{"requested_quantity":{"type":"integer","title":"Requested Quantity"},"effective":{"type":"string","title":"Effective"}},"type":"object","required":["requested_quantity","effective"],"title":"QuantityAccepted"},"QuantityRequest":{"properties":{"mailbox_quantity":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Mailbox Quantity"}},"additionalProperties":false,"type":"object","required":["mailbox_quantity"],"title":"QuantityRequest"},"RegisterDomainRequest":{"properties":{"domain":{"type":"string","maxLength":253,"minLength":3,"title":"Domain"}},"type":"object","required":["domain"],"title":"RegisterDomainRequest"},"RemedyRequest":{"properties":{"reason":{"type":"string","maxLength":1000,"minLength":8,"title":"Reason"}},"type":"object","required":["reason"],"title":"RemedyRequest"},"RemedyResponse":{"properties":{"outcome":{"type":"string","title":"Outcome"},"workspace_suspended":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Workspace Suspended"},"suppression_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Suppression Count"},"account_suspended":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Account Suspended"},"still_suspended_workspaces":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Still Suspended Workspaces"}},"type":"object","required":["outcome"],"title":"RemedyResponse"},"RenameAccountRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"RenameAccountRequest"},"ReplayResponse":{"properties":{"outbox_id":{"type":"string","format":"uuid","title":"Outbox Id"},"event_id":{"type":"string","title":"Event Id"},"status":{"type":"string","title":"Status"},"replay_count":{"type":"integer","title":"Replay Count"},"event_id_preserved":{"type":"boolean","title":"Event Id Preserved","default":true}},"type":"object","required":["outbox_id","event_id","status","replay_count"],"title":"ReplayResponse"},"ReplayResult":{"properties":{"outbox_id":{"type":"string","format":"uuid","title":"Outbox Id"},"event_id":{"type":"string","title":"Event Id"},"status":{"type":"string","title":"Status"},"replay_count":{"type":"integer","title":"Replay Count"},"event_id_preserved":{"type":"boolean","title":"Event Id Preserved","default":true}},"type":"object","required":["outbox_id","event_id","status","replay_count"],"title":"ReplayResult"},"ResolveResponse":{"properties":{"state":{"type":"string","title":"State"},"account_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Account Id"},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["state","generated_at"],"title":"ResolveResponse","description":"Where the bare `/` route should land. `specs/09` §15.4, §15.4a.\n\nA **rendering decision**, never an authorization one. It grants nothing: the\nids it returns still have to survive the full predicate on the very next\nrequest, exactly as if the caller had typed them."},"RetentionPeriod":{"properties":{"days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Days"}},"additionalProperties":false,"type":"object","required":["days"],"title":"RetentionPeriod"},"RetentionPolicyChange":{"properties":{"days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Days"},"expected_revision":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Expected Revision"},"confirm":{"type":"boolean","title":"Confirm"}},"additionalProperties":false,"type":"object","required":["days","expected_revision","confirm"],"title":"RetentionPolicyChange"},"RetentionStatus":{"properties":{"days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days"},"revision":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Revision"},"may_manage":{"type":"boolean","title":"May Manage"},"legal_hold":{"type":"boolean","title":"Legal Hold"},"eligible_received":{"type":"integer","title":"Eligible Received"},"eligible_sent":{"type":"integer","title":"Eligible Sent"},"removed_content":{"type":"integer","title":"Removed Content"},"pending_files":{"type":"integer","title":"Pending Files"},"retrying_jobs":{"type":"integer","title":"Retrying Jobs"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"raw_file_ceiling_days":{"type":"integer","title":"Raw File Ceiling Days","default":30}},"type":"object","required":["days","revision","may_manage","legal_hold","eligible_received","eligible_sent","removed_content","pending_files","retrying_jobs","last_run_at","last_error"],"title":"RetentionStatus"},"Revision":{"properties":{"expected_revision":{"type":"string","format":"uuid","title":"Expected Revision"}},"additionalProperties":false,"type":"object","required":["expected_revision"],"title":"Revision"},"RevokeRequest":{"properties":{"recipient":{"type":"string","maxLength":320,"title":"Recipient"}},"type":"object","required":["recipient"],"title":"RevokeRequest"},"RotateKeyRequest":{"properties":{"overlap_hours":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Overlap Hours"}},"type":"object","title":"RotateKeyRequest","description":"Optional overlap. Omitted, the configured default applies.\n\nThe bound is enforced by the service, not here — one place decides what a\nlegal window is, and it is the same place for every caller."},"RuleCreate":{"properties":{"direction":{"type":"string","enum":["inbound","outbound"],"title":"Direction"},"effect":{"type":"string","enum":["allow","block"],"title":"Effect"},"pattern":{"type":"string","maxLength":320,"minLength":1,"title":"Pattern"}},"additionalProperties":false,"type":"object","required":["direction","effect","pattern"],"title":"RuleCreate"},"RuleMutation":{"properties":{"direction":{"type":"string","enum":["inbound","outbound"],"title":"Direction"},"effect":{"type":"string","enum":["allow","block"],"title":"Effect"},"pattern":{"type":"string","maxLength":320,"minLength":1,"title":"Pattern"},"inbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inbox Id"}},"additionalProperties":false,"type":"object","required":["direction","effect","pattern"],"title":"RuleMutation"},"RuleOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"direction":{"type":"string","enum":["inbound","outbound"],"title":"Direction"},"effect":{"type":"string","enum":["allow","block"],"title":"Effect"},"kind":{"type":"string","enum":["address","domain"],"title":"Kind"},"pattern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pattern"},"erased":{"type":"boolean","title":"Erased"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","direction","effect","kind","pattern","erased","created_at"],"title":"RuleOut"},"SearchMatch":{"properties":{"message_id":{"type":"string","format":"uuid","title":"Message Id"},"thread_id":{"type":"string","format":"uuid","title":"Thread Id"},"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"similarity":{"type":"number","title":"Similarity"},"chunk_index":{"type":"integer","title":"Chunk Index"},"chunk_start":{"type":"integer","title":"Chunk Start"},"chunk_end":{"type":"integer","title":"Chunk End"},"risk_level":{"type":"string","title":"Risk Level"},"risk_signals":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Risk Signals"}},"type":"object","required":["message_id","thread_id","inbox_id","similarity","chunk_index","chunk_start","chunk_end","risk_level","risk_signals"],"title":"SearchMatch"},"SearchRequest":{"properties":{"query":{"type":"string","maxLength":1000,"minLength":1,"title":"Query"},"top_k":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Top K","default":10},"min_score":{"anyOf":[{"type":"number","maximum":1.0,"minimum":-1.0},{"type":"null"}],"title":"Min Score"}},"type":"object","required":["query"],"title":"SearchRequest"},"SearchResponse":{"properties":{"matches":{"items":{"$ref":"#/components/schemas/SearchMatch"},"type":"array","title":"Matches"},"model":{"type":"string","title":"Model"},"index_is_eventually_consistent":{"type":"boolean","title":"Index Is Eventually Consistent","default":true},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["matches","model","generated_at"],"title":"SearchResponse"},"SendRequest":{"properties":{"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"to":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"To"},"cc":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Cc"},"bcc":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Bcc"},"reply_all":{"type":"boolean","title":"Reply All","default":false},"subject":{"type":"string","maxLength":998,"title":"Subject","default":""},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"thread_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Thread Id"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/OutgoingAttachment"},"type":"array","maxItems":10},{"type":"null"}],"title":"Attachments"}},"additionalProperties":false,"type":"object","required":["inbox_id"],"title":"SendRequest","description":"`extra=\"forbid\"` is load-bearing.\n\nThere is no `from`, `sender` or `return_path` field: the From identity comes\nfrom the tenant's inbox record. Forbidding extras makes a caller who tries to\nset one get a `422` instead of a silent `202` — being ignored is worse,\nbecause the integrator believes they chose a sender and nothing says\notherwise. A caller-chosen From is sender spoofing on infrastructure whose\nDKIM signature makes it look authentic."},"SessionAccount":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"workspace_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Workspace Count"},"default_workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Default Workspace Id"},"outbound_suspended":{"type":"boolean","title":"Outbound Suspended"}},"type":"object","required":["id","name","role","status","workspace_count","default_workspace_id","outbound_suspended"],"title":"SessionAccount"},"SessionResponse":{"properties":{"user":{"$ref":"#/components/schemas/SessionUser"},"accounts":{"items":{"$ref":"#/components/schemas/SessionAccount"},"type":"array","title":"Accounts"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["user","accounts","generated_at"],"title":"SessionResponse"},"SessionUser":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["id","display_name"],"title":"SessionUser"},"SignupIn":{"properties":{"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email"},"username":{"type":"string","maxLength":64,"minLength":1,"title":"Username"}},"additionalProperties":false,"type":"object","required":["email","username"],"title":"SignupIn"},"SignupOut":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"api_key":{"type":"string","title":"Api Key"},"verified":{"type":"boolean","title":"Verified"},"code_queued":{"type":"boolean","title":"Code Queued"}},"type":"object","required":["agent_id","api_key","verified","code_queued"],"title":"SignupOut"},"SignupResponse":{"properties":{"account_id":{"type":"string","format":"uuid","title":"Account Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"created":{"type":"boolean","title":"Created"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["account_id","workspace_id","created","generated_at"],"title":"SignupResponse","description":"The scope a newly-provisioned caller lands in."},"StateChange":{"properties":{"add_labels":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Add Labels"},"remove_labels":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Remove Labels"},"is_read":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Read"}},"additionalProperties":false,"type":"object","title":"StateChange"},"SubscriptionChange":{"properties":{"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url"},"event_types":{"anyOf":[{"items":{"type":"string","enum":["message.received","thread.merged"]},"type":"array","maxItems":2,"minItems":1},{"type":"null"}],"title":"Event Types"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object","maxProperties":16},{"type":"null"}],"title":"Headers"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"additionalProperties":false,"type":"object","title":"SubscriptionChange"},"SubscriptionCreate":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url"},"event_types":{"items":{"type":"string","enum":["message.received","thread.merged"]},"type":"array","maxItems":2,"minItems":1,"title":"Event Types"},"headers":{"additionalProperties":{"type":"string"},"type":"object","maxProperties":16,"title":"Headers"}},"additionalProperties":false,"type":"object","required":["url","event_types"],"title":"SubscriptionCreate"},"SubscriptionMutation":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url"},"event_types":{"items":{"type":"string","enum":["message.received","thread.merged"]},"type":"array","maxItems":2,"minItems":1,"title":"Event Types"},"headers":{"additionalProperties":{"type":"string"},"type":"object","maxProperties":16,"title":"Headers"},"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"}},"additionalProperties":false,"type":"object","required":["url","event_types","inbox_id"],"title":"SubscriptionMutation"},"SubscriptionOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"url":{"type":"string","title":"Url"},"event_types":{"items":{"type":"string","enum":["message.received","thread.merged"]},"type":"array","title":"Event Types"},"enabled":{"type":"boolean","title":"Enabled"},"has_custom_headers":{"type":"boolean","title":"Has Custom Headers"},"secret_version":{"type":"integer","title":"Secret Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"signing_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signing Secret"}},"type":"object","required":["id","inbox_id","url","event_types","enabled","has_custom_headers","secret_version","created_at"],"title":"SubscriptionOut"},"SuppressionEntry":{"properties":{"recipient_digest":{"type":"string","title":"Recipient Digest"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"suppressed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Suppressed At"},"released":{"type":"boolean","title":"Released"}},"type":"object","required":["recipient_digest","reason","suppressed_at","released"],"title":"SuppressionEntry","description":"A suppression, addressed by DIGEST.\n\n`recipient_suppressions` also carries a plaintext `recipient` column. It is\nnever selected and never returned: suppressions are keyed by digest exactly\nso the plaintext need not be handled here, and a review surface that showed\naddresses would make reviewing suppressions a way to harvest them."},"SuppressionList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SuppressionEntry"},"type":"array","title":"Items"},"truncated":{"type":"boolean","title":"Truncated"}},"type":"object","required":["items","truncated"],"title":"SuppressionList"},"SuspendedAccount":{"properties":{"account_id":{"type":"string","format":"uuid","title":"Account Id"},"account_suspended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Account Suspended At"},"workspace_count":{"type":"integer","title":"Workspace Count"},"independently_suspended":{"type":"integer","title":"Independently Suspended"}},"type":"object","required":["account_id","account_suspended_at","workspace_count","independently_suspended"],"title":"SuspendedAccount","description":"One Account-level suspension, grouped ONCE (spec §6.4b).\n\nAn Account suspension blocks every Workspace under it, so listing one row\nper Workspace showed N identical entries and invited N identical decisions."},"SuspendedWorkspace":{"properties":{"org_id":{"type":"string","format":"uuid","title":"Org Id"},"account_id":{"type":"string","format":"uuid","title":"Account Id"},"workspace_suspended":{"type":"boolean","title":"Workspace Suspended"},"workspace_suspended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Workspace Suspended At"},"workspace_suspension_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Suspension Reason"},"account_suspended":{"type":"boolean","title":"Account Suspended"},"suppression_count":{"type":"integer","title":"Suppression Count"}},"type":"object","required":["org_id","account_id","workspace_suspended","workspace_suspended_at","workspace_suspension_reason","account_suspended","suppression_count"],"title":"SuspendedWorkspace","description":"One row of the review queue. Lifecycle facts only (spec §6.3)."},"SuspensionDetail":{"properties":{"org_id":{"type":"string","format":"uuid","title":"Org Id"},"account_id":{"type":"string","format":"uuid","title":"Account Id"},"workspace_suspended":{"type":"boolean","title":"Workspace Suspended"},"workspace_suspended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Workspace Suspended At"},"account_suspended":{"type":"boolean","title":"Account Suspended"},"suppression_count":{"type":"integer","title":"Suppression Count"}},"type":"object","required":["org_id","account_id","workspace_suspended","workspace_suspended_at","account_suspended","suppression_count"],"title":"SuspensionDetail"},"SuspensionQueue":{"properties":{"accounts":{"items":{"$ref":"#/components/schemas/SuspendedAccount"},"type":"array","title":"Accounts"},"items":{"items":{"$ref":"#/components/schemas/SuspendedWorkspace"},"type":"array","title":"Items"},"truncated":{"type":"boolean","title":"Truncated"}},"type":"object","required":["accounts","items","truncated"],"title":"SuspensionQueue"},"ThreadDetailOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"channel":{"type":"string","title":"Channel"},"status":{"type":"string","title":"Status"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"requested_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Requested Id"},"messages":{"items":{"$ref":"#/components/schemas/TimelineItemOut"},"type":"array","title":"Messages"}},"type":"object","required":["id","inbox_id","subject","channel","status","last_message_at","created_at","messages"],"title":"ThreadDetailOut"},"ThreadOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"channel":{"type":"string","title":"Channel"},"status":{"type":"string","title":"Status"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","inbox_id","subject","channel","status","last_message_at","created_at"],"title":"ThreadOut"},"ThreadPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ThreadOut"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","next_cursor","has_more"],"title":"ThreadPage"},"TimelineItemOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"direction":{"type":"string","title":"Direction"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender"},"recipient":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient"},"sequence_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sequence Number"},"risk_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Risk Level"},"risk_signals":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Risk Signals"},"message_id_header":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id Header"},"in_reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"In Reply To"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","required":["id","direction","occurred_at","subject","body_text","sender","recipient","sequence_number","risk_level","risk_signals","message_id_header","in_reply_to","status"],"title":"TimelineItemOut","description":"One entry in a conversation, from either direction (AT-8).\n\nA single ordered timeline rather than two lists: an agent reading a thread\nwants to know what was said and in what order, and reconstructing that from\ntwo arrays is work every caller would have to repeat.\n\n`direction` is derived from the **source table**, never from inspecting\n`sender` — erasure redacts addresses, so an inferred direction would flip on\nan erased row.\n\nFields that belong to only one direction are `null` on the other, and each\nis null for a stated reason rather than because it was not wired up:\noutbound has no `sender` (the address is the inbox's own and is not stored\ntwice), no `sequence_number` (that sequence is inbound-only so webhook\nreordering keeps working), and no `message_id_header` (SES overrides\n`Message-ID` and never reveals it)."},"UpdateIn":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"external_client_id":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"External Client Id"}},"type":"object","title":"UpdateIn"},"UpdateWorkspaceRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"external_client_id":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"External Client Id"}},"type":"object","title":"UpdateWorkspaceRequest"},"UsageCounts":{"properties":{"outbound_accepted":{"type":"integer","title":"Outbound Accepted","default":0},"outbound_delivered":{"type":"integer","title":"Outbound Delivered","default":0},"inbound_stored":{"type":"integer","title":"Inbound Stored","default":0}},"type":"object","title":"UsageCounts"},"UsageDay":{"properties":{"period_start":{"type":"string","format":"date-time","title":"Period Start"},"value":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Value"},"state":{"type":"string","title":"State"}},"type":"object","required":["period_start","value","state"],"title":"UsageDay","description":"One UTC day. Same rule as every other figure: `value` is null if and\nonly if `state` is `unavailable` — a day that could not be computed must\nnever render as `0`, because a zero on a chart claims nothing happened."},"UsageDimension":{"properties":{"value":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Value"},"state":{"type":"string","title":"State"}},"type":"object","required":["value","state"],"title":"UsageDimension","description":"`value` is null if and only if `state` is `unavailable`."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyIn":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"code":{"type":"string","maxLength":16,"minLength":1,"title":"Code"}},"additionalProperties":false,"type":"object","required":["agent_id","code"],"title":"VerifyIn"},"VerifyOut":{"properties":{"verified":{"type":"boolean","title":"Verified"}},"type":"object","required":["verified"],"title":"VerifyOut"},"WebhookOverview":{"properties":{"destinations":{"items":{"$ref":"#/components/schemas/DestinationSummary"},"type":"array","title":"Destinations"},"dead_letter_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dead Letter Total"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"degraded":{"type":"boolean","title":"Degraded"}},"type":"object","required":["destinations","dead_letter_total","generated_at","degraded"],"title":"WebhookOverview"},"WebhookRegisterRequest":{"properties":{"webhook_url":{"type":"string","title":"Webhook Url"}},"type":"object","required":["webhook_url"],"title":"WebhookRegisterRequest"},"Window":{"properties":{"start":{"type":"string","format":"date-time","title":"Start"},"end":{"type":"string","format":"date-time","title":"End"}},"type":"object","required":["start","end"],"title":"Window"},"WorkflowOverview":{"properties":{"inboxes":{"items":{"$ref":"#/components/schemas/app__api__v1__console_workflows__InboxOut"},"type":"array","title":"Inboxes"},"policies":{"items":{"$ref":"#/components/schemas/PolicyPanel"},"type":"array","title":"Policies"},"subscriptions":{"items":{"$ref":"#/components/schemas/SubscriptionOut"},"type":"array","title":"Subscriptions"},"drafts":{"items":{"$ref":"#/components/schemas/DraftOut"},"type":"array","title":"Drafts"},"may_manage":{"type":"boolean","title":"May Manage"},"may_send":{"type":"boolean","title":"May Send"},"draft_has_more":{"type":"boolean","title":"Draft Has More"},"draft_next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Next Cursor"}},"type":"object","required":["inboxes","policies","subscriptions","drafts","may_manage","may_send","draft_has_more","draft_next_cursor"],"title":"WorkflowOverview"},"WorkspaceDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"is_default":{"type":"boolean","title":"Is Default"},"workspace_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Slug"},"external_client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Client Id"},"outbound_suspended":{"type":"boolean","title":"Outbound Suspended"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","status","is_default","workspace_slug","external_client_id","outbound_suspended","created_at"],"title":"WorkspaceDetail"},"WorkspaceListOut":{"properties":{"workspaces":{"items":{"$ref":"#/components/schemas/WorkspaceOut"},"type":"array","title":"Workspaces"}},"type":"object","required":["workspaces"],"title":"WorkspaceListOut"},"WorkspaceListResponse":{"properties":{"workspaces":{"items":{"$ref":"#/components/schemas/WorkspaceSummary"},"type":"array","title":"Workspaces"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["workspaces","generated_at"],"title":"WorkspaceListResponse"},"WorkspaceOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"is_default":{"type":"boolean","title":"Is Default"},"workspace_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Slug"},"external_client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Client Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","status","is_default","workspace_slug","external_client_id","created_at"],"title":"WorkspaceOut"},"WorkspaceSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"is_default":{"type":"boolean","title":"Is Default"},"outbound_suspended":{"type":"boolean","title":"Outbound Suspended"}},"type":"object","required":["id","name","is_default","outbound_suspended"],"title":"WorkspaceSummary"},"WorkspaceUsage":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"account_id":{"type":"string","format":"uuid","title":"Account Id"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"degraded":{"type":"boolean","title":"Degraded"},"dimensions":{"additionalProperties":{"$ref":"#/components/schemas/UsageDimension"},"type":"object","title":"Dimensions"},"daily":{"additionalProperties":{"items":{"$ref":"#/components/schemas/UsageDay"},"type":"array"},"type":"object","title":"Daily"},"agents":{"$ref":"#/components/schemas/AgentBreakdown"}},"type":"object","required":["workspace_id","account_id","period_start","period_end","generated_at","degraded","dimensions","daily","agents"],"title":"WorkspaceUsage"},"app__api__v1__console__AccountDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"outbound_suspended":{"type":"boolean","title":"Outbound Suspended"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","status","outbound_suspended","created_at"],"title":"AccountDetail"},"app__api__v1__console_workflows__InboxOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"address":{"type":"string","title":"Address"}},"type":"object","required":["id","address"],"title":"InboxOut"},"app__api__v1__inboxes__InboxOut":{"properties":{"inbox_id":{"type":"string","format":"uuid","title":"Inbox Id"},"address":{"type":"string","title":"Address"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"channel":{"type":"string","title":"Channel"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["inbox_id","address","display_name","channel","webhook_url","created_at"],"title":"InboxOut","description":"An inbox as the API reports it after creation. Never the signing secret."},"app__api__v1__operator__AccountDetail":{"properties":{"account_id":{"type":"string","format":"uuid","title":"Account Id"},"account_suspended":{"type":"boolean","title":"Account Suspended"},"account_suspended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Account Suspended At"},"workspace_count":{"type":"integer","title":"Workspace Count"},"independently_suspended":{"type":"integer","title":"Independently Suspended"}},"type":"object","required":["account_id","account_suspended","account_suspended_at","workspace_count","independently_suspended"],"title":"AccountDetail","description":"Account-level lifecycle facts. No name, no owner, no tenant content."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}