{"openapi":"3.1.0","info":{"title":"Svanja Public API v1","version":"1.0.0","summary":"Public REST API v1 contract","description":"Hand-maintained contract for the public \/api\/v1 surface. It covers bearer-protected resource routes plus the unauthenticated first-party CLI device authorization bootstrap endpoints. It does not describe retained legacy \/api routes, browser session routes, admin routes, or generated CLI commands.\n"},"servers":[{"url":"https:\/\/your-domain.com","description":"Your application origin"}],"tags":[{"name":"Identity","description":"Caller identity, key metadata, capabilities, and project scope."},{"name":"Account","description":"Account state, entitlements, and bounded usage summaries."},{"name":"Activity","description":"Public API audit activity with conservative redaction."},{"name":"Assistant","description":"Assistant chat and run summaries for the key visibility user."},{"name":"Tasks","description":"Task status, events, outputs, and controls for the key visibility user."},{"name":"Spaces","description":"Space resources visible to the key visibility user."},{"name":"Files","description":"Space source files, history, search, saves, and downloads."},{"name":"Skills","description":"Skill package discovery, source, runs, imports, and exports."},{"name":"Mail","description":"Mailbox and thread summaries for granted mailbox content."},{"name":"Projects","description":"Project resources addressed by stable public IDs."},{"name":"Credits","description":"Team credit balance and public transaction history."},{"name":"Team","description":"Team member and pending invitation directory reads."},{"name":"API Keys","description":"Public API key lifecycle management."},{"name":"Webhooks","description":"Webhook subscription management and delivery diagnostics."},{"name":"CLI Auth","description":"First-party CLI device authorization bootstrap."}],"paths":{"\/api\/v1\/openapi.yaml":{"get":{"operationId":"getOpenApiYaml","tags":["Identity"],"summary":"Download the OpenAPI YAML document","responses":{"200":{"description":"OpenAPI document.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"}},"content":{"application\/yaml":{"schema":{"type":"string"}}}}}}},"\/api\/v1\/openapi.json":{"get":{"operationId":"getOpenApiJson","tags":["Identity"],"summary":"Download the OpenAPI JSON document","responses":{"200":{"description":"OpenAPI document.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"}},"content":{"application\/json":{"schema":{"type":"object"}}}}}}},"\/api\/v1\/capabilities":{"get":{"operationId":"listCapabilities","tags":["Identity"],"summary":"Search public API operation capabilities","description":"Returns family summaries, operation summaries, examples and the authenticated key's current availability for matching public operations. Discovery is descriptive and does not grant authority.\n","security":[{"bearerAuth":[]}],"parameters":[{"name":"q","in":"query","schema":{"type":"string","maxLength":255}},{"name":"family","in":"query","schema":{"type":"string","maxLength":64}},{"name":"effect_class","in":"query","schema":{"type":"string","enum":["read","internal","external","owner"]}},{"name":"available","in":"query","schema":{"type":"boolean"}},{"name":"include_examples","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Matching operation capabilities.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CapabilityDiscoveryEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/capabilities\/{name}":{"get":{"operationId":"getCapability","tags":["Identity"],"summary":"Read one public API operation capability","description":"Returns full operation metadata including schemas, examples, endpoints, failure reasons, effect class, undo metadata and current availability.\n","security":[{"bearerAuth":[]}],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Operation capability detail.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CapabilityDetailEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/administration\/connection-handoff":{"get":{"operationId":"getMailConnectionHandoff","tags":["Mail"],"summary":"Get private human connection setup navigation","description":"Read-only, no provisioning or credential effects. Requires Custom mail_administration read and matching personal administration approval, plus current Mail management. Existing-mailbox actions require its separate administration approval. Password entry, OAuth\/MFA consent and credential rotation happen only after the human opens this signed-in settings link and explicitly submits the private form. This link grants no authority, is not provider readiness or completion evidence, and never automatically approves new mailbox content\/API access.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","enum":["connect_oauth","connect_credentials","connect_shared","reauthorize","rotate_credentials"]}},{"name":"mailbox_id","in":"query","description":"Required only for reauthorize and rotate_credentials; prohibited for new connections.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}],"responses":{"200":{"description":"Human action required; no changes applied.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"properties":{"action":{"type":"string","enum":["connect_oauth","connect_credentials","connect_shared","reauthorize","rotate_credentials"]},"mailbox_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"const":"human_action_required"},"changes_applied":{"const":false},"provider_request_issued":{"const":false},"credentials_included":{"const":false},"url":{"type":"string","description":"Relative authenticated application URL, never a provider URL or bearer credential."}},"required":["action","mailbox_id","status","changes_applied","provider_request_issued","credentials_included","url"]}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}\/connection\/commands\/{command_id}\/acknowledge":{"post":{"operationId":"acknowledgeMailConnectionCommand","tags":["Mail"],"summary":"Acknowledge an unresolved connection outcome without retrying it","description":"Requires current management authority and this original key\/user receipt. Explicitly acknowledges possible partial or unknown changes and releases the admission fence, without provider HTTP, retries, cancellation or certification of success. confirm:true, reconciliation_revision as revision, and retained Idempotency-Key are required. Resync\/flush remain superadmin-only. Interrupted started commands additionally require current superadmin, absence of any active team connection lock and a 240-second quarantine. Original steps and command_completed:false remain preserved. Same intent replays with fresh authority; changed acknowledgement or stale revision conflicts.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}},{"name":"command_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Durable redacted invocation receipt; inspect status, not HTTP success alone.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","operation","status","command_completed","may_have_changes","provider_completion_not_guaranteed","automatic_retry_allowed","reason_code","completed_at","steps"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"mailbox_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"operation":{"type":"string","enum":["reconnect","disconnect","enable","repair","resync","flush","rotate_credentials"]},"status":{"type":"string","enum":["started","completed","needs_attention"]},"command_completed":{"type":"boolean"},"may_have_changes":{"const":true},"provider_completion_not_guaranteed":{"const":true},"automatic_retry_allowed":{"const":false},"reason_code":{"type":["string","null"]},"completed_at":{"type":["string","null"],"format":"date-time"},"steps":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","method","status","http_status"],"properties":{"index":{"type":"integer","minimum":0},"method":{"type":"string"},"status":{"type":"string","enum":["started","succeeded","rejected","unknown"]},"http_status":{"type":["integer","null"],"minimum":0,"maximum":599}}}},"acknowledged_at":{"type":["string","null"],"format":"date-time"},"reconciliation_revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}\/connection\/{operation}":{"post":{"operationId":"executeMailConnectionCommand","tags":["Mail"],"summary":"Execute one reviewed connection operation","description":"Requires Custom mail_administration capability, separate bound-user approval for this exact administration_mailbox_ids entry, and current management policy. Does not borrow content grants. A durable receipt records each provider mutation separately before transport and never retries provider effects automatically. A completed command is not a guarantee that provider synchronization has finished. started or needs_attention may include partial local\/provider changes; inspect steps and reconcile before any new command. New keys cannot bypass an unresolved command for this mailbox. Replay rechecks current authority. Reads of receipts are bound to the original key and user. No credentials or raw provider payloads are returned. Disconnect can cancel queued mail; flush rebuilds local sync state. Resync and flush additionally require the bound user's current superadmin role. acknowledged_at records explicit acknowledgement of an uncertain outcome, never success. reconciliation_revision binds a later human-approved acknowledgement to this exact receipt and mailbox state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"operation","in":"path","required":true,"schema":{"type":"string","enum":["reconnect","disconnect","enable","repair","resync","flush"]}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Durable redacted invocation receipt; inspect status, not HTTP success alone.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","operation","status","command_completed","may_have_changes","provider_completion_not_guaranteed","automatic_retry_allowed","reason_code","completed_at","steps"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"mailbox_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"operation":{"type":"string","enum":["reconnect","disconnect","enable","repair","resync","flush","rotate_credentials"]},"status":{"type":"string","enum":["started","completed","needs_attention"]},"command_completed":{"type":"boolean"},"may_have_changes":{"const":true},"provider_completion_not_guaranteed":{"const":true},"automatic_retry_allowed":{"const":false},"reason_code":{"type":["string","null"]},"completed_at":{"type":["string","null"],"format":"date-time"},"steps":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","method","status","http_status"],"properties":{"index":{"type":"integer","minimum":0},"method":{"type":"string"},"status":{"type":"string","enum":["started","succeeded","rejected","unknown"]},"http_status":{"type":["integer","null"],"minimum":0,"maximum":599}}}},"acknowledged_at":{"type":["string","null"],"format":"date-time"},"reconciliation_revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}\/connection\/commands\/{command_id}":{"get":{"operationId":"getMailConnectionCommand","tags":["Mail"],"summary":"Read your connection operation receipt","description":"Requires Custom mail_administration capability, separate bound-user approval for this exact administration_mailbox_ids entry, and current management policy. Does not borrow content grants. A durable receipt records each provider mutation separately before transport and never retries provider effects automatically. A completed command is not a guarantee that provider synchronization has finished. started or needs_attention may include partial local\/provider changes; inspect steps and reconcile before any new command. New keys cannot bypass an unresolved command for this mailbox. Replay rechecks current authority. Reads of receipts are bound to the original key and user. No credentials or raw provider payloads are returned. Disconnect can cancel queued mail; flush rebuilds local sync state. Resync and flush additionally require the bound user's current superadmin role. acknowledged_at records explicit acknowledgement of an uncertain outcome, never success. reconciliation_revision binds a later human-approved acknowledgement to this exact receipt and mailbox state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"command_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Durable redacted invocation receipt; inspect status, not HTTP success alone.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","operation","status","command_completed","may_have_changes","provider_completion_not_guaranteed","automatic_retry_allowed","reason_code","completed_at","steps"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"mailbox_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"operation":{"type":"string","enum":["reconnect","disconnect","enable","repair","resync","flush","rotate_credentials"]},"status":{"type":"string","enum":["started","completed","needs_attention"]},"command_completed":{"type":"boolean"},"may_have_changes":{"const":true},"provider_completion_not_guaranteed":{"const":true},"automatic_retry_allowed":{"const":false},"reason_code":{"type":["string","null"]},"completed_at":{"type":["string","null"],"format":"date-time"},"steps":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","method","status","http_status"],"properties":{"index":{"type":"integer","minimum":0},"method":{"type":"string"},"status":{"type":"string","enum":["started","succeeded","rejected","unknown"]},"http_status":{"type":["integer","null"],"minimum":0,"maximum":599}}}},"acknowledged_at":{"type":["string","null"],"format":"date-time"},"reconciliation_revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/safety\/sender-rules":{"get":{"operationId":"getMailSenderSafetyRules","tags":["Mail"],"summary":"get Mail Sender Safety Rules","description":"Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation\/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow\/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page\/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_sender_safety","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"Private current-authority safety projection; no provider effects.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","scope","revision","items","current_page","has_more","next_page"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"scope":{"type":"string","enum":["team","personal"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"items":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["id","kind","target_type","target","created_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"kind":{"type":"string","enum":["sender_allow","sender_block","remote_content_trust"]},"target_type":{"type":"string","enum":["address","domain"]},"target":{"type":"string"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"current_page":{"type":"integer","minimum":1},"has_more":{"type":"boolean"},"next_page":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createMailSenderSafetyRule","tags":["Mail"],"summary":"create Mail Sender Safety Rule","description":"Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation\/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow\/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page\/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_sender_safety","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority safety projection; no provider effects.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","scope","owner_id","deleted","rule","revision"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"scope":{"type":"string","enum":["team","personal"]},"owner_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"deleted":{"type":"boolean"},"rule":{"anyOf":[{"type":"object","additionalProperties":false,"required":["id","kind","target_type","target","created_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"kind":{"type":"string","enum":["sender_allow","sender_block","remote_content_trust"]},"target_type":{"type":"string","enum":["address","domain"]},"target":{"type":"string"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","kind","target_type","target"],"properties":{"confirm":{"type":"boolean","enum":[true]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"kind":{"type":"string","enum":["sender_allow","sender_block"]},"target_type":{"type":"string","enum":["address","domain"]},"target":{"type":"string","maxLength":320}}}}}}}},"\/api\/v1\/mail\/safety\/sender-rules\/{rule_id}":{"put":{"operationId":"updateMailSenderSafetyRule","tags":["Mail"],"summary":"update Mail Sender Safety Rule","description":"Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation\/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow\/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page\/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_sender_safety","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private current-authority safety projection; no provider effects.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","scope","owner_id","deleted","rule","revision"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"scope":{"type":"string","enum":["team","personal"]},"owner_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"deleted":{"type":"boolean"},"rule":{"anyOf":[{"type":"object","additionalProperties":false,"required":["id","kind","target_type","target","created_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"kind":{"type":"string","enum":["sender_allow","sender_block","remote_content_trust"]},"target_type":{"type":"string","enum":["address","domain"]},"target":{"type":"string"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","kind"],"properties":{"confirm":{"type":"boolean","enum":[true]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"kind":{"type":"string","enum":["sender_allow","sender_block"]}}}}}}},"delete":{"operationId":"deleteMailSenderSafetyRule","tags":["Mail"],"summary":"delete Mail Sender Safety Rule","description":"Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation\/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow\/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page\/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_sender_safety","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private current-authority safety projection; no provider effects.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","scope","owner_id","deleted","rule","revision"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"scope":{"type":"string","enum":["team","personal"]},"owner_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"deleted":{"type":"boolean"},"rule":{"anyOf":[{"type":"object","additionalProperties":false,"required":["id","kind","target_type","target","created_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"kind":{"type":"string","enum":["sender_allow","sender_block","remote_content_trust"]},"target_type":{"type":"string","enum":["address","domain"]},"target":{"type":"string"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"type":"boolean","enum":[true]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/safety\/remote-content-trust":{"get":{"operationId":"getMailRemoteContentTrustRules","tags":["Mail"],"summary":"get Mail Remote Content Trust Rules","description":"Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation\/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow\/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page\/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_remote_content_trust","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"Private current-authority safety projection; no provider effects.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","scope","revision","items","current_page","has_more","next_page"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"scope":{"type":"string","enum":["team","personal"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"items":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["id","kind","target_type","target","created_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"kind":{"type":"string","enum":["sender_allow","sender_block","remote_content_trust"]},"target_type":{"type":"string","enum":["address","domain"]},"target":{"type":"string"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"current_page":{"type":"integer","minimum":1},"has_more":{"type":"boolean"},"next_page":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createMailRemoteContentTrustRule","tags":["Mail"],"summary":"create Mail Remote Content Trust Rule","description":"Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation\/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow\/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page\/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_remote_content_trust","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority safety projection; no provider effects.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","scope","owner_id","deleted","rule","revision"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"scope":{"type":"string","enum":["team","personal"]},"owner_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"deleted":{"type":"boolean"},"rule":{"anyOf":[{"type":"object","additionalProperties":false,"required":["id","kind","target_type","target","created_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"kind":{"type":"string","enum":["sender_allow","sender_block","remote_content_trust"]},"target_type":{"type":"string","enum":["address","domain"]},"target":{"type":"string"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","mailbox_id","message_id","target_type"],"properties":{"confirm":{"type":"boolean","enum":[true]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"mailbox_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"message_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"target_type":{"type":"string","enum":["address","domain"]}}}}}}}},"\/api\/v1\/mail\/safety\/remote-content-trust\/{rule_id}":{"delete":{"operationId":"deleteMailRemoteContentTrustRule","tags":["Mail"],"summary":"delete Mail Remote Content Trust Rule","description":"Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation\/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow\/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page\/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_remote_content_trust","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private current-authority safety projection; no provider effects.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","scope","owner_id","deleted","rule","revision"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"scope":{"type":"string","enum":["team","personal"]},"owner_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"deleted":{"type":"boolean"},"rule":{"anyOf":[{"type":"object","additionalProperties":false,"required":["id","kind","target_type","target","created_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"kind":{"type":"string","enum":["sender_allow","sender_block","remote_content_trust"]},"target_type":{"type":"string","enum":["address","domain"]},"target":{"type":"string"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"type":"boolean","enum":[true]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/safety\/remote-content-trust\/source\/{mailbox_id}\/{message_id}":{"get":{"operationId":"getMailRemoteContentTrustSource","tags":["Mail"],"summary":"get Mail Remote Content Trust Source","description":"Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation\/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow\/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page\/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_remote_content_trust","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"message_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private current-authority safety projection; no provider effects.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","address","domain","revision"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"mailbox_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/administration\/doctor":{"get":{"operationId":"getMailAdministrationDoctor","tags":["Mail"],"summary":"Read paginated redacted stored Mail diagnostics","description":"Requires separate mail_administration read capability, explicit administration_mailbox_ids approval, and current management policy. Only approved managed mailboxes are included. Stored snapshot only: no live provider probe, message reads, credentials, repairs, or delivery guarantee. Each row includes health, explicit reader and available sender counts, runtime feature flags, observation time, and suggested next action. Follow the bound cursor to inspect the complete approved subset; an empty or partial page is not a whole-team readiness verdict. All authority is rechecked before returning data.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Private stored diagnostics for this approved mailbox page; no live provider probe.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name","snapshot_only","provider_probe_performed","observed_at","mailbox_updated_at","health","attention_reason","provider_send_ready","manually_disabled","bootstrap_state","explicit_reader_count","available_sender_count","runtime_features","next_action"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"snapshot_only":{"const":true},"provider_probe_performed":{"const":false},"observed_at":{"type":"string","format":"date-time"},"mailbox_updated_at":{"type":["string","null"],"format":"date-time"},"health":{"type":"string","enum":["healthy","syncing","connecting","degraded","action_required","disconnected"]},"attention_reason":{"type":["string","null"]},"provider_send_ready":{"type":"boolean"},"manually_disabled":{"type":"boolean"},"bootstrap_state":{"type":["string","null"]},"explicit_reader_count":{"type":"integer","minimum":0},"available_sender_count":{"type":"integer","minimum":0},"runtime_features":{"type":"object","additionalProperties":false,"properties":{"webhooks":{"type":"boolean"},"sender_safety":{"type":"boolean"},"remote_content_protection":{"type":"boolean"},"custom_fields":{"type":"boolean"},"live_sync":{"type":"boolean"}}},"next_action":{"type":"string","enum":["reauthorize","reconnect","review_enable","wait_for_initial_sync","review_repair","review_provider_suspension","review_connection","configure_access","configure_sender","none"]}}}},"meta":{"type":"object","required":["pagination"],"properties":{"pagination":{"type":"object","required":["per_page","next_cursor","has_more"],"properties":{"per_page":{"type":"integer"},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}}}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/administration\/mailboxes":{"get":{"operationId":"listManagedMailboxes","tags":["Mail"],"summary":"List separately approved manageable mailboxes","description":"Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender\/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona\/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Private current-authority mailbox settings; no provider credentials or message content.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailManagedMailboxSummary"}},"meta":{"type":"object","required":["pagination"],"properties":{"pagination":{"type":"object","required":["per_page","next_cursor","has_more"],"properties":{"per_page":{"type":"integer"},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}}}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}":{"get":{"operationId":"getManagedMailboxSettings","tags":["Mail"],"summary":"Read exact mailbox settings","description":"Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender\/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona\/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private current-authority mailbox settings; no provider credentials or message content.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailManagedMailbox"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}\/personas":{"get":{"operationId":"listManagedPersonaSettings","tags":["Mail"],"summary":"List managed sender settings","description":"Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender\/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona\/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Private current-authority mailbox settings; no provider credentials or message content.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailManagedPersona"}},"meta":{"type":"object","required":["pagination"],"properties":{"pagination":{"type":"object","required":["per_page","next_cursor","has_more"],"properties":{"per_page":{"type":"integer"},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}}}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}\/personas\/{persona_id}":{"get":{"operationId":"getManagedPersonaSettings","tags":["Mail"],"summary":"Read exact sender settings","description":"Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender\/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona\/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private current-authority mailbox settings; no provider credentials or message content.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailManagedPersona"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}\/grants":{"put":{"operationId":"updateManagedMailboxGrants","tags":["Mail"],"summary":"Replace the complete mailbox read-access list; removed users also lose dependent sending and collaboration access","description":"Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender\/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona\/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority mailbox settings; no provider credentials or message content.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailManagedMailbox"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","user_ids"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"user_ids":{"type":"array","maxItems":1000,"uniqueItems":true,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}}}}}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}\/personas\/{persona_id}\/grants":{"put":{"operationId":"updateManagedPersonaGrants","tags":["Mail"],"summary":"Replace the complete sender send-as access list; every selected user must already have mailbox read access","description":"Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender\/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona\/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority mailbox settings; no provider credentials or message content.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailManagedPersona"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","user_ids"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"user_ids":{"type":"array","maxItems":1000,"uniqueItems":true,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}}}}}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}\/personas\/{persona_id}\/signature":{"put":{"operationId":"updateManagedPersonaSignature","tags":["Mail"],"summary":"Set or clear a sender signature using sanitized HTML; does not send email","description":"Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender\/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona\/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority mailbox settings; no provider credentials or message content.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailManagedPersona"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","signature_html"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"signature_html":{"type":["string","null"],"maxLength":20000}}}}}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}\/personas\/{persona_id}\/enable":{"post":{"operationId":"updateManagedPersonaEnable","tags":["Mail"],"summary":"Enable an available-to-enable provider-discovered alias; not a reconnect and does not grant send-as access","description":"Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender\/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona\/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority mailbox settings; no provider credentials or message content.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailManagedPersona"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/administration\/mailboxes\/{mailbox_id}\/personas\/{persona_id}\/default-voice":{"put":{"operationId":"updateManagedPersonaDefaultVoice","tags":["Mail"],"summary":"Set or clear a sender default writing style; requires BOTH libraries and separately approved mailbox administration","description":"Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender\/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona\/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_administration","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority mailbox settings; no provider credentials or message content.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailManagedPersona"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","voice_id"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"voice_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"voice_revision":{"type":["string","null"],"pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/preferences":{"get":{"operationId":"getMailNotificationPreferences","tags":["Mail"],"summary":"Read my mail notification preferences","description":"Requires explicit Custom mail_preferences capability and the bound user\u2019s personal preferences approval. No mailbox is required and no content or administration authority is borrowed. Only the approving user is targeted; category\/quiet\/digest settings belong to this source team, but timezone changes affect the ENTIRE USER ACCOUNT across teams. Enabling digests authorizes FUTURE NOTIFICATION EMAILS. Categories update only submitted keys; quiet hours replace all windows in the saved account timezone, with ISO weekdays and 15-minute grid. Disabling digests clears frequency\/minute\/weekday. Enabled digests require frequency and preferred_send_minute; weekly requires weekly_weekday. Quiet hours and digests cannot be enabled without a valid saved timezone. Stored digest-only policies remain dormant when the feature is off. Every write requires confirm=true, Idempotency-Key and the exact revision from the read. No automatic stale revision refresh. Current key, actor, membership, consent, feature and interactive access are rechecked before replay and after effects.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_preferences","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailNotificationPreferences"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/preferences\/categories":{"put":{"operationId":"updateMailNotificationCategories","tags":["Mail"],"summary":"Update my mail notification categories","description":"Requires explicit Custom mail_preferences capability and the bound user\u2019s personal preferences approval. No mailbox is required and no content or administration authority is borrowed. Only the approving user is targeted; category\/quiet\/digest settings belong to this source team, but timezone changes affect the ENTIRE USER ACCOUNT across teams. Enabling digests authorizes FUTURE NOTIFICATION EMAILS. Categories update only submitted keys; quiet hours replace all windows in the saved account timezone, with ISO weekdays and 15-minute grid. Disabling digests clears frequency\/minute\/weekday. Enabled digests require frequency and preferred_send_minute; weekly requires weekly_weekday. Quiet hours and digests cannot be enabled without a valid saved timezone. Stored digest-only policies remain dormant when the feature is off. Every write requires confirm=true, Idempotency-Key and the exact revision from the read. No automatic stale revision refresh. Current key, actor, membership, consent, feature and interactive access are rechecked before replay and after effects.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_preferences","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailNotificationPreferences"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","policies"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"policies":{"type":"object","additionalProperties":false,"required":[],"properties":{"note_mentions":{"type":"string","enum":["immediate","muted","digest_only"]},"direct_reminders":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_inbound_replies":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_internal_notes":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_assignment_changes":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_assignment_group_changes":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_tag_changes":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_status_changes":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_reminder_due":{"type":"string","enum":["immediate","muted","digest_only"]},"send_outcome_success":{"type":"string","enum":["immediate","muted","digest_only"]},"send_outcome_failure":{"type":"string","enum":["immediate","muted","digest_only"]},"follow_up_blocked":{"type":"string","enum":["immediate","muted","digest_only"]},"follow_up_failed":{"type":"string","enum":["immediate","muted","digest_only"]},"follow_up_paused":{"type":"string","enum":["immediate","muted","digest_only"]},"follow_up_stopped":{"type":"string","enum":["immediate","muted","digest_only"]}},"minProperties":1}}}}}}}},"\/api\/v1\/mail\/preferences\/quiet-hours":{"put":{"operationId":"updateMailNotificationQuietHours","tags":["Mail"],"summary":"Update my mail notification quiet hours","description":"Requires explicit Custom mail_preferences capability and the bound user\u2019s personal preferences approval. No mailbox is required and no content or administration authority is borrowed. Only the approving user is targeted; category\/quiet\/digest settings belong to this source team, but timezone changes affect the ENTIRE USER ACCOUNT across teams. Enabling digests authorizes FUTURE NOTIFICATION EMAILS. Categories update only submitted keys; quiet hours replace all windows in the saved account timezone, with ISO weekdays and 15-minute grid. Disabling digests clears frequency\/minute\/weekday. Enabled digests require frequency and preferred_send_minute; weekly requires weekly_weekday. Quiet hours and digests cannot be enabled without a valid saved timezone. Stored digest-only policies remain dormant when the feature is off. Every write requires confirm=true, Idempotency-Key and the exact revision from the read. No automatic stale revision refresh. Current key, actor, membership, consent, feature and interactive access are rechecked before replay and after effects.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_preferences","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailNotificationPreferences"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","enabled","windows"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"enabled":{"type":"boolean"},"windows":{"type":"array","maxItems":14,"items":{"type":"object","additionalProperties":false,"required":["weekday","start_minute","duration_minutes"],"properties":{"weekday":{"type":"integer","minimum":1,"maximum":7},"start_minute":{"type":"integer","minimum":0,"maximum":1425,"multipleOf":15},"duration_minutes":{"type":"integer","minimum":15,"maximum":1425,"multipleOf":15}}}}}}}}}}},"\/api\/v1\/mail\/preferences\/digest-schedule":{"put":{"operationId":"updateMailNotificationDigestSchedule","tags":["Mail"],"summary":"Update my mail notification digest schedule","description":"Requires explicit Custom mail_preferences capability and the bound user\u2019s personal preferences approval. No mailbox is required and no content or administration authority is borrowed. Only the approving user is targeted; category\/quiet\/digest settings belong to this source team, but timezone changes affect the ENTIRE USER ACCOUNT across teams. Enabling digests authorizes FUTURE NOTIFICATION EMAILS. Categories update only submitted keys; quiet hours replace all windows in the saved account timezone, with ISO weekdays and 15-minute grid. Disabling digests clears frequency\/minute\/weekday. Enabled digests require frequency and preferred_send_minute; weekly requires weekly_weekday. Quiet hours and digests cannot be enabled without a valid saved timezone. Stored digest-only policies remain dormant when the feature is off. Every write requires confirm=true, Idempotency-Key and the exact revision from the read. No automatic stale revision refresh. Current key, actor, membership, consent, feature and interactive access are rechecked before replay and after effects.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_preferences","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailNotificationPreferences"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","enabled"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"enabled":{"type":"boolean"},"frequency":{"type":["string","null"],"enum":["daily","weekly",null]},"preferred_send_minute":{"type":["integer","null"],"minimum":0,"maximum":1425,"multipleOf":15},"weekly_weekday":{"type":["integer","null"],"minimum":1,"maximum":7}}}}}}}},"\/api\/v1\/mail\/preferences\/timezone":{"put":{"operationId":"updateMailNotificationTimezone","tags":["Mail"],"summary":"Update my mail notification timezone","description":"Requires explicit Custom mail_preferences capability and the bound user\u2019s personal preferences approval. No mailbox is required and no content or administration authority is borrowed. Only the approving user is targeted; category\/quiet\/digest settings belong to this source team, but timezone changes affect the ENTIRE USER ACCOUNT across teams. Enabling digests authorizes FUTURE NOTIFICATION EMAILS. Categories update only submitted keys; quiet hours replace all windows in the saved account timezone, with ISO weekdays and 15-minute grid. Disabling digests clears frequency\/minute\/weekday. Enabled digests require frequency and preferred_send_minute; weekly requires weekly_weekday. Quiet hours and digests cannot be enabled without a valid saved timezone. Stored digest-only policies remain dormant when the feature is off. Every write requires confirm=true, Idempotency-Key and the exact revision from the read. No automatic stale revision refresh. Current key, actor, membership, consent, feature and interactive access are rechecked before replay and after effects.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_preferences","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailNotificationPreferences"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","timezone"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"timezone":{"type":"string","minLength":1,"maxLength":128,"description":"Valid IANA timezone, for example Europe\/Berlin. Changes the user's entire account, not only this team."}}}}}}}},"\/api\/v1\/mail\/collections":{"get":{"operationId":"listMailCollection","tags":["Mail"],"summary":"List inbox groups","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"query","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailCollection"}},"meta":{"type":"object","properties":{"pagination":{"type":"object","additionalProperties":false,"required":["per_page","has_more","next_cursor"],"properties":{"per_page":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createMailCollection","tags":["Mail"],"summary":"Create inbox groups","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"201":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCollection"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","name"],"properties":{"confirm":{"const":true},"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":["string","null"],"maxLength":140,"description":"Plain text normalized to a URL-safe slug."},"description":{"type":["string","null"],"maxLength":500},"color":{"type":["string","null"],"maxLength":24},"icon":{"type":["string","null"],"maxLength":48}}}}}}}},"\/api\/v1\/mail\/collections\/order":{"get":{"operationId":"orderMailCollection","tags":["Mail"],"summary":"Order inbox groups","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCollectionOrder"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"put":{"operationId":"reorderMailCollection","tags":["Mail"],"summary":"Reorder inbox groups","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCollectionOrder"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","item_ids"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"item_ids":{"type":"array","maxItems":500,"uniqueItems":true,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}}}}}}}},"\/api\/v1\/mail\/collections\/{collection_id}":{"get":{"operationId":"showMailCollection","tags":["Mail"],"summary":"Show inbox groups","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCollection"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateMailCollection","tags":["Mail"],"summary":"Update inbox groups","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCollection"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":["string","null"],"maxLength":140,"description":"Plain text normalized to a URL-safe slug."},"description":{"type":["string","null"],"maxLength":500},"color":{"type":["string","null"],"maxLength":24},"icon":{"type":["string","null"],"maxLength":48}}}}}}},"delete":{"operationId":"deleteMailCollection","tags":["Mail"],"summary":"Delete inbox groups","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCollection"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/collections\/{collection_id}\/archive":{"post":{"operationId":"archiveMailCollection","tags":["Mail"],"summary":"Archive inbox groups","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCollection"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/collections\/{collection_id}\/unarchive":{"post":{"operationId":"unarchiveMailCollection","tags":["Mail"],"summary":"Unarchive inbox groups","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCollection"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/collections\/{collection_id}\/restore":{"post":{"operationId":"restoreMailCollection","tags":["Mail"],"summary":"Restore inbox groups","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCollection"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/collections\/{collection_id}\/mailboxes":{"put":{"operationId":"mailboxesMailCollection","tags":["Mail"],"summary":"Replace approved inbox-group membership","description":"Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCollection"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","mailbox_ids"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"mailbox_ids":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}}}}}}}},"\/api\/v1\/mail\/saved-items\/{kind}":{"get":{"operationId":"listMailSavedItem","tags":["Mail"],"summary":"List saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"query","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailSavedItem"}},"meta":{"type":"object","properties":{"pagination":{"type":"object","additionalProperties":false,"required":["per_page","has_more","next_cursor"],"properties":{"per_page":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createMailSavedItem","tags":["Mail"],"summary":"Create saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"201":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedItem"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","name","surface","definition"],"properties":{"confirm":{"const":true},"name":{"type":"string","maxLength":120,"minLength":1},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"color":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}]},"icon":{"anyOf":[{"type":"string","maxLength":48},{"type":"null"}]},"visibility":{"enum":["personal","shared"]},"pinned":{"type":"boolean"},"favorite":{"type":"boolean"},"surface":{"enum":["mailbox_threads","unified_inbox","mailbox_search","cross_mailbox_search"]},"definition":{"$ref":"#\/components\/schemas\/MailSavedDefinitionInput"}}}}}}}},"\/api\/v1\/mail\/saved-items\/{kind}\/order":{"get":{"operationId":"orderMailSavedItem","tags":["Mail"],"summary":"Order saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedOrder"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"put":{"operationId":"reorderMailSavedItem","tags":["Mail"],"summary":"Reorder saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedOrder"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","item_ids"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"item_ids":{"type":"array","items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"maxItems":500,"uniqueItems":true}}}}}}}},"\/api\/v1\/mail\/saved-items\/{kind}\/{saved_id}":{"get":{"operationId":"showMailSavedItem","tags":["Mail"],"summary":"Show saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"saved_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedItem"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateMailSavedItem","tags":["Mail"],"summary":"Update saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"saved_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedItem"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"name":{"type":"string","maxLength":120,"minLength":1},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"color":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}]},"icon":{"anyOf":[{"type":"string","maxLength":48},{"type":"null"}]},"visibility":{"enum":["personal","shared"]},"pinned":{"type":"boolean"},"favorite":{"type":"boolean"},"surface":{"enum":["mailbox_threads","unified_inbox","mailbox_search","cross_mailbox_search"]},"definition":{"$ref":"#\/components\/schemas\/MailSavedDefinitionInput"}}}}}}},"delete":{"operationId":"deleteMailSavedItem","tags":["Mail"],"summary":"Delete saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"saved_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedItem"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/saved-items\/{kind}\/{saved_id}\/open":{"get":{"operationId":"openMailSavedItem","tags":["Mail"],"summary":"Open saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"saved_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedOpen"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/saved-items\/{kind}\/{saved_id}\/duplicate":{"post":{"operationId":"duplicateMailSavedItem","tags":["Mail"],"summary":"Duplicate saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"saved_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"201":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedItem"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"name":{"type":["string","null"],"maxLength":120}}}}}}}},"\/api\/v1\/mail\/saved-items\/{kind}\/{saved_id}\/archive":{"post":{"operationId":"archiveMailSavedItem","tags":["Mail"],"summary":"Archive saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"saved_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedItem"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/saved-items\/{kind}\/{saved_id}\/unarchive":{"post":{"operationId":"unarchiveMailSavedItem","tags":["Mail"],"summary":"Unarchive saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"saved_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedItem"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/saved-items\/{kind}\/{saved_id}\/restore":{"post":{"operationId":"restoreMailSavedItem","tags":["Mail"],"summary":"Restore saved views or searches","description":"Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads\/unified_inbox; search accepts mailbox_search\/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workspace","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["view","search"]}},{"name":"saved_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255,"minLength":1}}],"responses":{"200":{"description":"Private current-authority saved workspace data.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSavedItem"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/crm\/contacts\/{resource_id}\/conversations":{"get":{"operationId":"getMailCrmContactConversations","tags":["Mail"],"summary":"Read recent contact conversations","description":"Requires Custom CRM read capability and personal CRM approval AND separate content capability\/consent. Current direct content grants, workspace visibility and the approved content mailbox list restrict the shared query before counts, sorting and limits. Returns at most 20 recent links, total matching count and has_more. Excludes Draft\/Trash\/Junk-only participant appearances. No bodies, snippets, attachments or internal identifiers. Ordinary CRM metadata reads remain content-free.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}],"responses":{"200":{"description":"Private approved-only recent conversation context.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","count","limit","has_more","links"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"count":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0,"maximum":20},"has_more":{"type":"boolean"},"links":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["id","mailbox","subject","latest_activity_at","status","message_count"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"mailbox":{"type":"object","additionalProperties":false,"required":["id","email_address"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"email_address":{"type":"string"}}},"subject":{"type":["string","null"]},"latest_activity_at":{"type":["string","null"],"format":"date-time"},"status":{"type":"string"},"message_count":{"type":"integer","minimum":0}}}}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/crm\/accounts\/{resource_id}\/conversations":{"get":{"operationId":"getMailCrmAccountConversations","tags":["Mail"],"summary":"Read recent account conversations","description":"Requires Custom CRM read capability and personal CRM approval AND separate content capability\/consent. Current direct content grants, workspace visibility and the approved content mailbox list restrict the shared query before counts, sorting and limits. Returns at most 20 recent links, total matching count and has_more. Excludes Draft\/Trash\/Junk-only participant appearances. No bodies, snippets, attachments or internal identifiers. Ordinary CRM metadata reads remain content-free.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}],"responses":{"200":{"description":"Private approved-only recent conversation context.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","count","limit","has_more","links"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"count":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0,"maximum":20},"has_more":{"type":"boolean"},"links":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["id","mailbox","subject","latest_activity_at","status","message_count"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"mailbox":{"type":"object","additionalProperties":false,"required":["id","email_address"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"email_address":{"type":"string"}}},"subject":{"type":["string","null"]},"latest_activity_at":{"type":["string","null"],"format":"date-time"},"status":{"type":"string"},"message_count":{"type":"integer","minimum":0}}}}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/custom-field-values\/{resource_type}\/{resource_id}":{"get":{"operationId":"listMailCustomFieldValues","tags":["Mail"],"summary":"Read applicable fields and current values for one resource","description":"Requires explicit Custom custom_fields read capability and personal consent PLUS underlying target access. Contacts\/accounts require CRM read consent and current record policy. Conversations require content read consent, current direct grant and the key's approved content mailbox_ids. Mailbox values require administration read consent, separate administration_mailbox_ids and current manageMailbox policy; this does not grant inbox content. Resource types and all IDs are explicit; user values use same-team public user IDs, never numeric IDs. Archived fields retain existing values read-only. Removed resource scopes hide values. Writes require confirm=true, Idempotency-Key and the exact value entry revision from the list; it binds the field definition and current target value. No automatic revision refresh. Clear preserves history. Value\/history responses and encrypted replay remain private and freshly authorized.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"in":"path","name":"resource_type","required":true,"schema":{"type":"string","enum":["contact","account","conversation","mailbox"]}},{"in":"path","name":"resource_id","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}],"responses":{"200":{"description":"Private typed resource values; no numeric attribution IDs.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["resource_type","resource_id","fields","user_options"],"properties":{"resource_type":{"type":"string","enum":["contact","account","conversation","mailbox"]},"resource_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"fields":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailCustomFieldValue"}},"user_options":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":["string","null"]},"name":{"type":"string"}}}}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/custom-field-values\/{resource_type}\/{resource_id}\/history":{"get":{"operationId":"listMailCustomFieldValueHistory","tags":["Mail"],"summary":"Read private custom-field value history for one resource","description":"Requires explicit Custom custom_fields read capability and personal consent PLUS underlying target access. Contacts\/accounts require CRM read consent and current record policy. Conversations require content read consent, current direct grant and the key's approved content mailbox_ids. Mailbox values require administration read consent, separate administration_mailbox_ids and current manageMailbox policy; this does not grant inbox content. Resource types and all IDs are explicit; user values use same-team public user IDs, never numeric IDs. Archived fields retain existing values read-only. Removed resource scopes hide values. Writes require confirm=true, Idempotency-Key and the exact value entry revision from the list; it binds the field definition and current target value. No automatic revision refresh. Clear preserves history. Value\/history responses and encrypted replay remain private and freshly authorized.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"in":"path","name":"resource_type","required":true,"schema":{"type":"string","enum":["contact","account","conversation","mailbox"]}},{"in":"path","name":"resource_id","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"definition_id","in":"query","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Private typed resource values; no numeric attribution IDs.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailCustomFieldValueHistory"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/custom-field-values\/{resource_type}\/{resource_id}\/{definition_id}":{"put":{"operationId":"setMailCustomFieldValue","tags":["Mail"],"summary":"Set one typed custom-field value","description":"Requires explicit Custom custom_fields write capability and personal consent PLUS underlying target access. Contacts\/accounts require CRM write consent and current record policy. Conversations require content read consent, current direct grant and the key's approved content mailbox_ids. Mailbox values require administration write consent, separate administration_mailbox_ids and current manageMailbox policy; this does not grant inbox content. Resource types and all IDs are explicit; user values use same-team public user IDs, never numeric IDs. Archived fields retain existing values read-only. Removed resource scopes hide values. Writes require confirm=true, Idempotency-Key and the exact value entry revision from the list; it binds the field definition and current target value. No automatic revision refresh. Clear preserves history. Value\/history responses and encrypted replay remain private and freshly authorized.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"in":"path","name":"resource_type","required":true,"schema":{"type":"string","enum":["contact","account","conversation","mailbox"]}},{"in":"path","name":"resource_id","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"in":"path","name":"definition_id","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"responses":{"200":{"description":"Private typed resource values; no numeric attribution IDs.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldValue"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","value"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"value":{"type":["string","number","boolean","array"],"maxLength":4000,"maxItems":25,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"description":"Scalar matching the field type; select fields use one option ID or a list; user fields use a current same-team public user ID. Null is not a set value; use clear."}}}}}}},"delete":{"operationId":"clearMailCustomFieldValue","tags":["Mail"],"summary":"Clear one custom-field value while retaining history","description":"Requires explicit Custom custom_fields write capability and personal consent PLUS underlying target access. Contacts\/accounts require CRM write consent and current record policy. Conversations require content read consent, current direct grant and the key's approved content mailbox_ids. Mailbox values require administration write consent, separate administration_mailbox_ids and current manageMailbox policy; this does not grant inbox content. Resource types and all IDs are explicit; user values use same-team public user IDs, never numeric IDs. Archived fields retain existing values read-only. Removed resource scopes hide values. Writes require confirm=true, Idempotency-Key and the exact value entry revision from the list; it binds the field definition and current target value. No automatic revision refresh. Clear preserves history. Value\/history responses and encrypted replay remain private and freshly authorized.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"in":"path","name":"resource_type","required":true,"schema":{"type":"string","enum":["contact","account","conversation","mailbox"]}},{"in":"path","name":"resource_id","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"in":"path","name":"definition_id","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"responses":{"200":{"description":"Private typed resource values; no numeric attribution IDs.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldValue"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/custom-fields":{"get":{"operationId":"indexMailCustomField","tags":["Mail"],"summary":"List custom-field definitions","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}},{"name":"query","in":"query","schema":{"type":"string","maxLength":200}},{"name":"include_archived","in":"query","schema":{"type":"integer","enum":[0,1]}},{"name":"include_deleted","in":"query","schema":{"type":"integer","enum":[0,1]}},{"name":"resource_type","in":"query","schema":{"type":"string","enum":["contact","account","conversation","mailbox"]}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"storeMailCustomField","tags":["Mail"],"summary":"Create a custom-field definition","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","label","type","resource_types"],"properties":{"confirm":{"const":true},"label":{"type":"string","minLength":1,"maxLength":120},"resource_types":{"type":"array","minItems":1,"maxItems":4,"uniqueItems":true,"items":{"type":"string","enum":["contact","account","conversation","mailbox"]}},"type":{"type":"string","enum":["text","textarea","number","boolean","single_select","multi_select","date","url","email","user"]},"field_key":{"type":["string","null"],"maxLength":80,"pattern":"^[a-z0-9](?:[a-z0-9_]*[a-z0-9])?$"},"options":{"type":["array","null"],"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["label"],"properties":{"label":{"type":"string","minLength":1,"maxLength":120}}}}}}}}}}},"\/api\/v1\/mail\/custom-fields\/order":{"get":{"operationId":"orderMailCustomField","tags":["Mail"],"summary":"Read the complete active custom-field order for one resource type","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_type","in":"query","required":true,"schema":{"type":"string","enum":["contact","account","conversation","mailbox"]}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldOrder"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"put":{"operationId":"reorderMailCustomField","tags":["Mail"],"summary":"Replace the complete active custom-field order","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldOrder"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","resource_type","field_ids"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"resource_type":{"type":"string","enum":["contact","account","conversation","mailbox"]},"field_ids":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}}}}}}}},"\/api\/v1\/mail\/custom-fields\/{definition_id}":{"get":{"operationId":"showMailCustomField","tags":["Mail"],"summary":"Read a custom-field definition","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateMailCustomField","tags":["Mail"],"summary":"Update a custom-field definition","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"label":{"type":"string","minLength":1,"maxLength":120},"resource_types":{"type":"array","minItems":1,"maxItems":4,"uniqueItems":true,"items":{"type":"string","enum":["contact","account","conversation","mailbox"]}}}}}}}},"delete":{"operationId":"destroyMailCustomField","tags":["Mail"],"summary":"Move a custom-field definition to trash","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/custom-fields\/{definition_id}\/force":{"delete":{"operationId":"forceDestroyMailCustomField","tags":["Mail"],"summary":"Permanently delete a trashed custom-field definition and all its values and history","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","status"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"status":{"const":"permanently_deleted"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/custom-fields\/{definition_id}\/archive":{"post":{"operationId":"archiveMailCustomField","tags":["Mail"],"summary":"Archive a custom-field definition","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/custom-fields\/{definition_id}\/unarchive":{"post":{"operationId":"unarchiveMailCustomField","tags":["Mail"],"summary":"Unarchive a custom-field definition","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/custom-fields\/{definition_id}\/restore":{"post":{"operationId":"restoreMailCustomField","tags":["Mail"],"summary":"Restore a trashed custom-field definition","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/custom-fields\/{definition_id}\/options":{"post":{"operationId":"optionStoreMailCustomField","tags":["Mail"],"summary":"Create a custom-field option","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","label"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"label":{"type":"string","minLength":1,"maxLength":120}}}}}}},"patch":{"operationId":"optionUpdateMailCustomField","tags":["Mail"],"summary":"Rename a custom-field option","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","label","option_id"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"label":{"type":"string","minLength":1,"maxLength":120},"option_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}}}}}},"delete":{"operationId":"optionDestroyMailCustomField","tags":["Mail"],"summary":"Move a custom-field option to trash","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","option_id"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"option_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}}}}}}},"\/api\/v1\/mail\/custom-fields\/{definition_id}\/options\/archive":{"post":{"operationId":"optionArchiveMailCustomField","tags":["Mail"],"summary":"Archive a custom-field option","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","option_id"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"option_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}}}}}}},"\/api\/v1\/mail\/custom-fields\/{definition_id}\/options\/unarchive":{"post":{"operationId":"optionUnarchiveMailCustomField","tags":["Mail"],"summary":"Unarchive a custom-field option","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","option_id"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"option_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}}}}}}},"\/api\/v1\/mail\/custom-fields\/{definition_id}\/options\/restore":{"post":{"operationId":"optionRestoreMailCustomField","tags":["Mail"],"summary":"Restore a trashed custom-field option","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","option_id"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"option_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}}}}}}},"\/api\/v1\/mail\/custom-fields\/{definition_id}\/options\/order":{"put":{"operationId":"optionsReorderMailCustomField","tags":["Mail"],"summary":"Replace the complete non-deleted custom-field option order","description":"Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update\/lifecycle\/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values\/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_custom_fields","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private metadata only. Record values require separately authorized target access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCustomFieldDefinition"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","option_ids"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"option_ids":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}}}}}}}},"\/api\/v1\/mail\/crm\/contacts\/{resource_id}\/force":{"delete":{"operationId":"permanentlyDeleteMailCrmContact","tags":["Mail"],"summary":"Permanently delete a trashed CRM contact","description":"Requires current CRM write capability, explicit personal CRM write consent, team management rights, confirm=true, Idempotency-Key and the exact reviewed trashed-record revision. Irreversibly removes the record and its owned identities\/custom values. Company deletion unlinks its contacts rather than deleting contacts. No mailbox content is returned or email sent. A successful response is a content-free historical receipt; same-key replay rechecks current class-scope authority and never repeats deletion. A different key after deletion returns404. Active records must first move to trash.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Content-free permanent deletion receipt; cannot be undone.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","status"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"const":"permanently_deleted"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/crm\/accounts\/{resource_id}\/force":{"delete":{"operationId":"permanentlyDeleteMailCrmAccount","tags":["Mail"],"summary":"Permanently delete a trashed CRM account","description":"Requires current CRM write capability, explicit personal CRM write consent, team management rights, confirm=true, Idempotency-Key and the exact reviewed trashed-record revision. Irreversibly removes the record and its owned identities\/custom values. Company deletion unlinks its contacts rather than deleting contacts. No mailbox content is returned or email sent. A successful response is a content-free historical receipt; same-key replay rechecks current class-scope authority and never repeats deletion. A different key after deletion returns404. Active records must first move to trash.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Content-free permanent deletion receipt; cannot be undone.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","status"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"const":"permanently_deleted"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/crm\/contacts\/{resource_id}\/emails":{"post":{"operationId":"addEmailMailCrmContact","tags":["Mail"],"summary":"Confirm CRM add email","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state. Domain auto_link changes future team contact matching. Merge moves source identities, history and custom values into the survivor and soft-deletes the source; both revisions must match. Account links require the current account revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","email"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"email":{"type":"string","format":"email","maxLength":320}}}}}}},"delete":{"operationId":"removeEmailMailCrmContact","tags":["Mail"],"summary":"Confirm CRM remove email","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state. Domain auto_link changes future team contact matching. Merge moves source identities, history and custom values into the survivor and soft-deletes the source; both revisions must match. Account links require the current account revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","email"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"email":{"type":"string","format":"email","maxLength":320}}}}}}}},"\/api\/v1\/mail\/crm\/contacts\/{resource_id}\/account":{"put":{"operationId":"linkAccountMailCrmContact","tags":["Mail"],"summary":"Confirm CRM link account","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state. Domain auto_link changes future team contact matching. Merge moves source identities, history and custom values into the survivor and soft-deletes the source; both revisions must match. Account links require the current account revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","account_id","account_revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"account_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"account_revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}},"delete":{"operationId":"unlinkAccountMailCrmContact","tags":["Mail"],"summary":"Confirm CRM unlink account","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state. Domain auto_link changes future team contact matching. Merge moves source identities, history and custom values into the survivor and soft-deletes the source; both revisions must match. Account links require the current account revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}}}},"\/api\/v1\/mail\/crm\/accounts\/{resource_id}\/domains":{"post":{"operationId":"addDomainMailCrmAccount","tags":["Mail"],"summary":"Confirm CRM add domain","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state. Domain auto_link changes future team contact matching. Merge moves source identities, history and custom values into the survivor and soft-deletes the source; both revisions must match. Account links require the current account revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","domain","match_mode"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"domain":{"type":"string","maxLength":253},"match_mode":{"type":"string","enum":["suggest_only","auto_link"]}}}}}}},"patch":{"operationId":"updateDomainMailCrmAccount","tags":["Mail"],"summary":"Confirm CRM update domain","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state. Domain auto_link changes future team contact matching. Merge moves source identities, history and custom values into the survivor and soft-deletes the source; both revisions must match. Account links require the current account revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","domain_id","match_mode"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"domain_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"match_mode":{"type":"string","enum":["suggest_only","auto_link"]}}}}}}},"delete":{"operationId":"removeDomainMailCrmAccount","tags":["Mail"],"summary":"Confirm CRM remove domain","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state. Domain auto_link changes future team contact matching. Merge moves source identities, history and custom values into the survivor and soft-deletes the source; both revisions must match. Account links require the current account revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","domain_id"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"domain_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}}}}}}},"\/api\/v1\/mail\/crm\/contacts\/{resource_id}\/merge":{"post":{"operationId":"mergeMailCrmContact","tags":["Mail"],"summary":"Confirm CRM merge","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state. Domain auto_link changes future team contact matching. Merge moves source identities, history and custom values into the survivor and soft-deletes the source; both revisions must match. Account links require the current account revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","source_id","source_revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"source_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"source_revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"field_choices":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","enum":["survivor","loser"]},"account":{"type":"string","enum":["survivor","loser"]}}}}}}}}}},"\/api\/v1\/mail\/crm\/accounts\/{resource_id}\/merge":{"post":{"operationId":"mergeMailCrmAccount","tags":["Mail"],"summary":"Confirm CRM merge","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state. Domain auto_link changes future team contact matching. Merge moves source identities, history and custom values into the survivor and soft-deletes the source; both revisions must match. Account links require the current account revision.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision","source_id","source_revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"source_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"source_revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"field_choices":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","enum":["survivor","loser"]}}}}}}}}}},"\/api\/v1\/mail\/crm\/contacts":{"get":{"operationId":"listMailCrmContacts","tags":["Mail"],"summary":"List team contacts","description":"Requires explicitly selected Custom CRM read capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Stable ID ordering; cursors bind actor, key and filters. Search is a literal name\/address\/domain substring.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}},{"name":"query","in":"query","schema":{"type":"string","maxLength":200}},{"name":"include_archived","in":"query","description":"Use 1 or 0.","schema":{"type":"integer","enum":[0,1],"default":0}},{"name":"include_deleted","in":"query","description":"Use 1 or 0.","schema":{"type":"integer","enum":[0,1],"default":0}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailCrmContact"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createMailCrmContact","tags":["Mail"],"summary":"Create team contacts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmContactCreate"}}}}}},"\/api\/v1\/mail\/crm\/contacts\/{resource_id}":{"get":{"operationId":"getMailCrmContact","tags":["Mail"],"summary":"Get team contacts","description":"Requires explicitly selected Custom CRM read capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Stable ID ordering; cursors bind actor, key and filters. Search is a literal name\/address\/domain substring.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateMailCrmContact","tags":["Mail"],"summary":"Update team contacts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmContactUpdate"}}}}},"delete":{"operationId":"deleteMailCrmContact","tags":["Mail"],"summary":"Delete team contacts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmRevisionCommand"}}}}}},"\/api\/v1\/mail\/crm\/contacts\/{resource_id}\/archive":{"post":{"operationId":"archiveMailCrmContact","tags":["Mail"],"summary":"Archive team contacts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmRevisionCommand"}}}}}},"\/api\/v1\/mail\/crm\/contacts\/{resource_id}\/unarchive":{"post":{"operationId":"unarchiveMailCrmContact","tags":["Mail"],"summary":"Unarchive team contacts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmRevisionCommand"}}}}}},"\/api\/v1\/mail\/crm\/contacts\/{resource_id}\/restore":{"post":{"operationId":"restoreMailCrmContact","tags":["Mail"],"summary":"Restore team contacts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmContact"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmRevisionCommand"}}}}}},"\/api\/v1\/mail\/crm\/accounts":{"get":{"operationId":"listMailCrmAccounts","tags":["Mail"],"summary":"List team accounts","description":"Requires explicitly selected Custom CRM read capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Stable ID ordering; cursors bind actor, key and filters. Search is a literal name\/address\/domain substring.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}},{"name":"query","in":"query","schema":{"type":"string","maxLength":200}},{"name":"include_archived","in":"query","description":"Use 1 or 0.","schema":{"type":"integer","enum":[0,1],"default":0}},{"name":"include_deleted","in":"query","description":"Use 1 or 0.","schema":{"type":"integer","enum":[0,1],"default":0}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailCrmAccount"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createMailCrmAccount","tags":["Mail"],"summary":"Create team accounts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmAccountCreate"}}}}}},"\/api\/v1\/mail\/crm\/accounts\/{resource_id}":{"get":{"operationId":"getMailCrmAccount","tags":["Mail"],"summary":"Get team accounts","description":"Requires explicitly selected Custom CRM read capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Stable ID ordering; cursors bind actor, key and filters. Search is a literal name\/address\/domain substring.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateMailCrmAccount","tags":["Mail"],"summary":"Update team accounts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmAccountUpdate"}}}}},"delete":{"operationId":"deleteMailCrmAccount","tags":["Mail"],"summary":"Delete team accounts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmRevisionCommand"}}}}}},"\/api\/v1\/mail\/crm\/accounts\/{resource_id}\/archive":{"post":{"operationId":"archiveMailCrmAccount","tags":["Mail"],"summary":"Archive team accounts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmRevisionCommand"}}}}}},"\/api\/v1\/mail\/crm\/accounts\/{resource_id}\/unarchive":{"post":{"operationId":"unarchiveMailCrmAccount","tags":["Mail"],"summary":"Unarchive team accounts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmRevisionCommand"}}}}}},"\/api\/v1\/mail\/crm\/accounts\/{resource_id}\/restore":{"post":{"operationId":"restoreMailCrmAccount","tags":["Mail"],"summary":"Restore team accounts","description":"Requires explicitly selected Custom CRM read\/write capability and separate personal CRM consent. Current team membership and management policy apply. No mailbox selection or email-content authority is implied. Requires confirm=true and Idempotency-Key; existing records require their exact reviewed revision. Encrypted historical replay repeats no effects and rechecks current authority. Unarchive restores archived metadata; restore undeletes without changing archived state.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_crm","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private CRM metadata, never conversation content. Deleted records remain individually readable for restoration.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailCrmAccount"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailCrmRevisionCommand"}}}}}},"\/api\/v1\/mail\/libraries\/snippets":{"get":{"operationId":"listMailLibrarySnippets","tags":["Mail"],"summary":"List accessible snippets","description":"Requires explicitly selected Custom libraries read ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Results use stable ID ordering with actor\/key\/filter-bound cursors. Deleted resources are omitted.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}},{"name":"query","in":"query","description":"Literal title\/shortcut substring, never body search.","schema":{"type":"string","maxLength":200}},{"name":"scope","in":"query","schema":{"type":"string","enum":["personal","shared"]}},{"name":"category","in":"query","schema":{"type":"string","maxLength":120}},{"name":"tag","in":"query","schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailSnippet"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createMailLibrarySnippet","tags":["Mail"],"summary":"Create an accessible snippet","description":"Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle\/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSnippet"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailSnippetCreate"}}}}}},"\/api\/v1\/mail\/libraries\/snippets\/{snippet_id}":{"get":{"operationId":"getMailLibrarySnippet","tags":["Mail"],"summary":"Read an accessible snippet","description":"Requires explicitly selected Custom libraries read ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Deleted resources return resource_not_found. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"snippet_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSnippet"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateMailLibrarySnippet","tags":["Mail"],"summary":"Update an accessible snippet","description":"Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle\/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"snippet_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSnippet"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailSnippetUpdate"}}}}},"delete":{"operationId":"deleteMailLibrarySnippet","tags":["Mail"],"summary":"Delete an accessible snippet","description":"Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle\/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"snippet_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailSnippet"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailLibraryRevisionCommand"}}}}}},"\/api\/v1\/mail\/libraries\/voices":{"get":{"operationId":"listMailLibraryVoices","tags":["Mail"],"summary":"List accessible writing styles","description":"Requires explicitly selected Custom libraries read ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Results use stable ID ordering with actor\/key\/filter-bound cursors. Deleted resources are omitted.Role-only administrators receive metadata, never guidance\/examples without a direct grant. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}},{"name":"query","in":"query","description":"Literal name substring, never guidance search.","schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","schema":{"type":"string","enum":["active","archived","all"],"default":"active"}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailVoice"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createMailLibraryVoice","tags":["Mail"],"summary":"Create an accessible writing style","description":"Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle\/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance\/examples without a direct grant. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailVoice"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailVoiceCreate"}}}}}},"\/api\/v1\/mail\/libraries\/voices\/{voice_id}":{"get":{"operationId":"getMailLibraryVoice","tags":["Mail"],"summary":"Read an accessible writing style","description":"Requires explicitly selected Custom libraries read ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance\/examples without a direct grant. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailVoice"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateMailLibraryVoice","tags":["Mail"],"summary":"Update an accessible writing style","description":"Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle\/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance\/examples without a direct grant. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailVoice"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailVoiceUpdate"}}}}},"delete":{"operationId":"deleteMailLibraryVoice","tags":["Mail"],"summary":"Delete an accessible writing style","description":"Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle\/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance\/examples without a direct grant. Review personas_using_default before confirmation: archive\/delete makes those senders fall back to neutral; restore makes their existing default available again. Restore only unarchives, never undeletes. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailVoice"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailLibraryRevisionCommand"}}}}}},"\/api\/v1\/mail\/libraries\/voices\/{voice_id}\/archive":{"post":{"operationId":"archiveMailLibraryVoice","tags":["Mail"],"summary":"Archive an accessible writing style","description":"Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle\/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance\/examples without a direct grant. Review personas_using_default before confirmation: archive\/delete makes those senders fall back to neutral; restore makes their existing default available again. Restore only unarchives, never undeletes. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailVoice"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailLibraryRevisionCommand"}}}}}},"\/api\/v1\/mail\/libraries\/voices\/{voice_id}\/restore":{"post":{"operationId":"restoreMailLibraryVoice","tags":["Mail"],"summary":"Restore an accessible writing style","description":"Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle\/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance\/examples without a direct grant. Review personas_using_default before confirmation: archive\/delete makes those senders fall back to neutral; restore makes their existing default available again. Restore only unarchives, never undeletes. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailVoice"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailLibraryRevisionCommand"}}}}}},"\/api\/v1\/mail\/libraries\/voices\/{voice_id}\/grants":{"put":{"operationId":"replaceMailLibraryVoiceGrants","tags":["Mail"],"summary":"Replace access to an accessible writing style","description":"Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle\/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance\/examples without a direct grant. This replaces ALL direct grants. Omitted users lose access; select exposes guidance and manage permits editing. The content-free receipt remains replayable after self-removal while the original key retains library write consent. ","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_libraries","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Private library result; policy-sensitive fields are omitted without current access.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"no-store, private"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailVoiceGrantReceipt"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailVoiceGrantReplacement"}}}}}},"\/api\/v1\/whoami":{"get":{"operationId":"getCurrentApiKeyIdentity","tags":["Identity"],"summary":"Show the authenticated team API key context","description":"Returns the team, API key metadata, effective public API capabilities, and selected-project scope summary for the bearer key.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"identity","access":"any_key","project_scope":"not_applicable"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Authenticated key identity.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WhoamiEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"options":{"operationId":"getWhoamiOptions","tags":["Identity"],"summary":"Return allowed whoami methods through the v1 stack","description":"Explicit OPTIONS endpoint for \/api\/v1\/whoami. Other resource OPTIONS responses are framework behavior and are not part of this contract.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"identity","access":"any_key","project_scope":"not_applicable"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"204":{"description":"No content. The Allow header is GET, HEAD, OPTIONS.","headers":{"Allow":{"description":"Allowed methods for this endpoint.","schema":{"type":"string","const":"GET, HEAD, OPTIONS"}},"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/account":{"get":{"operationId":"getAccountSummary","tags":["Account"],"summary":"Show account summary","description":"Returns compact account, key, plan, subscription, API access, credit, billing availability, auto top-up, and related endpoint links for any valid team API key.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"identity","access":"any_key","project_scope":"not_applicable"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Account summary.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AccountSummaryEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/account\/entitlements":{"get":{"operationId":"getAccountEntitlements","tags":["Account"],"summary":"Show account entitlements","description":"Returns account-level capability, feature, limit, and project-scope entitlement state for a key with Account read access.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"account","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Account entitlements.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AccountEntitlementsEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/account\/usage":{"get":{"operationId":"getAccountUsage","tags":["Account"],"summary":"Show account usage","description":"Returns bounded credit, purchased-credit, usage-window, and recent transaction summaries for a key with Account read access.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"account","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Account usage summary.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AccountUsageEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/activity":{"get":{"operationId":"listActivity","tags":["Activity"],"summary":"List public API activity","description":"Lists public API audit activity for the authenticated team. Project rows are narrowed for selected-project keys, while team-level API key and CLI authorization rows remain team-scoped. Raw activity properties, internal ids, names, token material, provider payloads, mail content, and assistant prompts are never exposed.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"activity","access":"read","project_scope":"hybrid_project_rows_filter_team_rows_remain"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/ActivityCursor"},{"$ref":"#\/components\/parameters\/ActivitySort"},{"$ref":"#\/components\/parameters\/ActivityResourceType"},{"$ref":"#\/components\/parameters\/ActivityResourceId"},{"$ref":"#\/components\/parameters\/ActivityActorKeyId"},{"$ref":"#\/components\/parameters\/ActivityActorUserId"},{"$ref":"#\/components\/parameters\/ActivityEventType"},{"$ref":"#\/components\/parameters\/ActivityCreatedFrom"},{"$ref":"#\/components\/parameters\/ActivityCreatedTo"}],"responses":{"200":{"description":"Public API activity list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ActivityListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/changes":{"get":{"operationId":"listChanges","tags":["Activity"],"summary":"List Changes and receipts","description":"Lists changes and receipts visible to the key visibility user. A key or hosted MCP grant limited to chosen Spaces sees Space changes only in those Spaces, and Mail and CRM changes only through the person's Mail delegation and its mailboxes, as on the Mail endpoints. Detail, undo, check and reverse follow the same rules.","security":[{"bearerAuth":[]}],"x-capability":{"group":"changes","access":"read","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Change list.","content":{"application\/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true}},"meta":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/changes\/{change_id}":{"parameters":[{"name":"change_id","in":"path","required":true,"schema":{"type":"string","maxLength":128}}],"get":{"operationId":"getChange","tags":["Activity"],"summary":"Show a Change or receipt","security":[{"bearerAuth":[]}],"x-capability":{"group":"changes","access":"read","project_scope":"team_level_uses_actor_visibility"},"responses":{"200":{"description":"Change detail.","content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/changes\/{change_id}\/undo":{"parameters":[{"name":"change_id","in":"path","required":true,"schema":{"type":"string","maxLength":128}}],"post":{"operationId":"undoChange","tags":["Activity"],"summary":"Undo a supported Change","security":[{"bearerAuth":[]}],"x-capability":{"group":"changes","access":"write","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"responses":{"200":{"description":"Undo result.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperationEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/changes\/{change_id}\/check":{"parameters":[{"name":"change_id","in":"path","required":true,"schema":{"type":"string","maxLength":128}}],"post":{"operationId":"checkChangeOutcome","tags":["Activity"],"summary":"Check an external Change outcome","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Outcome check result.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperationEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/changes\/{change_id}\/reverse":{"parameters":[{"name":"change_id","in":"path","required":true,"schema":{"type":"string","maxLength":128}}],"post":{"operationId":"reverseExternalChange","tags":["Activity"],"summary":"Reverse an external Change where supported","security":[{"bearerAuth":[]}],"x-capability":{"group":"changes","access":"write","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"responses":{"200":{"description":"Reversal result.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperationEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/assistant\/chats":{"get":{"operationId":"listAssistantChats","tags":["Assistant"],"summary":"List assistant chats","description":"Lists assistant chat summaries owned by the API key's bound visibility user. Provider runtime state, prompts, tools, events, page context, billing internals, and numeric ids are not exposed.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"assistant","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/AssistantChatCursor"},{"$ref":"#\/components\/parameters\/AssistantChatStatus"},{"$ref":"#\/components\/parameters\/AssistantCreatedFrom"},{"$ref":"#\/components\/parameters\/AssistantCreatedTo"}],"responses":{"200":{"description":"Assistant chat list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AssistantChatListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/assistant\/chats\/{chat_id}":{"parameters":[{"$ref":"#\/components\/parameters\/AssistantChatPublicId"}],"get":{"operationId":"getAssistantChat","tags":["Assistant"],"summary":"Show assistant chat","description":"Shows one assistant chat summary for the bound visibility user. Missing, malformed, cross-team, other-user, and deleted chats return the same resource_not_found envelope after capability checks.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"assistant","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Assistant chat summary.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AssistantChatEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/assistant\/runs":{"get":{"operationId":"listAssistantRuns","tags":["Assistant"],"summary":"List assistant runs","description":"Lists assistant run summaries owned by the API key's bound visibility user. The response includes bounded text excerpts and aggregate usage facts only; raw prompts, tool payloads, events, provider ids, runtime state, page context, billing internals, and numeric ids are excluded.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"assistant","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/AssistantRunCursor"},{"$ref":"#\/components\/parameters\/AssistantRunChatId"},{"$ref":"#\/components\/parameters\/AssistantRunStatus"},{"$ref":"#\/components\/parameters\/AssistantCreatedFrom"},{"$ref":"#\/components\/parameters\/AssistantCreatedTo"}],"responses":{"200":{"description":"Assistant run list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AssistantRunListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/assistant\/runs\/{run_id}":{"parameters":[{"$ref":"#\/components\/parameters\/AssistantRunPublicId"}],"get":{"operationId":"getAssistantRun","tags":["Assistant"],"summary":"Show assistant run","description":"Shows one assistant run summary for the bound visibility user. Missing, malformed, cross-team, other-user, and deleted runs return the same resource_not_found envelope after capability checks.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"assistant","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Assistant run summary.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AssistantRunEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/mailboxes":{"get":{"operationId":"listMailMailboxes","tags":["Mail"],"summary":"List mailboxes","description":"Lists visible mailboxes for which the API key's bound visibility user has an explicit content grant. Provider account ids, credentials, metadata payloads, message content, and numeric ids are excluded.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/MailMailboxCursor"}],"responses":{"200":{"description":"Mailbox list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailMailboxListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/search":{"get":{"operationId":"searchMail","tags":["Mail"],"summary":"Search only explicitly approved mailboxes","description":"Uses the shared cross-mailbox ranking, scope and filter engine. Mail content capability and bound-user consent are both required. Membership and mailbox grants are rechecked on each page. Current resolved mailboxes, key, actor and filters bind the encrypted cursor. Use POST for large filters\/cursors to avoid URL length limits. Results include public thread summaries and matched-message snippets, never provider credentials, internal identifiers or raw diagnostics. Coverage metadata distinguishes partial search and fan-out truncation.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_content","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/PerPage"},{"name":"query","in":"query","schema":{"type":"string","maxLength":500}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":32768}},{"name":"mailbox_ids","in":"query","schema":{"type":"array","maxItems":50,"items":{"type":"string"}}},{"name":"collection_ids","in":"query","schema":{"type":"array","maxItems":50,"items":{"type":"string"}}},{"name":"scope","in":"query","style":"deepObject","explode":true,"schema":{"$ref":"#\/components\/schemas\/MailSearchScope"}},{"name":"filters","in":"query","style":"deepObject","explode":true,"schema":{"$ref":"#\/components\/schemas\/MailSearchFilters"}}],"responses":{"200":{"description":"Ranked public thread summaries with cursor and coverage.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailSearchEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"},"503":{"description":"Search temporarily unavailable.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}}}},"post":{"operationId":"queryMail","tags":["Mail"],"summary":"Search mail with a JSON query body","description":"Same read-only operation as GET; use this form for large filter arrays or cursors. Requires content consent, does not send mail, and ignores the Idempotency-Key header. Provider search is not wrapped in a replay transaction.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_content","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Ranked public thread summaries with cursor and coverage.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailSearchEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"},"503":{"description":"Search temporarily unavailable.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailSearchInput"}}}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/messages":{"get":{"operationId":"listMailMessages","tags":["Mail"],"summary":"List delegated mailbox messages","description":"Requires the explicitly selected mail_content capability plus session-approved content delegation for this mailbox. Current membership and content grants are rechecked on every request. Existing full-access and read-only presets do not include this capability. Binary downloads require bearer headers; credentials must never be placed in URLs. Message lists use ascending local ingestion order and encrypted, context-bound keyset cursors. Draft content returns the authored body only; staged uploads are not provider attachments.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_content","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/PerPage"},{"name":"thread_id","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"List delegated mailbox messages.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailContentMessageListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"},"503":{"description":"Provider content unavailable.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/messages\/{message_id}":{"get":{"operationId":"getMailMessage","tags":["Mail"],"summary":"Show delegated message metadata","description":"Requires the explicitly selected mail_content capability plus session-approved content delegation for this mailbox. Current membership and content grants are rechecked on every request. Existing full-access and read-only presets do not include this capability. Binary downloads require bearer headers; credentials must never be placed in URLs. Message lists use ascending local ingestion order and encrypted, context-bound keyset cursors. Draft content returns the authored body only; staged uploads are not provider attachments.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_content","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"message_id","in":"path","required":true,"schema":{"type":"string"},"description":"Opaque message public id."}],"responses":{"200":{"description":"Show delegated message metadata.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailContentMessageEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"},"503":{"description":"Provider content unavailable.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/messages\/{message_id}\/body":{"get":{"operationId":"getMailMessageBody","tags":["Mail"],"summary":"Read sanitized message content","description":"Requires the explicitly selected mail_content capability plus session-approved content delegation for this mailbox. Current membership and content grants are rechecked on every request. Existing full-access and read-only presets do not include this capability. Binary downloads require bearer headers; credentials must never be placed in URLs. Message lists use ascending local ingestion order and encrypted, context-bound keyset cursors. Draft content returns the authored body only; staged uploads are not provider attachments.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_content","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"message_id","in":"path","required":true,"schema":{"type":"string"},"description":"Opaque message public id."}],"responses":{"200":{"description":"Read sanitized message content.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailContentBodyEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"},"503":{"description":"Provider content unavailable.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/messages\/{message_id}\/source":{"get":{"operationId":"getMailMessageSource","tags":["Mail"],"summary":"Download RFC822 source","description":"Requires the explicitly selected mail_content capability plus session-approved content delegation for this mailbox. Current membership and content grants are rechecked on every request. Existing full-access and read-only presets do not include this capability. Binary downloads require bearer headers; credentials must never be placed in URLs. Message lists use ascending local ingestion order and encrypted, context-bound keyset cursors. Draft content returns the authored body only; staged uploads are not provider attachments.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_content","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"message_id","in":"path","required":true,"schema":{"type":"string"},"description":"Opaque message public id."}],"responses":{"200":{"description":"Download RFC822 source.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"message\/rfc822":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"},"503":{"description":"Provider content unavailable.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/messages\/{message_id}\/attachments\/{attachment_id}":{"get":{"operationId":"getMailMessageAttachment","tags":["Mail"],"summary":"Download message attachment","description":"Requires the explicitly selected mail_content capability plus session-approved content delegation for this mailbox. Current membership and content grants are rechecked on every request. Existing full-access and read-only presets do not include this capability. Binary downloads require bearer headers; credentials must never be placed in URLs. Message lists use ascending local ingestion order and encrypted, context-bound keyset cursors. Draft content returns the authored body only; staged uploads are not provider attachments.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_content","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"message_id","in":"path","required":true,"schema":{"type":"string"},"description":"Opaque message public id."},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string"},"description":"Opaque attachment handle returned by the body projection."}],"responses":{"200":{"description":"Download message attachment.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"},"503":{"description":"Provider content unavailable.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/personas":{"get":{"operationId":"listMailDraftPersonas","tags":["Mail"],"summary":"List currently granted sender identities","description":"Requires explicit mail_drafts read capability and personal drafts approval. Returns only same-mailbox persona grants; does not authorize sending.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_drafts","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"}],"responses":{"200":{"description":"Currently granted sender identities.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["personas"],"properties":{"personas":{"type":"array","items":{"type":"object","required":["id","email_address","display_name","availability"],"properties":{"id":{"type":"string","description":"Opaque public persona ID."},"email_address":{"type":"string"},"display_name":{"type":["string","null"]},"availability":{"type":"string"}}}}}}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/drafts":{"get":{"operationId":"listMailDrafts","tags":["Mail"],"summary":"List delegated drafts and revision tokens","description":"Current personal approval, membership and mailbox grants are required. Bodies are available through the individual draft endpoint.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_drafts","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/PerPage"},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Cursor-paginated draft summaries without bodies.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","mailbox_id","thread_id","persona_id","subject","revision","updated_at"],"properties":{"id":{"type":"string"},"mailbox_id":{"type":"string"},"thread_id":{"type":["string","null"]},"persona_id":{"type":["string","null"]},"subject":{"type":["string","null"]},"revision":{"type":"string"},"updated_at":{"type":["string","null"]}}}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"post":{"operationId":"createMailDraft","tags":["Mail"],"summary":"Create a draft without sending","description":"Requires personally approved draft-write authority and an Idempotency-Key. Replays recheck current authority. Reply and forward references remain mailbox scoped. No provider requests occur inside draft mutation transactions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_drafts","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailDraftInput"}}}},"responses":{"201":{"$ref":"#\/components\/responses\/MailDraft"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/drafts\/{message_id}":{"get":{"operationId":"getMailDraft","tags":["Mail"],"summary":"Read the authored draft snapshot","description":"Returns a revision token and public identities, not browser-only preview URLs or provider credentials.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_drafts","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/MailMessagePublicId"}],"responses":{"200":{"$ref":"#\/components\/responses\/MailDraft"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"patch":{"operationId":"updateMailDraft","tags":["Mail"],"summary":"Update a revision-bound draft snapshot","description":"Send the complete authored snapshot and its revision. Changed revisions return conflict with draft_revision_changed. Threading and RFC identity cannot be changed. Replays recheck personal approval and current mailbox access.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_drafts","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/MailMessagePublicId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/MailDraftInput"},{"type":"object","required":["revision"],"properties":{"revision":{"type":"string","minLength":64,"maxLength":64}}}]}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailDraft"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"discardMailDraft","tags":["Mail"],"summary":"Discard a revision-bound draft","description":"Requires current draft-write approval. Frozen or submitted drafts cannot be discarded. Replays retain current authorization checks.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_drafts","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/MailMessagePublicId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["revision"],"properties":{"revision":{"type":"string","minLength":64,"maxLength":64}}}}}},"responses":{"200":{"description":"The identified draft was discarded.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","discarded"],"properties":{"id":{"type":"string"},"discarded":{"type":"boolean"}}}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/drafts\/{message_id}\/attachments":{"post":{"operationId":"addMailDraftAttachment","tags":["Mail"],"summary":"Add a revision-bound draft attachment","description":"Upload canonical base64 in JSON. Decoded bytes count against the configured draft total (25 MiB by default); empty files are not accepted. MIME type is detected from bytes. Inline images require rich compose and a supported image type. Returns the new draft snapshot, attachment ref and revision. The idempotency hash includes filename, bytes, disposition and revision. Files from an outer transaction rollback are reclaimed by staged-file cleanup.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_drafts","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/MailMessagePublicId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["revision","filename","content_base64"],"properties":{"revision":{"type":"string","minLength":64,"maxLength":64},"filename":{"type":"string","minLength":1,"maxLength":255,"description":"A filename without directory separators or control characters."},"content_base64":{"type":"string","format":"byte","minLength":1},"disposition":{"type":"string","enum":["attachment","inline"],"default":"attachment"}}}}}},"responses":{"201":{"$ref":"#\/components\/responses\/MailDraft"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/drafts\/{message_id}\/attachments\/{ref}":{"delete":{"operationId":"removeMailDraftAttachment","tags":["Mail"],"summary":"Remove a revision-bound draft attachment","description":"The ref must belong to this draft. Inline images still referenced in HTML cannot be removed; update the authored HTML first. Frozen drafts reject removal. Returns the new draft revision; retries retain current authorization checks.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_drafts","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/MailMessagePublicId"},{"name":"ref","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["revision"],"properties":{"revision":{"type":"string","minLength":64,"maxLength":64}}}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailDraft"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/drafts\/{message_id}\/send-intents":{"post":{"operationId":"prepareMailSend","tags":["Mail"],"summary":"Prepare an immutable send for explicit confirmation","description":"Requires separately selected mail_outbound write capability and personal outbound delegation. Binds the current draft revision, sender identity and signature, recipients, attachments, UTC schedule and warning state. Returns an encrypted-at-rest authored snapshot for review and a key\/actor-bound intent expiring in ten minutes. This operation performs no provider submission.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_outbound","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"$ref":"#\/components\/parameters\/MailMessagePublicId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["revision"],"properties":{"revision":{"type":"string","minLength":64,"maxLength":64},"send_at":{"type":["string","null"],"format":"date-time","description":"Future UTC timestamp formatted YYYY-MM-DDTHH:mm:ssZ; omit for immediate sending."}}}}}},"responses":{"201":{"$ref":"#\/components\/responses\/MailSendIntent"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/send-intents\/{intent_id}":{"get":{"operationId":"getMailSendIntent","tags":["Mail"],"summary":"Read a prepared send and its current outcome","description":"Available only to the preparing key and bound user with current outbound read approval and mailbox access. An intent or unresolved result is not proof of delivery. A failed preparation needs a new reviewed intent; processing is never permission to resubmit automatically.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_outbound","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"intent_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"$ref":"#\/components\/responses\/MailSendIntent"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/send-intents\/{intent_id}\/submit":{"post":{"operationId":"confirmAndSubmitMailSend","tags":["Mail"],"summary":"Confirm and submit the immutable prepared send","description":"Explicit automation authority must already have been granted by the bound user's session. Requires confirm=true and acknowledgement of the prepared warning fingerprint when warnings exist. Content overrides are rejected. The durable command is claimed before provider IO outside any generic replay transaction. Identical retries return current state without another submission; a different confirmation or request key conflicts. Current authority is rechecked before freeze and after body assembly. An uncertain provider response returns 202 with submission_unresolved=true, never a safe-to-resend indication.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_outbound","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"intent_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm"],"properties":{"confirm":{"type":"boolean","const":true},"warning_fingerprint":{"type":["string","null"],"minLength":64,"maxLength":64}}}}}},"responses":{"202":{"$ref":"#\/components\/responses\/MailSendIntent"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/send-intents\/{intent_id}\/cancel":{"post":{"operationId":"cancelPreparedMailSend","tags":["Mail"],"summary":"Cancel a submitted scheduled send","description":"Requires explicit confirmation and current outbound write authority. Uses the shared provider cancellation boundary outside the replay transaction. Already canceled outcomes are safe to repeat; an acceptance or dispatch race is not reported as canceled without provider proof.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_outbound","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"intent_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm"],"properties":{"confirm":{"type":"boolean","const":true}}}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailSendIntent"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/ai\/generations":{"post":{"operationId":"generateMailAiWriting","tags":["Mail"],"summary":"Generate AI writing from personally approved context","description":"Uses the shared AI ledger and provider outside replay transactions. Explicit AI write approval can consume credits. Only preview output is generated; this never sends or silently writes a draft. Draft context requires its current revision. Pending workers recheck the original key, bound user, mailbox grants and revision. Retain the same Idempotency-Key for retries; expired results are not regenerated.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_ai","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailAiGenerateRequest"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailAiGeneration"},"202":{"$ref":"#\/components\/responses\/MailAiGeneration"},"402":{"$ref":"#\/components\/responses\/MailAiFailure"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"500":{"$ref":"#\/components\/responses\/MailAiFailure"},"503":{"$ref":"#\/components\/responses\/MailAiFailure"},"504":{"$ref":"#\/components\/responses\/MailAiFailure"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/ai\/generations\/{generation_id}":{"get":{"operationId":"getMailAiGeneration","tags":["Mail"],"summary":"Read an agent-owned AI generation and cached result","description":"Requires AI read approval and current mailbox access. Only the originating key and bound user can read the generation. Output expires independently of the durable status and usage ledger; null output is not a new generation.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_ai","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"generation_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}],"responses":{"200":{"$ref":"#\/components\/responses\/MailAiGeneration"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/ai\/generations\/{generation_id}\/cancel":{"post":{"operationId":"cancelMailAiGeneration","tags":["Mail"],"summary":"Request cancellation of an agent-owned AI generation","description":"Requires AI write approval. Pending work becomes canceled; running work records a cancellation request. Billable work already performed remains billable. Terminal outcomes are not changed. Retries use the same command key.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_ai","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"generation_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailAiCancelRequest"}}}},"responses":{"202":{"$ref":"#\/components\/responses\/MailAiGeneration"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/ai\/generations\/{generation_id}\/apply":{"post":{"operationId":"applyMailAiGeneration","tags":["Mail"],"summary":"Apply an exact cached AI preview to its saved draft","description":"Requires both AI write and draft-write personal approval. The target must be the generation's own draft and match the supplied current revision plus its captured generation baseline. Applying never sends. Subject and alternate outputs are selected by server-validated index. Replay preserves the original result without repeating the change.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_ai","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"generation_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailAiApplyRequest"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailDraft"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"410":{"$ref":"#\/components\/responses\/MailAiFailure"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/workflow\/candidates":{"get":{"operationId":"getMailWorkflowCandidates","tags":["Mail"],"summary":"Read current mailbox assignment candidates and enabled workflow actions","description":"Requires personally approved workflow read access. Returns opaque user IDs for current members with mailbox content access. Does not grant access or change assignment.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workflow","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"}],"responses":{"200":{"$ref":"#\/components\/responses\/MailWorkflowCandidates"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/threads\/{thread_id}\/workflow":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"getMailWorkflow","tags":["Mail"],"summary":"Read app-local conversation workflow and its revision","description":"Personally approved workflow read access is required. The revision covers status, assignment, snooze, archive metadata and sorted tags; incoming messages do not invalidate it.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workflow","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"$ref":"#\/components\/responses\/MailWorkflow"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"post":{"operationId":"updateMailWorkflow","tags":["Mail"],"summary":"Apply a revision-bound local conversation action","description":"Requires separate personal workflow write approval and interactive Mail access. Uses shared status, assignment, snooze, tag and queue services. A stale revision conflicts; retries retain the same key. No provider folder move or email submission occurs.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workflow","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailWorkflowCommand"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailWorkflow"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/workflow\/bulk":{"post":{"operationId":"bulkMailWorkflow","tags":["Mail"],"summary":"Apply one local workflow action to a bounded explicit conversation set","description":"Up to 100 unique opaque thread IDs with individual revisions. Each item returns succeeded or failed with safe reason and fresh workflow for successful rows; missing and stale rows do not undo other items. Current delegated authority is checked before replay and at each row. Use the same retry key; never silently obtain newer revisions. No provider folder moves or sending.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_workflow","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailWorkflowBulkCommand"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailWorkflowBulk"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/threads\/{thread_id}\/reminders":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"listMailReminders","tags":["Mail"],"summary":"List my personal and shared reminders with bound cursor pagination","description":"Requires reminders read approval. Lists shared reminders and only the approving member's personal reminders, including terminal history. Managers cannot read another member's personal reminders. Pagination is bound to the current actor, mailbox, thread and page size. Does not change snooze or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_reminders","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"$ref":"#\/components\/responses\/MailReminders"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"post":{"operationId":"createMailReminder","tags":["Mail"],"summary":"Create a personal or shared reminder","description":"Requires reminders write approval, interactive access and a stable retry key. Personal reminders belong only to the approving member. Shared reminders synchronize conversation snooze and may notify eligible people. Due time must include seconds and timezone, be future at execution, and not exceed 2038-01-19T03:14:07Z. Current authority is checked before replay. No outbound email is sent.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_reminders","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailReminderCreate"}}}},"responses":{"201":{"$ref":"#\/components\/responses\/MailReminder"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/threads\/{thread_id}\/reminders\/{reminder_id}":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"getMailReminder","tags":["Mail"],"summary":"Read my personal or shared reminder","description":"Requires reminders read approval. Returns a shared reminder or the approving member's own personal reminder, including lifecycle and current revision. Another person's personal reminder is not found even for managers. Does not change snooze or send email.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_reminders","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"$ref":"#\/components\/responses\/MailReminder"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"patch":{"operationId":"updateMailReminder","tags":["Mail"],"summary":"Reschedule or dismiss a reminder at its exact revision","description":"Requires reminders write approval, interactive access, current revision and a stable retry key. Reschedule requires a future due time with seconds and timezone no later than 2038-01-19T03:14:07Z. Dismiss accepts no due time or condition. Shared reminders synchronize only their owned snooze. Stale revisions return 409 reminder_revision_changed; rescheduling after a notification was delivered returns 409 reminder_already_delivered. Current authority is checked before replay. No outbound email is sent.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_reminders","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailReminderUpdate"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailReminder"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteMailReminder","tags":["Mail"],"summary":"Delete a reminder that has not been delivered","description":"Requires reminders write approval, interactive access, current revision and a stable retry key. Only your own personal or shared reminders are eligible. Delivered reminders return 409 reminder_already_delivered; stale revisions return 409 reminder_revision_changed. Clears only the reminder's owned snooze. Current authority is checked before replay, including repeated deletion. No outbound email is sent.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_reminders","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailNoteDelete"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailReminderDeleted"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/threads\/{thread_id}\/followers":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"listMailFollowers","tags":["Mail"],"summary":"List current conversation followers","description":"Separate following read approval is required. Only current eligible members are returned with opaque IDs and bound cursor pagination.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_following","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"$ref":"#\/components\/responses\/MailFollowers"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/threads\/{thread_id}\/following":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"getMailFollowing","tags":["Mail"],"summary":"Read your own following state and revision","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_following","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"$ref":"#\/components\/responses\/MailFollowing"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"post":{"operationId":"updateMailFollowing","tags":["Mail"],"summary":"Follow or unfollow a conversation as the personally approving member","description":"Requires following write approval and interactive access. Unfollow preserves the shared opt-out from automatic following. No other user may be supplied. Use the current revision and a stable retry key; current authority is checked before replay. A stale revision returns 409 with reason following_revision_changed.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_following","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["action","revision"],"properties":{"action":{"type":"string","enum":["follow","unfollow"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailFollowing"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/threads\/{thread_id}\/notes":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"listMailNotes","tags":["Mail"],"summary":"List internal notes with bound cursor pagination","description":"Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_notes","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"$ref":"#\/components\/responses\/MailNotes"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"post":{"operationId":"createMailNote","tags":["Mail"],"summary":"Create an internal note and optional mentions","description":"Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_notes","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailNoteCreate"}}}},"responses":{"201":{"$ref":"#\/components\/responses\/MailNote"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/threads\/{thread_id}\/notes\/candidates":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"getMailNoteCandidates","tags":["Mail"],"summary":"Read eligible mention candidates","description":"Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_notes","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"$ref":"#\/components\/responses\/MailNoteCandidates"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/threads\/{thread_id}\/notes\/read":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"operationId":"readMailNoteMentions","tags":["Mail"],"summary":"Mark my mentions in an explicit note set as read","description":"Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_notes","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailNoteReadCommand"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailNoteRead"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/threads\/{thread_id}\/notes\/{note_id}":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"note_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"getMailNote","tags":["Mail"],"summary":"Read an internal note or redacted tombstone","description":"Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_notes","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"$ref":"#\/components\/responses\/MailNote"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"patch":{"operationId":"updateMailNote","tags":["Mail"],"summary":"Update my note at its exact revision","description":"Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_notes","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailNoteUpdate"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailNote"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteMailNote","tags":["Mail"],"summary":"Redact an internal note at its exact revision","description":"Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_notes","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailNoteDelete"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/MailNote"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"}],"get":{"operationId":"getMailMailbox","tags":["Mail"],"summary":"Show mailbox","description":"Shows one granted visible mailbox and local folder summaries. Missing, malformed, cross-team, ungranted, hidden, and deleted mailboxes return resource_not_found after capability checks.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Mailbox detail.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailMailboxEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/threads":{"get":{"operationId":"listMailThreads","tags":["Mail"],"summary":"List mail threads","description":"Lists thread summaries from granted visible mailboxes. Message bodies, headers, provider thread\/message ids, attachment metadata, drafts, link internals, and numeric ids are excluded.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/MailThreadCursor"},{"$ref":"#\/components\/parameters\/MailThreadMailboxId"},{"$ref":"#\/components\/parameters\/MailThreadFolderId"},{"$ref":"#\/components\/parameters\/MailThreadStatus"},{"$ref":"#\/components\/parameters\/MailThreadAssignedUserId"},{"$ref":"#\/components\/parameters\/MailThreadTagId"},{"$ref":"#\/components\/parameters\/MailCreatedFrom"},{"$ref":"#\/components\/parameters\/MailCreatedTo"},{"$ref":"#\/components\/parameters\/MailUpdatedFrom"},{"$ref":"#\/components\/parameters\/MailUpdatedTo"}],"responses":{"200":{"description":"Mail thread list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailThreadListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/threads\/{thread_id}":{"parameters":[{"$ref":"#\/components\/parameters\/MailThreadPublicId"}],"get":{"operationId":"getMailThread","tags":["Mail"],"summary":"Show mail thread","description":"Shows one granted visible thread summary. Missing, malformed, cross-team, ungranted, hidden, and deleted threads return resource_not_found after capability checks.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Mail thread summary.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailThreadEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/tasks":{"get":{"operationId":"listTasks","tags":["Tasks"],"summary":"List tasks","description":"Lists Tasks visible to the key's current visibility user.","security":[{"bearerAuth":[]}],"x-capability":{"group":"tasks","access":"read","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/TaskStatusFilter"}],"responses":{"200":{"description":"Task list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"startTask","tags":["Tasks"],"summary":"Start a task","description":"Starts accepted background work for the key's current visibility user.","security":[{"bearerAuth":[]}],"x-capability":{"group":"tasks","access":"write","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskStartRequest"}}}},"responses":{"202":{"description":"Task accepted.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Idempotent-Replayed":{"$ref":"#\/components\/headers\/IdempotentReplayed"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskActionEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/tasks\/{task}":{"parameters":[{"$ref":"#\/components\/parameters\/TaskPublicId"}],"get":{"operationId":"getTask","tags":["Tasks"],"summary":"Show a task","description":"Shows one Task if the visibility user can currently read it.","security":[{"bearerAuth":[]}],"x-capability":{"group":"tasks","access":"read","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Task detail.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/tasks\/{task}\/events":{"parameters":[{"$ref":"#\/components\/parameters\/TaskPublicId"}],"get":{"operationId":"listTaskEvents","tags":["Tasks"],"summary":"Replay task events","description":"Returns durable Task events after the submitted sequence.","security":[{"bearerAuth":[]}],"x-capability":{"group":"tasks","access":"read","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"after_sequence","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Task events.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskEventsEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/tasks\/{task}\/outputs":{"parameters":[{"$ref":"#\/components\/parameters\/TaskPublicId"}],"get":{"operationId":"listTaskOutputs","tags":["Tasks"],"summary":"List task outputs","description":"Returns retained outputs visible to the key's current visibility user.","security":[{"bearerAuth":[]}],"x-capability":{"group":"tasks","access":"read","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Task outputs.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskOutputsEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/tasks\/{task}\/actions":{"parameters":[{"$ref":"#\/components\/parameters\/TaskPublicId"}],"post":{"operationId":"controlTask","tags":["Tasks"],"summary":"Control a task","description":"Pauses, resumes, stops, retries, or continues a controllable Task.","security":[{"bearerAuth":[]}],"x-capability":{"group":"tasks","access":"write","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskControlRequest"}}}},"responses":{"202":{"description":"Task control accepted.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskActionEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/spaces":{"get":{"operationId":"listSpaces","tags":["Spaces"],"summary":"List Spaces","description":"Lists Spaces visible to the key visibility user.","security":[{"bearerAuth":[]}],"x-capability":{"group":"spaces","access":"read","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Space list.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SpaceListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createSpace","tags":["Spaces"],"summary":"Create a Space","description":"Creates a project or client Space and starts repository preparation.","security":[{"bearerAuth":[]}],"x-capability":{"group":"spaces","access":"write","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SpaceCreateRequest"}}}},"responses":{"201":{"description":"Space created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SpaceEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/spaces\/{space}":{"parameters":[{"$ref":"#\/components\/parameters\/SpacePublicId"}],"get":{"operationId":"getSpace","tags":["Spaces"],"summary":"Show a Space","description":"Shows one Space visible to the key visibility user.","security":[{"bearerAuth":[]}],"x-capability":{"group":"spaces","access":"read","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Space found.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SpaceEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/spaces\/{space}\/files":{"parameters":[{"$ref":"#\/components\/parameters\/SpacePublicId"}],"get":{"operationId":"listSpaceFiles","tags":["Files"],"summary":"List Space files","description":"Lists current source entries and knowledge pins inside an accessible Space.","security":[{"bearerAuth":[]}],"x-capability":{"group":"spaces","access":"read","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Space file list.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SpaceFilesEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/spaces\/{space}\/files\/content":{"parameters":[{"$ref":"#\/components\/parameters\/SpacePublicId"}],"get":{"operationId":"readSpaceFile","tags":["Files"],"summary":"Read a Space file","description":"Reads the current content of one source file after current access checks.","security":[{"bearerAuth":[]}],"x-capability":{"group":"spaces","access":"read","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"path","in":"query","required":true,"schema":{"type":"string","maxLength":1024}}],"responses":{"200":{"description":"Space file content.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SpaceFileEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"put":{"operationId":"saveSpaceFile","tags":["Files"],"summary":"Save a Space file","description":"Saves source content with optional revision conflict detection.","security":[{"bearerAuth":[]}],"x-capability":{"group":"spaces","access":"write","project_scope":"team_level_uses_actor_visibility"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SpaceFileSaveRequest"}}}},"responses":{"200":{"description":"Space file saved.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SpaceFileEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/spaces\/{space}\/files\/history":{"parameters":[{"$ref":"#\/components\/parameters\/SpacePublicId"}],"get":{"operationId":"listSpaceFileHistory","tags":["Files"],"summary":"Read Space file history","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"path","in":"query","schema":{"type":"string","maxLength":1024}},{"name":"commit","in":"query","schema":{"type":"string","minLength":40,"maxLength":40}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"File history or comparison.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SpaceFileHistoryEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/spaces\/{space}\/files\/search":{"parameters":[{"$ref":"#\/components\/parameters\/SpacePublicId"}],"get":{"operationId":"searchSpaceFiles","tags":["Files"],"summary":"Search Space files","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":255}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":20}}],"responses":{"200":{"description":"Search results.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SpaceFileSearchEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/spaces\/{space}\/files\/download":{"parameters":[{"$ref":"#\/components\/parameters\/SpacePublicId"}],"get":{"operationId":"downloadSpaceFile","tags":["Files"],"summary":"Download a Space file","description":"Streams a bearer-authorized source or binary object after current access checks.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"path","in":"query","required":true,"schema":{"type":"string","maxLength":1024}},{"name":"commit","in":"query","schema":{"type":"string","minLength":40,"maxLength":40}},{"name":"object_id","in":"query","schema":{"type":"string","maxLength":128}}],"responses":{"200":{"description":"File stream.","content":{"application\/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/skills":{"get":{"operationId":"discoverSkills","tags":["Skills"],"summary":"Discover Skills","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"q","in":"query","schema":{"type":"string","maxLength":255}},{"name":"space_id","in":"query","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"Matching Skills.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SkillListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createSkill","tags":["Skills"],"summary":"Save a new Skill","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SkillSaveRequest"}}}},"responses":{"200":{"description":"Skill saved.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SkillEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/skills\/source":{"get":{"operationId":"readSkill","tags":["Skills"],"summary":"Read Skill source","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"name":"space_id","in":"query","required":true,"schema":{"type":"string","maxLength":255}},{"name":"path","in":"query","required":true,"schema":{"type":"string","maxLength":1024}}],"responses":{"200":{"description":"Skill source and metadata.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SkillEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateSkill","tags":["Skills"],"summary":"Update Skill source","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SkillSaveRequest"}}}},"responses":{"200":{"description":"Skill updated.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SkillEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/skills\/runs":{"post":{"operationId":"invokeSkill","tags":["Skills"],"summary":"Invoke a Skill","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SkillRunRequest"}}}},"responses":{"202":{"description":"Skill run accepted.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskActionEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/skills\/imports":{"post":{"operationId":"importSkill","tags":["Skills"],"summary":"Import a Skill package","security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Import preview or adoption started.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperationEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/skills\/exports":{"post":{"operationId":"exportSkill","tags":["Skills"],"summary":"Export a Skill package","security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Export started.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperationEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/projects":{"get":{"operationId":"listProjects","tags":["Projects"],"summary":"List projects","description":"Lists projects visible to the authenticated key. Selected-project keys receive only their selected projects for project-backed reads.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"projects","access":"read","project_scope":"filters_to_selected_projects"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/Page"},{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/ProjectStatusFilter"},{"$ref":"#\/components\/parameters\/ProjectSearch"},{"$ref":"#\/components\/parameters\/ProjectSort"}],"responses":{"200":{"description":"Project list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProjectListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createProject","tags":["Projects"],"summary":"Create a project","description":"Creates a project from JSON body fields only. Project-backed creation requires a Projects write-capable key with all-projects scope.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"projects","access":"write","project_scope":"requires_all_projects"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProjectCreateRequest"}}}},"responses":{"201":{"description":"Project created.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Idempotent-Replayed":{"$ref":"#\/components\/headers\/IdempotentReplayed"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProjectEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/projects\/{project}":{"parameters":[{"$ref":"#\/components\/parameters\/ProjectPublicId"}],"get":{"operationId":"getProject","tags":["Projects"],"summary":"Show a project","description":"Shows one project by public ID. Missing, malformed, cross-team, soft-deleted, and selected-project scope misses return the same public not-found error.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"projects","access":"read","project_scope":"selected_project_misses_are_not_found"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Project found.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProjectEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateProject","tags":["Projects"],"summary":"Update a project","description":"Partially updates a project from JSON body fields only. Selected-project keys may update selected projects when they have Projects write access.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"projects","access":"write","project_scope":"allowed_for_selected_project"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProjectUpdateRequest"}}}},"responses":{"200":{"description":"Project updated.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Idempotent-Replayed":{"$ref":"#\/components\/headers\/IdempotentReplayed"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProjectEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"delete":{"operationId":"deleteProject","tags":["Projects"],"summary":"Delete a project","description":"Soft-deletes a project and returns a public acknowledgement. Selected- project keys may delete selected projects when they have Projects write access.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"projects","access":"write","project_scope":"allowed_for_selected_project"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"responses":{"200":{"description":"Project deleted.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Idempotent-Replayed":{"$ref":"#\/components\/headers\/IdempotentReplayed"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProjectDeleteEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/credits\/balance":{"get":{"operationId":"getCreditBalance","tags":["Credits"],"summary":"Show credit balance","description":"Returns the team-level credit balance, normalized subscription summary, and last credit update timestamp.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"credits","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Credit balance.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreditBalanceEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/credits\/transactions":{"get":{"operationId":"listCreditTransactions","tags":["Credits"],"summary":"List credit transactions","description":"Lists the team-level credit ledger with public transaction type labels. Selected-project keys with Credits read access see the full team ledger.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"credits","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/Page"},{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/CreditTransactionType"},{"$ref":"#\/components\/parameters\/CreditCreatedFrom"},{"$ref":"#\/components\/parameters\/CreditCreatedTo"},{"$ref":"#\/components\/parameters\/CreditTransactionSort"}],"responses":{"200":{"description":"Credit transaction list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreditTransactionListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/api-keys":{"get":{"operationId":"listApiKeys","tags":["API Keys"],"summary":"List API keys","description":"Lists non-secret metadata for API keys in the authenticated team. Requires API key read management capability.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"api_keys","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/Page"},{"$ref":"#\/components\/parameters\/PerPage"}],"responses":{"200":{"description":"API key list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKeyListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createApiKey","tags":["API Keys"],"summary":"Create an API key","description":"Creates an API key and returns the plaintext bearer value once. This secret-issuing endpoint rejects Idempotency-Key and is not replayable.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"api_keys","access":"write_create","project_scope":"delegation_bounds_apply"},"x-svanja-non-replayable-secret":true,"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKeyCreateRequest"}}}},"responses":{"201":{"description":"API key created and secret issued once.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKeySecretEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/api-keys\/{apiKey}":{"parameters":[{"$ref":"#\/components\/parameters\/ApiKeyPublicId"}],"get":{"operationId":"getApiKey","tags":["API Keys"],"summary":"Show an API key","description":"Shows non-secret metadata for one API key by display id. Missing, malformed, cross-team, deleted-token, and sidecar-missing targets return resource_not_found after the read capability check.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"api_keys","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"API key found.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKeyEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateApiKey","tags":["API Keys"],"summary":"Update an API key","description":"Partially updates API key metadata from JSON body fields only. The final target state must fit within the managing key's capabilities, project scope, selected projects, and lifetime. This non-secret write supports idempotency replay.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"api_keys","access":"write_update","project_scope":"delegation_bounds_apply"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKeyUpdateRequest"}}}},"responses":{"200":{"description":"API key updated.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Idempotent-Replayed":{"$ref":"#\/components\/headers\/IdempotentReplayed"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKeyEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/api-keys\/{apiKey}\/rotate":{"parameters":[{"$ref":"#\/components\/parameters\/ApiKeyPublicId"}],"post":{"operationId":"rotateApiKey","tags":["API Keys"],"summary":"Rotate an API key","description":"Revokes the source key and creates a replacement with the same configuration. The plaintext replacement bearer value is returned once. This secret-issuing endpoint rejects Idempotency-Key.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"api_keys","access":"write_rotate","project_scope":"delegation_bounds_apply"},"x-svanja-non-replayable-secret":true,"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKeyRotateRequest"}}}},"responses":{"200":{"description":"API key rotated and replacement secret issued once.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKeyRotationEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/api-keys\/{apiKey}\/revoke":{"parameters":[{"$ref":"#\/components\/parameters\/ApiKeyPublicId"}],"post":{"operationId":"revokeApiKey","tags":["API Keys"],"summary":"Revoke an API key","description":"Soft-revokes a same-team non-self API key. Repeated revoke calls are idempotent no-ops and this non-secret write supports idempotency replay.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"api_keys","access":"write_revoke","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"responses":{"200":{"description":"API key revoked.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Idempotent-Replayed":{"$ref":"#\/components\/headers\/IdempotentReplayed"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKeyEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/webhooks":{"get":{"operationId":"listWebhooks","tags":["Webhooks"],"summary":"List webhook subscriptions","description":"Lists non-deleted team-level webhook subscriptions. Selected-project keys do not narrow this team infrastructure surface.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/Page"},{"$ref":"#\/components\/parameters\/PerPage"}],"responses":{"200":{"description":"Webhook subscription list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSubscriptionListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createWebhook","tags":["Webhooks"],"summary":"Create a webhook subscription","description":"Creates an enabled webhook subscription and returns its signing secret exactly once. This secret-issuing endpoint rejects Idempotency-Key.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"write_create","project_scope":"team_level_ignores_project_scope"},"x-svanja-non-replayable-secret":true,"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSubscriptionCreateRequest"}}}},"responses":{"201":{"description":"Webhook subscription created and signing secret issued once.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSubscriptionSecretEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/webhooks\/{webhook_id}\/deliveries":{"parameters":[{"$ref":"#\/components\/parameters\/WebhookSubscriptionPublicId"}],"get":{"operationId":"listWebhookDeliveries","tags":["Webhooks"],"summary":"List webhook deliveries","description":"Lists delivery records for one webhook subscription with signed cursor pagination. Cursor signatures are bound to filters that change result membership.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/PerPage"},{"$ref":"#\/components\/parameters\/WebhookDeliveryCursor"},{"$ref":"#\/components\/parameters\/WebhookDeliveryEventType"},{"$ref":"#\/components\/parameters\/WebhookDeliveryStatus"},{"$ref":"#\/components\/parameters\/WebhookDeliveryCreatedFrom"},{"$ref":"#\/components\/parameters\/WebhookDeliveryCreatedTo"}],"responses":{"200":{"description":"Webhook delivery list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookDeliveryListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/webhooks\/{webhook_id}\/rotate-secret":{"parameters":[{"$ref":"#\/components\/parameters\/WebhookSubscriptionPublicId"}],"post":{"operationId":"rotateWebhookSecret","tags":["Webhooks"],"summary":"Rotate a webhook signing secret","description":"Rotates the active signing secret and returns the replacement secret exactly once. This secret-issuing endpoint rejects Idempotency-Key. Named clients may opt into exact configuration review with the JSON confirm\/revision pair; a changed configuration returns 409. Empty-body legacy callers retain the original contract. Responses are private, no-store; never place the returned key in model history or logs.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"write_rotate_secret","project_scope":"team_level_ignores_project_scope"},"x-svanja-non-replayable-secret":true,"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"confirm":{"type":"boolean","const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"oneOf":[{"maxProperties":0},{"required":["confirm","revision"]}]}}}},"responses":{"200":{"description":"Webhook signing secret rotated and issued once.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSubscriptionSecretEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/webhooks\/{webhook_id}":{"parameters":[{"$ref":"#\/components\/parameters\/WebhookSubscriptionPublicId"}],"get":{"operationId":"getWebhook","tags":["Webhooks"],"summary":"Show a webhook subscription","description":"Shows one non-deleted webhook subscription by canonical whsub_ id. Missing, malformed, cross-team, and deleted subscriptions return the same not-found error after capability checks.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Webhook subscription found.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSubscriptionEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateWebhook","tags":["Webhooks"],"summary":"Update a webhook subscription","description":"Partially updates endpoint URL, event types, enabled state, name, and description from JSON body fields only. This non-secret write supports idempotency replay.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"write_update","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSubscriptionUpdateRequest"}}}},"responses":{"200":{"description":"Webhook subscription updated.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Idempotent-Replayed":{"$ref":"#\/components\/headers\/IdempotentReplayed"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSubscriptionEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"delete":{"operationId":"deleteWebhook","tags":["Webhooks"],"summary":"Delete a webhook subscription","description":"Revokes a webhook subscription, retires its signing secrets, and hides it from public reads. This non-secret write supports idempotency replay.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"write_delete","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"responses":{"200":{"description":"Webhook subscription deleted.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Idempotent-Replayed":{"$ref":"#\/components\/headers\/IdempotentReplayed"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSubscriptionDeleteEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/webhooks\/{webhook_id}\/commands\/update":{"parameters":[{"$ref":"#\/components\/parameters\/WebhookSubscriptionPublicId"}],"post":{"operationId":"updateReviewedWebhook","tags":["Webhooks"],"summary":"Confirm update of one exact reviewed webhook","description":"Uses current team webhook update capability. Read webhook detail for revision, then confirm exactly that configuration. Enabling or selecting new events authorizes external team-data forwarding; disabling pauses unsent deliveries, deletion cancels unsent deliveries and removes recoverable credentials but retains diagnostic history. In-flight HTTP cannot be recalled. Destination URL and signing-secret changes use the separate secret-once human\/API handoff. No provider HTTP occurs in this local configuration transaction. Current key, capability and plan are checked before cached replay and before commit; changed configuration returns conflict. Never silently refresh a stale approval.","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[!-~]+$"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"type":"boolean","const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":["string","null"],"maxLength":1000},"event_types":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"items":{"$ref":"#\/components\/schemas\/WebhookEventType"}}}}}}},"responses":{"200":{"description":"Redacted configuration receipt.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","operation","status","changes_applied"],"properties":{"id":{"type":"string","pattern":"^whsub_[0-9A-HJKMNP-TV-Z]{26}$"},"operation":{"const":"webhook_update"},"status":{"enum":["enabled","disabled"]},"changes_applied":{"const":true}}}}}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/webhooks\/{webhook_id}\/commands\/enable":{"parameters":[{"$ref":"#\/components\/parameters\/WebhookSubscriptionPublicId"}],"post":{"operationId":"enableReviewedWebhook","tags":["Webhooks"],"summary":"Confirm enable of one exact reviewed webhook","description":"Uses current team webhook update capability. Read webhook detail for revision, then confirm exactly that configuration. Enabling or selecting new events authorizes external team-data forwarding; disabling pauses unsent deliveries, deletion cancels unsent deliveries and removes recoverable credentials but retains diagnostic history. In-flight HTTP cannot be recalled. Destination URL and signing-secret changes use the separate secret-once human\/API handoff. No provider HTTP occurs in this local configuration transaction. Current key, capability and plan are checked before cached replay and before commit; changed configuration returns conflict. Never silently refresh a stale approval.","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[!-~]+$"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"type":"boolean","const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}},"responses":{"200":{"description":"Redacted configuration receipt.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","operation","status","changes_applied"],"properties":{"id":{"type":"string","pattern":"^whsub_[0-9A-HJKMNP-TV-Z]{26}$"},"operation":{"const":"webhook_enable"},"status":{"enum":["enabled"]},"changes_applied":{"const":true}}}}}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/webhooks\/{webhook_id}\/commands\/disable":{"parameters":[{"$ref":"#\/components\/parameters\/WebhookSubscriptionPublicId"}],"post":{"operationId":"disableReviewedWebhook","tags":["Webhooks"],"summary":"Confirm disable of one exact reviewed webhook","description":"Uses current team webhook update capability. Read webhook detail for revision, then confirm exactly that configuration. Enabling or selecting new events authorizes external team-data forwarding; disabling pauses unsent deliveries, deletion cancels unsent deliveries and removes recoverable credentials but retains diagnostic history. In-flight HTTP cannot be recalled. Destination URL and signing-secret changes use the separate secret-once human\/API handoff. No provider HTTP occurs in this local configuration transaction. Current key, capability and plan are checked before cached replay and before commit; changed configuration returns conflict. Never silently refresh a stale approval.","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[!-~]+$"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"type":"boolean","const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}},"responses":{"200":{"description":"Redacted configuration receipt.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","operation","status","changes_applied"],"properties":{"id":{"type":"string","pattern":"^whsub_[0-9A-HJKMNP-TV-Z]{26}$"},"operation":{"const":"webhook_disable"},"status":{"enum":["disabled"]},"changes_applied":{"const":true}}}}}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/webhooks\/{webhook_id}\/commands\/delete":{"parameters":[{"$ref":"#\/components\/parameters\/WebhookSubscriptionPublicId"}],"post":{"operationId":"deleteReviewedWebhook","tags":["Webhooks"],"summary":"Confirm delete of one exact reviewed webhook","description":"Uses current team webhook delete capability. Read webhook detail for revision, then confirm exactly that configuration. Enabling or selecting new events authorizes external team-data forwarding; disabling pauses unsent deliveries, deletion cancels unsent deliveries and removes recoverable credentials but retains diagnostic history. In-flight HTTP cannot be recalled. Destination URL and signing-secret changes use the separate secret-once human\/API handoff. No provider HTTP occurs in this local configuration transaction. Current key, capability and plan are checked before cached replay and before commit; changed configuration returns conflict. Never silently refresh a stale approval.","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[!-~]+$"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"type":"boolean","const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}},"responses":{"200":{"description":"Redacted configuration receipt.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","operation","status","changes_applied"],"properties":{"id":{"type":"string","pattern":"^whsub_[0-9A-HJKMNP-TV-Z]{26}$"},"operation":{"const":"webhook_delete"},"status":{"enum":["deleted"]},"changes_applied":{"const":true}}}}}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/webhook-deliveries\/{delivery_id}\/retry":{"parameters":[{"$ref":"#\/components\/parameters\/WebhookDeliveryPublicId"}],"post":{"operationId":"retryWebhookDelivery","tags":["Webhooks"],"summary":"Confirm one retry of an exact webhook delivery","description":"Requires current api:webhooks:update authority and an enabled Mail webhook feature and plan. Read delivery detail for its exact revision, then send confirm=true and an Idempotency-Key. The revision binds the event payload, attempt state and destination configuration. A retry may duplicate an event already accepted by the receiver; receivers must deduplicate event IDs. This reuses the existing delivery ledger, preserves attempt history and leases before after-commit dispatch. Active or uncertain in-flight attempts cannot be displaced. queued or waiting_capacity acknowledges scheduling, NOT successful HTTP delivery. Inspect delivery detail for the actual outcome. Cached responses require current key authority and feature\/plan availability; no secret is returned.","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[!-~]+$"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"type":"boolean","const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}},"responses":{"200":{"description":"Retry scheduling receipt, not a delivery success claim.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","operation","status","delivery_completed","event_id","attempt_count"],"properties":{"id":{"type":"string","pattern":"^dlv_[0-9A-HJKMNP-TV-Z]{26}$"},"operation":{"const":"webhook_delivery_retry"},"status":{"enum":["queued","waiting_capacity"]},"delivery_completed":{"const":false},"event_id":{"type":"string","pattern":"^evt_[0-9A-HJKMNP-TV-Z]{26}$"},"attempt_count":{"type":"integer","minimum":0}}}}}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/webhook-deliveries\/{delivery_id}":{"parameters":[{"$ref":"#\/components\/parameters\/WebhookDeliveryPublicId"}],"get":{"operationId":"getWebhookDelivery","tags":["Webhooks"],"summary":"Show webhook delivery diagnostics","description":"Shows one webhook delivery by canonical dlv_ id. Diagnostics are redacted: full endpoint URLs, query strings, signing secrets, signature values, encrypted columns, claim tokens, and internal ids are not exposed.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"webhooks","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Webhook delivery found.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookDeliveryDetailEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/team\/members":{"get":{"operationId":"listTeamMembers","tags":["Team"],"summary":"List team members","description":"Lists active team members for the authenticated team. The owner appears first with the owner role, followed by active pivot members ordered by join time. Removed and soft-deleted users are excluded.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"team","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/Page"},{"$ref":"#\/components\/parameters\/PerPage"}],"responses":{"200":{"description":"Team member list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TeamMemberListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/team\/members\/{member}":{"parameters":[{"$ref":"#\/components\/parameters\/TeamMemberPublicId"}],"get":{"operationId":"getTeamMember","tags":["Team"],"summary":"Show a team member","description":"Shows one active team member by public user ID. Missing, malformed, cross-team, removed, and soft-deleted users return the same public not-found error once the key has Team read access.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"team","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Team member found.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TeamMemberEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/team\/invitations":{"get":{"operationId":"listTeamInvitations","tags":["Team"],"summary":"List pending team invitations","description":"Lists non-deleted pending invitations for the authenticated team, ordered newest first with id as a stable tie-breaker.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"team","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"},{"$ref":"#\/components\/parameters\/Page"},{"$ref":"#\/components\/parameters\/PerPage"}],"responses":{"200":{"description":"Team invitation list.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TeamInvitationListEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/team\/invitations\/{invitation}":{"parameters":[{"$ref":"#\/components\/parameters\/TeamInvitationPublicId"}],"get":{"operationId":"getTeamInvitation","tags":["Team"],"summary":"Show a pending team invitation","description":"Shows one pending team invitation by public invitation ID. Missing, malformed, cross-team, and deleted invitations return the same public not-found error once the key has Team read access.\n","security":[{"bearerAuth":[]}],"x-capability":{"group":"team","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"Team invitation found.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TeamInvitationEnvelope"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/cli-auth\/discovery":{"get":{"operationId":"discoverCliDeviceAuthorization","tags":["CLI Auth"],"summary":"Discover CLI device authorization settings","description":"Returns stable feature status and endpoint metadata for first-party CLI login. This endpoint intentionally runs before a bearer key exists.\n","security":[],"x-capability":{"group":"cli_auth","access":"unauthenticated","project_scope":"not_applicable"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"responses":{"200":{"description":"CLI auth discovery state.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CliDiscoveryEnvelope"}}}},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/cli-auth\/device":{"post":{"operationId":"createCliDeviceAuthorization","tags":["CLI Auth"],"summary":"Create a CLI device authorization request","description":"Creates a short-lived browser authorization request and returns the plaintext device code once. CLI metadata is optional and sanitized.\n","security":[],"x-capability":{"group":"cli_auth","access":"unauthenticated","project_scope":"not_applicable"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CliDeviceRequest"}}}},"responses":{"200":{"description":"Device authorization created.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CliDeviceEnvelope"}}}},"400":{"$ref":"#\/components\/responses\/MalformedJson"},"404":{"$ref":"#\/components\/responses\/RouteNotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/cli-auth\/token":{"post":{"operationId":"pollCliDeviceAuthorization","tags":["CLI Auth"],"summary":"Poll for CLI device authorization completion","description":"Polls a pending device authorization request. It returns an issued API key once after browser approval, or a public polling error while the request is pending, denied, expired, invalid, unsupported, or too fast.\n","security":[],"x-capability":{"group":"cli_auth","access":"unauthenticated","project_scope":"not_applicable"},"parameters":[{"$ref":"#\/components\/parameters\/AcceptLanguage"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CliTokenRequest"}}}},"responses":{"200":{"description":"API key issued.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CliIssuedTokenEnvelope"}}}},"400":{"description":"Polling outcome or malformed polling request.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CliTokenPollingErrorEnvelope"}}}},"404":{"$ref":"#\/components\/responses\/RouteNotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"description":"Polling too quickly or rate limited.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"},"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CliTokenPollingErrorEnvelope"}}}}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/folders":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"}],"get":{"operationId":"listMailProviderFolders","tags":["Mail"],"summary":"List delegated provider folders","description":"Requires explicit folders read approval and current mailbox content access. Full\/read-only presets do not grant this capability. Folder names are private content. Command reads are restricted to the original key and member. Polling reconciles durable positive provider evidence only; it never repeats a provider mutation.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_folders","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Current private folder projection.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailProviderFolder"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createMailProviderFolder","tags":["Mail"],"summary":"Create a confirmed provider folder","description":"Requires explicit folders write approval, interactive mail and current mailbox-management permission and current mailbox content access. Full\/read-only presets do not grant this capability. Requires JSON confirm=true and the exact reviewed revision. Provider IO is outside generic replay transactions. Preserve the idempotency key; identical retries return the same receipt without repeating the provider mutation. An unresolved result must not be retried with a new key. Physical folder deletion requires proven empty and childless state; special-use folders are protected.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_folders","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailProviderFolderCreate"}}}},"responses":{"200":{"description":"Pollable receipt. A 202 or unresolved state is not proof of failure or permission to repeat the mutation.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailProviderCommand"}}}}}},"202":{"description":"Pollable receipt. A 202 or unresolved state is not proof of failure or permission to repeat the mutation.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailProviderCommand"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/folders\/capabilities":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"}],"get":{"operationId":"getMailProviderFolderCapabilities","tags":["Mail"],"summary":"Read folder capabilities and creation revision","description":"Requires explicit folders read approval and current mailbox content access. Full\/read-only presets do not grant this capability. Folder names are private content. Command reads are restricted to the original key and member. Polling reconciles durable positive provider evidence only; it never repeats a provider mutation.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_folders","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"description":"Current private folder projection.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailProviderFolderCapabilities"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/folders\/{folder_id}":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"folder_id","in":"path","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"get":{"operationId":"getMailProviderFolder","tags":["Mail"],"summary":"Read a folder and its current revision","description":"Requires explicit folders read approval and current mailbox content access. Full\/read-only presets do not grant this capability. Folder names are private content. Command reads are restricted to the original key and member. Polling reconciles durable positive provider evidence only; it never repeats a provider mutation.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_folders","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"description":"Current private folder projection.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailProviderFolder"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"renameMailProviderFolder","tags":["Mail"],"summary":"Rename a confirmed provider folder","description":"Requires explicit folders write approval, interactive mail and current mailbox-management permission and current mailbox content access. Full\/read-only presets do not grant this capability. Requires JSON confirm=true and the exact reviewed revision. Provider IO is outside generic replay transactions. Preserve the idempotency key; identical retries return the same receipt without repeating the provider mutation. An unresolved result must not be retried with a new key. Physical folder deletion requires proven empty and childless state; special-use folders are protected.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_folders","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailProviderFolderRename"}}}},"responses":{"200":{"description":"Pollable receipt. A 202 or unresolved state is not proof of failure or permission to repeat the mutation.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailProviderCommand"}}}}}},"202":{"description":"Pollable receipt. A 202 or unresolved state is not proof of failure or permission to repeat the mutation.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailProviderCommand"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"delete":{"operationId":"deleteMailProviderFolder","tags":["Mail"],"summary":"Delete a confirmed mutable provider folder","description":"Requires explicit folders write approval, interactive mail and current mailbox-management permission and current mailbox content access. Full\/read-only presets do not grant this capability. Requires JSON confirm=true and the exact reviewed revision. Provider IO is outside generic replay transactions. Preserve the idempotency key; identical retries return the same receipt without repeating the provider mutation. An unresolved result must not be retried with a new key. Physical folder deletion requires proven empty and childless state; special-use folders are protected.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_folders","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailProviderFolderDelete"}}}},"responses":{"200":{"description":"Pollable receipt. A 202 or unresolved state is not proof of failure or permission to repeat the mutation.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailProviderCommand"}}}}}},"202":{"description":"Pollable receipt. A 202 or unresolved state is not proof of failure or permission to repeat the mutation.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailProviderCommand"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/folder-commands\/{command_id}":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"command_id","in":"path","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"get":{"operationId":"getMailProviderFolderCommand","tags":["Mail"],"summary":"Inspect this key's folder command without resubmitting","description":"Requires explicit folders read approval and current mailbox content access. Full\/read-only presets do not grant this capability. Folder names are private content. Command reads are restricted to the original key and member. Polling reconciles durable positive provider evidence only; it never repeats a provider mutation.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_folders","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"description":"Pollable receipt. A 202 or unresolved state is not proof of failure or permission to repeat the mutation.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailProviderCommand"}}}}}},"202":{"description":"Pollable receipt. A 202 or unresolved state is not proof of failure or permission to repeat the mutation.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailProviderCommand"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/messages\/{message_id}\/state":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"message_id","in":"path","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"get":{"operationId":"getMailMessageState","tags":["Mail"],"summary":"Read delegated message flags and placements","description":"Requires explicit message_state read consent and current content grants. This capability never sends email and does not require folder-management rights. Reviewed writes require JSON confirm=true, a current revision and an Idempotency-Key. Placement actions require an explicit source folder; permanent deletion requires Trash. Provider IO runs outside replay transactions. Preserve the same key for retries. Unknown outcomes are not resubmitted; a positive provider response is retained before local projection.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_message_state","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"description":"Private current state or durable receipt. Unresolved is not permission to repeat. Provider acceptance and local projection are separate.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailMessageState"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"updateMailMessageState","tags":["Mail"],"summary":"Apply one confirmed revision-bound provider message action","description":"Requires explicit message_state write consent and current content grants. This capability never sends email and does not require folder-management rights. Reviewed writes require JSON confirm=true, a current revision and an Idempotency-Key. Placement actions require an explicit source folder; permanent deletion requires Trash. Provider IO runs outside replay transactions. Preserve the same key for retries. Unknown outcomes are not resubmitted; a positive provider response is retained before local projection.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_message_state","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailMessageStateChange"}}}},"responses":{"200":{"description":"Private current state or durable receipt. Unresolved is not permission to repeat. Provider acceptance and local projection are separate.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailMessageCommand"}}}}}},"202":{"description":"Private current state or durable receipt. Unresolved is not permission to repeat. Provider acceptance and local projection are separate.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailMessageCommand"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"},"503":{"$ref":"#\/components\/responses\/MailProviderUnavailable"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/message-batches":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"}],"post":{"operationId":"createMailMessageBatch","tags":["Mail"],"summary":"createMailMessageBatch","description":"Explicit message_state write consent and current content grants required. Four exact revision-bound messages maximum; configured provider-call budget must fit 150 seconds. A new key never resumes unknown work. No email is sent.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_message_state","access":"write","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"description":"Exact per-item outcomes. Partial, unresolved and not_run are not success; reads and replays never resume the loop.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailMessageBatch"}}}}}},"202":{"description":"Exact per-item outcomes. Partial, unresolved and not_run are not success; reads and replays never resume the loop.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailMessageBatch"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailMessageBatchManifest"}}}}},"get":{"operationId":"listMailMessageBatches","tags":["Mail"],"summary":"listMailMessageBatches","description":"Explicit message_state read consent and current content grants required. Four exact revision-bound messages maximum; configured provider-call budget must fit 150 seconds. A new key never resumes unknown work. No email is sent.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_message_state","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"description":"Exact per-item outcomes. Partial, unresolved and not_run are not success; reads and replays never resume the loop.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailMessageBatch"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}]}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/message-batches\/{batch_id}":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"get":{"operationId":"getMailMessageBatch","tags":["Mail"],"summary":"getMailMessageBatch","description":"Explicit message_state read consent and current content grants required. Four exact revision-bound messages maximum; configured provider-call budget must fit 150 seconds. A new key never resumes unknown work. No email is sent.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_message_state","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"description":"Exact per-item outcomes. Partial, unresolved and not_run are not success; reads and replays never resume the loop.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailMessageBatch"}}}}}},"202":{"description":"Exact per-item outcomes. Partial, unresolved and not_run are not success; reads and replays never resume the loop.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailMessageBatch"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/message-commands":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"}],"get":{"operationId":"listMailMessageCommands","tags":["Mail"],"summary":"List this key\u2019s message command receipts","description":"Requires explicit message_state read consent and current content grants. This capability never sends email and does not require folder-management rights. Reviewed writes require JSON confirm=true, a current revision and an Idempotency-Key. Placement actions require an explicit source folder; permanent deletion requires Trash. Provider IO runs outside replay transactions. Preserve the same key for retries. Unknown outcomes are not resubmitted; a positive provider response is retained before local projection.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_message_state","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Private current state or durable receipt. Unresolved is not permission to repeat. Provider acceptance and local projection are separate.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailMessageCommand"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/message-commands\/{command_id}":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"command_id","in":"path","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"get":{"operationId":"getMailMessageCommand","tags":["Mail"],"summary":"Inspect a provider message command without resubmitting","description":"Requires explicit message_state read consent and current content grants. This capability never sends email and does not require folder-management rights. Reviewed writes require JSON confirm=true, a current revision and an Idempotency-Key. Placement actions require an explicit source folder; permanent deletion requires Trash. Provider IO runs outside replay transactions. Preserve the same key for retries. Unknown outcomes are not resubmitted; a positive provider response is retained before local projection.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_message_state","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"description":"Private current state or durable receipt. Unresolved is not permission to repeat. Provider acceptance and local projection are separate.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailMessageCommand"}}}}}},"202":{"description":"Private current state or durable receipt. Unresolved is not permission to repeat. Provider acceptance and local projection are separate.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"Cache-Control":{"schema":{"type":"string"},"description":"private, no-store"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailMessageCommand"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/messages\/{message_id}\/follow-up-source":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"message_id","in":"path","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"get":{"operationId":"getMailFollowUpSource","tags":["Mail"],"summary":"Read the revision needed to create future follow-ups","description":"Requires explicit followups read approval and current content access to the approved mailbox. Full step bodies and visible targets are content-granted data. No provider IDs or run metadata are returned. Source discovery additionally requires the selected sender grant.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_followups","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"persona_id","in":"query","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"responses":{"200":{"description":"Current public follow-up projection","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailFollowUpSource"}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/messages\/{message_id}\/follow-ups":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"message_id","in":"path","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"get":{"operationId":"listMailFollowUps","tags":["Mail"],"summary":"List follow-ups attached to this message","description":"Requires explicit followups read approval and current content access to the approved mailbox. Full step bodies and visible targets are content-granted data. No provider IDs or run metadata are returned. Source discovery additionally requires the selected sender grant.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_followups","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Current public follow-up projection","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailFollowUpSequence"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"post":{"operationId":"createMailFollowUp","tags":["Mail"],"summary":"Approve and create future follow-up emails","description":"Requires explicit followups write approval and a stable retry key. Create, step replacement, resume, reschedule and takeover also require outbound write approval and a current sender grant. Commands bind exact revisions and arming commands require JSON true confirmation. Existing API authority is rechecked except during explicit takeover. Pause, cancel and target removal never transfer sending authority. Workers recheck the bound real key; withdrawal, expiry, removal or rotation blocks unsent work. Takeover does not resume and is unavailable during delivery or after a submitted follow-up. No provider call occurs in these local transactions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_followups","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailFollowUpCreate"}}}},"responses":{"201":{"description":"Current public follow-up projection","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailFollowUpSequence"}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/follow-ups\/{sequence_id}":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"get":{"operationId":"getMailFollowUp","tags":["Mail"],"summary":"Read full content and current sending authority","description":"Requires explicit followups read approval and current content access to the approved mailbox. Full step bodies and visible targets are content-granted data. No provider IDs or run metadata are returned. Source discovery additionally requires the selected sender grant.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_followups","access":"read","project_scope":"team_level_ignores_project_scope"},"responses":{"200":{"description":"Current public follow-up projection","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailFollowUpSequence"}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"patch":{"operationId":"updateMailFollowUp","tags":["Mail"],"summary":"Replace follow-up steps before evaluation has begun","description":"Requires explicit followups write approval and a stable retry key. Create, step replacement, resume, reschedule and takeover also require outbound write approval and a current sender grant. Commands bind exact revisions and arming commands require JSON true confirmation. Existing API authority is rechecked except during explicit takeover. Pause, cancel and target removal never transfer sending authority. Workers recheck the bound real key; withdrawal, expiry, removal or rotation blocks unsent work. Takeover does not resume and is unavailable during delivery or after a submitted follow-up. No provider call occurs in these local transactions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_followups","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailFollowUpUpdate"}}}},"responses":{"200":{"description":"Current public follow-up projection","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailFollowUpSequence"}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/follow-ups\/{sequence_id}\/runs":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"get":{"operationId":"listMailFollowUpRuns","tags":["Mail"],"summary":"Read follow-up delivery history without provider internals","description":"Requires explicit followups read approval and current content access to the approved mailbox. Full step bodies and visible targets are content-granted data. No provider IDs or run metadata are returned. Source discovery additionally requires the selected sender grant.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_followups","access":"read","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Current public follow-up projection","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailFollowUpRun"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#\/components\/schemas\/MailFollowUpPagination"}}}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/mail\/mailboxes\/{mailbox_id}\/follow-ups\/{sequence_id}\/actions":{"parameters":[{"$ref":"#\/components\/parameters\/MailMailboxPublicId"},{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","minLength":26,"maxLength":26}}],"post":{"operationId":"actOnMailFollowUp","tags":["Mail"],"summary":"Pause resume cancel reschedule remove a target or explicitly take over sending","description":"Requires explicit followups write approval and a stable retry key. Create, step replacement, resume, reschedule and takeover also require outbound write approval and a current sender grant. Commands bind exact revisions and arming commands require JSON true confirmation. Existing API authority is rechecked except during explicit takeover. Pause, cancel and target removal never transfer sending authority. Workers recheck the bound real key; withdrawal, expiry, removal or rotation blocks unsent work. Takeover does not resume and is unavailable during delivery or after a submitted follow-up. No provider call occurs in these local transactions.","security":[{"bearerAuth":[]}],"x-capability":{"group":"mail_followups","access":"write","project_scope":"team_level_ignores_project_scope"},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MailFollowUpAction"}}}},"responses":{"200":{"description":"Current public follow-up projection","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailFollowUpSequence"}}}}}},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"409":{"$ref":"#\/components\/responses\/Conflict"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/api\/v1\/authorization-requests":{"post":{"operationId":"createAuthorizationRequest","tags":["Identity"],"summary":"Create a human authorization request","description":"Prepare an operation that requires human approval using the same target resolution as execution. Supply input.id for an existing resource and input.action when choosing among actions. Other input fields are the intended execution body. The server binds current target versions; caller-supplied _target is ignored. After browser approval, execute the matching route\/body with authorization_request_id before expires_at. Approval is bound to this API key and visibility user. Changed targets or inputs require new approval. Operations without an action handoff return validation_failed.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["operation","input"],"properties":{"operation":{"type":"string"},"family":{"type":"string","description":"Optional compatibility hint; the operation determines the family."},"input":{"type":"object","additionalProperties":true},"message":{"type":"string","maxLength":1000}}},"example":{"operation":"rule.enable","input":{"id":"01EXAMPLE000000000000000000","action":"enable"}}}}},"responses":{"202":{"description":"Authorization request created."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/authorization-requests\/{authorization_request}":{"get":{"operationId":"getAuthorizationRequest","tags":["Identity"],"summary":"Read a human authorization request","security":[{"bearerAuth":[]}],"parameters":[{"name":"authorization_request","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Authorization request status."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/tools":{"get":{"operationId":"listTools","tags":["Tools"],"summary":"List tool packages","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Tool packages."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"saveTool","tags":["Tools"],"summary":"Save a tool package","security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Tool package saved."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/tools\/{id}":{"get":{"operationId":"getTool","tags":["Tools"],"summary":"Read a tool package","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Tool package."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateTool","tags":["Tools"],"summary":"Update a tool package","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Tool package updated."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/tools\/{id}\/actions":{"post":{"operationId":"runToolAction","tags":["Tools"],"summary":"Run or verify a tool package","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Tool action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/templates":{"get":{"operationId":"listTemplates","tags":["Templates"],"summary":"List templates","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Templates."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"runTemplateCollectionAction","tags":["Templates"],"summary":"Add or import templates","security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Template action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/templates\/{id}":{"get":{"operationId":"getTemplate","tags":["Templates"],"summary":"Read a template","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Template."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateTemplate","tags":["Templates"],"summary":"Update a template","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Template updated."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/templates\/{id}\/actions":{"post":{"operationId":"runTemplateAction","tags":["Templates"],"summary":"Render a template","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Template action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/rules":{"get":{"operationId":"listRules","tags":["Rules"],"summary":"List Rules","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Rules."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createRuleDraft","tags":["Rules"],"summary":"Create a Rule draft","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Rule draft created."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/rules\/{id}":{"get":{"operationId":"getRule","tags":["Rules"],"summary":"Read a Rule","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Rule."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateRuleDraft","tags":["Rules"],"summary":"Update a Rule draft","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Rule draft updated."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/rules\/{id}\/actions":{"post":{"operationId":"runRuleAction","tags":["Rules"],"summary":"Run a Rule lifecycle action","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Rule action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/rules\/{id}\/tests":{"post":{"operationId":"testRule","tags":["Rules"],"summary":"Test a Rule","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Rule test accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/connections":{"get":{"operationId":"listConnections","tags":["Connections"],"summary":"List provider connections","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Connections."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"connectProvider","tags":["Connections"],"summary":"Start provider connection handoff","security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Connection handoff accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/connections\/{id}":{"get":{"operationId":"getConnection","tags":["Connections"],"summary":"Read a provider connection","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Connection."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateConnection","tags":["Connections"],"summary":"Update provider connection settings","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Connection updated."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/connections\/{id}\/actions":{"post":{"operationId":"runConnectionAction","tags":["Connections"],"summary":"Run a provider connection action","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Connection action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/computers":{"get":{"operationId":"listComputers","tags":["Computers"],"summary":"List computers","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Computers."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"pairRunner","tags":["Computers"],"summary":"Pair a runner","security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Runner pairing handoff accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/computers\/{id}":{"get":{"operationId":"getComputer","tags":["Computers"],"summary":"Read a computer","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Computer."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateComputer","tags":["Computers"],"summary":"Update a computer","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Computer updated."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/computers\/{id}\/actions":{"post":{"operationId":"runComputerAction","tags":["Computers"],"summary":"Run a computer action","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Computer action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/artifacts":{"get":{"operationId":"listArtifacts","tags":["Artifacts"],"summary":"List artifacts","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Artifacts."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"createArtifactAction","tags":["Artifacts"],"summary":"Run an artifact collection action","security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Artifact action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/artifacts\/{id}":{"get":{"operationId":"getArtifact","tags":["Artifacts"],"summary":"Read an artifact","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Artifact."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateArtifact","tags":["Artifacts"],"summary":"Update an artifact","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Artifact updated."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/artifacts\/{id}\/actions":{"post":{"operationId":"runArtifactAction","tags":["Artifacts"],"summary":"Run an artifact action","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Artifact action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/publications":{"get":{"operationId":"listPublications","tags":["Publications"],"summary":"List publications","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Publications."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"publishContent","tags":["Publications"],"summary":"Publish content","security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Publication action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/publications\/{id}":{"get":{"operationId":"getPublication","tags":["Publications"],"summary":"Read a publication","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Publication."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updatePublication","tags":["Publications"],"summary":"Update a publication","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Publication updated."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/publications\/{id}\/actions":{"post":{"operationId":"runPublicationAction","tags":["Publications"],"summary":"Run a publication action","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Publication action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/channels":{"get":{"operationId":"listChannels","tags":["Channels"],"summary":"List channel status","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Channels."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"post":{"operationId":"linkChannel","tags":["Channels"],"summary":"Start a channel action","security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Channel action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/channels\/{id}":{"get":{"operationId":"getChannel","tags":["Channels"],"summary":"Read a channel link","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Channel."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}},"patch":{"operationId":"updateChannel","tags":["Channels"],"summary":"Update channel preferences","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Channel updated."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}},"\/api\/v1\/channels\/{id}\/actions":{"post":{"operationId":"runChannelAction","tags":["Channels"],"summary":"Run a channel action","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Channel action accepted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"},"429":{"$ref":"#\/components\/responses\/RateLimited"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Team API key id|secret","description":"Send the full one-time plaintext API key value as Authorization: Bearer id|secret. Protect both the full value and the secret after the pipe.\n"}},"headers":{"XRequestId":{"description":"UUID v4 request identifier. Error bodies repeat this value as request_id.","schema":{"type":"string","format":"uuid"}},"XRateLimitLimit":{"description":"Maximum requests in the active rate-limit window.","schema":{"type":"integer","minimum":0}},"XRateLimitRemaining":{"description":"Remaining requests in the active rate-limit window.","schema":{"type":"integer","minimum":0}},"XRateLimitReset":{"description":"Unix epoch second when the active rate-limit window resets.","schema":{"type":"integer","minimum":0}},"RetryAfter":{"description":"Seconds to wait before retrying after a rate-limit or CLI polling cadence response.","schema":{"type":"integer","minimum":1}},"IdempotentReplayed":{"description":"Present with value true when an unsafe bearer write is replayed from a stored idempotency response.","schema":{"type":"string","const":"true"}}},"parameters":{"MailMessagePublicId":{"name":"message_id","in":"path","required":true,"description":"Opaque public message identity, scoped to the selected mailbox.","schema":{"type":"string"}},"AcceptLanguage":{"name":"Accept-Language","in":"header","required":false,"description":"Preferred response language for public messages and descriptions.","schema":{"type":"string","example":"de"}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional key for unsafe bearer writes. Reusing the same key and same canonical body replays the original response for 24 hours; reusing it with a different body returns idempotency_conflict.\n","schema":{"type":"string","minLength":1,"maxLength":255}},"Page":{"name":"page","in":"query","required":false,"description":"Page number. Defaults to 1.","schema":{"type":"integer","minimum":1,"default":1}},"PerPage":{"name":"per_page","in":"query","required":false,"description":"Page size. Defaults to 25 and is capped at 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},"ProjectStatusFilter":{"name":"status","in":"query","required":false,"description":"Filter projects by status.","schema":{"$ref":"#\/components\/schemas\/ProjectStatus"}},"ProjectSearch":{"name":"q","in":"query","required":false,"description":"Search project name and description.","schema":{"type":"string","maxLength":255}},"ProjectSort":{"name":"sort","in":"query","required":false,"description":"Sort projects. A leading dash means descending.","schema":{"type":"string","enum":["created_at","-created_at","updated_at","-updated_at","name","-name","status","-status"],"default":"-created_at"}},"ProjectPublicId":{"name":"project","in":"path","required":true,"description":"Project public ULID. This is not the legacy numeric project id.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","example":"01HY9Y8A7B6C5D4E3F2G1H0J9K"}},"TaskPublicId":{"name":"task","in":"path","required":true,"description":"Task public ULID.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","example":"01HY9Y8A7B6C5D4E3F2G1H0J9K"}},"SpacePublicId":{"name":"space","in":"path","required":true,"description":"Space public ULID or slug.","schema":{"type":"string","maxLength":255,"example":"01HY9Y8A7B6C5D4E3F2G1H0J9K"}},"TaskStatusFilter":{"name":"status","in":"query","required":false,"description":"Filter tasks by status.","schema":{"type":"string","enum":["queued","running","waiting","paused","cancelling","completed","failed","cancelled"]}},"ApiKeyPublicId":{"name":"apiKey","in":"path","required":true,"description":"API key display id in ak_<ULID> form. This is not the internal numeric token row id.","schema":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$","example":"ak_01HY9Y8A7B6C5D4E3F2G1H0J9K"}},"WebhookSubscriptionPublicId":{"name":"webhook_id","in":"path","required":true,"description":"Webhook subscription id in whsub_<ULID> form.","schema":{"type":"string","pattern":"^whsub_[0-9A-HJKMNP-TV-Z]{26}$","example":"whsub_01HY9Y8A7B6C5D4E3F2G1H0J9K"}},"WebhookDeliveryPublicId":{"name":"delivery_id","in":"path","required":true,"description":"Webhook delivery id in dlv_<ULID> form.","schema":{"type":"string","pattern":"^dlv_[0-9A-HJKMNP-TV-Z]{26}$","example":"dlv_01HY9Y8A7B6C5D4E3F2G1H0J9K"}},"TeamMemberPublicId":{"name":"member","in":"path","required":true,"description":"Team member public user ULID. This is not the legacy numeric user id.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","example":"01HY9Y8A7B6C5D4E3F2G1H0J9K"}},"TeamInvitationPublicId":{"name":"invitation","in":"path","required":true,"description":"Team invitation public ULID. This is not the legacy numeric invitation id.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","example":"01HY9Y8A7B6C5D4E3F2G1H0J9K"}},"CreditTransactionType":{"name":"type","in":"query","required":false,"description":"Public credit transaction type.","schema":{"$ref":"#\/components\/schemas\/CreditTransactionType"}},"CreditCreatedFrom":{"name":"created_from","in":"query","required":false,"description":"Inclusive created_at lower bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1779368400}},"CreditCreatedTo":{"name":"created_to","in":"query","required":false,"description":"Inclusive created_at upper bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1779368400}},"CreditTransactionSort":{"name":"sort","in":"query","required":false,"description":"Sort credit transactions by creation time.","schema":{"type":"string","enum":["created_at","-created_at"],"default":"-created_at"}},"ActivityCursor":{"name":"cursor","in":"query","required":false,"description":"Signed cursor returned by the previous activity page.","schema":{"type":"string","maxLength":2048}},"ActivitySort":{"name":"sort","in":"query","required":false,"description":"Sort activity by occurrence time. A leading dash means descending.","schema":{"type":"string","enum":["occurred_at","-occurred_at"],"default":"-occurred_at"}},"ActivityResourceType":{"name":"resource_type","in":"query","required":false,"description":"Filter activity by public resource family.","schema":{"$ref":"#\/components\/schemas\/ActivityResourceType"}},"ActivityResourceId":{"name":"resource_id","in":"query","required":false,"description":"Public resource id. When resource_type is present, the id must match that resource family's public id shape.\n","schema":{"type":"string","maxLength":80}},"ActivityActorKeyId":{"name":"actor_key_id","in":"query","required":false,"description":"API key display id for key-originated activity.","schema":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$"}},"ActivityActorUserId":{"name":"actor_user_id","in":"query","required":false,"description":"Public user ULID for user-originated activity.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"ActivityEventType":{"name":"event_type","in":"query","required":false,"description":"Public activity event identifier.","schema":{"$ref":"#\/components\/schemas\/ActivityEventType"}},"ActivityCreatedFrom":{"name":"created_from","in":"query","required":false,"description":"Inclusive occurred_at lower bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1783591200}},"ActivityCreatedTo":{"name":"created_to","in":"query","required":false,"description":"Inclusive occurred_at upper bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1783591200}},"AssistantChatPublicId":{"name":"chat_id","in":"path","required":true,"description":"Assistant chat public ULID. This is not the internal numeric chat id.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"AssistantRunPublicId":{"name":"run_id","in":"path","required":true,"description":"Assistant run public ULID. This is not the internal numeric run id.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"AssistantChatCursor":{"name":"cursor","in":"query","required":false,"description":"Signed cursor returned by the previous assistant chat page.","schema":{"type":"string","maxLength":2048}},"AssistantRunCursor":{"name":"cursor","in":"query","required":false,"description":"Signed cursor returned by the previous assistant run page.","schema":{"type":"string","maxLength":2048}},"AssistantChatStatus":{"name":"status","in":"query","required":false,"description":"Filter assistant chats by archive state.","schema":{"type":"string","enum":["active","archived","all"],"default":"active"}},"AssistantRunChatId":{"name":"chat_id","in":"query","required":false,"description":"Filter runs to one assistant chat public ULID.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"AssistantRunStatus":{"name":"status","in":"query","required":false,"description":"Filter assistant runs by status.","schema":{"$ref":"#\/components\/schemas\/AssistantRunStatus"}},"AssistantCreatedFrom":{"name":"created_from","in":"query","required":false,"description":"Inclusive created_at lower bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1783591200}},"AssistantCreatedTo":{"name":"created_to","in":"query","required":false,"description":"Inclusive created_at upper bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1783591200}},"MailMailboxPublicId":{"name":"mailbox_id","in":"path","required":true,"description":"Mailbox public ULID. This is not the internal numeric mailbox id.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"MailThreadPublicId":{"name":"thread_id","in":"path","required":true,"description":"Mail thread public ULID. This is not the internal numeric thread id.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"MailMailboxCursor":{"name":"cursor","in":"query","required":false,"description":"Signed cursor returned by the previous mailbox page.","schema":{"type":"string","maxLength":2048}},"MailThreadCursor":{"name":"cursor","in":"query","required":false,"description":"Signed cursor returned by the previous mail thread page.","schema":{"type":"string","maxLength":2048}},"MailThreadMailboxId":{"name":"mailbox_id","in":"query","required":false,"description":"Filter threads to one granted mailbox public ULID.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"MailThreadFolderId":{"name":"folder","in":"query","required":false,"description":"Filter threads to messages placed in one mailbox folder public ULID.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"MailThreadStatus":{"name":"status","in":"query","required":false,"description":"Filter threads by conversation status.","schema":{"type":"string","enum":["active","pending"]}},"MailThreadAssignedUserId":{"name":"assigned_user_id","in":"query","required":false,"description":"Filter threads by assigned public user ULID.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"MailThreadTagId":{"name":"tag_id","in":"query","required":false,"description":"Filter threads by public conversation tag ULID.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"MailCreatedFrom":{"name":"created_from","in":"query","required":false,"description":"Inclusive created_at lower bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1783591200}},"MailCreatedTo":{"name":"created_to","in":"query","required":false,"description":"Inclusive created_at upper bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1783591200}},"MailUpdatedFrom":{"name":"updated_from","in":"query","required":false,"description":"Inclusive updated_at lower bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1783591200}},"MailUpdatedTo":{"name":"updated_to","in":"query","required":false,"description":"Inclusive updated_at upper bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1783591200}},"WebhookDeliveryCursor":{"name":"cursor","in":"query","required":false,"description":"Signed cursor returned by the previous webhook delivery page.","schema":{"type":"string","maxLength":2048}},"WebhookDeliveryEventType":{"name":"event_type","in":"query","required":false,"description":"Filter webhook deliveries by mail event type.","schema":{"$ref":"#\/components\/schemas\/WebhookEventType"}},"WebhookDeliveryStatus":{"name":"status","in":"query","required":false,"description":"Filter webhook deliveries by delivery status.","schema":{"$ref":"#\/components\/schemas\/WebhookDeliveryStatus"}},"WebhookDeliveryCreatedFrom":{"name":"created_from","in":"query","required":false,"description":"Inclusive delivery created_at lower bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1783591200}},"WebhookDeliveryCreatedTo":{"name":"created_to","in":"query","required":false,"description":"Inclusive delivery created_at upper bound. Must include seconds and Z or an explicit UTC offset.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$","example":1783591200}}},"responses":{"MailAiGeneration":{"description":"Agent-owned AI work and expiring output; provider work may be pending and billable usage is explicit.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailAiGeneration"}}}}}},"MailSendIntent":{"description":"Immutable reviewed send and current authoritative outcome; 202 does not mean delivered.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","message_id","status","reason","submission_unresolved","send_at","expires_at","revision","warning_codes","warning_fingerprint","snapshot"],"properties":{"id":{"type":"string"},"message_id":{"type":"string"},"status":{"type":"string","enum":["prepared","expired","processing","submitted","unresolved","failed","intent","queued","scheduled","accepted","delivery_error","bounced","canceled"]},"reason":{"type":["string","null"]},"submission_unresolved":{"type":"boolean"},"send_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"revision":{"type":"string"},"warning_codes":{"type":"array","items":{"type":"string"}},"warning_fingerprint":{"type":["string","null"]},"snapshot":{"description":"Approved content; cleared one day after approval expiry. Replay\/outcome metadata remains.","oneOf":[{"$ref":"#\/components\/schemas\/MailDraftSnapshot"},{"type":"null"}]}}}}}}}},"MailDraft":{"description":"Current authored draft and revision token. ETag mirrors the revision; mutation requests include revision in JSON so replay identity covers it.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"},"ETag":{"schema":{"type":"string"}}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailDraftSnapshot"}}}}}},"MailWorkflow":{"description":"App-local workflow snapshot and revision.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailWorkflowSnapshot"}}}}}},"MailReminder":{"description":"Personally visible reminder lifecycle and current revision.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailReminder"}}}}}},"MailReminders":{"description":"Personal and shared reminder history with cursor pagination.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailReminder"}},"meta":{"type":"object","required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}}}}},"MailReminderDeleted":{"description":"Deletion result; the same retry key replays without repeating deletion.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","deleted"],"properties":{"id":{"type":"string"},"deleted":{"const":true}}}}}}}},"MailFollowing":{"description":"Current actor following state and active eligible follower count.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailFollowing"}}}}}},"MailFollowers":{"description":"Cursor-paginated eligible followers.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailFollower"}},"meta":{"type":"object","required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}}}}},"MailNote":{"description":"Public internal note or body-redacted tombstone.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailNote"}}}}}},"MailNotes":{"description":"Cursor-paginated internal notes.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailNote"}},"meta":{"type":"object","required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}}}}},"MailNoteCandidates":{"description":"Current eligible mention users.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["users"],"additionalProperties":false,"properties":{"users":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailNoteUser"}}}}}}}}},"MailNoteRead":{"description":"Current actor mention-read result.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","updated_count","unread_count"],"additionalProperties":false,"properties":{"id":{"type":"string"},"updated_count":{"type":"integer"},"unread_count":{"type":"integer"}}}}}}}},"MailWorkflowCandidates":{"description":"Current assignable mailbox users and feature-enabled workflow actions.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["users","actions"],"properties":{"users":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"actions":{"type":"array","items":{"type":"string"}}}}}}}}},"MailWorkflowBulk":{"description":"Partial-bulk outcomes. HTTP 200 is not a claim that every item succeeded.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["action","rows","summary"],"properties":{"action":{"type":"string"},"rows":{"type":"array","items":{"type":"object","required":["thread_id","status","changed","reason","workflow"],"properties":{"thread_id":{"type":"string"},"status":{"type":"string","enum":["succeeded","failed"]},"changed":{"type":"boolean"},"reason":{"type":["string","null"]},"workflow":{"oneOf":[{"$ref":"#\/components\/schemas\/MailWorkflowSnapshot"},{"type":"null"}]}}}},"summary":{"type":"object","required":["total","succeeded","failed","unchanged"],"properties":{"total":{"type":"integer"},"succeeded":{"type":"integer"},"failed":{"type":"integer"},"unchanged":{"type":"integer"}}}}}}}}}},"MailProviderUnavailable":{"description":"A definitive provider refusal mapped to mail_provider_unavailable. Preserve the original command key and inspect the stored receipt; this response does not authorize a new submission.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}},"MailAiFailure":{"description":"Stable AI failure reason with provider\/credit\/preview availability distinguished. Provider errors never authorize an automatic new generation or retry key.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}},"Unauthorized":{"description":"Missing, invalid, expired, or revoked API key.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}},"Forbidden":{"description":"Plan, capability, ability, or project-scope denial.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}},"NotFound":{"description":"Resource or route was not found.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}},"RouteNotFound":{"description":"Route hidden or not found.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}},"MalformedJson":{"description":"Request body could not be parsed as a valid JSON object.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}},"ValidationFailed":{"description":"Public validation error.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}},"Conflict":{"description":"State conflict or idempotency conflict.","headers":{"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}},"RateLimited":{"description":"Too many requests.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/RetryAfter"},"X-Request-Id":{"$ref":"#\/components\/headers\/XRequestId"},"X-RateLimit-Limit":{"$ref":"#\/components\/headers\/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#\/components\/headers\/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#\/components\/headers\/XRateLimitReset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorEnvelope"}}}}},"schemas":{"CapabilityDiscoveryEnvelope":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["families","operations","examples","filters"],"properties":{"families":{"type":"array","items":{"$ref":"#\/components\/schemas\/CapabilityFamilySummary"}},"operations":{"type":"array","items":{"$ref":"#\/components\/schemas\/CapabilityOperationSummary"}},"examples":{"type":"array","items":{"$ref":"#\/components\/schemas\/CapabilityExample"}},"filters":{"type":"object","additionalProperties":true}}}}},"CapabilityDetailEnvelope":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/CapabilityOperationDetail"}}},"CapabilityFamilySummary":{"type":"object","required":["id","label","description","operation_count","available_count","unavailable_count"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"operation_count":{"type":"integer","minimum":0},"available_count":{"type":"integer","minimum":0},"unavailable_count":{"type":"integer","minimum":0}}},"CapabilityAvailability":{"type":"object","required":["available","reasons","plan_available","requires_visibility_user"],"properties":{"available":{"type":["boolean","null"]},"reasons":{"type":"array","items":{"type":"string"}},"plan_available":{"type":["boolean","null"]},"requires_visibility_user":{"type":"boolean"}}},"CapabilityEndpoint":{"type":"object","required":["method","path","route_name","registered"],"properties":{"method":{"type":"string"},"path":{"type":"string"},"route_name":{"type":["string","null"]},"registered":{"type":["boolean","null"]}}},"CapabilityExample":{"type":"object","required":["title","request","response","status"],"properties":{"title":{"type":"string"},"request":{"type":"string"},"response":[],"status":{"type":"integer","minimum":100,"maximum":599}}},"CapabilityUndo":{"type":"object","required":["supported","operation","window"],"properties":{"supported":{"type":"boolean"},"operation":{"type":["string","null"]},"window":{"type":["string","null"]}}},"CapabilityOperationSummary":{"type":"object","required":["name","family","summary","effect_class","capability_group","ability","availability","long_running","authorization_required","undo","links","endpoints"],"properties":{"name":{"type":"string"},"family":{"type":"string"},"summary":{"type":"string"},"effect_class":{"type":"string","enum":["read","internal","external","owner"]},"capability_group":{"type":["string","null"]},"ability":{"type":["string","null"]},"availability":{"$ref":"#\/components\/schemas\/CapabilityAvailability"},"long_running":{"type":"boolean"},"authorization_required":{"type":"boolean"},"undo":{"anyOf":[{"$ref":"#\/components\/schemas\/CapabilityUndo"},{"type":"null"}]},"links":{"type":"object","additionalProperties":true},"endpoints":{"type":"array","items":{"$ref":"#\/components\/schemas\/CapabilityEndpoint"}},"examples":{"type":"array","items":{"$ref":"#\/components\/schemas\/CapabilityExample"}}}},"CapabilityOperationDetail":{"allOf":[{"$ref":"#\/components\/schemas\/CapabilityOperationSummary"},{"type":"object","required":["description","cli","mcp","schemas","failure_reasons","docs"],"properties":{"description":{"type":"string"},"cli":{"type":"array","items":{"type":"string"}},"mcp":{"type":"array","items":{"type":"string"}},"schemas":{"type":"object","required":["input","output"],"properties":{"input":{"type":"object","additionalProperties":true},"output":{"type":"object","additionalProperties":true}}},"failure_reasons":{"type":"array","items":{"type":"string"}},"docs":{"type":"object","additionalProperties":true}}}]},"MailManagedMailboxSummary":{"type":"object","additionalProperties":false,"required":["id","email_address","display_name","lifecycle_state","connection_method","bootstrap_completeness","manually_disabled"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"email_address":{"type":"string"},"display_name":{"type":["string","null"]},"lifecycle_state":{"type":"string"},"connection_method":{"type":"string"},"bootstrap_completeness":{"type":["string","null"]},"manually_disabled":{"type":"boolean"}}},"MailManagedPersona":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","revision","email_address","display_name","kind","availability","can_enable","signature_html","send_as_grant_user_ids","default_voice_id"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"mailbox_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"email_address":{"type":"string"},"display_name":{"type":["string","null"]},"kind":{"type":"string","enum":["primary","alias"]},"availability":{"type":"string","enum":["available","unavailable"]},"can_enable":{"type":"boolean"},"signature_html":{"type":["string","null"]},"send_as_grant_user_ids":{"type":"array","items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"default_voice_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}},"MailManagedMailbox":{"type":"object","additionalProperties":false,"required":["id","email_address","display_name","lifecycle_state","connection_method","bootstrap_completeness","manually_disabled","revision","content_grant_user_ids","assignable_members","personas"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"email_address":{"type":"string"},"display_name":{"type":["string","null"]},"lifecycle_state":{"type":"string"},"connection_method":{"type":"string"},"bootstrap_completeness":{"type":["string","null"]},"manually_disabled":{"type":"boolean"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"content_grant_user_ids":{"type":"array","items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"assignable_members":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name","email"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"email":{"type":"string"}}}},"personas":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailManagedPersona"}}}},"MailNotificationPreferences":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"timezone":{"type":["string","null"]},"timezone_scope":{"const":"account"},"saved_timezone_valid":{"type":"boolean"},"catalog":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"type":"string"},"label_key":{"type":"string"},"description_key":{"type":"string"},"default_policy":{"type":"string","enum":["immediate","muted","digest_only"]},"available":{"type":"boolean"},"dependent_features":{"type":"array","items":{"type":"string"}},"digest_only_available":{"type":"boolean"}},"required":["key","label_key","description_key","default_policy","available","dependent_features","digest_only_available"]}},"policies":{"type":"object","additionalProperties":false,"properties":{"note_mentions":{"type":"string","enum":["immediate","muted","digest_only"]},"direct_reminders":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_inbound_replies":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_internal_notes":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_assignment_changes":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_assignment_group_changes":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_tag_changes":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_status_changes":{"type":"string","enum":["immediate","muted","digest_only"]},"follower_reminder_due":{"type":"string","enum":["immediate","muted","digest_only"]},"send_outcome_success":{"type":"string","enum":["immediate","muted","digest_only"]},"send_outcome_failure":{"type":"string","enum":["immediate","muted","digest_only"]},"follow_up_blocked":{"type":"string","enum":["immediate","muted","digest_only"]},"follow_up_failed":{"type":"string","enum":["immediate","muted","digest_only"]},"follow_up_paused":{"type":"string","enum":["immediate","muted","digest_only"]},"follow_up_stopped":{"type":"string","enum":["immediate","muted","digest_only"]}},"required":["note_mentions","direct_reminders","follower_inbound_replies","follower_internal_notes","follower_assignment_changes","follower_assignment_group_changes","follower_tag_changes","follower_status_changes","follower_reminder_due","send_outcome_success","send_outcome_failure","follow_up_blocked","follow_up_failed","follow_up_paused","follow_up_stopped"]},"quiet_hours":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"enabled":{"type":"boolean"},"windows":{"type":"array","maxItems":14,"items":{"type":"object","additionalProperties":false,"required":["weekday","start_minute","duration_minutes"],"properties":{"weekday":{"type":"integer","minimum":1,"maximum":7},"start_minute":{"type":"integer","minimum":0,"maximum":1425,"multipleOf":15},"duration_minutes":{"type":"integer","minimum":15,"maximum":1425,"multipleOf":15}}}}},"required":["revision","enabled","windows"]},"digest_schedule":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"frequency":{"type":["string","null"],"enum":["daily","weekly",null]},"preferred_send_minute":{"type":["integer","null"],"minimum":0,"maximum":1425,"multipleOf":15},"weekly_weekday":{"type":["integer","null"],"minimum":1,"maximum":7}},"required":["revision","enabled","frequency","preferred_send_minute","weekly_weekday"]},"digests_available":{"type":"boolean"},"digest_delivery_enabled":{"type":"boolean","description":"True only when this user has an enabled, valid digest schedule and timezone. Feature availability alone never enables delivery."}},"required":["id","revision","timezone","timezone_scope","saved_timezone_valid","digests_available","catalog","policies","quiet_hours","digest_schedule","digest_delivery_enabled"]},"MailCollection":{"type":"object","additionalProperties":false,"required":["id","name","slug","description","color","icon","sort_order","archived","deleted","can_manage","mailboxes","visible_mailbox_count","revision","created_at","updated_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"color":{"type":["string","null"]},"icon":{"type":["string","null"]},"sort_order":{"type":"integer"},"archived":{"type":"boolean"},"deleted":{"type":"boolean"},"can_manage":{"type":"boolean"},"mailboxes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}}},"visible_mailbox_count":{"type":"integer","minimum":0},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"created_at":{"type":["string","null"]},"updated_at":{"type":["string","null"]}}},"MailCollectionOrder":{"type":"object","additionalProperties":false,"required":["items","revision"],"properties":{"items":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}}},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailSavedDefinitionInput":{"type":"object","additionalProperties":false,"required":[],"properties":{"mailbox_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"mailbox_ids":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"type":"null"}]},"collection_ids":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"type":"null"}]},"scope":{"anyOf":[{"type":"string","maxLength":500},{"type":"object","additionalProperties":false,"required":[],"properties":{"kind":{"anyOf":[{"enum":["folder","all_mail","local_drafts","view","unified","mailbox"]},{"type":"null"}]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},{"type":"null"}]},"view":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"query":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"filters":{"anyOf":[{"type":"object","additionalProperties":false,"required":[],"properties":{"unassigned":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ungrouped":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"unread":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"starred":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"due_reminders":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"has_attachment":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_read":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_unread":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_flagged":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_answered":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_draft":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"from":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"to":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"cc":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"bcc":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"subject":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"gmail_raw":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"date_from":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"date_to":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"larger":{"anyOf":[{"type":"number"},{"type":"null"}]},"smaller":{"anyOf":[{"type":"number"},{"type":"null"}]},"tag_ids":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"type":"null"}]},"tag_public_ids":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"type":"null"}]},"assigned_user_ids":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"type":"null"}]},"assignment_group":{"anyOf":[{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"following":{"anyOf":[{"enum":["current_user"]},{"type":"null"}]},"status":{"anyOf":[{"enum":["active","pending"]},{"type":"null"}]},"view":{"anyOf":[{"enum":["mine","starred","assigned","unassigned","snoozed","pending","due_reminders"]},{"type":"null"}]},"labels":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","maxLength":255}},{"type":"null"}]},"provider_scope":{"anyOf":[{"type":"object","additionalProperties":false,"required":[],"properties":{"kind":{"anyOf":[{"enum":["special_use","folder"]},{"type":"null"}]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},{"type":"null"}]},"sent_outcome":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},{"type":"null"}]},"follow_up_status":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},{"type":"null"}]},"custom_fields":{"anyOf":[{"type":"array","maxItems":10,"items":{"type":"object","additionalProperties":false,"required":["field_public_id","operator"],"properties":{"field_public_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"operator":{"type":"string","maxLength":60},"value":{"description":"Typed filter value; user values are public team-member IDs."}}}},{"type":"null"}]}}},{"type":"null"}]}}},"MailSavedDefinition":{"type":"object","additionalProperties":false,"required":[],"properties":{"mailbox_id":{"anyOf":[{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"mailbox_ids":{"anyOf":[{"type":"array","maxItems":50,"items":{"anyOf":[{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]}},{"type":"null"}]},"collection_ids":{"anyOf":[{"type":"array","maxItems":50,"items":{"anyOf":[{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]}},{"type":"null"}]},"scope":{"anyOf":[{"type":"string","maxLength":500},{"type":"object","additionalProperties":false,"required":[],"properties":{"kind":{"anyOf":[{"enum":["folder","all_mail","local_drafts","view","unified","mailbox"]},{"type":"null"}]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},{"type":"null"}]},"view":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"query":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"filters":{"anyOf":[{"type":"object","additionalProperties":false,"required":[],"properties":{"unassigned":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ungrouped":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"unread":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"starred":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"due_reminders":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"has_attachment":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_read":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_unread":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_flagged":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_answered":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_draft":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"from":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"to":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"cc":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"bcc":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"subject":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"gmail_raw":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"date_from":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"date_to":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"larger":{"anyOf":[{"type":"number"},{"type":"null"}]},"smaller":{"anyOf":[{"type":"number"},{"type":"null"}]},"tag_ids":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"type":"null"}]},"tag_public_ids":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},{"type":"null"}]},"assigned_user_ids":{"anyOf":[{"type":"array","maxItems":50,"items":{"anyOf":[{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]}},{"type":"null"}]},"assignment_group":{"anyOf":[{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"following":{"anyOf":[{"enum":["current_user"]},{"type":"null"}]},"status":{"anyOf":[{"enum":["active","pending"]},{"type":"null"}]},"view":{"anyOf":[{"enum":["mine","starred","assigned","unassigned","snoozed","pending","due_reminders"]},{"type":"null"}]},"labels":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","maxLength":255}},{"type":"null"}]},"provider_scope":{"anyOf":[{"type":"object","additionalProperties":false,"required":[],"properties":{"kind":{"anyOf":[{"enum":["special_use","folder"]},{"type":"null"}]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},{"type":"null"}]},"sent_outcome":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},{"type":"null"}]},"follow_up_status":{"anyOf":[{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},{"type":"null"}]},"custom_fields":{"anyOf":[{"type":"array","maxItems":10,"items":{"type":"object","additionalProperties":false,"required":["field_public_id","operator"],"properties":{"field_public_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"operator":{"type":"string","maxLength":60},"value":{"description":"Typed filter value; user values are public team-member IDs."}}}},{"type":"null"}]}}},{"type":"null"}]}}},"MailSavedItem":{"type":"object","additionalProperties":false,"required":["id","kind","name","surface","definition","owner","revision","has_unavailable_references","archived","deleted"],"properties":{"name":{"type":"string","maxLength":120,"minLength":1},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"color":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}]},"icon":{"anyOf":[{"type":"string","maxLength":48},{"type":"null"}]},"visibility":{"enum":["personal","shared"]},"pinned":{"type":"boolean"},"favorite":{"type":"boolean"},"surface":{"enum":["mailbox_threads","unified_inbox","mailbox_search","cross_mailbox_search"]},"definition":{"$ref":"#\/components\/schemas\/MailSavedDefinition"},"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"kind":{"enum":["view","search"]},"sort_order":{"type":"integer"},"archived":{"type":"boolean"},"deleted":{"type":"boolean"},"owner":{"type":"object","additionalProperties":false,"required":["id","is_current_user"],"properties":{"id":{"anyOf":[{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"is_current_user":{"type":"boolean"}}},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"has_unavailable_references":{"type":"boolean"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailSavedOrder":{"type":"object","additionalProperties":false,"required":["kind","items","revision"],"properties":{"kind":{"enum":["view","search"]},"items":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string","maxLength":120}}}},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailSavedOpen":{"type":"object","additionalProperties":false,"required":["id","surface","items","pagination","coverage"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"surface":{"enum":["mailbox_threads","unified_inbox","mailbox_search","cross_mailbox_search"]},"items":{"type":"array","items":{"allOf":[{"$ref":"#\/components\/schemas\/MailThread"},{"type":"object","properties":{"hits":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["message_id"],"properties":{"message_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"matched_fields":{"type":"array","maxItems":50,"items":{"type":"string"}},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}]},"message_date":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}]}},"pagination":{"type":"object","additionalProperties":false,"required":["per_page","has_more","next_cursor"],"properties":{"per_page":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"coverage":{"type":"object","additionalProperties":false,"required":["status","truncated","truncation_reason","searched_scopes","skipped_scopes"],"properties":{"status":{"type":"string"},"truncated":{"type":"boolean"},"truncation_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"searched_scopes":{"type":"array","maxItems":50,"items":{"type":"object"}},"skipped_scopes":{"type":"array","maxItems":50,"items":{"type":"object"}}}}}},"MailCustomFieldTypedValue":{"oneOf":[{"type":"null"},{"type":"object","additionalProperties":false,"required":["type","text"],"properties":{"type":{"const":"text"},"text":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["type","text"],"properties":{"type":{"const":"textarea"},"text":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["type","number"],"properties":{"type":{"const":"number"},"number":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["type","boolean"],"properties":{"type":{"const":"boolean"},"boolean":{"type":"boolean"}}},{"type":"object","additionalProperties":false,"required":["type","date"],"properties":{"type":{"const":"date"},"date":{"type":["string","null"]}}},{"type":"object","additionalProperties":false,"required":["type","url"],"properties":{"type":{"const":"url"},"url":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["type","email"],"properties":{"type":{"const":"email"},"email":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["type","user"],"properties":{"type":{"const":"user"},"user":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":["string","null"]},"name":{"type":"string"}}}}},{"type":"object","additionalProperties":false,"required":["type","option"],"properties":{"type":{"const":"single_select"},"option":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"type":["string","null"]},"label":{"type":"string"}}}}},{"type":"object","additionalProperties":false,"required":["type","options"],"properties":{"type":{"const":"multi_select"},"options":{"type":"array","maxItems":25,"items":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"type":["string","null"]},"label":{"type":"string"}}}}}}]},"MailCustomFieldValue":{"type":"object","additionalProperties":false,"required":["id","resource_type","resource_id","definition","value","revision"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"resource_type":{"type":"string","enum":["contact","account","conversation","mailbox"]},"resource_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"definition":{"type":"object","required":["id","label","key","type","is_archived","is_deleted","resource_types","options"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"label":{"type":"string","minLength":1,"maxLength":120},"key":{"type":"string"},"type":{"type":"string","enum":["text","textarea","number","boolean","single_select","multi_select","date","url","email","user"]},"is_archived":{"type":"boolean"},"is_deleted":{"type":"boolean"},"resource_types":{"type":"array","items":{"type":"object","required":["resource_type","sort_order"],"properties":{"resource_type":{"type":"string","enum":["contact","account","conversation","mailbox"]},"sort_order":{"type":"integer"}}}},"options":{"type":"array","items":{"type":"object","required":["id","label","sort_order","is_archived"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"label":{"type":"string","minLength":1,"maxLength":120},"sort_order":{"type":"integer"},"is_archived":{"type":"boolean"},"is_deleted":{"type":"boolean"}}}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"value":{"$ref":"#\/components\/schemas\/MailCustomFieldTypedValue"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailCustomFieldValueHistory":{"type":"object","additionalProperties":false,"required":["id","definition","change_kind","previous_value","new_value","source","acted_by","occurred_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"definition":{"type":"object","additionalProperties":false,"required":["id","label","type"],"properties":{"id":{"type":["string","null"]},"label":{"type":"string"},"type":{"type":["string","null"]}}},"change_kind":{"type":"string"},"previous_value":{"$ref":"#\/components\/schemas\/MailCustomFieldTypedValue"},"new_value":{"$ref":"#\/components\/schemas\/MailCustomFieldTypedValue"},"source":{"type":"string"},"acted_by":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":["string","null"]},"name":{"type":"string"}}},"occurred_at":{"type":["string","null"],"format":"date-time"}}},"MailCustomFieldDefinition":{"type":"object","required":["id","label","key","type","is_archived","is_deleted","resource_types","options","revision"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"label":{"type":"string","minLength":1,"maxLength":120},"key":{"type":"string"},"type":{"type":"string","enum":["text","textarea","number","boolean","single_select","multi_select","date","url","email","user"]},"is_archived":{"type":"boolean"},"is_deleted":{"type":"boolean"},"resource_types":{"type":"array","items":{"type":"object","required":["resource_type","sort_order"],"properties":{"resource_type":{"type":"string","enum":["contact","account","conversation","mailbox"]},"sort_order":{"type":"integer"}}}},"options":{"type":"array","items":{"type":"object","required":["id","label","sort_order","is_archived"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"label":{"type":"string","minLength":1,"maxLength":120},"sort_order":{"type":"integer"},"is_archived":{"type":"boolean"},"is_deleted":{"type":"boolean"}}}},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"permanent_deletion":{"type":"object","required":["revision","value_count","history_count"],"properties":{"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"value_count":{"type":"integer","minimum":0},"history_count":{"type":"integer","minimum":0}}}}},"MailCustomFieldOrder":{"type":"object","required":["resource_type","fields","revision"],"properties":{"resource_type":{"type":"string","enum":["contact","account","conversation","mailbox"]},"fields":{"type":"array","items":{"type":"object","required":["id","label","sort_order"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"label":{"type":"string","minLength":1,"maxLength":120},"sort_order":{"type":"integer"}}}},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailCrmContact":{"type":"object","additionalProperties":false,"required":["id","revision","name","primary_email","secondary_emails","account","archived","deleted"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"name":{"type":["string","null"]},"archived":{"type":"boolean"},"deleted":{"type":"boolean"},"merged_into_public_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"created_by":{"type":["object","null"],"additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"updated_by":{"type":["object","null"],"additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"primary_email":{"type":"object","additionalProperties":false,"required":["email","normalized_email"],"properties":{"email":{"type":"string"},"normalized_email":{"type":"string"}}},"secondary_emails":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["email","normalized_email"],"properties":{"email":{"type":"string"},"normalized_email":{"type":"string"}}}},"account":{"type":["object","null"],"properties":{"public_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}},"additionalProperties":false},"display_name_locked":{"type":"boolean"}}},"MailCrmAccount":{"type":"object","additionalProperties":false,"required":["id","revision","name","domains","related_contacts","archived","deleted"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"name":{"type":"string"},"archived":{"type":"boolean"},"deleted":{"type":"boolean"},"merged_into_public_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"created_by":{"type":["object","null"],"additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"updated_by":{"type":["object","null"],"additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"domains":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"public_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"domain":{"type":"string"},"match_mode":{"type":"string","enum":["suggest_only","auto_link"]}}}},"related_contacts":{"type":"array","description":"Bounded active related-contact summaries, not a complete contact directory.","items":{"type":"object","additionalProperties":false,"properties":{"public_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":["string","null"]},"primary_email":{"type":"string"}}}}}},"MailCrmContactCreate":{"type":"object","additionalProperties":false,"required":["confirm"],"anyOf":[{"required":["email"]},{"required":["primary_email"]}],"properties":{"confirm":{"const":true},"name":{"type":["string","null"],"maxLength":255},"email":{"type":"string","format":"email","maxLength":320},"primary_email":{"type":"string","format":"email","maxLength":320}}},"MailCrmContactUpdate":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"anyOf":[{"required":["name"]},{"required":["email"]},{"required":["primary_email"]}],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"name":{"type":["string","null"],"maxLength":255},"email":{"type":"string","format":"email","maxLength":320},"primary_email":{"type":"string","format":"email","maxLength":320}}},"MailCrmAccountCreate":{"type":"object","additionalProperties":false,"required":["confirm","name"],"properties":{"confirm":{"const":true},"name":{"type":"string","minLength":1,"maxLength":255}}},"MailCrmAccountUpdate":{"type":"object","additionalProperties":false,"required":["confirm","revision","name"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"name":{"type":"string","minLength":1,"maxLength":255}}},"MailCrmRevisionCommand":{"type":"object","additionalProperties":false,"required":["confirm","revision"],"properties":{"confirm":{"const":true},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailLibraryRevisionCommand":{"type":"object","additionalProperties":false,"required":["revision","confirm"],"properties":{"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","const":true}}},"MailSnippetCreate":{"type":"object","additionalProperties":false,"required":["scope","title","confirm"],"properties":{"scope":{"type":"string","enum":["personal","shared"]},"title":{"type":"string","maxLength":255},"shortcut":{"type":["string","null"],"maxLength":64},"body_text":{"type":["string","null"],"maxLength":21000},"insertion_mode":{"type":"string","enum":["literal","ai","dual"]},"ai_instructions":{"type":["string","null"],"maxLength":5000},"ai_context_policy":{"type":["object","null"],"additionalProperties":{"type":"boolean"}},"default_ai_behavior":{"type":"string","enum":["literal","adapt"]},"category":{"type":["string","null"],"maxLength":120},"tags":{"type":["array","null"],"maxItems":10,"uniqueItems":true,"items":{"type":"string","maxLength":64}},"sort_order":{"type":["integer","null"],"minimum":0,"maximum":1000000},"confirm":{"type":"boolean","const":true}}},"MailSnippetUpdate":{"type":"object","additionalProperties":false,"required":["revision","confirm"],"properties":{"scope":{"type":"string","enum":["personal","shared"]},"title":{"type":"string","maxLength":255},"shortcut":{"type":["string","null"],"maxLength":64},"body_text":{"type":"string","maxLength":21000},"insertion_mode":{"type":"string","enum":["literal","ai","dual"]},"ai_instructions":{"type":["string","null"],"maxLength":5000},"ai_context_policy":{"type":["object","null"],"additionalProperties":{"type":"boolean"}},"default_ai_behavior":{"type":"string","enum":["literal","adapt"]},"category":{"type":["string","null"],"maxLength":120},"tags":{"type":["array","null"],"maxItems":10,"uniqueItems":true,"items":{"type":"string","maxLength":64}},"sort_order":{"type":["integer","null"],"minimum":0,"maximum":1000000},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","const":true}}},"MailVoiceCreate":{"type":"object","additionalProperties":false,"required":["name","guidance_text","confirm"],"properties":{"name":{"type":"string","maxLength":120},"description":{"type":["string","null"],"maxLength":500},"guidance_text":{"type":"string","maxLength":12000},"example_text":{"type":["string","null"],"maxLength":4000},"locale":{"type":["string","null"],"maxLength":16,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"confirm":{"type":"boolean","const":true}}},"MailVoiceUpdate":{"type":"object","additionalProperties":false,"required":["revision","confirm"],"properties":{"name":{"type":"string","maxLength":120},"description":{"type":["string","null"],"maxLength":500},"guidance_text":{"type":"string","maxLength":12000},"example_text":{"type":["string","null"],"maxLength":4000},"locale":{"type":["string","null"],"maxLength":16,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","const":true}}},"MailVoiceGrantReplacement":{"type":"object","additionalProperties":false,"required":["revision","grants","confirm"],"properties":{"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"grants":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["user_id","access_level"],"properties":{"user_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"access_level":{"type":"string","enum":["select","manage"]}}}},"confirm":{"type":"boolean","const":true}}},"MailVoiceGrantReceipt":{"type":"object","additionalProperties":false,"required":["id","operation","status"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"operation":{"const":"replace_grants"},"status":{"const":"completed"}}},"MailSnippet":{"type":"object","additionalProperties":false,"required":["id","revision","deleted","scope","title","body_text"],"properties":{"scope":{"type":"string","enum":["personal","shared"]},"title":{"type":"string","maxLength":255},"body_text":{"type":["string","null"],"maxLength":21000},"insertion_mode":{"type":"string","enum":["literal","ai","dual"]},"ai_instructions":{"type":["string","null"],"maxLength":5000},"ai_context_policy":{"type":["object","null"],"additionalProperties":{"type":"boolean"}},"default_ai_behavior":{"type":"string","enum":["literal","adapt"]},"category":{"type":["string","null"],"maxLength":120},"tags":{"type":["array","null"],"maxItems":10,"uniqueItems":true,"items":{"type":"string","maxLength":64}},"sort_order":{"type":["integer","null"],"minimum":0,"maximum":1000000},"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"deleted":{"type":"boolean"},"display_shortcut":{"type":["string","null"]},"updated_at":{"type":["string","null"],"format":"date-time"},"literal_available":{"type":"boolean"},"ai_available":{"type":"boolean"},"ai_unavailable_reason":{"type":["string","null"]}}},"MailVoice":{"type":"object","additionalProperties":false,"description":"Guidance and examples are omitted without a direct grant. Role-only administration never implies content access. Management fields are omitted without administer permission.","required":["id","revision","deleted","name","is_archived","is_deleted"],"properties":{"name":{"type":"string","maxLength":120},"description":{"type":["string","null"],"maxLength":500},"guidance_text":{"type":"string","maxLength":12000},"example_text":{"type":["string","null"],"maxLength":4000},"locale":{"type":["string","null"],"maxLength":16,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"deleted":{"type":"boolean"},"is_archived":{"type":"boolean"},"is_deleted":{"type":"boolean"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"created_by":{"type":["object","null"],"additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"updated_by":{"type":["object","null"],"additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"access_level":{"type":["string","null"],"enum":["select","manage",null]},"can_administer":{"type":"boolean"},"can_manage_content":{"type":"boolean"},"can_select":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["user_id","name","access_level"],"properties":{"user_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"access_level":{"type":"string","enum":["select","manage"]}}}},"personas_using_default":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","email_address"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"email_address":{"type":"string"}}}}}},"MailMessageState":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","deleted","flags","labels","placements","capabilities","label_behavior","revision"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"mailbox_id":{"type":"string","minLength":26,"maxLength":26},"deleted":{"type":"boolean"},"flags":{"type":"array","items":{"type":"string"}},"labels":{"type":"array","items":{"type":"string"}},"placements":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["folder_id","path","special_use"],"properties":{"folder_id":{"type":"string","minLength":26,"maxLength":26,"nullable":true},"path":{"type":"string"},"special_use":{"type":"string","nullable":true}}}},"capabilities":{"type":"object","additionalProperties":false,"required":["mark_read","mark_unread","star","unstar","move","archive","trash","restore","unarchive","unspam","delete_forever","add_labels","remove_labels"],"properties":{"mark_read":{"type":"boolean"},"mark_unread":{"type":"boolean"},"star":{"type":"boolean"},"unstar":{"type":"boolean"},"move":{"type":"boolean"},"archive":{"type":"boolean"},"trash":{"type":"boolean"},"restore":{"type":"boolean"},"unarchive":{"type":"boolean"},"unspam":{"type":"boolean"},"delete_forever":{"type":"boolean"},"add_labels":{"type":"boolean"},"remove_labels":{"type":"boolean"}}},"label_behavior":{"type":"string","enum":["not_supported","tag_like","folder_like"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailMessageStateChange":{"type":"object","additionalProperties":false,"required":["action","revision","confirm"],"properties":{"action":{"type":"string","enum":["mark_read","mark_unread","star","unstar","move","archive","trash","restore","unarchive","unspam","delete_forever","add_labels","remove_labels"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","enum":[true]},"source_folder_id":{"type":"string","minLength":26,"maxLength":26,"description":"Required only for move, archive, trash, restore, unarchive, unspam and delete_forever; must be a current exact placement."},"target_folder_id":{"type":"string","minLength":26,"maxLength":26,"description":"Required only for move."},"labels":{"type":"array","minItems":1,"maxItems":25,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":255},"description":"Required only for add_labels and remove_labels."}}},"MailMessageBatchManifest":{"type":"object","additionalProperties":false,"required":["action","items","confirm"],"description":"Ordered unique messages; action determines exact required and forbidden source\/target\/label fields as in MailMessageStateChange.","properties":{"action":{"type":"string","enum":["mark_read","mark_unread","star","unstar","move","archive","trash","restore","unarchive","unspam","delete_forever","add_labels","remove_labels"]},"confirm":{"type":"boolean","const":true},"items":{"type":"array","minItems":1,"maxItems":4,"items":{"type":"object","additionalProperties":false,"required":["message_id","revision"],"properties":{"message_id":{"type":"string","minLength":26,"maxLength":26},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"source_folder_id":{"type":"string","minLength":26,"maxLength":26,"description":"Required only for move, archive, trash, restore, unarchive, unspam and delete_forever; must be a current exact placement."},"target_folder_id":{"type":"string","minLength":26,"maxLength":26,"description":"Required only for move."},"labels":{"type":"array","minItems":1,"maxItems":25,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":255},"description":"Required only for add_labels and remove_labels."}}}}}},"MailMessageBatch":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","action","status","reason_code","items","created_at","completed_at"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"mailbox_id":{"type":"string","minLength":26,"maxLength":26},"action":{"type":"string","enum":["mark_read","mark_unread","star","unstar","move","archive","trash","restore","unarchive","unspam","delete_forever","add_labels","remove_labels"]},"status":{"type":"string","enum":["executing","succeeded","partial","unresolved"]},"reason_code":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","required":["message_id","command"],"properties":{"message_id":{"type":"string","minLength":26,"maxLength":26},"command":{"$ref":"#\/components\/schemas\/MailMessageCommand"}}}},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}}},"MailMessageCommand":{"type":"object","additionalProperties":false,"required":["id","operation","status","reason_code","provider_started","result","created_at","completed_at"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"operation":{"type":"string","enum":["message.mark_read","message.mark_unread","message.star","message.unstar","message.move","message.archive","message.trash","message.restore","message.unarchive","message.unspam","message.delete_forever","message.add_labels","message.remove_labels"]},"status":{"type":"string","enum":["claimed","executing","unresolved","succeeded","pending_projection","projection_failed","projection_unknown","completed","failed","not_run"]},"reason_code":{"type":"string","nullable":true},"provider_started":{"type":"boolean"},"result":{"type":"object","nullable":true,"properties":{"status":{"type":"string"},"provider_status":{"type":"string"},"message":{"$ref":"#\/components\/schemas\/MailMessageState"}}},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time","nullable":true}}},"MailProviderFolder":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","name","path","delimiter","special_use","state","listed","subscribed","message_count","unread_count","capabilities","revision"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"mailbox_id":{"type":"string","minLength":26,"maxLength":26},"name":{"type":"string","nullable":true},"path":{"type":"string"},"delimiter":{"type":"string","nullable":true},"special_use":{"type":"string","nullable":true},"state":{"type":"string"},"listed":{"type":"boolean"},"subscribed":{"type":"boolean"},"message_count":{"type":"integer"},"unread_count":{"type":"integer"},"capabilities":{"type":"object","additionalProperties":false,"required":["can_create_child","can_rename","can_delete"],"properties":{"can_create_child":{"type":"boolean"},"can_rename":{"type":"boolean"},"can_delete":{"type":"boolean"}}},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailProviderFolderCapabilities":{"type":"object","additionalProperties":false,"required":["mailbox_id","source_revision","capabilities"],"properties":{"mailbox_id":{"type":"string","minLength":26,"maxLength":26},"source_revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"capabilities":{"type":"object","additionalProperties":false,"required":["feature_enabled","provider_operations_available","label_behavior","can_create","can_create_at_root","can_rename","can_delete"],"properties":{"feature_enabled":{"type":"boolean"},"provider_operations_available":{"type":"boolean"},"label_behavior":{"type":"string"},"can_create":{"type":"boolean"},"can_create_at_root":{"type":"boolean"},"can_rename":{"type":"boolean"},"can_delete":{"type":"boolean"}}}}},"MailProviderFolderCreate":{"type":"object","additionalProperties":false,"required":["name","source_revision","confirm"],"properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"One folder name segment, not a path."},"parent_folder_id":{"type":"string","minLength":26,"maxLength":26,"nullable":true},"source_revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","enum":[true]}}},"MailProviderFolderRename":{"type":"object","additionalProperties":false,"required":["name","revision","confirm"],"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","enum":[true]}}},"MailProviderFolderDelete":{"type":"object","additionalProperties":false,"required":["revision","confirm"],"properties":{"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","enum":[true]}}},"MailProviderFolderOperation":{"type":"object","additionalProperties":false,"required":["id","kind","status","provider_status","projection_status","provider_reason","projection_reason","folder_id","path","completed_at"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"kind":{"type":"string","enum":["create","rename","delete"]},"status":{"type":"string","enum":["pending","succeeded","failed","unresolved"]},"provider_status":{"type":"string","enum":["pending","succeeded","failed","unresolved"]},"projection_status":{"type":"string"},"provider_reason":{"type":"string","nullable":true},"projection_reason":{"type":"string","nullable":true},"folder_id":{"type":"string","minLength":26,"maxLength":26,"nullable":true},"path":{"type":"string","nullable":true},"completed_at":{"type":"string","format":"date-time","nullable":true}}},"MailProviderCommand":{"type":"object","additionalProperties":false,"required":["id","operation","status","reason_code","provider_started","result","created_at","completed_at"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"operation":{"type":"string","enum":["folder.create","folder.rename","folder.delete"]},"status":{"type":"string","enum":["claimed","executing","unresolved","succeeded","pending_projection","projection_failed","completed","failed"]},"reason_code":{"type":"string","nullable":true},"provider_started":{"type":"boolean"},"result":{"$ref":"#\/components\/schemas\/MailProviderFolderOperation","nullable":true},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time","nullable":true}}},"MailFollowUpPagination":{"type":"object","required":["per_page","has_more","next_cursor"],"properties":{"per_page":{"type":"integer","minimum":1,"maximum":100},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"MailFollowUpStepInput":{"type":"object","additionalProperties":false,"required":["kind","delay_seconds"],"properties":{"kind":{"type":"string","enum":["one_time","recurring"]},"delay_seconds":{"type":"integer","minimum":1},"body_text":{"type":"string","nullable":true,"maxLength":65536},"body_html":{"type":"string","nullable":true,"maxLength":65536},"recurrence_max_sends":{"type":"integer","minimum":1,"nullable":true},"recurrence_until":{"type":"string","format":"date-time","nullable":true}}},"MailFollowUpCreate":{"type":"object","additionalProperties":false,"required":["persona_id","source_revision","confirm","steps"],"properties":{"persona_id":{"type":"string","minLength":26,"maxLength":26},"source_revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","enum":[true]},"unsafe_outcome_override":{"type":"boolean"},"steps":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailFollowUpStepInput"},"minItems":1,"maxItems":10}}},"MailFollowUpUpdate":{"type":"object","additionalProperties":false,"required":["revision","confirm","steps"],"properties":{"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","enum":[true]},"steps":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailFollowUpStepInput"},"minItems":1,"maxItems":10}}},"MailFollowUpAction":{"oneOf":[{"type":"object","additionalProperties":false,"required":["action","revision"],"properties":{"action":{"type":"string","enum":["pause"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"until":{"type":"string","format":"date-time","nullable":true}}},{"type":"object","additionalProperties":false,"required":["action","revision","confirm"],"properties":{"action":{"type":"string","enum":["resume"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","enum":[true]}}},{"type":"object","additionalProperties":false,"required":["action","revision"],"properties":{"action":{"type":"string","enum":["cancel"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},{"type":"object","additionalProperties":false,"required":["action","revision","confirm","due_at"],"properties":{"action":{"type":"string","enum":["reschedule"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","enum":[true]},"due_at":{"type":"string","format":"date-time"}}},{"type":"object","additionalProperties":false,"required":["action","revision","target_id"],"properties":{"action":{"type":"string","enum":["remove_target"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"target_id":{"type":"string","minLength":26,"maxLength":26}}},{"type":"object","additionalProperties":false,"required":["action","revision","confirm","persona_id"],"properties":{"action":{"type":"string","enum":["takeover"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirm":{"type":"boolean","enum":[true]},"persona_id":{"type":"string","minLength":26,"maxLength":26}}}]},"MailFollowUpSource":{"type":"object","additionalProperties":false,"required":["message_id","persona_id","subject","to","cc","state","source_revision"],"properties":{"message_id":{"type":"string","minLength":26,"maxLength":26},"persona_id":{"type":"string","minLength":26,"maxLength":26},"subject":{"type":"string","nullable":true},"to":{"type":"array","items":{"type":"object"}},"cc":{"type":"array","items":{"type":"object"}},"state":{"type":"string"},"source_revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailFollowUpSequence":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","thread_id","message_id","persona_id","sender","authority","state","reason_code","sent_baseline_at","next_due_at","paused_until","total_sent_runs","revision","steps","targets"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"mailbox_id":{"type":"string","minLength":26,"maxLength":26,"nullable":true},"thread_id":{"type":"string","minLength":26,"maxLength":26,"nullable":true},"message_id":{"type":"string","minLength":26,"maxLength":26,"nullable":true},"persona_id":{"type":"string","minLength":26,"maxLength":26,"nullable":true},"sender":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"name":{"type":"string"}},"nullable":true},"authority":{"type":"object","additionalProperties":false,"required":["kind","key_display_id"],"properties":{"kind":{"type":"string","enum":["session_user","team_api_token"]},"key_display_id":{"type":"string","nullable":true}}},"state":{"type":"string"},"reason_code":{"type":"string","nullable":true},"sent_baseline_at":{"type":"string","format":"date-time","nullable":true},"next_due_at":{"type":"string","format":"date-time","nullable":true},"paused_until":{"type":"string","format":"date-time","nullable":true},"total_sent_runs":{"type":"integer"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"steps":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","position","kind","state","delay_seconds","recurrence_max_sends","recurrence_until","sends_completed","body_text","body_html"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"position":{"type":"integer"},"kind":{"type":"string"},"state":{"type":"string"},"delay_seconds":{"type":"integer"},"recurrence_max_sends":{"type":"integer","nullable":true},"recurrence_until":{"type":"string","format":"date-time","nullable":true},"sends_completed":{"type":"integer"},"body_text":{"type":"string","nullable":true},"body_html":{"type":"string","nullable":true}}}},"targets":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","role","address","name","state","reason_code","defer_until"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"role":{"type":"string"},"address":{"type":"string"},"name":{"type":"string","nullable":true},"state":{"type":"string"},"reason_code":{"type":"string","nullable":true},"defer_until":{"type":"string","format":"date-time","nullable":true}}}}}},"MailFollowUpRun":{"type":"object","additionalProperties":false,"required":["id","step_id","attempt","state","reason_code","message_id","reference_message_id","scheduled_for","submitted_at","accepted_at","blocked_at","failed_at","canceled_at"],"properties":{"id":{"type":"string","minLength":26,"maxLength":26},"step_id":{"type":"string","minLength":26,"maxLength":26,"nullable":true},"attempt":{"type":"integer"},"state":{"type":"string"},"reason_code":{"type":"string","nullable":true},"message_id":{"type":"string","minLength":26,"maxLength":26,"nullable":true},"reference_message_id":{"type":"string","minLength":26,"maxLength":26,"nullable":true},"scheduled_for":{"type":"string","format":"date-time","nullable":true},"submitted_at":{"type":"string","format":"date-time","nullable":true},"accepted_at":{"type":"string","format":"date-time","nullable":true},"blocked_at":{"type":"string","format":"date-time","nullable":true},"failed_at":{"type":"string","format":"date-time","nullable":true},"canceled_at":{"type":"string","format":"date-time","nullable":true}}},"MailFollowUpPage":{"type":"object","additionalProperties":false,"required":["items","pagination"],"properties":{"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailFollowUpSequence"}},"pagination":{"type":"object","additionalProperties":false,"required":["per_page","has_more","next_cursor"],"properties":{"per_page":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string","nullable":true}}}}},"MailFollowUpRunPage":{"type":"object","additionalProperties":false,"required":["items","pagination"],"properties":{"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailFollowUpRun"}},"pagination":{"type":"object","additionalProperties":false,"required":["per_page","has_more","next_cursor"],"properties":{"per_page":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string","nullable":true}}}}},"MailReminder":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","thread_id","scope","condition","due_at","is_active","is_delivered","satisfied_at","dismissed_at","created_at","updated_at","revision"],"properties":{"id":{"type":"string"},"mailbox_id":{"type":"string"},"thread_id":{"type":"string"},"scope":{"type":"string","enum":["personal","shared"]},"condition":{"type":"string","enum":["unconditional","if_no_reply"]},"due_at":{"type":"string","format":"date-time"},"is_active":{"type":"boolean"},"is_delivered":{"type":"boolean"},"satisfied_at":{"type":["string","null"],"format":"date-time"},"dismissed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailReminderCreate":{"type":"object","additionalProperties":false,"required":["scope","condition","due_at"],"properties":{"scope":{"type":"string","enum":["personal","shared"]},"condition":{"type":"string","enum":["unconditional","if_no_reply"]},"due_at":{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)$"}}},"MailReminderUpdate":{"type":"object","additionalProperties":false,"required":["action","revision"],"properties":{"action":{"type":"string","enum":["reschedule","dismiss"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"due_at":{"$ref":"#\/components\/schemas\/MailReminderCreate\/properties\/due_at"},"condition":{"type":"string","enum":["unconditional","if_no_reply"]}},"oneOf":[{"properties":{"action":{"const":"reschedule"}},"required":["due_at"]},{"properties":{"action":{"const":"dismiss"}},"not":{"anyOf":[{"required":["due_at"]},{"required":["condition"]}]}}]},"MailFollowing":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","is_following","count","revision"],"properties":{"id":{"type":"string","description":"Opaque conversation ID."},"mailbox_id":{"type":"string"},"is_following":{"type":"boolean"},"count":{"type":"integer","minimum":0},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailFollower":{"type":"object","additionalProperties":false,"required":["id","name","followed_at","followed_via"],"properties":{"id":{"type":"string","description":"Opaque user ID."},"name":{"type":"string"},"followed_at":{"type":"string","format":"date-time"},"followed_via":{"type":"string","enum":["manual","auto_assignment","auto_note_mention","auto_outbound_send"]}}},"MailNoteUser":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"MailNote":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","thread_id","message_id","anchor_unavailable","body_text","is_deleted","author","mentions","viewer_can_edit","viewer_can_delete","created_at","updated_at","revision"],"properties":{"id":{"type":"string"},"mailbox_id":{"type":"string"},"thread_id":{"type":"string"},"message_id":{"type":["string","null"]},"anchor_unavailable":{"type":"boolean"},"body_text":{"type":["string","null"]},"is_deleted":{"type":"boolean"},"author":{"anyOf":[{"$ref":"#\/components\/schemas\/MailNoteUser"},{"type":"null"}]},"mentions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["user","read_at"],"properties":{"user":{"$ref":"#\/components\/schemas\/MailNoteUser"},"read_at":{"type":["string","null"],"format":"date-time"}}}},"viewer_can_edit":{"type":"boolean"},"viewer_can_delete":{"type":"boolean"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailNoteCreate":{"type":"object","additionalProperties":false,"required":["body_text"],"properties":{"body_text":{"type":"string","minLength":1,"maxLength":10000},"message_id":{"type":["string","null"]},"mention_user_ids":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string"}}}},"MailNoteUpdate":{"type":"object","additionalProperties":false,"required":["revision"],"anyOf":[{"required":["body_text"]},{"required":["mention_user_ids"]}],"properties":{"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"body_text":{"type":"string","minLength":1,"maxLength":10000},"mention_user_ids":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string"}}}},"MailNoteDelete":{"type":"object","additionalProperties":false,"required":["revision"],"properties":{"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"MailNoteReadCommand":{"type":"object","additionalProperties":false,"required":["note_ids"],"properties":{"note_ids":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"items":{"type":"string"}}}},"MailWorkflowSnapshot":{"type":"object","additionalProperties":false,"required":["thread_id","mailbox_id","status","assigned_user_id","assignment_group_id","snoozed_until","archived_at","tag_ids","revision"],"properties":{"thread_id":{"type":"string"},"mailbox_id":{"type":"string"},"status":{"type":"string","enum":["active","pending"]},"assigned_user_id":{"type":["string","null"]},"assignment_group_id":{"type":["string","null"]},"snoozed_until":{"type":["string","null"],"format":"date-time"},"archived_at":{"type":["string","null"],"format":"date-time"},"tag_ids":{"type":"array","items":{"type":"string"}},"revision":{"type":"string","pattern":"^[0-9a-f]{64}$"}}},"MailWorkflowCommand":{"type":"object","additionalProperties":false,"required":["action","revision"],"properties":{"action":{"type":"string","enum":["mark_active","mark_pending","assign","unassign","snooze","unsnooze","mark_done","mark_not_done","add_tag","remove_tag","assign_group","unassign_group"]},"revision":{"type":"string","pattern":"^[0-9a-f]{64}$"},"assigned_user_id":{"type":"string","description":"Required only for assign; opaque current mailbox candidate ID."},"snoozed_until":{"type":"string","format":"date-time","description":"Required only for snooze; future timestamp with explicit timezone."},"tag_public_id":{"type":"string","description":"Required only for add_tag or remove_tag."},"group_public_id":{"type":"string","description":"Required only for assign_group."}}},"MailWorkflowBulkCommand":{"type":"object","additionalProperties":false,"required":["action","rows"],"properties":{"action":{"type":"string","enum":["mark_active","mark_pending","assign","unassign","snooze","unsnooze","mark_done","mark_not_done","add_tag","remove_tag","assign_group","unassign_group"]},"assigned_user_id":{"type":"string","description":"Required only for assign."},"snoozed_until":{"type":"string","format":"date-time","description":"Required only for snooze."},"tag_public_id":{"type":"string","description":"Required only for add_tag or remove_tag."},"group_public_id":{"type":"string","description":"Required only for assign_group."},"rows":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["thread_id","revision"],"properties":{"thread_id":{"type":"string"},"revision":{"type":"string","pattern":"^[0-9a-f]{64}$"}}}}}},"MailAiGenerateRequest":{"type":"object","additionalProperties":false,"required":["action"],"dependentRequired":{"draft_id":["revision"],"revision":["draft_id"]},"properties":{"action":{"type":"string","enum":["draft_compose","draft_reply","rewrite_body","suggest_subject","alternate_phrasing","adapt_snippet"]},"persona_id":{"type":["string","null"],"minLength":26,"maxLength":26},"draft_id":{"type":["string","null"],"minLength":26,"maxLength":26},"revision":{"type":"string","minLength":64,"maxLength":64},"thread_id":{"type":["string","null"],"minLength":26,"maxLength":26},"selected_message_id":{"type":["string","null"],"minLength":26,"maxLength":26},"snippet_id":{"type":["string","null"],"minLength":26,"maxLength":26},"voice_id":{"type":["string","null"],"minLength":26,"maxLength":26},"voice_mode":{"type":"string","enum":["auto","persona_default","neutral","explicit"]},"selection_start":{"type":["integer","null"],"minimum":0},"selection_end":{"type":["integer","null"],"minimum":0},"selection_text":{"type":["string","null"],"maxLength":4000},"instruction":{"type":["string","null"],"maxLength":5000},"locale":{"type":["string","null"],"maxLength":16}}},"MailAiCancelRequest":{"type":"object","additionalProperties":false},"MailAiApplyRequest":{"type":"object","additionalProperties":false,"required":["draft_id","revision","apply_mode"],"properties":{"draft_id":{"type":"string","minLength":26,"maxLength":26},"revision":{"type":"string","minLength":64,"maxLength":64},"apply_mode":{"type":"string","enum":["replace_body","insert_at_cursor","replace_selection","select_subject","select_alternate"]},"selected_index":{"type":["integer","null"],"minimum":0},"apply_time_selection_start":{"type":["integer","null"],"minimum":0},"apply_time_selection_end":{"type":["integer","null"],"minimum":0},"body_html":{"type":["string","null"],"maxLength":32000}}},"MailAiGeneration":{"type":"object","additionalProperties":false,"required":["id","action","status","reason","delivery_mode","output_kind","output","output_expires_at","output_applied","estimated_credits","final_credits","usage_unavailable","cancellation_requested"],"properties":{"id":{"type":"string"},"action":{"type":"string"},"status":{"type":"string"},"reason":{"type":["string","null"]},"delivery_mode":{"type":"string","enum":["sync","stream","queued"]},"output_kind":{"type":"string"},"output":{"type":["object","null"],"additionalProperties":true,"description":"Expiring action-specific preview; untrusted generated content, never an instruction to send."},"output_expires_at":{"type":["string","null"],"format":"date-time"},"output_applied":{"type":"boolean"},"estimated_credits":{"type":["integer","null"]},"final_credits":{"type":["integer","null"]},"usage_unavailable":{"type":"boolean"},"cancellation_requested":{"type":"boolean"}}},"ErrorCode":{"type":"string","enum":["unauthenticated","invalid_token","token_expired","token_revoked","api_access_unavailable","capability_unavailable","forbidden_ability","mail_delegation_required","mail_content_unavailable","mail_provider_unavailable","forbidden_project_scope","resource_not_found","route_not_found","method_not_allowed","malformed_json","validation_failed","rate_limited","plan_limit_reached","conflict","idempotency_conflict","internal_error","authorization_pending","slow_down","access_denied","expired_token","invalid_grant","unsupported_grant_type"]},"ErrorEnvelope":{"type":"object","additionalProperties":false,"required":["error","request_id"],"properties":{"error":{"$ref":"#\/components\/schemas\/PublicError"},"request_id":{"type":"string","format":"uuid"}}},"PublicError":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"$ref":"#\/components\/schemas\/ErrorCode"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"SingleResourceSuccessEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true}}},"ListSuccessEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/Pagination"}}}}},"PublicErrorResponse":{"$ref":"#\/components\/schemas\/ErrorEnvelope"},"Pagination":{"type":"object","additionalProperties":false,"required":["current_page","page","per_page","total","last_page","from","to","has_more"],"properties":{"current_page":{"type":"integer","minimum":1},"page":{"type":"integer","minimum":1,"description":"Compatibility alias for current_page."},"per_page":{"type":"integer","minimum":1},"total":{"type":"integer","minimum":0},"last_page":{"type":"integer","minimum":1},"from":{"type":["integer","null"],"minimum":1},"to":{"type":["integer","null"],"minimum":1},"has_more":{"type":"boolean"}}},"CursorPagination":{"type":"object","additionalProperties":false,"required":["per_page","next_cursor","has_more"],"properties":{"per_page":{"type":"integer","minimum":1,"maximum":100},"next_cursor":{"type":["string","null"],"maxLength":2048},"has_more":{"type":"boolean"}}},"WhoamiEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Whoami"}}},"Whoami":{"type":"object","additionalProperties":false,"required":["team","key","capabilities","project_scope"],"properties":{"mail_access":{"type":"object","additionalProperties":false,"required":["content","reason","mailbox_ids"],"properties":{"content":{"type":"boolean"},"reason":{"type":["string","null"]},"libraries":{"type":"object","additionalProperties":false,"required":["read","write","mailbox_ids","scope"],"description":"Team-library consent; no mailbox consent is implied. Individual snippet\/style feature gates and current resource permissions still apply.","properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","maxItems":0,"items":{"type":"string"}},"scope":{"type":"string","const":"team"}}},"folders":{"type":"object","required":["read","write","mailbox_ids"],"properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"message_state":{"type":"object","required":["read","write","mailbox_ids"],"properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"followups":{"type":"object","required":["read","write","mailbox_ids"],"properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"ai":{"type":"object","additionalProperties":false,"required":["read","write","mailbox_ids"],"properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"outbound":{"type":"object","additionalProperties":false,"required":["read","write","mailbox_ids"],"properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"drafts":{"type":"object","additionalProperties":false,"required":["read","write","mailbox_ids"],"properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"workflow":{"type":"object","additionalProperties":false,"required":["read","write","mailbox_ids"],"properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"reminders":{"type":"object","additionalProperties":false,"required":["read","write","mailbox_ids"],"properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"following":{"type":"object","additionalProperties":false,"required":["read","write","mailbox_ids"],"properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"notes":{"type":"object","additionalProperties":false,"required":["read","write","mailbox_ids"],"properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"mailbox_ids":{"type":"array","items":{"type":"string"}}}},"team":{"$ref":"#\/components\/schemas\/WhoamiTeam"},"key":{"$ref":"#\/components\/schemas\/WhoamiKey"},"capabilities":{"type":"array","items":{"$ref":"#\/components\/schemas\/Capability"}},"project_scope":{"$ref":"#\/components\/schemas\/ProjectScope"}}},"WhoamiTeam":{"type":"object","additionalProperties":false,"required":["id","display_id","name","plan","plan_label","api_access"],"properties":{"id":{"type":"integer","description":"Numeric team id retained for whoami compatibility."},"display_id":{"type":"string","pattern":"^team_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"plan":{"type":"string"},"plan_label":{"type":"string"},"api_access":{"type":"boolean","const":true}}},"WhoamiKey":{"type":"object","additionalProperties":false,"required":["id","display_id","name","preset","expiration","last_used_at","created_at"],"properties":{"id":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$"},"display_id":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"preset":{"type":"string","enum":["full_access","read_only","custom"]},"expiration":{"$ref":"#\/components\/schemas\/KeyExpiration"},"last_used_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"KeyExpiration":{"type":"object","additionalProperties":false,"required":["state","expires_at"],"properties":{"state":{"type":"string","enum":["active","expiring_soon","expired","no_expiration"]},"expires_at":{"type":["string","null"],"format":"date-time"}}},"Capability":{"type":"object","additionalProperties":false,"required":["id","label","description","read","write","scope_type","plan_available"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"read":{"type":"boolean"},"write":{"type":"boolean"},"scope_type":{"type":"string","enum":["project_backed","team_level"]},"plan_available":{"type":"boolean"}}},"ProjectScope":{"type":"object","additionalProperties":false,"required":["mode","selected_count","selected_projects","applies_to_team_level_groups"],"properties":{"mode":{"type":"string","enum":["all_projects","selected_projects"]},"selected_count":{"type":"integer","minimum":0},"selected_projects":{"type":"object","additionalProperties":false,"required":["data","has_more"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/SelectedProjectSummary"}},"has_more":{"type":"boolean"}}},"applies_to_team_level_groups":{"type":"boolean","const":false}}},"SelectedProjectSummary":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"AccountSummaryEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/AccountSummary"}}},"AccountSummary":{"type":"object","additionalProperties":false,"required":["account","key","plan","subscription","api_access","credits","billing","links"],"properties":{"account":{"$ref":"#\/components\/schemas\/AccountIdentity"},"key":{"$ref":"#\/components\/schemas\/AccountKey"},"plan":{"$ref":"#\/components\/schemas\/AccountPlan"},"subscription":{"$ref":"#\/components\/schemas\/AccountSubscription"},"api_access":{"$ref":"#\/components\/schemas\/AccountApiAccess"},"credits":{"$ref":"#\/components\/schemas\/AccountCreditSummary"},"billing":{"$ref":"#\/components\/schemas\/AccountBillingSummary"},"links":{"$ref":"#\/components\/schemas\/AccountLinks"}}},"AccountEntitlementsEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/AccountEntitlements"}}},"AccountEntitlements":{"type":"object","additionalProperties":false,"required":["account","plan","api_access","project_scope","capabilities","limits","features"],"properties":{"account":{"$ref":"#\/components\/schemas\/AccountIdentity"},"plan":{"$ref":"#\/components\/schemas\/AccountPlan"},"api_access":{"$ref":"#\/components\/schemas\/AccountApiAccess"},"project_scope":{"$ref":"#\/components\/schemas\/ProjectScope"},"capabilities":{"type":"array","items":{"$ref":"#\/components\/schemas\/AccountCapabilityEntitlement"}},"limits":{"type":"array","items":{"$ref":"#\/components\/schemas\/AccountLimit"}},"features":{"type":"array","items":{"$ref":"#\/components\/schemas\/AccountFeature"}}}},"AccountUsageEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/AccountUsage"}}},"AccountUsage":{"type":"object","additionalProperties":false,"required":["account","credits","purchased_credits","windows","recent_transactions"],"properties":{"account":{"$ref":"#\/components\/schemas\/AccountIdentity"},"credits":{"$ref":"#\/components\/schemas\/AccountUsageCredits"},"purchased_credits":{"$ref":"#\/components\/schemas\/AccountPurchasedCredits"},"windows":{"type":"array","items":{"$ref":"#\/components\/schemas\/AccountUsageWindow"}},"recent_transactions":{"$ref":"#\/components\/schemas\/AccountRecentTransactions"}}},"AccountIdentity":{"type":"object","additionalProperties":false,"required":["id","display_id","name"],"properties":{"id":{"type":"string","pattern":"^team_[0-9A-HJKMNP-TV-Z]{26}$"},"display_id":{"type":"string","pattern":"^team_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"AccountKey":{"type":"object","additionalProperties":false,"required":["id","display_id","name","preset"],"properties":{"id":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$"},"display_id":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"preset":{"type":"string","enum":["full_access","read_only","custom"]}}},"AccountPlan":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"type":"string","example":"pro"},"label":{"type":"string","example":"Pro Plan"}}},"AccountSubscription":{"type":"object","additionalProperties":false,"required":["state","status","active","on_trial","on_grace_period","trial_ends_at","ends_at"],"properties":{"state":{"type":"string","enum":["none","trialing","active","grace_period","past_due","paused","canceled","unknown"]},"status":{"type":["string","null"]},"active":{"type":"boolean"},"on_trial":{"type":"boolean"},"on_grace_period":{"type":"boolean"},"trial_ends_at":{"type":["string","null"],"format":"date-time"},"ends_at":{"type":["string","null"],"format":"date-time"}}},"AccountAvailability":{"type":"object","additionalProperties":false,"required":["available","reason_code"],"properties":{"available":{"type":"boolean"},"reason_code":{"type":["string","null"]}}},"AccountApiAccess":{"type":"object","additionalProperties":false,"required":["available","reason_code","default_preset","max_active_keys","allowed_presets"],"properties":{"available":{"type":"boolean"},"reason_code":{"type":["string","null"]},"default_preset":{"type":"string","enum":["full_access","read_only","custom"]},"max_active_keys":{"type":["integer","null"],"minimum":1},"allowed_presets":{"type":"array","items":{"type":"string","enum":["full_access","read_only","custom"]}}}},"AccountCreditSummary":{"type":"object","additionalProperties":false,"required":["balance","spendable_balance","debt_amount","last_credit_update"],"properties":{"balance":{"type":"integer"},"spendable_balance":{"type":"integer","minimum":0},"debt_amount":{"type":"integer","minimum":0},"last_credit_update":{"type":["string","null"],"format":"date-time"}}},"AccountBillingSummary":{"type":"object","additionalProperties":false,"required":["credit_purchase","auto_topup"],"properties":{"credit_purchase":{"$ref":"#\/components\/schemas\/AccountAvailability"},"auto_topup":{"$ref":"#\/components\/schemas\/AccountAutoTopup"}}},"AccountAutoTopup":{"type":"object","additionalProperties":false,"required":["enabled","state","selected_package","threshold","daily_limit","last_triggered_at","failed_at"],"properties":{"enabled":{"type":"boolean"},"state":{"type":"string","enum":["disabled","ready","failed","unavailable"]},"selected_package":{"anyOf":[{"$ref":"#\/components\/schemas\/AccountCreditPackage"},{"type":"null"}]},"threshold":{"type":"integer","minimum":0},"daily_limit":{"type":["integer","null"],"minimum":1},"last_triggered_at":{"type":["string","null"],"format":"date-time"},"failed_at":{"type":["string","null"],"format":"date-time"}}},"AccountCreditPackage":{"type":"object","additionalProperties":false,"required":["id","label","credits"],"properties":{"id":{"type":"string","example":"credits_1000"},"label":{"type":"string","example":"1,000 Credits"},"credits":{"type":"integer","minimum":1}}},"AccountLinks":{"type":"object","additionalProperties":false,"required":["self","entitlements","usage","credit_balance","credit_transactions"],"properties":{"self":{"type":"string","format":"uri"},"entitlements":{"type":"string","format":"uri"},"usage":{"type":"string","format":"uri"},"credit_balance":{"type":"string","format":"uri"},"credit_transactions":{"type":"string","format":"uri"}}},"AccountCapabilityEntitlement":{"type":"object","additionalProperties":false,"required":["id","label","description","scope_type","requires_base_api_access","plan_available","read","write"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"scope_type":{"type":"string","enum":["project_backed","team_level"]},"requires_base_api_access":{"type":"boolean"},"plan_available":{"type":"boolean"},"read":{"$ref":"#\/components\/schemas\/AccountCapabilityMode"},"write":{"$ref":"#\/components\/schemas\/AccountCapabilityMode"}}},"AccountCapabilityMode":{"type":"object","additionalProperties":false,"required":["supported","granted","available","reason_code"],"properties":{"supported":{"type":"boolean"},"granted":{"type":"boolean"},"available":{"type":"boolean"},"reason_code":{"type":["string","null"],"enum":["not_supported","forbidden_ability","capability_unavailable","api_access_unavailable",null]}}},"AccountLimit":{"type":"object","additionalProperties":false,"required":["id","label","limit","used","remaining"],"properties":{"id":{"type":"string","enum":["projects","team_members","monthly_credits","max_rollover_credits","debt_ceiling"],"description":"Limit identifier. The debt_ceiling row uses the team's effective max debt credits, including team-specific overrides.\n"},"label":{"type":"string"},"limit":{"type":["integer","null"],"minimum":0},"used":{"type":["integer","null"],"minimum":0},"remaining":{"type":["integer","null"],"minimum":0}}},"AccountFeature":{"type":"object","additionalProperties":false,"required":["id","label","available","reason_code"],"properties":{"id":{"type":"string","enum":["api_access","credit_purchase","assistant_access","mail_access","mail_ai"]},"label":{"type":"string"},"available":{"type":"boolean"},"reason_code":{"type":["string","null"]}}},"AccountUsageCredits":{"type":"object","additionalProperties":false,"required":["balance","spendable_balance","subscription_balance","purchased_balance","debt_amount","max_debt_credits","debt_headroom","dunning_status","start_blocked_by_dunning","last_credit_update"],"properties":{"balance":{"type":"integer"},"spendable_balance":{"type":"integer","minimum":0},"subscription_balance":{"type":"integer"},"purchased_balance":{"type":"integer","minimum":0},"debt_amount":{"type":"integer","minimum":0},"max_debt_credits":{"type":"integer","minimum":0,"description":"Team effective max debt credits, including team-specific overrides.\n"},"debt_headroom":{"type":"integer","minimum":0,"description":"Remaining debt headroom after current debt is applied to the effective max debt credits.\n"},"dunning_status":{"type":["string","null"]},"start_blocked_by_dunning":{"type":"boolean"},"last_credit_update":{"type":["string","null"],"format":"date-time"}}},"AccountPurchasedCredits":{"type":"object","additionalProperties":false,"required":["active_pack_count","remaining","earliest_expires_at","expiring_soon"],"properties":{"active_pack_count":{"type":"integer","minimum":0},"remaining":{"type":"integer","minimum":0},"earliest_expires_at":{"type":["string","null"],"format":"date-time"},"expiring_soon":{"type":"object","additionalProperties":false,"required":["days","pack_count","credits"],"properties":{"days":{"type":"integer","minimum":1},"pack_count":{"type":"integer","minimum":0},"credits":{"type":"integer","minimum":0}}}}},"AccountUsageWindow":{"type":"object","additionalProperties":false,"required":["id","label","starts_at","ends_at","transaction_count","net_amount","by_type"],"properties":{"id":{"type":"string","enum":["last_7_days","last_30_days","month_to_date"]},"label":{"type":"string"},"starts_at":{"type":"string","format":"date-time"},"ends_at":{"type":"string","format":"date-time"},"transaction_count":{"type":"integer","minimum":0},"net_amount":{"type":"integer"},"by_type":{"type":"array","items":{"$ref":"#\/components\/schemas\/AccountUsageTypeSummary"}}}},"AccountUsageTypeSummary":{"type":"object","additionalProperties":false,"required":["type","label","amount","count"],"properties":{"type":{"$ref":"#\/components\/schemas\/CreditTransactionType"},"label":{"type":"string"},"amount":{"type":"integer"},"count":{"type":"integer","minimum":1}}},"AccountRecentTransactions":{"type":"object","additionalProperties":false,"required":["data","has_more","url"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/CreditTransaction"}},"has_more":{"type":"boolean"},"url":{"type":"string","format":"uri"}}},"ActivityListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Activity"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}},"Activity":{"type":"object","additionalProperties":false,"required":["id","event_type","occurred_at","resource","actor","request_id","summary","metadata"],"properties":{"id":{"type":"string","pattern":"^act_[0-9A-HJKMNP-TV-Z]{26}$"},"event_type":{"$ref":"#\/components\/schemas\/ActivityEventType"},"occurred_at":{"type":"string","format":"date-time"},"resource":{"anyOf":[{"$ref":"#\/components\/schemas\/ActivityResourceReference"},{"type":"null"}]},"actor":{"$ref":"#\/components\/schemas\/ActivityActor"},"request_id":{"type":["string","null"],"format":"uuid"},"summary":{"type":"string"},"metadata":{"$ref":"#\/components\/schemas\/ActivityMetadata"}}},"ActivityResourceReference":{"type":"object","additionalProperties":false,"required":["type","id"],"properties":{"type":{"$ref":"#\/components\/schemas\/ActivityResourceType"},"id":{"type":"string","description":"Public resource id, never a numeric database id."}}},"ActivityActor":{"type":"object","additionalProperties":false,"required":["kind","user","api_key"],"properties":{"kind":{"type":"string","enum":["api_key","user","system","unknown"]},"user":{"anyOf":[{"$ref":"#\/components\/schemas\/ActivityActorUser"},{"type":"null"}]},"api_key":{"anyOf":[{"$ref":"#\/components\/schemas\/ActivityActorApiKey"},{"type":"null"}]}}},"ActivityActorUser":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"ActivityActorApiKey":{"type":"object","additionalProperties":false,"required":["id","display_id"],"properties":{"id":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$"},"display_id":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$"}}},"ActivityMetadata":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"null"},{"type":"array","items":{"type":"string"}}]},"description":"Conservative allowlist only. Raw activity_log.properties, internal ids, names, token material, provider payloads, mail content, assistant prompts, and tool arguments are not exposed.\n"},"ActivityResourceType":{"type":"string","enum":["project","api_key","cli_device_authorization","webhook_subscription"]},"ActivityEventType":{"type":"string","enum":["project_created","project_updated","project_deleted","team_api_key_created","team_api_key_renamed","team_api_key_preset_changed","team_api_key_expiration_changed","team_api_key_rotated","team_api_key_revoked","team_api_key_project_scope_changed","cli_device_authorization_approved","cli_device_authorization_denied","cli_device_authorization_consumed","webhook_subscription_created","webhook_subscription_updated","webhook_subscription_enabled","webhook_subscription_disabled","webhook_subscription_deleted","webhook_subscription_secret_rotated"]},"AssistantChatListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/AssistantChat"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}},"AssistantChatEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/AssistantChat"}}},"AssistantChat":{"type":"object","additionalProperties":false,"required":["id","title","title_source","status","run_count","latest_run","created_at","updated_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"title":{"type":"string"},"title_source":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"run_count":{"type":"integer","minimum":0},"latest_run":{"anyOf":[{"$ref":"#\/components\/schemas\/AssistantLatestRun"},{"type":"null"}]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"AssistantLatestRun":{"type":"object","additionalProperties":false,"required":["id","status","started_at","completed_at","created_at","updated_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"$ref":"#\/components\/schemas\/AssistantRunStatus"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"AssistantRunListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/AssistantRun"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}},"AssistantRunEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/AssistantRun"}}},"AssistantRun":{"type":"object","additionalProperties":false,"required":["id","chat","status","reason_code","model","usage","has_user_message","has_assistant_response","user_message_excerpt","assistant_response_excerpt","tool_call_count","roundtrip_count","started_at","completed_at","created_at","updated_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"chat":{"$ref":"#\/components\/schemas\/AssistantRunChat"},"status":{"$ref":"#\/components\/schemas\/AssistantRunStatus"},"reason_code":{"type":["string","null"],"enum":["provider_error","user_cancelled","confirmation_denied","confirmation_required","response_blocked",null]},"model":{"$ref":"#\/components\/schemas\/AssistantRunModel"},"usage":{"$ref":"#\/components\/schemas\/AssistantRunUsage"},"has_user_message":{"type":"boolean"},"has_assistant_response":{"type":"boolean"},"user_message_excerpt":{"type":["string","null"],"maxLength":240},"assistant_response_excerpt":{"type":["string","null"],"maxLength":240},"tool_call_count":{"type":"integer","minimum":0},"roundtrip_count":{"type":"integer","minimum":0},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"AssistantRunChat":{"type":"object","additionalProperties":false,"required":["id","title"],"properties":{"id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"title":{"type":["string","null"]}}},"AssistantRunModel":{"type":"object","additionalProperties":false,"required":["alias","label"],"properties":{"alias":{"type":["string","null"]},"label":{"type":["string","null"]}}},"AssistantRunUsage":{"type":"object","additionalProperties":false,"required":["prompt_tokens","completion_tokens","total_tokens","usage_unavailable","usage_finalized_at","charged_credits"],"properties":{"prompt_tokens":{"type":["integer","null"],"minimum":0},"completion_tokens":{"type":["integer","null"],"minimum":0},"total_tokens":{"type":["integer","null"],"minimum":0},"usage_unavailable":{"type":"boolean"},"usage_finalized_at":{"type":["string","null"],"format":"date-time"},"charged_credits":{"type":["integer","null"],"minimum":0}}},"AssistantRunStatus":{"type":"string","enum":["pending","running","awaiting_confirmation","awaiting_user_input","cancelled","completed","denied","failed"]},"MailSearchScope":{"type":"object","properties":{"kind":{"type":"string","enum":["unified","mailbox","folder","all_mail","local_drafts","view"]},"value":{"type":["string","null"]}}},"MailSearchInput":{"type":"object","properties":{"query":{"type":"string","maxLength":500},"cursor":{"type":["string","null"],"maxLength":32768},"per_page":{"type":"integer","minimum":1,"maximum":100,"default":25},"mailbox_ids":{"type":"array","maxItems":50,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"collection_ids":{"type":"array","maxItems":50,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"scope":{"$ref":"#\/components\/schemas\/MailSearchScope"},"filters":{"$ref":"#\/components\/schemas\/MailSearchFilters"}}},"MailSearchFilters":{"type":"object","description":"Shared Mail filters. Dates use ISO dates; IDs are opaque public IDs. Provider-specific unsupported fields appear in coverage.","properties":{"tag_ids":{"type":"array","maxItems":50,"items":{"type":"string"}},"assigned_user_ids":{"type":"array","maxItems":50,"items":{"type":"string"}},"unassigned":{"type":"boolean"},"assignment_group":{"type":"string"},"ungrouped":{"type":"boolean"},"following":{"type":"string","enum":["current_user"]},"status":{"type":"string","enum":["active","pending"]},"view":{"type":"string","enum":["mine","starred","assigned","unassigned","snoozed","pending","due_reminders"]},"unread":{"type":"boolean"},"starred":{"type":"boolean"},"due_reminders":{"type":"boolean"},"from":{"type":"string","maxLength":255},"to":{"type":"string","maxLength":255},"cc":{"type":"string","maxLength":255},"bcc":{"type":"string","maxLength":255},"subject":{"type":"string","maxLength":255},"body":{"type":"string","maxLength":500},"gmail_raw":{"type":"string","maxLength":500},"date_from":{"type":"string","format":"date"},"date_to":{"type":"string","format":"date"},"has_attachment":{"type":"boolean"},"is_read":{"type":"boolean"},"is_unread":{"type":"boolean"},"is_flagged":{"type":"boolean"},"is_answered":{"type":"boolean"},"is_draft":{"type":"boolean"},"larger":{"type":"number"},"smaller":{"type":"number"},"labels":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":255}},"sent_outcome":{"type":"array","maxItems":50,"items":{"type":"string"}},"follow_up_status":{"type":"array","maxItems":50,"items":{"type":"string"}},"custom_fields":{"type":"array","description":"Subject to configured condition limit (default 10) and field-schema validation.","items":{"type":"object","required":["field_public_id","operator"],"properties":{"field_public_id":{"type":"string"},"operator":{"type":"string"},"value":[]}}},"provider_scope":{"type":"object","properties":{"kind":{"type":"string","enum":["special_use","folder"]},"value":{"type":"string"}}}}},"MailSearchEnvelope":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailThread"}},"meta":{"type":"object","required":["pagination"],"properties":{"pagination":{"type":"object","required":["per_page","has_more","next_cursor"],"properties":{"per_page":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"coverage":{"type":"object","properties":{"status":{"type":"string"},"truncated":{"type":"boolean"},"truncation_reason":{"type":["string","null"]},"searched_scopes":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailSearchCoverageScope"}},"skipped_scopes":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailSearchCoverageScope"}}}}}}}},"MailSearchCoverageScope":{"type":"object","properties":{"mailbox_id":{"type":"string"},"source":{"type":"string"},"reason":{"type":["string","null"]},"field":{"type":"string"},"result_count":{"type":"integer"},"truncated":{"type":"boolean"},"path":{"type":["string","null"]},"special_use":{"type":["string","null"]}}},"MailDraftInput":{"type":"object","required":["persona_id","subject","to","cc","bcc","body_mode","body_text","body_html"],"properties":{"persona_id":{"type":"string","description":"Current same-mailbox public persona ID with a send-as grant."},"subject":{"type":["string","null"],"maxLength":500},"to":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["address"],"properties":{"address":{"type":"string","format":"email","maxLength":255},"name":{"type":["string","null"],"maxLength":255}}}},"cc":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["address"],"properties":{"address":{"type":"string","format":"email","maxLength":255},"name":{"type":["string","null"],"maxLength":255}}}},"bcc":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["address"],"properties":{"address":{"type":"string","format":"email","maxLength":255},"name":{"type":["string","null"],"maxLength":255}}}},"body_mode":{"type":"string","enum":["plain","rich"]},"body_text":{"type":["string","null"],"maxLength":1000000},"body_html":{"type":["string","null"],"maxLength":1000000,"description":"Must be null for plain drafts. Rich HTML is sanitized by the existing draft service."},"quote_suppressed":{"type":"boolean"},"referenced_message_id":{"type":["string","null"],"description":"Creation only. Same-mailbox public message ID; requires reference_action."},"reference_action":{"type":["string","null"],"enum":["reply","forward",null],"description":"Creation only. Reply-all uses reply with explicitly selected recipients."}}},"MailDraftSnapshot":{"allOf":[{"$ref":"#\/components\/schemas\/MailDraftInput"},{"type":"object","required":["id","mailbox_id","thread_id","revision","updated_at","attachments"],"properties":{"id":{"type":"string"},"mailbox_id":{"type":"string"},"thread_id":{"type":["string","null"]},"revision":{"type":"string","minLength":64,"maxLength":64},"updated_at":{"type":["string","null"]},"editable":{"type":"boolean"},"submission_unresolved":{"type":"boolean","description":"Provider acceptance is unknown; the attempt is immutable and must not be resubmitted."},"attachments":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","description":"Draft-bound staged reference, not a provider handle or storage path."},"filename":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer"},"disposition":{"type":"string"},"cid":{"type":["string","null"]}}}}}}]},"MailContentMessage":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","thread_id","subject","from","to","cc","state","origin","snippet","attachment_count","flags","date"],"properties":{"id":{"type":"string"},"mailbox_id":{"type":"string"},"thread_id":{"type":["string","null"]},"subject":{"type":["string","null"]},"from":{"type":["object","null"]},"to":{"type":["array","null"],"items":{"type":"object"}},"cc":{"type":["array","null"],"items":{"type":"object"}},"state":{"type":"string","enum":["draft","queued","sent","received","send_failed"]},"origin":{"type":"string"},"snippet":{"type":["string","null"]},"attachment_count":{"type":"integer"},"flags":{"type":["array","null"],"items":{"type":"string"}},"date":{"type":["string","null"],"format":"date-time"}}},"MailContentMessageEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailContentMessage"}}},"MailContentMessageListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailContentMessage"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}},"MailContentBodyEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","mailbox_id","plain","html","attachments","header_metadata","privacy"],"properties":{"id":{"type":"string"},"mailbox_id":{"type":"string"},"plain":{"type":["string","null"]},"content_source":{"type":"string","enum":["provider","authored_snapshot"],"description":"Authored snapshot is a labeled retained preview, not proof of provider delivery."},"html":{"type":["string","null"],"description":"Sanitized HTML. Render in a sandbox; fetch CID attachment URLs with bearer headers and use local blob URLs, never URL credentials."},"attachments":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string"},"mime_type":{"type":"string","description":"MIME type on retained authored previews."},"size":{"type":"integer","description":"Staged byte count on retained authored previews."},"encoded_size":{"type":"integer"},"inline":{"type":"boolean"},"embedded":{"type":"boolean"},"content_id":{"type":"string"}}}},"header_metadata":{"type":["object","array"],"description":"Ingestion-time allowlisted header metadata, never raw provider headers."},"privacy":{"type":"object","description":"Shared remote-content policy and tracking suppression counts."},"sender_safety":{"type":"object","description":"Optional shared sender classification, signals and rule type. Does not grant rule management.","additionalProperties":false,"properties":{"blocked":{"type":"boolean"},"allowed":{"type":"boolean"},"external":{"type":"boolean"},"rule":{"type":["object","null"],"properties":{"rule_kind":{"type":"string"},"target_type":{"type":"string"}}},"signals":{"type":"array","items":{"type":"string"}},"signal_metadata":{"type":["object","array"]}}},"links":{"type":"array","description":"Optional warnings for sanitized links. Unsafe original URLs are never returned.","items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer"},"href_key":{"type":["string","null"]},"text_key":{"type":"string"},"navigable":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}},"display_host":{"type":["string","null"]},"visible_host":{"type":["string","null"]}}}}}}}},"MailMailboxListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailMailbox"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}},"MailMailboxEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailMailbox"}}},"MailMailbox":{"type":"object","additionalProperties":false,"required":["id","email_address","display_name","provider_backend","connection_method","lifecycle_state","health","bootstrap","capabilities","created_at","updated_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"email_address":{"type":"string","format":"email"},"display_name":{"type":["string","null"]},"provider_backend":{"type":["string","null"]},"connection_method":{"type":["string","null"]},"lifecycle_state":{"type":["string","null"]},"health":{"$ref":"#\/components\/schemas\/MailMailboxHealth"},"bootstrap":{"$ref":"#\/components\/schemas\/MailMailboxBootstrap"},"capabilities":{"$ref":"#\/components\/schemas\/MailMailboxCapabilities"},"folders":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailFolder"}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"MailMailboxHealth":{"type":"object","additionalProperties":false,"required":["state","attention_reason","send_ready"],"properties":{"state":{"type":["string","null"]},"attention_reason":{"type":["string","null"]},"send_ready":{"type":"boolean"}}},"MailMailboxBootstrap":{"type":"object","additionalProperties":false,"required":["completeness","history_since","started_at","completed_at","folders_discovered_at"],"properties":{"completeness":{"type":["string","null"]},"history_since":{"type":["string","null"],"format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"folders_discovered_at":{"type":["string","null"],"format":"date-time"}}},"MailMailboxCapabilities":{"type":"object","additionalProperties":false,"required":["can_read","can_send"],"properties":{"can_read":{"type":"boolean"},"can_send":{"type":"boolean"}}},"MailFolder":{"type":"object","additionalProperties":false,"required":["id","name","special_use","listed","subscribed","local_message_count","local_unread_count","last_synced_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"special_use":{"type":["string","null"]},"listed":{"type":"boolean"},"subscribed":{"type":"boolean"},"local_message_count":{"type":"integer","minimum":0},"local_unread_count":{"type":"integer","minimum":0},"last_synced_at":{"type":["string","null"],"format":"date-time"}}},"MailThreadListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailThread"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}},"MailThreadEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/MailThread"}}},"MailThread":{"type":"object","additionalProperties":false,"required":["id","mailbox","subject","status","message_count","unread_count","latest_activity_at","latest_snippet","participants","assignment","tags","follow_up","snoozed_until","archived_at","created_at","updated_at"],"properties":{"hits":{"type":"array","description":"Matched-message excerpts, present on the delegated search surface only.","items":{"type":"object","required":["message_id"],"properties":{"message_id":{"type":"string"},"matched_fields":{"type":"array","items":{"type":"string"}},"snippet":{"type":["string","null"]},"message_date":{"type":["string","null"],"format":"date-time"}}}},"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"mailbox":{"$ref":"#\/components\/schemas\/MailThreadMailbox"},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["active","pending"]},"message_count":{"type":"integer","minimum":0},"unread_count":{"type":"integer","minimum":0},"latest_activity_at":{"type":["string","null"],"format":"date-time"},"latest_snippet":{"type":["string","null"],"maxLength":240},"participants":{"$ref":"#\/components\/schemas\/MailThreadParticipants"},"assignment":{"$ref":"#\/components\/schemas\/MailThreadAssignment"},"tags":{"type":"array","items":{"$ref":"#\/components\/schemas\/MailThreadTag"}},"follow_up":{"anyOf":[{"$ref":"#\/components\/schemas\/MailFollowUpSummary"},{"type":"null"}]},"snoozed_until":{"type":["string","null"],"format":"date-time"},"archived_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"MailThreadMailbox":{"type":"object","additionalProperties":false,"required":["id","email_address","display_name"],"properties":{"id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"email_address":{"type":["string","null"],"format":"email"},"display_name":{"type":["string","null"]}}},"MailThreadParticipants":{"type":"object","additionalProperties":false,"required":["data","has_more"],"properties":{"data":{"type":"array","maxItems":10,"items":{"$ref":"#\/components\/schemas\/MailThreadParticipant"}},"has_more":{"type":"boolean"}}},"MailThreadParticipant":{"type":"object","additionalProperties":false,"required":["name","address"],"properties":{"name":{"type":["string","null"]},"address":{"type":"string","format":"email"}}},"MailThreadAssignment":{"type":"object","additionalProperties":false,"required":["user","group"],"properties":{"user":{"anyOf":[{"$ref":"#\/components\/schemas\/MailThreadAssignedUser"},{"type":"null"}]},"group":{"anyOf":[{"$ref":"#\/components\/schemas\/MailThreadAssignedGroup"},{"type":"null"}]}}},"MailThreadAssignedUser":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"MailThreadAssignedGroup":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"MailThreadTag":{"type":"object","additionalProperties":false,"required":["id","name","color"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"color":{"type":["string","null"]}}},"MailFollowUpSummary":{"type":"object","additionalProperties":false,"required":["state","reason_code","state_reason","next_due_at","paused_until","sent_count","active_target_count","blocked_reason"],"properties":{"state":{"type":["string","null"]},"reason_code":{"type":["string","null"]},"state_reason":{"type":["string","null"]},"next_due_at":{"type":["string","null"],"format":"date-time"},"paused_until":{"type":["string","null"],"format":"date-time"},"sent_count":{"type":"integer","minimum":0},"active_target_count":{"type":"integer","minimum":0},"blocked_reason":{"type":["string","null"]}}},"WebhookSubscriptionListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/WebhookSubscription"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/Pagination"}}}}},"WebhookSubscriptionEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/WebhookSubscription"}}},"WebhookSubscriptionSecretEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["webhook","secret"],"properties":{"webhook":{"$ref":"#\/components\/schemas\/WebhookSubscription"},"secret":{"type":"string","pattern":"^whsec_[a-f0-9]{64}$","description":"One-time plaintext signing secret. It is never returned again."}}}}},"WebhookSubscriptionDeleteEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","deleted"],"properties":{"id":{"type":"string","pattern":"^whsub_[0-9A-HJKMNP-TV-Z]{26}$"},"deleted":{"type":"boolean","const":true}}}}},"WebhookSubscription":{"type":"object","additionalProperties":false,"required":["id","name","description","enabled","status","endpoint","event_types","signing_secret","last_delivery","created_at","updated_at","disabled_at"],"properties":{"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Exact configuration revision returned by the detail read; excludes observational delivery timestamps."},"id":{"type":"string","pattern":"^whsub_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string","maxLength":120},"description":{"type":["string","null"],"maxLength":1000},"enabled":{"type":"boolean"},"status":{"$ref":"#\/components\/schemas\/WebhookSubscriptionStatus"},"endpoint":{"$ref":"#\/components\/schemas\/WebhookEndpoint"},"event_types":{"type":"array","items":{"$ref":"#\/components\/schemas\/WebhookEventType"}},"signing_secret":{"$ref":"#\/components\/schemas\/WebhookSigningSecretSummary"},"last_delivery":{"type":"object","additionalProperties":false,"required":["status","timestamp"],"properties":{"status":{"type":["string","null"]},"timestamp":{"type":["string","null"],"format":"date-time"}}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"disabled_at":{"type":["string","null"],"format":"date-time"}}},"WebhookEndpoint":{"type":"object","additionalProperties":false,"required":["display_url","host","path","fingerprint"],"properties":{"display_url":{"type":"string","description":"Scheme, host, and safe port only. Query strings are not exposed.","example":"https:\/\/example.com"},"host":{"type":["string","null"],"example":"example.com"},"path":{"type":["string","null"],"example":"\/webhooks\/mail"},"fingerprint":{"type":"string","description":"Non-secret endpoint fingerprint."}}},"WebhookSigningSecretSummary":{"type":"object","additionalProperties":false,"required":["active_fingerprint","previous_overlap_active","previous_overlap_expires_at"],"properties":{"active_fingerprint":{"type":["string","null"],"description":"Non-secret active signing-secret fingerprint."},"previous_overlap_active":{"type":"boolean"},"previous_overlap_expires_at":{"type":["string","null"],"format":"date-time"}}},"WebhookSubscriptionCreateRequest":{"type":"object","additionalProperties":false,"required":["name","endpoint_url","event_types"],"properties":{"name":{"type":"string","maxLength":120},"description":{"type":["string","null"],"maxLength":1000},"endpoint_url":{"type":"string","maxLength":2048,"description":"HTTPS endpoint URL validated with the webhook endpoint rules."},"event_types":{"type":"array","minItems":1,"uniqueItems":true,"items":{"$ref":"#\/components\/schemas\/WebhookEventType"}}},"description":"New subscriptions are always created enabled; enabled is rejected on create."},"WebhookSubscriptionUpdateRequest":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"name":{"type":"string","maxLength":120},"description":{"type":["string","null"],"maxLength":1000},"endpoint_url":{"type":"string","maxLength":2048},"event_types":{"type":"array","minItems":1,"uniqueItems":true,"items":{"$ref":"#\/components\/schemas\/WebhookEventType"}},"enabled":{"type":"boolean"}}},"WebhookDeliveryListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/WebhookDelivery"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/CursorPagination"}}}}},"WebhookDeliveryDetailEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/WebhookDeliveryDetail"}}},"WebhookDelivery":{"type":"object","additionalProperties":false,"required":["id","webhook_id","event_id","event_type","event_version","event_occurred_at","status","http_status","attempt_count","next_retry_at","request_id","last_error","created_at","updated_at"],"properties":{"id":{"type":"string","pattern":"^dlv_[0-9A-HJKMNP-TV-Z]{26}$"},"webhook_id":{"type":["string","null"],"pattern":"^whsub_[0-9A-HJKMNP-TV-Z]{26}$"},"event_id":{"type":"string","pattern":"^evt_[0-9A-HJKMNP-TV-Z]{26}$"},"event_type":{"$ref":"#\/components\/schemas\/WebhookEventType"},"event_version":{"type":"integer","minimum":1},"event_occurred_at":{"type":["string","null"],"format":"date-time"},"status":{"$ref":"#\/components\/schemas\/WebhookDeliveryStatus"},"http_status":{"type":["integer","null"],"minimum":100,"maximum":599},"attempt_count":{"type":"integer","minimum":0},"next_retry_at":{"type":["string","null"],"format":"date-time"},"request_id":{"type":["string","null"],"pattern":"^att_[0-9A-HJKMNP-TV-Z]{26}$"},"last_error":{"type":"object","additionalProperties":false,"required":["failure_reason","summary"],"properties":{"failure_reason":{"type":["string","null"]},"summary":{"type":["string","null"],"description":"Stored sanitized response excerpt."}}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"WebhookDeliveryDetail":{"type":"object","additionalProperties":false,"required":["revision","id","webhook_id","event_id","event_type","event_version","event_occurred_at","status","http_status","attempt_count","next_retry_at","request_id","last_error","created_at","updated_at","payload","request","response","attempts"],"properties":{"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Exact retry review of delivery state, event payload and destination configuration."},"id":{"type":"string","pattern":"^dlv_[0-9A-HJKMNP-TV-Z]{26}$"},"webhook_id":{"type":["string","null"],"pattern":"^whsub_[0-9A-HJKMNP-TV-Z]{26}$"},"event_id":{"type":"string","pattern":"^evt_[0-9A-HJKMNP-TV-Z]{26}$"},"event_type":{"$ref":"#\/components\/schemas\/WebhookEventType"},"event_version":{"type":"integer","minimum":1},"event_occurred_at":{"type":["string","null"],"format":"date-time"},"status":{"$ref":"#\/components\/schemas\/WebhookDeliveryStatus"},"http_status":{"type":["integer","null"],"minimum":100,"maximum":599},"attempt_count":{"type":"integer","minimum":0},"next_retry_at":{"type":["string","null"],"format":"date-time"},"request_id":{"type":["string","null"],"pattern":"^att_[0-9A-HJKMNP-TV-Z]{26}$"},"last_error":{"type":"object","additionalProperties":false,"required":["failure_reason","summary"],"properties":{"failure_reason":{"type":["string","null"]},"summary":{"type":["string","null"],"description":"Stored sanitized response excerpt."}}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"payload":{"type":["object","null"],"additionalProperties":true,"description":"External webhook payload when the retained outbox event still exists."},"request":{"type":"object","additionalProperties":false,"required":["method","endpoint","event_id","delivery_id","attempt_id"],"properties":{"method":{"type":"string","const":"POST"},"endpoint":{"type":"object","additionalProperties":false,"required":["display_url","path"],"properties":{"display_url":{"type":["string","null"]},"path":{"type":["string","null"],"description":"Endpoint path only, excluding query string and fragment."}}},"event_id":{"type":"string","pattern":"^evt_[0-9A-HJKMNP-TV-Z]{26}$"},"delivery_id":{"type":"string","pattern":"^dlv_[0-9A-HJKMNP-TV-Z]{26}$"},"attempt_id":{"type":["string","null"],"pattern":"^att_[0-9A-HJKMNP-TV-Z]{26}$"}}},"response":{"type":"object","additionalProperties":false,"required":["http_status","failure_reason","response_excerpt","duration_ms"],"properties":{"http_status":{"type":["integer","null"],"minimum":100,"maximum":599},"failure_reason":{"type":["string","null"]},"response_excerpt":{"type":["string","null"],"description":"Stored sanitized response excerpt."},"duration_ms":{"type":["integer","null"],"minimum":0}}},"attempts":{"type":"array","items":{"$ref":"#\/components\/schemas\/WebhookDeliveryAttempt"}}}},"WebhookDeliveryAttempt":{"type":"object","additionalProperties":false,"required":["id","attempt_number","status","started_at","completed_at","duration_ms","http_status","failure_reason","response_excerpt"],"properties":{"id":{"type":"string","pattern":"^att_[0-9A-HJKMNP-TV-Z]{26}$"},"attempt_number":{"type":"integer","minimum":1},"status":{"type":["string","null"],"enum":["queued","sending","succeeded","failed_retryable","failed_terminal","abandoned",null]},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"duration_ms":{"type":["integer","null"],"minimum":0},"http_status":{"type":["integer","null"],"minimum":100,"maximum":599},"failure_reason":{"type":["string","null"]},"response_excerpt":{"type":["string","null"]}}},"WebhookSubscriptionStatus":{"type":"string","enum":["enabled","disabled","deleted"]},"WebhookDeliveryStatus":{"type":"string","enum":["pending","retryable","paused_feature_off","paused_plan_blocked","paused_subscription_disabled","delivered","terminal_failed","skipped_filter_changed","canceled_deleted","abandoned_stale"]},"WebhookEventType":{"type":"string","enum":["message.sent","message.scheduled","message.send_cancelled","message.received","message.send_failed","message.sent_outcome.terminal","message.sent_outcome.manual_override","conversation.assigned","conversation.unassigned","conversation.group_assigned","conversation.group_unassigned","conversation.status_changed","conversation.snoozed","conversation.unsnoozed","conversation.archived","conversation.reopened","conversation.tag_added","conversation.tag_removed","conversation.followed","conversation.unfollowed","conversation.note_created","conversation.note_updated","conversation.note_deleted","conversation.reminder_created","conversation.reminder_due","conversation.reminder_completed","conversation.reminder_cancelled","conversation.pre_send_warning_shown","conversation.pre_send_warning_confirmed","conversation.pre_send_warning_cancelled","mailbox.collection_membership_changed","mailbox.folder_operation.completed","mailbox.folder_operation.failed","mailbox.health_changed"]},"ApiKeyListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ApiKey"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/Pagination"}}}}},"ApiKeyEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/ApiKey"}}},"ApiKeySecretEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["access_token","token_type","key"],"properties":{"access_token":{"type":"string","description":"One-time plaintext bearer value. It is never returned again."},"token_type":{"type":"string","const":"Bearer"},"key":{"$ref":"#\/components\/schemas\/ApiKey"}}}}},"ApiKeyRotationEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["access_token","token_type","previous_key","key"],"properties":{"access_token":{"type":"string","description":"One-time plaintext replacement bearer value."},"token_type":{"type":"string","const":"Bearer"},"previous_key":{"$ref":"#\/components\/schemas\/ApiKey"},"key":{"$ref":"#\/components\/schemas\/ApiKey"}}}}},"ApiKey":{"type":"object","additionalProperties":false,"required":["id","display_id","name","preset","capabilities","project_scope","expiration","lifecycle_state","last_used_at","created_at","updated_at","revoked_at"],"properties":{"id":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$"},"display_id":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"preset":{"type":"string","enum":["full_access","read_only","custom"]},"capabilities":{"type":"array","items":{"$ref":"#\/components\/schemas\/Capability"}},"project_scope":{"$ref":"#\/components\/schemas\/ProjectScope"},"expiration":{"$ref":"#\/components\/schemas\/KeyExpiration"},"lifecycle_state":{"type":"string","enum":["active","expired","revoked"]},"last_used_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"revoked_at":{"type":["string","null"],"format":"date-time"}}},"ApiKeyCreateRequest":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","maxLength":255},"preset":{"type":"string","enum":["full_access","read_only","custom"],"default":"full_access"},"group_selections":{"type":"array","items":{"$ref":"#\/components\/schemas\/ApiKeyCapabilitySelection"}},"project_scope":{"$ref":"#\/components\/schemas\/ApiKeyProjectScopeMode"},"selected_project_public_ids":{"type":"array","items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"expires_at":{"type":["string","null"],"format":"date-time"}}},"ApiKeyUpdateRequest":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"name":{"type":"string","maxLength":255},"preset":{"type":"string","enum":["full_access","read_only","custom"]},"group_selections":{"type":"array","items":{"$ref":"#\/components\/schemas\/ApiKeyCapabilitySelection"}},"project_scope":{"$ref":"#\/components\/schemas\/ApiKeyProjectScopeMode"},"selected_project_public_ids":{"type":"array","items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"expires_at":{"type":["string","null"],"format":"date-time"}}},"ApiKeyRotateRequest":{"type":"object","additionalProperties":false,"properties":{"expires_at":{"type":["string","null"],"format":"date-time","description":"Required only when rotating an expired source key."}}},"ApiKeyCapabilitySelection":{"type":"object","additionalProperties":false,"required":["id","mode"],"properties":{"id":{"type":"string","enum":["projects","credits","team","api_keys","account","activity","tasks","skills","tools","templates","rules","connections","computers","artifacts","publications","channels","webhooks"]},"mode":{"type":"string","enum":["read","read_write"]}}},"ApiKeyProjectScopeMode":{"type":"string","enum":["all_projects","selected_projects"]},"TaskListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Task"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/Pagination"}}}}},"TaskEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Task"}}},"TaskActionEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["task"],"properties":{"task":{"$ref":"#\/components\/schemas\/Task"},"idempotent_replay":{"type":"boolean"}}}}},"TaskEventsEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["events","next_sequence"],"properties":{"events":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_sequence":{"type":"integer","minimum":0}}}}},"TaskOutputsEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["outputs"],"properties":{"outputs":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}},"Task":{"type":"object","additionalProperties":true,"required":["id","title","brief","origin","visibility","status","permissions","created_at","updated_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"title":{"type":["string","null"]},"brief":{"type":["string","null"]},"origin":{"type":"string"},"visibility":{"type":"string","enum":["personal","team","space","mail_thread"]},"status":{"type":["string","null"],"enum":["queued","running","waiting","paused","cancelling","completed","failed","cancelled",null]},"waiting_reason":{"type":["string","null"]},"last_progress":{"type":["string","null"]},"permissions":{"type":"object","additionalProperties":true},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"TaskStartRequest":{"type":"object","additionalProperties":false,"required":["brief"],"properties":{"title":{"type":"string","maxLength":255},"brief":{"type":"string","maxLength":12000},"visibility":{"type":"string","enum":["personal","team"]},"model_route":{"type":"string","maxLength":80},"selected_space_id":{"type":"string","maxLength":80},"expected_result":{"type":"string","maxLength":2000},"credit_cap_microcredits":{"type":"integer","minimum":0},"source_refs":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"TaskControlRequest":{"type":"object","additionalProperties":false,"required":["action"],"properties":{"action":{"type":"string","enum":["pause","resume","resume_wait","stop","continue","retry"]},"instructions":{"type":"string","maxLength":12000},"credit_cap_microcredits":{"type":"integer","minimum":0}}},"SpaceListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Space"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"type":"object","additionalProperties":true}}}}},"SpaceEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Space"}}},"Space":{"type":"object","additionalProperties":false,"required":["id","slug","name","kind","status","language","repository_state","created_at","updated_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["personal","team_library","client","project"]},"status":{"type":["string","null"]},"language":{"type":["string","null"]},"repository_state":{"type":["string","null"],"enum":["preparing","ready","failed",null]},"archived_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"SpaceCreateRequest":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"kind":{"type":"string","enum":["client","project"],"default":"project"},"name":{"type":"string","maxLength":255},"description":{"type":["string","null"],"maxLength":1000},"language":{"type":"string","example":"en-US"},"mail_account_public_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}}},"SpaceFilesEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["files"],"properties":{"files":{"type":"array","items":{"$ref":"#\/components\/schemas\/SpaceFile"}},"knowledge":{"type":"object","additionalProperties":true}}}}},"SpaceFileEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["file"],"properties":{"file":{"$ref":"#\/components\/schemas\/SpaceFile"}}}}},"SpaceFile":{"type":"object","additionalProperties":true,"required":["path"],"properties":{"path":{"type":"string"},"content":{"type":"string"},"revision":{"type":["string","null"]},"kind":{"type":"string"},"size":{"type":"integer","minimum":0}}},"SpaceFileSaveRequest":{"type":"object","additionalProperties":false,"required":["path","content"],"properties":{"path":{"type":"string","maxLength":1024},"content":{"type":"string"},"expected_revision":{"type":["string","null"],"minLength":64,"maxLength":64}}},"SpaceFileHistoryEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true}}},"SpaceFileSearchEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["results"],"properties":{"results":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}},"SkillListEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["skills"],"properties":{"skills":{"type":"array","items":{"type":"object","additionalProperties":true}},"canonical_action":{"type":"string"}}}}},"SkillEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"required":["skill"],"properties":{"skill":{"$ref":"#\/components\/schemas\/Skill"}}}}},"Skill":{"type":"object","additionalProperties":true,"required":["id","space","path","name","description","instructions","revision"],"properties":{"id":{"type":"string"},"space":{"type":"object","additionalProperties":true},"path":{"type":"string"},"name":{"type":["string","null"]},"description":{"type":["string","null"]},"instructions":{"type":["string","null"]},"revision":{"type":["string","null"]}}},"SkillSaveRequest":{"type":"object","additionalProperties":true,"required":["space_id"],"properties":{"space_id":{"type":"string","maxLength":255},"path":{"type":"string","maxLength":1024},"name":{"type":"string","maxLength":255},"description":{"type":"string","maxLength":1000},"content":{"type":"string"},"expected_revision":{"type":["string","null"],"minLength":64,"maxLength":64}}},"SkillRunRequest":{"type":"object","additionalProperties":true,"required":["space_id","path"],"properties":{"space_id":{"type":"string","maxLength":255},"path":{"type":"string","maxLength":1024},"inputs":{"type":"object","additionalProperties":true},"message":{"type":"string","maxLength":12000}}},"OperationEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true}}},"ProjectListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Project"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/Pagination"}}}}},"ProjectEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/Project"}}},"Project":{"type":"object","additionalProperties":false,"required":["id","name","description","url","status","timezone","language","limit","automate","created_at","updated_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"status":{"$ref":"#\/components\/schemas\/ProjectStatus"},"timezone":{"$ref":"#\/components\/schemas\/ProjectTimezone"},"language":{"$ref":"#\/components\/schemas\/ProjectLanguage"},"limit":{"type":"integer","minimum":0},"automate":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ProjectCreateRequest":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"status":{"$ref":"#\/components\/schemas\/ProjectStatus"},"timezone":{"$ref":"#\/components\/schemas\/ProjectTimezone","default":"UTC"},"language":{"$ref":"#\/components\/schemas\/ProjectLanguage","default":"en-US"},"limit":{"type":"integer","minimum":0,"default":0},"automate":{"type":"boolean","default":false}}},"ProjectUpdateRequest":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"status":{"$ref":"#\/components\/schemas\/ProjectStatus"},"timezone":{"$ref":"#\/components\/schemas\/ProjectTimezone"},"language":{"$ref":"#\/components\/schemas\/ProjectLanguage"},"limit":{"type":"integer","minimum":0},"automate":{"type":"boolean"}}},"ProjectDeleteEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["id","deleted"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"deleted":{"type":"boolean","const":true}}}}},"ProjectStatus":{"type":"string","enum":["active","paused","archived"]},"ProjectTimezone":{"type":"string","enum":["UTC","America\/New_York","America\/Los_Angeles","Europe\/London","Europe\/Berlin","Asia\/Tokyo"]},"ProjectLanguage":{"type":"string","enum":["en-US","en-GB","en-AU","en-CA","de-DE","de-AT","de-CH","es-ES","es-MX","es-AR","fr-FR","fr-CA","fr-BE","fr-CH"]},"CreditBalanceEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/CreditBalance"}}},"CreditBalance":{"type":"object","additionalProperties":false,"required":["balance","subscription","last_credit_update"],"properties":{"balance":{"type":"integer"},"subscription":{"anyOf":[{"$ref":"#\/components\/schemas\/CreditSubscription"},{"type":"null"}]},"last_credit_update":{"type":["string","null"],"format":"date-time"}}},"CreditSubscription":{"type":"object","additionalProperties":false,"required":["plan","status"],"properties":{"plan":{"type":"string"},"status":{"type":"string"}}},"CreditTransactionListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/CreditTransaction"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/Pagination"}}}}},"CreditTransaction":{"type":"object","additionalProperties":false,"required":["id","type","amount","description","created_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"type":{"$ref":"#\/components\/schemas\/CreditTransactionType"},"amount":{"type":"integer","description":"Signed credit amount."},"description":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"CreditTransactionType":{"type":"string","enum":["credit_added","credit_spent","debt","adjustment","other"]},"TeamRole":{"type":"object","additionalProperties":false,"required":["key","name","description"],"properties":{"key":{"type":["string","null"]},"name":{"type":["string","null"]},"description":{"type":["string","null"]}}},"TeamMemberListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/TeamMember"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/Pagination"}}}}},"TeamMemberEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/TeamMember"}}},"TeamMember":{"type":"object","additionalProperties":false,"required":["id","name","email","role","status","joined_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"role":{"$ref":"#\/components\/schemas\/TeamRole"},"status":{"type":"string","const":"active"},"joined_at":{"type":["string","null"],"format":"date-time"}}},"TeamInvitationListEnvelope":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/TeamInvitation"}},"meta":{"type":"object","additionalProperties":false,"required":["pagination"],"properties":{"pagination":{"$ref":"#\/components\/schemas\/Pagination"}}}}},"TeamInvitationEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/TeamInvitation"}}},"TeamInvitation":{"type":"object","additionalProperties":false,"required":["id","email","role","status","created_at","expires_at"],"properties":{"id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"email":{"type":"string","format":"email"},"role":{"$ref":"#\/components\/schemas\/TeamRole"},"status":{"type":"string","const":"pending"},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"null"}}},"CliDiscoveryEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/CliDiscovery"}}},"CliDiscovery":{"type":"object","additionalProperties":false,"required":["enabled","grant_type","user_code_length","device_authorization_endpoint","token_endpoint","verification_uri","expires_in","interval","supported_client_kinds","local_agent_default_key_lifetime_seconds","max_requested_key_lifetime_seconds"],"properties":{"enabled":{"type":"boolean"},"grant_type":{"type":["string","null"],"enum":["urn:ietf:params:oauth:grant-type:device_code",null]},"user_code_length":{"type":["integer","null"],"minimum":1},"device_authorization_endpoint":{"type":["string","null"],"format":"uri"},"token_endpoint":{"type":["string","null"],"format":"uri"},"verification_uri":{"type":["string","null"],"format":"uri"},"expires_in":{"type":["integer","null"],"minimum":1},"interval":{"type":["integer","null"],"minimum":1},"supported_client_kinds":{"type":["array","null"],"items":{"type":"string","enum":["cli","local_agent"]},"description":"Null when CLI auth is disabled; otherwise includes the client kinds accepted by \/device."},"local_agent_default_key_lifetime_seconds":{"oneOf":[{"type":"integer","const":2592000},{"type":"null"}],"description":"Null unless local_agent scoped key creation is advertised."},"max_requested_key_lifetime_seconds":{"oneOf":[{"type":"integer","const":7776000},{"type":"null"}],"description":"Null unless local_agent scoped key creation is advertised."}}},"CliDeviceRequest":{"oneOf":[{"$ref":"#\/components\/schemas\/CliLegacyDeviceRequest"},{"$ref":"#\/components\/schemas\/CliExplicitDeviceRequest"},{"$ref":"#\/components\/schemas\/CliLocalAgentDeviceRequest"}]},"CliLegacyDeviceRequest":{"type":"object","additionalProperties":true,"description":"Legacy metadata-only request. Omitting client_kind preserves compatibility with unknown telemetry fields but scoped key fields are rejected at runtime.\n","not":{"anyOf":[{"required":["client_kind"],"properties":{"client_kind":{"type":"string"}}},{"required":["preset"],"properties":{"preset":{"type":"string"}}},{"required":["group_selections"],"properties":{"group_selections":{"type":"array"}}},{"required":["project_scope"],"properties":{"project_scope":{"type":"string"}}},{"required":["selected_project_public_ids"],"properties":{"selected_project_public_ids":{"type":"array"}}},{"required":["expires_at"],"properties":{"expires_at":{"type":"string"}}}]},"properties":{"client_kind":{"type":"string","description":"Forbidden in the legacy omitted-client-kind request arm."},"preset":{"type":"string","description":"Forbidden unless client_kind is local_agent."},"group_selections":{"type":"array","description":"Forbidden unless client_kind is local_agent."},"project_scope":{"type":"string","description":"Forbidden unless client_kind is local_agent."},"selected_project_public_ids":{"type":"array","description":"Forbidden unless client_kind is local_agent."},"expires_at":{"type":"string","description":"Forbidden unless client_kind is local_agent."},"client_name":{"type":["string","null"],"maxLength":80,"description":"Optional client-declared name. Control characters are sanitized."},"cli_version":{"type":["string","null"],"maxLength":80,"description":"Optional client-declared version metadata. Control characters are sanitized."},"key_name":{"type":["string","null"],"maxLength":255,"description":"Optional API key name. null is treated as omitted. A non-null value must be non-empty after sanitization. When omitted or null the key is named \"Svanja CLI\", or \"Svanja CLI (<client_name>)\" when client_name is present.\n"}}},"CliExplicitDeviceRequest":{"type":"object","additionalProperties":false,"required":["client_kind"],"properties":{"client_kind":{"type":"string","const":"cli"},"client_name":{"type":["string","null"],"maxLength":80},"cli_version":{"type":["string","null"],"maxLength":80},"key_name":{"type":["string","null"],"maxLength":255,"description":"Optional API key name. null is treated as omitted. A non-null value must be non-empty after sanitization. When omitted or null the key is named \"Svanja CLI\", or \"Svanja CLI (<client_name>)\" when client_name is present.\n"}}},"CliLocalAgentDeviceRequest":{"type":"object","additionalProperties":false,"required":["client_kind"],"allOf":[{"if":{"required":["preset"],"properties":{"preset":{"const":"custom"}}},"then":{"type":"object","properties":{"group_selections":[]},"required":["group_selections"]},"else":{"not":{"type":"object","properties":{"group_selections":[]},"required":["group_selections"]}}},{"if":{"required":["project_scope"],"properties":{"project_scope":{"const":"selected_projects"}}},"then":{"type":"object","properties":{"selected_project_public_ids":[]},"required":["selected_project_public_ids"]},"else":{"not":{"type":"object","properties":{"selected_project_public_ids":[]},"required":["selected_project_public_ids"]}}}],"properties":{"client_kind":{"type":"string","const":"local_agent"},"client_name":{"type":["string","null"],"maxLength":80},"cli_version":{"type":["string","null"],"maxLength":80},"key_name":{"type":["string","null"],"maxLength":255,"description":"Optional API key name. null is treated as omitted. A non-null value must be non-empty after sanitization. When omitted or null the key is named \"Svanja CLI\", or \"Svanja CLI (<client_name>)\" when client_name is present.\n"},"preset":{"type":"string","enum":["full_access","read_only","custom"],"default":"read_only"},"group_selections":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"x-svanja-unique-by":"id","allOf":[{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"projects"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"credits"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"team"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"api_keys"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"account"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"activity"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"tasks"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"skills"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"tools"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"templates"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"rules"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"connections"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"computers"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"artifacts"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"publications"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"channels"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"webhooks"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_content"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_drafts"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_outbound"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_ai"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_workflow"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_notes"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_following"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_reminders"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_followups"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_folders"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_message_state"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_libraries"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_crm"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_custom_fields"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_administration"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_workspace"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_sender_safety"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_remote_content_trust"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"mail_preferences"}}},"minContains":0,"maxContains":1},{"contains":{"type":"object","required":["id"],"properties":{"id":{"const":"assistant"}}},"minContains":0,"maxContains":1}],"items":{"$ref":"#\/components\/schemas\/CliCapabilitySelection"},"description":"Required only when preset is custom; prohibited otherwise."},"project_scope":{"type":"string","enum":["all_projects","selected_projects"],"default":"all_projects"},"selected_project_public_ids":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"description":"Required only when project_scope is selected_projects; prohibited otherwise."},"expires_at":{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)$","description":"Defaults to 30 days for local_agent and may not exceed 90 days."}}},"CliCapabilitySelection":{"type":"object","additionalProperties":false,"required":["id","mode"],"properties":{"id":{"type":"string","enum":["projects","credits","team","api_keys","account","activity","tasks","skills","tools","templates","rules","connections","computers","artifacts","publications","channels","webhooks","mail","mail_content","mail_drafts","mail_outbound","mail_ai","mail_workflow","mail_notes","mail_following","mail_reminders","mail_followups","mail_folders","mail_message_state","mail_libraries","mail_crm","mail_custom_fields","mail_administration","mail_workspace","mail_sender_safety","mail_remote_content_trust","mail_preferences","assistant"]},"mode":{"type":"string","enum":["read","read_write"]}}},"CliDeviceEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/CliDevice"}}},"CliDevice":{"type":"object","additionalProperties":false,"required":["device_code","user_code","verification_uri","verification_uri_complete","grant_type","expires_in","interval","client_kind","requested_key"],"properties":{"device_code":{"type":"string","pattern":"^[A-Za-z0-9]{64}$","description":"One-time plaintext device code returned only by this response."},"user_code":{"type":"string","description":"Short display code for browser verification."},"verification_uri":{"type":"string","format":"uri"},"verification_uri_complete":{"type":"string","format":"uri"},"grant_type":{"type":"string","const":"urn:ietf:params:oauth:grant-type:device_code"},"expires_in":{"type":"integer","minimum":1},"interval":{"type":"integer","minimum":1},"client_kind":{"type":"string","enum":["cli","local_agent"]},"requested_key":{"$ref":"#\/components\/schemas\/CliRequestedKey"}}},"CliRequestedKey":{"type":"object","additionalProperties":false,"required":["name","preset","group_selections","project_scope","selected_project_public_ids","expires_at"],"properties":{"name":{"type":"string","maxLength":255},"preset":{"type":"string","enum":["full_access","read_only","custom"]},"group_selections":{"type":"array","items":{"$ref":"#\/components\/schemas\/CliCapabilitySelection"}},"project_scope":{"type":"string","enum":["all_projects","selected_projects"]},"selected_project_public_ids":{"type":"array","items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"expires_at":{"type":["string","null"],"format":"date-time"}}},"CliTokenRequest":{"type":"object","additionalProperties":true,"required":["grant_type","device_code"],"properties":{"grant_type":{"type":"string","const":"urn:ietf:params:oauth:grant-type:device_code"},"device_code":{"type":"string","pattern":"^[A-Za-z0-9]{64}$"}}},"CliIssuedTokenEnvelope":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#\/components\/schemas\/CliIssuedToken"}}},"CliIssuedToken":{"type":"object","additionalProperties":false,"required":["access_token","token_type","api_base_url","team","client_kind","key"],"properties":{"access_token":{"type":"string","description":"One-time plaintext team API key. Redact before storing or logging.","example":"REDACTED_ID|REDACTED_SECRET"},"token_type":{"type":"string","const":"Bearer"},"api_base_url":{"type":"string","format":"uri"},"team":{"type":"object","additionalProperties":false,"required":["display_id","name"],"properties":{"display_id":{"type":"string","pattern":"^team_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}}},"client_kind":{"type":"string","enum":["cli","local_agent"]},"key":{"$ref":"#\/components\/schemas\/CliIssuedKey"}}},"CliIssuedKey":{"type":"object","additionalProperties":false,"required":["display_id","name","preset","group_selections","project_scope","selected_project_public_ids","expires_at"],"properties":{"display_id":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string","maxLength":255},"preset":{"type":"string","enum":["full_access","read_only","custom"]},"group_selections":{"type":"array","items":{"$ref":"#\/components\/schemas\/CliCapabilitySelection"}},"project_scope":{"type":"string","enum":["all_projects","selected_projects"]},"selected_project_public_ids":{"type":"array","items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"expires_at":{"type":["string","null"],"format":"date-time"}}},"CliTokenPollingErrorEnvelope":{"type":"object","additionalProperties":false,"required":["error","request_id"],"properties":{"error":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","enum":["malformed_json","validation_failed","route_not_found","authorization_pending","slow_down","access_denied","expired_token","invalid_grant","unsupported_grant_type","rate_limited"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"request_id":{"type":"string","format":"uuid"}}}}}}