@extrovert.dev/sdk 0.1.0-pre.10 → 0.1.0-pre.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,5 +1,141 @@
1
1
  'use strict';
2
2
 
3
+ // src/administration.generated.ts
4
+ var administrativeCatalog = [{ "description": null, "id": "getConnectionAuthorization", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "authorization_id": { "type": "string" } }, "required": ["authorization_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/connection-authorizations/{authorization_id}", "responseFormat": "json", "summary": "Inspect the application and requested resource before consent" }, { "description": null, "id": "approveConnectionAuthorization", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/ConnectionConsent" }, "path": { "additionalProperties": false, "properties": { "authorization_id": { "type": "string" } }, "required": ["authorization_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/connection-authorizations/{authorization_id}/approve", "responseFormat": "json", "summary": "Authorize a new connection grant" }, { "description": null, "id": "denyConnectionAuthorization", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "authorization_id": { "type": "string" } }, "required": ["authorization_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/connection-authorizations/{authorization_id}/deny", "responseFormat": "json", "summary": "Deny an authorization request" }, { "description": null, "id": "listConnections", "inputSchema": { "additionalProperties": false, "properties": { "query": { "additionalProperties": false, "properties": { "created_by_connection_id": { "description": "Show independently surviving access created by this connection.", "type": "string" }, "cursor": { "description": "Opaque pagination cursor echoed back from a prior `next_cursor`. Treat it as an opaque token; pass it back verbatim as `?cursor` to fetch the next page.\n", "type": "string" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" } }, "required": [], "type": "object" } }, "required": null, "type": "object" }, "method": "GET", "path": "/v1/admin/connections", "responseFormat": "json", "summary": "List your connections and independently surviving created credentials" }, { "description": null, "id": "listConnectionCreatedCredentials", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "connection_id": { "type": "string" } }, "required": ["connection_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "cursor": { "description": "Opaque pagination cursor echoed back from a prior `next_cursor`. Treat it as an opaque token; pass it back verbatim as `?cursor` to fetch the next page.\n", "type": "string" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/connections/{connection_id}/created-credentials", "responseFormat": "json", "summary": "List independently surviving agent keys and enrollment tokens created by a connection" }, { "description": "Revoking an enrollment token does not revoke keys it already issued. Each issued key has its own record and revoke operation.", "id": "revokeConnectionCreatedCredential", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "connection_id": { "type": "string" }, "credential_id": { "type": "string" } }, "required": ["connection_id", "credential_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/connections/{connection_id}/created-credentials/{credential_id}/revoke", "responseFormat": "json", "summary": "Revoke one created agent key or enrollment token separately from its parent" }, { "description": "Requires an active full-account connection matching connection_id. The new credential has its own expiry and revocation, and records the source connection as provenance. The secret is returned only once.", "id": "createConnectionCredential", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/ConnectionConsent" }, "path": { "additionalProperties": false, "properties": { "connection_id": { "type": "string" } }, "required": ["connection_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/connections/{connection_id}/credentials", "responseFormat": "json", "summary": "Create an independently surviving credential" }, { "description": null, "id": "listConnectionEvents", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "connection_id": { "type": "string" } }, "required": ["connection_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "cursor": { "description": "Opaque pagination cursor echoed back from a prior `next_cursor`. Treat it as an opaque token; pass it back verbatim as `?cursor` to fetch the next page.\n", "type": "string" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/connections/{connection_id}/events", "responseFormat": "json", "summary": "List activity attributed to this connection" }, { "description": null, "id": "revokeConnection", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "connection_id": { "type": "string" } }, "required": ["connection_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/connections/{connection_id}/revoke", "responseFormat": "json", "summary": "Revoke this connection without revoking credentials it created" }, { "description": "Accepts an invitation by its raw token. IDENTITY-ONLY (no {org_id}; the token carries the org). The accept binds to the authenticated user's VERIFIED Clerk email == the normalized invitation email (else 403). Idempotent for the same user; a revoked/expired invitation cannot be accepted.\n", "id": "acceptInvitation", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/AcceptInvitationRequest" } }, "required": ["body"], "type": "object" }, "method": "POST", "path": "/v1/admin/invitations/accept", "responseFormat": "json", "summary": "Accept an invitation (identity-only; email-bound)" }, { "description": "Returns the authenticated Clerk identity plus the orgs/projects it can reach (derived from membership). The console uses this to render the org/project switchers and to revalidate cookie landing hints. IDENTITY-ONLY; no {org_id} in the URL.\n", "id": "adminMe", "inputSchema": { "additionalProperties": false, "properties": {}, "required": null, "type": "object" }, "method": "GET", "path": "/v1/admin/me", "responseFormat": "json", "summary": "The identity's reachable orgs + projects (landing scope)" }, { "description": "Clerk identity only. Preferences and devices belong to the person across all current and future organizations. Agent credentials are not accepted. Request bodies are limited to 16 KB. Responses use private, no-store caching.\n", "id": "personalNotificationSettings", "inputSchema": { "additionalProperties": false, "properties": {}, "required": null, "type": "object" }, "method": "GET", "path": "/v1/admin/me/notifications", "responseFormat": "json", "summary": "Read personal notification preferences" }, { "description": "Clerk identity only. Preferences and devices belong to the person across all current and future organizations. Agent credentials are not accepted. Request bodies are limited to 16 KB. Responses use private, no-store caching.\n", "id": "patchPersonalNotificationPreferences", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/PersonalPreferencePatch" } }, "required": ["body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/me/notifications", "responseFormat": "json", "summary": "Change one category or grouping interval with optimistic version checking" }, { "description": "Clerk identity only. Preferences and devices belong to the person across all current and future organizations. Agent credentials are not accepted. Request bodies are limited to 16 KB. Responses use private, no-store caching.\n", "id": "personalNotificationHistory", "inputSchema": { "additionalProperties": false, "properties": { "query": { "additionalProperties": false, "properties": { "cursor": { "maxLength": 1024, "type": "string" }, "limit": { "default": 50, "maximum": 100, "minimum": 1, "type": "integer" } }, "required": [], "type": "object" } }, "required": null, "type": "object" }, "method": "GET", "path": "/v1/admin/me/notifications/history", "responseFormat": "json", "summary": "List current authorized notifications across organizations" }, { "description": "Clerk identity only. Preferences and devices belong to the person across all current and future organizations. Agent credentials are not accepted. Request bodies are limited to 16 KB. Responses use private, no-store caching.\n", "id": "personalNotificationBatch", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "batch_id": { "type": "string" } }, "required": ["batch_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/me/notifications/history/{batch_id}", "responseFormat": "json", "summary": "View a grouped notification after rechecking current access" }, { "description": "Clerk identity only. Preferences and devices belong to the person across all current and future organizations. Agent credentials are not accepted. Request bodies are limited to 16 KB. Responses use private, no-store caching.\n", "id": "personalPushDevices", "inputSchema": { "additionalProperties": false, "properties": {}, "required": null, "type": "object" }, "method": "GET", "path": "/v1/admin/me/push-devices", "responseFormat": "json", "summary": "List up to 20 personal devices" }, { "description": "Clerk identity only. Preferences and devices belong to the person across all current and future organizations. Agent credentials are not accepted. Request bodies are limited to 16 KB. Responses use private, no-store caching.\n", "id": "enrollPersonalPushDevice", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/PersonalPushEnrollment" } }, "required": ["body"], "type": "object" }, "method": "POST", "path": "/v1/admin/me/push-devices", "responseFormat": "json", "summary": "Enroll or refresh this user\u2019s browser subscription without duplicates" }, { "description": "Clerk identity only. Preferences and devices belong to the person across all current and future organizations. Agent credentials are not accepted. Request bodies are limited to 16 KB. Responses use private, no-store caching.\n", "id": "personalPushPublicKey", "inputSchema": { "additionalProperties": false, "properties": {}, "required": null, "type": "object" }, "method": "GET", "path": "/v1/admin/me/push-devices/public-key", "responseFormat": "json", "summary": "Read the deployment\u2019s shared VAPID public key and availability" }, { "description": "Clerk identity only. Preferences and devices belong to the person across all current and future organizations. Agent credentials are not accepted. Request bodies are limited to 16 KB. Responses use private, no-store caching.\n", "id": "testPersonalPushDevices", "inputSchema": { "additionalProperties": false, "properties": { "body": { "additionalProperties": false, "properties": { "device_ids": { "items": { "type": "string" }, "maxItems": 20, "minItems": 1, "type": "array" } }, "required": ["device_ids"], "type": "object" } }, "required": ["body"], "type": "object" }, "method": "POST", "path": "/v1/admin/me/push-devices/test", "responseFormat": "json", "summary": "Send an explicit test to selected owned devices, once per minute" }, { "description": "Clerk identity only. Preferences and devices belong to the person across all current and future organizations. Agent credentials are not accepted. Request bodies are limited to 16 KB. Responses use private, no-store caching.\n", "id": "patchPersonalPushDevice", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/PersonalPushDevicePatch" }, "path": { "additionalProperties": false, "properties": { "device_id": { "type": "string" } }, "required": ["device_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/me/push-devices/{device_id}", "responseFormat": "json", "summary": "Rename or pause an owned device" }, { "description": "Clerk identity only. Preferences and devices belong to the person across all current and future organizations. Agent credentials are not accepted. Request bodies are limited to 16 KB. Responses use private, no-store caching.\n", "id": "removePersonalPushDevice", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "device_id": { "type": "string" } }, "required": ["device_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/me/push-devices/{device_id}", "responseFormat": "json", "summary": "Remove an owned device" }, { "description": null, "id": "listOrgs", "inputSchema": { "additionalProperties": false, "properties": {}, "required": null, "type": "object" }, "method": "GET", "path": "/v1/admin/orgs", "responseFormat": "json", "summary": "List the identity's reachable orgs" }, { "description": "Create a CHILD org under parent_org_id (required). Requires admin+ on the parent. The child inherits the root org's tier/limits and is capped by the root's max_child_orgs. Client org/customer ids are never accepted.\n", "id": "createOrg", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CreateOrgRequest" } }, "required": ["body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs", "responseFormat": "json", "summary": "Create a child org (admin+ on the parent)" }, { "description": null, "id": "patchOrg", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/PatchOrgRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}", "responseFormat": "json", "summary": "Update an org's display fields (admin)" }, { "description": "Soft-deletes (archives) the org. Guarded: an org with active child orgs or active projects cannot be archived. The compatibility customers row is never hard-deleted.\n", "id": "archiveOrg", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/orgs/{org_id}", "responseFormat": "json", "summary": "Archive (soft-delete) an org (owner)" }, { "description": null, "id": "adminGetBilling", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "month": { "example": "2026-06", "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/billing", "responseFormat": "json", "summary": "Get org billing state and plan entitlements" }, { "description": null, "id": "adminCreateBillingCheckout", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CreateBillingCheckoutRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/billing/checkout", "responseFormat": "json", "summary": "Create a Stripe Checkout Session for an Extrovert paid plan" }, { "description": "Quotes the requested domain and a configured .com baseline with the registrar, reuses or creates a lookup-keyed annual Stripe Price, then returns a Checkout Session. Registration is queued only after the domain Checkout succeeds.", "id": "adminCreateDomainBillingCheckout", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CreateDomainBillingCheckoutRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/billing/domain-checkout", "responseFormat": "json", "summary": "Create a Stripe Checkout Session for an annual managed-domain registration" }, { "description": null, "id": "adminCreateBillingPortal", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CreateBillingPortalRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/billing/portal", "responseFormat": "json", "summary": "Create a Stripe Billing Portal Session for payment recovery and subscription management" }, { "description": null, "id": "adminListCommerceRequests", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "kind": { "type": "string" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" }, "page": { "description": "Opaque page token echoed back from a prior `next_page`. Used by the legacy offset-paginated admin/console list surface; the cursor-paginated agent surface uses `Cursor` (`?cursor`) instead.\n", "type": "string" }, "state": { "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/commerce/requests", "responseFormat": "json", "summary": "List commerce approvals for an org" }, { "description": null, "id": "adminCreateDomainPurchaseRequest", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CreateDomainPurchaseRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/commerce/requests/domain-purchases", "responseFormat": "json", "summary": "Create an exact-price domain request without charging or registering" }, { "description": null, "id": "adminCreatePlanChangeRequest", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CreatePlanChangeRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/commerce/requests/plan-changes", "responseFormat": "json", "summary": "Create a reviewable upgrade or downgrade without charging" }, { "description": null, "id": "adminGetCommerceRequest", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "request_id": { "type": "string" } }, "required": ["org_id", "request_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/commerce/requests/{request_id}", "responseFormat": "json", "summary": "Get a commerce approval request" }, { "description": null, "id": "adminApproveCommerceRequest", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/DecideCommerceRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "request_id": { "type": "string" } }, "required": ["org_id", "request_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/commerce/requests/{request_id}/approve", "responseFormat": "json", "summary": "Approve once and optionally create bounded future authority" }, { "description": null, "id": "adminCancelCommerceRequest", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "request_id": { "type": "string" } }, "required": ["org_id", "request_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/commerce/requests/{request_id}/cancel", "responseFormat": "json", "summary": "Cancel a commerce request before irreversible work" }, { "description": null, "id": "adminDenyCommerceRequest", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/DecideCommerceRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "request_id": { "type": "string" } }, "required": ["org_id", "request_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/commerce/requests/{request_id}/deny", "responseFormat": "json", "summary": "Deny a pending commerce request" }, { "description": null, "id": "adminGetCommercePaymentLink", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "request_id": { "type": "string" } }, "required": ["org_id", "request_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/commerce/requests/{request_id}/payment-link", "responseFormat": "json", "summary": "Get Stripe's hosted payment-authentication link for a human" }, { "description": null, "id": "adminRetryCommerceRequest", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "request_id": { "type": "string" } }, "required": ["org_id", "request_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/commerce/requests/{request_id}/retry", "responseFormat": "json", "summary": "Resume the same idempotent request after a recoverable blocker" }, { "description": null, "id": "adminListCommerceSpendLimits", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/commerce/spend-limits", "responseFormat": "json", "summary": "List bounded future domain-purchase authority" }, { "description": null, "id": "adminCreateCommerceSpendLimit", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CommerceSpendLimitInput" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/commerce/spend-limits", "responseFormat": "json", "summary": "Create bounded future domain-purchase authority" }, { "description": null, "id": "adminUpdateCommerceSpendLimit", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CommerceSpendLimitInput" }, "path": { "additionalProperties": false, "properties": { "limit_id": { "type": "string" }, "org_id": { "type": "string" } }, "required": ["org_id", "limit_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PUT", "path": "/v1/admin/orgs/{org_id}/commerce/spend-limits/{limit_id}", "responseFormat": "json", "summary": "Update a spend control with version fencing" }, { "description": null, "id": "adminDeleteCommerceSpendLimit", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "limit_id": { "type": "string" }, "org_id": { "type": "string" } }, "required": ["org_id", "limit_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/orgs/{org_id}/commerce/spend-limits/{limit_id}", "responseFormat": "json", "summary": "Disable a spend control" }, { "description": null, "id": "adminListDomains", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" }, "page": { "description": "Opaque page token echoed back from a prior `next_page`. Used by the legacy offset-paginated admin/console list surface; the cursor-paginated agent surface uses `Cursor` (`?cursor`) instead.\n", "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/domains", "responseFormat": "json", "summary": "List onboarded domains" }, { "description": null, "id": "adminOnboardDomain", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/OnboardDomainRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/domains", "responseFormat": "json", "summary": "Add a delegated or purchased domain" }, { "description": "Read one onboarded domain the caller's org owns, including the DNS nameserver records the customer must publish for `ns_delegated` mode. The list endpoint omits records to stay lightweight, so the console reads this when a domain row is expanded so the delegation reappears after the onboarding dialog is dismissed or the page reloaded. Tenant-scoped: an unknown domain, or one owned by a different org, is a 404 (records are never leaked across tenants).\n", "id": "adminGetDomain", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "domain": { "type": "string" }, "org_id": { "type": "string" } }, "required": ["org_id", "domain"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/domains/{domain}", "responseFormat": "json", "summary": "Get one domain's detail and nameserver records" }, { "description": "Requires org admin membership and ownership. Checks authoritative DNS immediately (bounded to 30 seconds), persists the result, and returns current detail. DNS confirmation does not imply completed mail setup. Concurrent checks and repeats within 10 seconds return 429 with Retry-After. Inconclusive DNS results return delegation.status check_delayed.\n", "id": "adminVerifyDomain", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "domain": { "type": "string" }, "org_id": { "type": "string" } }, "required": ["org_id", "domain"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/domains/{domain}/verify", "responseFormat": "json", "summary": "Recheck delegated domain DNS now" }, { "description": "Creates (or idempotently reuses an existing pending) org invitation. The raw token is returned ONCE on a fresh create (201); a reused pending invite returns 200 with no token. Role-capped to the inviter's own role.\n", "id": "createInvitation", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CreateInvitationRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/invitations", "responseFormat": "json", "summary": "Invite a member to the org (admin; role-capped)" }, { "description": null, "id": "revokeInvitation", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "invitation_id": { "type": "string" }, "org_id": { "type": "string" } }, "required": ["org_id", "invitation_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/invitations/{invitation_id}/revoke", "responseFormat": "json", "summary": "Revoke a pending invitation (admin)" }, { "description": null, "id": "listMembers", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/members", "responseFormat": "json", "summary": "List the org's members (viewer)" }, { "description": "Changes a member's role. Role-capped to the actor's own effective role; demoting the org's LAST owner is refused (409 last_owner).\n", "id": "updateMemberRole", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/UpdateMemberRoleRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "user_id": { "type": "string" } }, "required": ["org_id", "user_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}/members/{user_id}", "responseFormat": "json", "summary": "Change a member's role (admin; role-capped, last-owner guarded)" }, { "description": "Removes a member. Removing the org's LAST owner is refused (409 last_owner).\n", "id": "removeMember", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "user_id": { "type": "string" } }, "required": ["org_id", "user_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/orgs/{org_id}/members/{user_id}", "responseFormat": "json", "summary": "Remove a member from the org (admin; last-owner guarded)" }, { "description": null, "id": "listProjects", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "include_archived": { "type": "boolean" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects", "responseFormat": "json", "summary": "List the org's projects (viewer)" }, { "description": "Create a project under the org. The org's max_projects cap is enforced inside the same transaction as the create. Client ids are never accepted.\n", "id": "createProject", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CreateProjectRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects", "responseFormat": "json", "summary": "Create a project in the org (admin)" }, { "description": null, "id": "patchProject", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/PatchProjectRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}", "responseFormat": "json", "summary": "Update a project's display fields (admin)" }, { "description": "Soft-deletes (archives) the project. Guarded: the default project can never be archived, and a project with active resources cannot be archived.\n", "id": "archiveProject", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}", "responseFormat": "json", "summary": "Archive (soft-delete) a project (admin)" }, { "description": null, "id": "listAgentKeys", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "agent_id": { "type": "string" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" }, "page": { "description": "Opaque page token echoed back from a prior `next_page`. Used by the legacy offset-paginated admin/console list surface; the cursor-paginated agent surface uses `Cursor` (`?cursor`) instead.\n", "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/agent-keys", "responseFormat": "json", "summary": "List issued agent API keys" }, { "description": null, "id": "issueAgentKey", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/IssueAgentKeyRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/agent-keys", "responseFormat": "json", "summary": "Issue an agent API key (secret shown once)" }, { "description": null, "id": "revokeAgentKey", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/agent-keys/{id}", "responseFormat": "json", "summary": "Revoke an agent API key" }, { "description": null, "id": "listAgents", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" }, "page": { "description": "Opaque page token echoed back from a prior `next_page`. Used by the legacy offset-paginated admin/console list surface; the cursor-paginated agent surface uses `Cursor` (`?cursor`) instead.\n", "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/agents", "responseFormat": "json", "summary": "List agents" }, { "description": "Creates an active, project-bound agent for console-managed inboxes. API keys can be issued separately.", "id": "createAgent", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CreateAgentRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/agents", "responseFormat": "json", "summary": "Create an agent identity without issuing credentials" }, { "description": null, "id": "disableAgent", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/agents/{id}/disable", "responseFormat": "json", "summary": "Disable an agent (instantly invalidates its keys)" }, { "description": null, "id": "enableAgent", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/agents/{id}/enable", "responseFormat": "json", "summary": "Re-enable a disabled agent" }, { "description": null, "id": "listAuditEvents", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" }, "page": { "description": "Opaque page token echoed back from a prior `next_page`. Used by the legacy offset-paginated admin/console list surface; the cursor-paginated agent surface uses `Cursor` (`?cursor`) instead.\n", "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/audit", "responseFormat": "json", "summary": "List the org's console audit log" }, { "description": "List the shared category registry, scoped to the resolved org/project. The agent-plane read (GET /v1/categories) is AgentKey-only, so the console reads the SAME view here (Clerk session). The optional `match` is a pure lexical/substring filter (NO LLM); identity is opaque cat_ ids (D10).\n", "id": "adminListCategories", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "limit": { "default": 100, "maximum": 200, "minimum": 1, "type": "integer" }, "match": { "description": "Lexical substring filter over name+description+slug (every token must match; NO LLM).", "type": "string" }, "page": { "description": "Opaque next_cursor from the preceding page. Keep match and sort unchanged.", "type": "string" }, "sort": { "default": "popular", "description": "30-day popularity by default; last use and category ID break ties. Semantic fit remains the agent's choice.", "enum": ["popular", "messages_7d", "messages_90d", "last_used", "pending_reviews", "name"], "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories", "responseFormat": "json", "summary": "Browse the category registry (console plane)" }, { "description": null, "id": "adminCreateCategory", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/AdminCreateCategoryRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories", "responseFormat": "json", "summary": "Create a category from the console" }, { "description": "Read one category from the shared registry, scoped to the resolved org/project. The agent-plane read (GET /v1/categories/{id}) is AgentKey-only, so the console reads the SAME view here (Clerk session). The console re-reads after a soft-delete to reflect the self-tombstone. A foreign id is 404.\n", "id": "adminGetCategory", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}", "responseFormat": "json", "summary": "Get one category (console plane)" }, { "description": "Rename / re-describe a category with author_kind=human (metadata only, D10); writes a rename/redescribe audit/undo row. Console-only (never an MCP tool, D17). Customer-scoped; a foreign id is 404.\n", "id": "adminUpdateCategory", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/UpdateCategoryRequest" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}", "responseFormat": "json", "summary": "Rename / re-describe a category (console plane, human authority)" }, { "description": "SOFT delete the category (D9 never-hard-delete): the row + its references + history survive as training data. The soft-delete is a self-tombstone (merged_into = self) so it drops out of the default registry list; an audit/undo row (action=retire) records it. Console-only; a foreign id is 404.\n", "id": "adminDeleteCategory", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}", "responseFormat": "json", "summary": "Soft-delete a category (console plane, human authority)" }, { "description": "Read the $0-LLM, read-only D19 snapshot of how many queued drafts are stale vs current-enough against the current rules-version (\xA78). The agent-plane read (GET /v1/categories/{id}/backlog-status) is AgentKey-only, so the console reads the SAME view here (Clerk session) for its reconciliation panel; the human scan-backlog button TRIGGERS the sweep. Read-only; a foreign id is 404.\n", "id": "adminGetBacklogStatus", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}/backlog-status", "responseFormat": "json", "summary": "Read a category's backlog reconciliation status (console plane)" }, { "description": "Flip the graduation bit ONE rung down (auto_silent\u2192auto_notify\u2192supervised). Demoting from supervised is 409 (nowhere below). On success it clears the graduated provenance, writes a ctr_ transition (reason regressed), emits category.demoted, and enqueues recheck_category nudges. Console-only (never an MCP tool, D17). A foreign id is 404.\n", "id": "adminDemoteCategory", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}/demote", "responseFormat": "json", "summary": "Demote a category one rung down (console plane, human authority)" }, { "description": "Flip the graduation bit ONE rung up: supervised\u2192auto_notify\u2192auto_silent (D16). never_graduate is locked at supervised (409 graduation_locked); a non-adjacent target is 400; graduating to auto_silent requires the MATURITY GATE (clean_approval_count \u2265 N AND category age \u2265 min_age_hours) or it is 409 maturity_gate_unmet. On success it writes a ctr_ transition, emits category.graduated, and enqueues recheck_category nudges to pending drafts. Console-only (never an MCP tool, D17). A foreign id is 404.\n", "id": "adminGraduateCategory", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/GraduateCategoryRequest" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}/graduate", "responseFormat": "json", "summary": "Graduate a category one rung up (console plane, human authority)" }, { "description": "Read the gate status toward the next rung (the maturity gate + drift tripwire counters that drive the console graduation controls). The agent-plane read (GET /v1/categories/{id}/graduation-status) is AgentKey-only, so the console reads the SAME view here (Clerk session). Read-only; a foreign id is 404.\n", "id": "adminGetGraduationStatus", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}/graduation-status", "responseFormat": "json", "summary": "Read a category's graduation gate status (console plane)" }, { "description": "Merge the path category (the loser) into into_category_id (the survivor), repointing all rr_/rule_ references BY cat_ id and setting merged_into on the loser in ONE transaction (D9/D10), plus a merge transition + audit/undo row. A cross-tenant or unknown into_category_id is 404 (never a cross-customer merge); merging into itself is 400. Console-only.\n", "id": "adminMergeCategory", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/MergeCategoryRequest" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}/merge", "responseFormat": "json", "summary": "Merge a category into another (console plane, human authority)" }, { "description": "Pin a category at supervised (locked=true) or release the pin (locked=false; D16). Locking a graduated category FIRST demotes it down to supervised (each rung writes its own ctr_ transition) so a locked category can never sit in a live auto-send state. Clearing the lock leaves the state untouched. Console-only (never an MCP tool, D17). A foreign id is 404.\n", "id": "adminSetNeverGraduate", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/NeverGraduateRequest" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}/never-graduate", "responseFormat": "json", "summary": "Set/clear the never-graduate lock on a category (console plane, human authority)" }, { "description": `Read the demand-driven pacing snapshot: the human review cursor, the effective window/ceiling/interval, the queued count, and each draft's in-window / redrafting / behind-cursor classification (the "redrafting\u2026" shimmer). The agent-plane read (GET /v1/categories/{id}/pacing-state) is AgentKey-only, so the console reads the SAME view here (Clerk session). Read-only; a foreign id is 404.
5
+ `, "id": "adminGetPacingState", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}/pacing-state", "responseFormat": "json", "summary": "Read a category's demand-driven pacing state (console plane)" }, { "description": "Set / clear the per-category risk-dial OVERRIDES (D12). For each field, a non-null value SETS the override; an explicit JSON null RESETS it back to inherit (null = account default); an omitted field is unchanged. Console-only (never an MCP tool, D17). A foreign id is 404.\n", "id": "adminUpdateCategoryRiskDial", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CategoryRiskDialRequest" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}/risk-dial", "responseFormat": "json", "summary": "Set a category's risk-dial overrides (console plane, human authority)" }, { "description": "Run the D19/\xA78 on-demand reconciliation sweep for a category: walk every QUEUED draft and INTEGER-COMPARE its composed_* rules-versions against the category's CURRENT versions (with a tunable staleness tolerance). A current-enough draft is released through the M6 submit-time gate (the agent re-submits to deliver; the gate is re-run, never bypassed); a stale draft is nudged to redraft against current rules and stays queued. The human never hand-touches the backlog and no stale draft slips out. Deterministic, $0-LLM. Console-only (never an MCP tool, D17). A foreign id is 404.\n", "id": "adminScanBacklog", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/ScanBacklogRequest" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/categories/{id}/scan-backlog", "responseFormat": "json", "summary": "Run the D19 backlog reconciliation sweep on demand (console plane)" }, { "description": null, "id": "listEnrollmentTokens", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "include_revoked": { "type": "boolean" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" }, "page": { "description": "Opaque page token echoed back from a prior `next_page`. Used by the legacy offset-paginated admin/console list surface; the cursor-paginated agent surface uses `Cursor` (`?cursor`) instead.\n", "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/enrollment-tokens", "responseFormat": "json", "summary": "List enrollment tokens" }, { "description": null, "id": "issueEnrollmentToken", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/IssueEnrollmentTokenRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/enrollment-tokens", "responseFormat": "json", "summary": "Issue an enrollment token (secret shown once)" }, { "description": null, "id": "revokeEnrollmentToken", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/enrollment-tokens/{id}", "responseFormat": "json", "summary": "Revoke an enrollment token" }, { "description": null, "id": "adminListInboxes", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" }, "page": { "description": "Opaque page token echoed back from a prior `next_page`. Used by the legacy offset-paginated admin/console list surface; the cursor-paginated agent surface uses `Cursor` (`?cursor`) instead.\n", "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes", "responseFormat": "json", "summary": "List every inbox in the org" }, { "description": null, "id": "adminCreateInbox", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/AdminCreateInboxRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes", "responseFormat": "json", "summary": "Create an inbox from the console" }, { "description": null, "id": "adminUpdateInbox", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/AdminUpdateInboxRequest" }, "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}", "responseFormat": "json", "summary": "Update an inbox's enforced daily recipient limit" }, { "description": null, "id": "adminDeleteInbox", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}", "responseFormat": "json", "summary": "Permanently delete an inbox and its authenticated sender" }, { "description": null, "id": "adminListMessages", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "folder": { "description": "IMAP folder to read (default INBOX).", "type": "string" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}/messages", "responseFormat": "json", "summary": "List recent messages for an org inbox" }, { "description": null, "id": "adminGetMessage", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "id": { "description": "Opaque message id (`msg_...`). Encodes its owning inbox.", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}/messages/{id}", "responseFormat": "json", "summary": "Get a single message (with attachment metadata) for an org inbox" }, { "description": null, "id": "adminListAttachments", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "id": { "description": "Opaque message id (`msg_...`). Encodes its owning inbox.", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}/messages/{id}/attachments", "responseFormat": "json", "summary": "List a message's attachment metadata for an org inbox" }, { "description": null, "id": "adminGetAttachment", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "attId": { "description": "Opaque attachment id locating one MIME part of the message.", "type": "string" }, "id": { "description": "Opaque message id (`msg_...`). Encodes its owning inbox.", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr", "id", "attId"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}/messages/{id}/attachments/{attId}", "responseFormat": "binary", "summary": "Download one attachment's bytes for an org inbox" }, { "description": null, "id": "adminReplyMessage", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/ReplyRequest" }, "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}/reply", "responseFormat": "json", "summary": "Thread-aware console reply from an org inbox" }, { "description": "Set the per-inbox review-policy override (a non-null policy) or clear it back to inherit the account default (explicit JSON null; D6). A foreign address is 404; an invalid non-null policy value is 400. Console-only (never an MCP tool, D17).\n", "id": "adminUpdateInboxReviewPolicy", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/InboxReviewPolicyRequest" }, "path": { "additionalProperties": false, "properties": { "addr": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}/review-policy", "responseFormat": "json", "summary": "Set/clear the per-inbox review-policy override (console plane, human authority)" }, { "description": null, "id": "adminSendMessage", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/SendRequest" }, "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}/send", "responseFormat": "json", "summary": "Send a message from an org inbox" }, { "description": null, "id": "adminGetSubmission", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" }, "submission_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr", "submission_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}/submissions/{submission_id}", "responseFormat": "json", "summary": "Read transport and Sent-copy status for an org inbox submission" }, { "description": null, "id": "adminListInboxThreads", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "cursor": { "description": "Opaque pagination cursor echoed back from a prior `next_cursor`. Treat it as an opaque token; pass it back verbatim as `?cursor` to fetch the next page.\n", "type": "string" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}/threads", "responseFormat": "json", "summary": "List persistent threads for an org inbox" }, { "description": null, "id": "adminGetInboxThread", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "addr": { "description": "The full inbox address, URL-encoded (e.g. `agent7%40extrovertmail.com`).", "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" }, "thread_id": { "type": "string" } }, "required": ["org_id", "project_id", "addr", "thread_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/inboxes/{addr}/threads/{thread_id}", "responseFormat": "json", "summary": "Get one persistent thread and its messages" }, { "description": "Create a short-lived, single-use ticket bound to the Clerk session's customer scope, for opening the live Approvals SSE stream (`GET /v1/admin/reviews/stream?ticket=\u2026`). A browser EventSource cannot set an Authorization header, so this ticket carries the customer scope instead. The ticket is consumed on first stream connect and self-expires (~60s).\n", "id": "adminMintRealtimeTicket", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/realtime/ticket", "responseFormat": "json", "summary": "Create a single-use ticket for the console realtime stream" }, { "description": "The customer's review links (D5). Secrets are elided (has_secret only). Console-only (Clerk-authed).\n", "id": "adminListReviewLinks", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/review-links", "responseFormat": "json", "summary": "List BYO review-agent links (console plane)" }, { "description": "Link a reviewer agent to an inbox (inbox_address empty = account-wide) so reviewed drafts on that scope route to the linked review-agent instead of straight to the human queue (D5; \xA79). One link per scope (the UNIQUE scope index); a duplicate scope is 409. The reviewer holds review:act, never mailbox:send; the platform sends with the COMPOSER's creds. Console-only (Clerk-authed); configuring WHO reviews is a human-authority setup decision, NEVER an MCP tool (the reviewer DECISION endpoints are agent-plane).\n", "id": "adminCreateReviewLink", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/CreateReviewLinkRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/review-links", "responseFormat": "json", "summary": "Link a BYO review-agent to an inbox (console plane)" }, { "description": "Remove a review link AND sweep every in-flight review currently routed through it back to the HUMAN queue; no orphan deliveries (\xA79): a review held by the deleted reviewer must not stay assigned to a reviewer that no longer exists. Console-only (Clerk-authed). A foreign id is 404.\n", "id": "adminDeleteReviewLink", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" }, "rvl_id": { "type": "string" } }, "required": ["org_id", "project_id", "rvl_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/review-links/{rvl_id}", "responseFormat": "json", "summary": "Delete a BYO review-agent link (console plane)" }, { "description": "The authoritative account-default review policy (D6): require_review, allow_direct, or auto_send_graduated. require_review always downgrades an agent's per-send mode assertion (an agent can never override it). effective is the account policy with the safe require_review floor applied. Console-only (Clerk-authed); the agent plane only READS the effective policy.\n", "id": "adminGetReviewPolicy", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/review-policy", "responseFormat": "json", "summary": "Read the account-default review policy (console plane)" }, { "description": "Set the account-default review policy (D6). An invalid policy value is 400. Console-only (never an MCP tool, D17).\n", "id": "adminUpdateReviewPolicy", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/ReviewPolicyRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/review-policy", "responseFormat": "json", "summary": "Set the account-default review policy (console plane, human authority)" }, { "description": "The human Approvals queue: pending reviews across ALL the tenant's inboxes, newest-first and paginated, each with an intent summary + a body snippet (never the full body). Filter by state (repeatable / comma-separated), inbox, and category_id. Customer-scoped to the Clerk session; these human-authority reads/actions are console-only and never MCP tools (D17).\n", "id": "adminListReviews", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "category_id": { "description": "Filter by opaque category id (cat_\u2026).", "type": "string" }, "inbox": { "description": "Filter by composer inbox address.", "type": "string" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" }, "page": { "description": "Opaque page cursor.", "type": "string" }, "state": { "description": "Filter by state (repeatable or comma-separated).", "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/reviews", "responseFormat": "json", "summary": "Approvals queue (Review Loop, console plane)" }, { "description": "The full review for the console detail view: intent, the current draft (subject/body), the append-only thread turns, and the diff if the draft was revised. Customer-scoped; a foreign id is 404 (no cross-tenant leak).\n", "id": "adminGetReview", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/reviews/{id}", "responseFormat": "json", "summary": "Get one review (intent + current draft + turns + diff)" }, { "description": "Approve the draft as-is under the revision+version CAS (D17), with the staleness check run INSIDE approve (a stale draft 409s; reconfirm first). The platform then performs the authenticated send using the COMPOSER's inbox credentials (credential boundary) and records terminal success, returning the sent message id + thread id. The send is irreversible once returned.\n", "id": "adminApproveReview", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/AdminReviewAction" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/reviews/{id}/approve", "responseFormat": "json", "summary": "Approve a draft and send it (human authority)" }, { "description": "The console chat side-panel (M5; spec \xA75.3, \xA710): a human_comment turn whose OTHER party is the COMPOSING agent; it enqueues a feedback_added durable nudge to the composer (the agent wakes to answer/redraft) and emits a review.chat event; when the draft is in_review it flips to chatting. CONSOLE-ONLY (Clerk- authed); NEVER an MCP tool (D17). $0 LLM; the human writes the comment.\n", "id": "adminReviewChat", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/AdminReviewChatRequest" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/reviews/{id}/chat", "responseFormat": "json", "summary": "Post a human comment on a review's chat thread (console side-panel)" }, { "description": "The human supplies an edited subject/body. The platform captures the proposed-vs-sent diff into a system_diff turn (deterministic Go diff, $0 LLM), approves under the revision+version CAS, then performs the authenticated send of the EDITED content via the COMPOSER's inbox and records terminal success. Irreversible once returned; a stale draft or CAS race 409s.\n", "id": "adminEditSendReview", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/AdminReviewAction" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/reviews/{id}/edit-send", "responseFormat": "json", "summary": "Edit a draft, capture the diff, and send (human authority)" }, { "description": "Restore the prior version recorded in an audit row with author_kind=human (D11). UNDO = a forward 'restore' supersession; the source row is marked undone. Idempotent: a re-undo of an already-undone row is a clean 409. Only the source reviewer or an organization administrator may undo this learning.\n", "id": "undoLearnedReviewRule", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" }, "udo_id": { "type": "string" } }, "required": ["id", "org_id", "project_id", "udo_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/reviews/{id}/learned-rules/{udo_id}/undo", "responseFormat": "json", "summary": "Undo a rule change (console plane, human authority)" }, { "description": "Reject the draft under the revision+version CAS, with an optional feedback comment persisted as the raw rule-birth signal (D7; empty allowed). The composing agent may redraft from rejected. Console-only.\n", "id": "adminRejectReview", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/AdminReviewAction" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/reviews/{id}/reject", "responseFormat": "json", "summary": "Reject a draft (human authority)" }, { "description": "Read the effective brand-risk dial; the account-wide default plus every category's per-category overrides (each with its resolved effective value; null override = inherit, D12). The agent-plane read (GET /v1/risk-dial) is AgentKey-only, so the console reads the SAME view here (Clerk session) to render the risk-dial panel. Read-only; setting the dial is the PATCH above.\n", "id": "adminGetRiskDial", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/risk-dial", "responseFormat": "json", "summary": "Read the effective risk dial (console plane)" }, { "description": "Set the account-wide risk-dial defaults every inheriting category uses (D4): min_confidence, first_contact_gate, drift_demote_after (K), canary_rate, graduate_min_approvals, graduate_min_age_hours, auto_send_cap_per_day. A nil field is unchanged. Console-only (never an MCP tool, D17).\n", "id": "adminUpdateRiskDial", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/RiskDialRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/risk-dial", "responseFormat": "json", "summary": "Set the account-default risk dial (console plane, human authority)" }, { "description": "Read the \xA77 precedence-ordered effective writing-rule stack for the resolved org/project (and optional category), applied SERVER-SIDE (deterministic, NO LLM). The agent-plane read (GET /v1/rules) is AgentKey-only, so the console reads the SAME ordered list here (Clerk session) for its rules panel.\n", "id": "adminGetRules", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "category_id": { "description": "Category id (cat_\u2026). Empty returns ONLY the house-style/general layer.", "type": "string" }, "scope": { "description": "Narrow to one layer (general | category). Default returns both.", "enum": ["general", "category"], "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/rules", "responseFormat": "json", "summary": "Read the effective rule stack (console plane)" }, { "description": "Requires org and project admin authority. Ownership comes from the path; inherited organization rules and rules in other projects cannot be changed. Records human authorship and revision history. Scope/category changes are applied on edit. Per-agent targeting and review provenance are not accepted. This operation does not automatically retry or support client_id replay.\n", "id": "adminSaveProjectRule", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/AdminSaveProjectRuleRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PUT", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/rules", "responseFormat": "json", "summary": "Create or edit a shared project rule (console only)" }, { "description": "The human-facing change/undo audit log spanning rules AND categories (D11), optionally narrowed to one entity. Console-only (Clerk-authed); the safety net for the shared/house-style rule governance. Undo a row via POST /v1/admin/rules/audit/{udo_id}/undo.\n", "id": "adminGetRuleAudit", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "entity_id": { "description": "Narrow to one entity (rule_\u2026 or cat_\u2026).", "type": "string" }, "entity_kind": { "description": "Narrow to one entity kind.", "enum": ["rule", "category"], "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/rules/audit", "responseFormat": "json", "summary": "Read the rule/category change audit log (console plane)" }, { "description": "Restore the prior version recorded in an audit row with author_kind=human (D11). UNDO = a forward 'restore' supersession; the source row is marked undone. Idempotent: a re-undo of an already-undone row is a clean 409. Console-only. Only rules belonging to the addressed project can be undone; category changes and inherited organization rules are read-only here.\n", "id": "adminUndoRuleChange", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" }, "udo_id": { "type": "string" } }, "required": ["org_id", "project_id", "udo_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/rules/audit/{udo_id}/undo", "responseFormat": "json", "summary": "Undo a rule change (console plane, human authority)" }, { "description": "Requires org and project admin authority; inherited organization rules and other projects are read-only here. Preserves revision history and records human authorship.", "id": "adminPromoteProjectRule", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/PromoteRuleRequest" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/rules/{id}/promote", "responseFormat": "json", "summary": "Promote a shared project rule (console only)" }, { "description": "Requires org and project admin authority; inherited organization rules and other projects are read-only here. Preserves revision history and records human authorship.", "id": "adminRetireProjectRule", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/rules/{id}/retire", "responseFormat": "json", "summary": "Retire a shared project rule (console only)" }, { "description": "Uses bounded per-inbox fan-out, tags each thread with its inbox, and merges them newest-first with a stable global keyset cursor.", "id": "listSharedInboxThreads", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "cursor": { "description": "Opaque pagination cursor echoed back from a prior `next_cursor`. Treat it as an opaque token; pass it back verbatim as `?cursor` to fetch the next page.\n", "type": "string" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/threads", "responseFormat": "json", "summary": "Shared-inbox feed; recent threads across every org inbox" }, { "description": null, "id": "adminListWebhooks", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/webhooks", "responseFormat": "json", "summary": "List project webhooks" }, { "description": null, "id": "adminRegisterWebhook", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/AdminRegisterWebhookRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/webhooks", "responseFormat": "json", "summary": "Register a project webhook" }, { "description": null, "id": "adminGetWebhook", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/webhooks/{id}", "responseFormat": "json", "summary": "Get one project webhook" }, { "description": null, "id": "adminUpdateWebhook", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/UpdateWebhookRequest" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/webhooks/{id}", "responseFormat": "json", "summary": "Update a project webhook" }, { "description": null, "id": "adminDeleteWebhook", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" } }, "required": ["org_id", "project_id", "id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "DELETE", "path": "/v1/admin/orgs/{org_id}/projects/{project_id}/webhooks/{id}", "responseFormat": "json", "summary": "Delete a project webhook" }, { "description": "Read-only deliverability rollup for the org (viewer): status badge, sending status, latest metrics window, and open-finding count.\n", "id": "adminGetReputation", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/reputation", "responseFormat": "json", "summary": "The org's deliverability rollup (console)" }, { "description": "The org's deliverability findings, newest-first (viewer). Supports ?status=, ?severity=, ?domain=, ?sender= filters and limit/cursor paging.\n", "id": "adminListReputationFindings", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "cursor": { "type": "string" }, "domain": { "type": "string" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" }, "sender": { "type": "string" }, "severity": { "enum": ["low", "high", "unknown"], "type": "string" }, "status": { "enum": ["open", "resolved"], "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/reputation/findings", "responseFormat": "json", "summary": "List the org's deliverability findings (console)" }, { "description": null, "id": "getOrgSettings", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/settings", "responseFormat": "json", "summary": "Get the org's console settings" }, { "description": null, "id": "updateOrgSettings", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/PatchOrgSettingsRequest" }, "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "PATCH", "path": "/v1/admin/orgs/{org_id}/settings", "responseFormat": "json", "summary": "Update a subset of the org's console settings" }, { "description": "The org's recipient opt-out (suppression) rows, newest-first. Only org-scope rows are visible; global/shared-domain rows are operator-only. Supports ?recipient=, ?scope=, ?include_revoked=true, and limit/cursor paging.\n", "id": "adminListSuppressions", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "cursor": { "type": "string" }, "include_revoked": { "type": "boolean" }, "limit": { "default": 50, "description": "Page size for the cursor-paginated agent surface (default 50; clamped to the 1-100 range).", "maximum": 100, "minimum": 1, "type": "integer" }, "recipient": { "description": "Filter by (canonicalized) recipient.", "type": "string" }, "scope": { "enum": ["org"], "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/suppressions", "responseFormat": "json", "summary": "List / search the org's suppression rows" }, { "description": "A CSV of the org's suppression rows (viewer). ?include_revoked=true adds soft-revoked rows; ?recipient= / ?scope= narrow the export.\n", "id": "adminExportSuppressions", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "org_id": { "type": "string" } }, "required": ["org_id"], "type": "object" }, "query": { "additionalProperties": false, "properties": { "include_revoked": { "type": "boolean" }, "recipient": { "type": "string" }, "scope": { "enum": ["org"], "type": "string" } }, "required": [], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "GET", "path": "/v1/admin/orgs/{org_id}/suppressions/export", "responseFormat": "binary", "summary": "Export the org's suppression rows as CSV" }, { "description": "An org admin (role >= admin) revokes ONE org-scope row with a REQUIRED reason (audit-logged). A foreign/global/shared id is a 404; an empty reason is a 400.\n", "id": "adminRevokeSuppression", "inputSchema": { "additionalProperties": false, "properties": { "body": { "$ref": "#/components/schemas/RevokeSuppressionRequest" }, "path": { "additionalProperties": false, "properties": { "id": { "type": "string" }, "org_id": { "type": "string" } }, "required": ["org_id", "id"], "type": "object" } }, "required": ["path", "body"], "type": "object" }, "method": "POST", "path": "/v1/admin/orgs/{org_id}/suppressions/{id}/revoke", "responseFormat": "json", "summary": "Revoke (un-suppress) one org-scope suppression row" }, { "description": "Accepts a live system-seeded owner claim previously discovered through GET /v1/admin/me. IDENTITY-ONLY: the claim id is only a selector and the server accepts it only when its normalized email matches the authenticated user's VERIFIED Clerk email. No raw invitation token is required or exposed.\n", "id": "acceptSignupClaim", "inputSchema": { "additionalProperties": false, "properties": { "path": { "additionalProperties": false, "properties": { "claim_id": { "type": "string" } }, "required": ["claim_id"], "type": "object" } }, "required": ["path"], "type": "object" }, "method": "POST", "path": "/v1/admin/signup-claims/{claim_id}/accept", "responseFormat": "json", "summary": "Claim an agent-created account (identity-only; email-bound)" }];
6
+ var administrativeSchemas = { "AcceptInvitationRequest": { "description": "Accept an invitation with its raw token. IDENTITY-ONLY: the accept binds to the authenticated user's VERIFIED Clerk email, which must equal the normalized invitation email (else 403). Idempotent for the same user.\n", "properties": { "token": { "type": "string" } }, "required": ["token"], "type": "object" }, "AccountRiskDial": { "description": "The account-wide default risk dial (org_settings; D4/D12); the values a per-category null override inherits. The single user-configurable brand-risk lever (canary rate, drift-demote K, maturity-gate thresholds, min confidence, first-contact gate, per-day auto-send cap).\n", "properties": { "auto_send_cap_per_day": { "description": "Plan-tier per-customer auto-send volume cap (D1).", "type": "integer" }, "canary_rate": { "format": "double", "type": "number" }, "drift_demote_after": { "description": "Drift-demote threshold K.", "type": "integer" }, "first_contact_gate": { "type": "boolean" }, "graduate_min_age_hours": { "description": "Maturity-gate minimum category age.", "type": "integer" }, "graduate_min_approvals": { "description": "Maturity-gate N (clean approvals).", "type": "integer" }, "min_confidence": { "format": "double", "type": "number" } }, "required": ["min_confidence", "first_contact_gate", "drift_demote_after", "canary_rate", "graduate_min_approvals", "graduate_min_age_hours", "auto_send_cap_per_day"], "type": "object" }, "AdminBilling": { "properties": { "billing_owner_id": { "description": "The org id used for plan and monthly usage enforcement.", "type": "string" }, "customer_id": { "type": "string" }, "entitlements": { "$ref": "#/components/schemas/AdminBillingPlan" }, "org_id": { "type": "string" }, "plan_tier": { "enum": ["free", "developer", "startup", "enterprise"], "type": "string" }, "plans": { "items": { "$ref": "#/components/schemas/AdminBillingPlan" }, "type": "array" }, "stripe_configured": { "type": "boolean" }, "stripe_mode": { "enum": ["test", "live"], "type": "string" }, "subscription": { "$ref": "#/components/schemas/AdminBillingSubscription" }, "usage": { "$ref": "#/components/schemas/AdminBillingUsage" } }, "required": ["org_id", "customer_id", "billing_owner_id", "stripe_mode", "stripe_configured", "plan_tier", "entitlements", "usage", "plans"], "type": "object" }, "AdminBillingPlan": { "properties": { "checkout_available": { "type": "boolean" }, "custom": { "type": "boolean" }, "custom_domain_limit": { "format": "int64", "type": "integer" }, "daily_message_cap": { "format": "int64", "type": "integer" }, "domain_annual_com_reference_cents": { "description": "Reference annual managed-domain price for .com; other TLDs are quoted from live registrar cost at checkout.", "format": "int64", "type": "integer" }, "inbox_limit": { "format": "int64", "type": "integer" }, "included_messages_monthly": { "description": "Combined inbound plus outbound recipient/message quota.", "format": "int64", "type": "integer" }, "member_limit": { "format": "int64", "type": "integer" }, "monthly_price_cents": { "format": "int64", "type": "integer" }, "name": { "type": "string" }, "pod_limit": { "format": "int64", "type": "integer" }, "storage_bytes": { "description": "Decimal GB converted to bytes.", "format": "int64", "type": "integer" }, "tier": { "enum": ["free", "developer", "startup", "enterprise"], "type": "string" }, "webhook_limit": { "format": "int64", "type": "integer" } }, "required": ["tier", "name", "monthly_price_cents", "domain_annual_com_reference_cents", "included_messages_monthly", "inbox_limit", "custom_domain_limit", "storage_bytes", "pod_limit", "webhook_limit", "member_limit"], "type": "object" }, "AdminBillingSubscription": { "properties": { "cancel_at_period_end": { "type": "boolean" }, "current_period_end": { "format": "date-time", "type": "string" }, "current_period_start": { "format": "date-time", "type": "string" }, "customer_id": { "type": "string" }, "org_id": { "type": "string" }, "plan_tier": { "enum": ["free", "developer", "startup", "enterprise"], "type": "string" }, "status": { "type": "string" }, "stripe_customer_id": { "type": "string" }, "stripe_price_id": { "type": "string" }, "stripe_subscription_id": { "type": "string" }, "stripe_subscription_item_id": { "type": "string" } }, "required": ["org_id", "customer_id", "plan_tier", "status", "cancel_at_period_end"], "type": "object" }, "AdminBillingUsage": { "properties": { "billing_owner_id": { "type": "string" }, "customer_id": { "type": "string" }, "message_quota_exceeded": { "type": "boolean" }, "message_quota_limit": { "description": "Combined monthly inbound plus outbound message quota for the effective plan; -1 means unlimited/custom.", "format": "int64", "type": "integer" }, "message_quota_remaining": { "description": "Remaining included messages this month; -1 means unlimited/custom.", "format": "int64", "type": "integer" }, "month": { "example": "2026-06", "type": "string" }, "received_messages": { "format": "int64", "type": "integer" }, "received_recipients": { "format": "int64", "type": "integer" }, "sent_messages": { "format": "int64", "type": "integer" }, "sent_recipients": { "format": "int64", "type": "integer" }, "storage_bytes": { "description": "Compatibility alias for storage_used_bytes.", "format": "int64", "type": "integer" }, "storage_captured_at": { "format": "date-time", "type": "string" }, "storage_included_bytes": { "description": "Included storage bytes for the effective plan; -1 means unlimited/custom.", "format": "int64", "type": "integer" }, "storage_mailbox_count": { "type": "integer" }, "storage_over_limit_bytes": { "format": "int64", "type": "integer" }, "storage_peak_over_limit_bytes": { "format": "int64", "type": "integer" }, "storage_peak_used_bytes": { "description": "Billing-month high-water mark", "format": "int64", "summed from the peak observed bytes per durable storage object.": null, "type": "integer" }, "storage_quota_exceeded": { "type": "boolean" }, "storage_used_bytes": { "description": "Current owner-level storage gauge from latest mailbox snapshots.", "format": "int64", "type": "integer" }, "total_messages": { "format": "int64", "type": "integer" } }, "required": ["billing_owner_id", "customer_id", "month", "sent_messages", "sent_recipients", "received_messages", "received_recipients", "storage_bytes", "storage_used_bytes", "storage_peak_used_bytes", "storage_included_bytes", "storage_over_limit_bytes", "storage_peak_over_limit_bytes", "storage_mailbox_count", "storage_quota_exceeded", "total_messages", "message_quota_limit", "message_quota_remaining", "message_quota_exceeded"], "type": "object" }, "AdminCreateCategoryRequest": { "description": "Create a human-authored shared category from the console.", "properties": { "description": { "description": "Skill-style matcher text the agent reads (mutable).", "type": "string" }, "name": { "description": "Display name (mutable metadata; never a reference key).", "type": "string" }, "scope": { "description": "Defaults to org_shared.", "enum": ["org_shared", "agent_private"], "type": "string" } }, "required": ["name"], "type": "object" }, "AdminCreateInboxRequest": { "properties": { "agent_id": { "description": "Active agent that owns the new inbox.", "type": "string" }, "display_name": { "type": "string" }, "domain": { "description": "Domain name fallback when domain_id is omitted.", "type": "string" }, "domain_id": { "description": "Domain id from the console domains list.", "type": "string" }, "username": { "description": "Local part. On `extrovertmail.com` and `free.extrovertmail.com` it is normalized to lowercase, must contain at least five characters, and must not be postmaster, admin, webadmin, legal, fraudmark, fraudmarc, keith, melissa, richard, sydney, syd, john, or johnny. These restrictions do not apply to customer-owned domains. Omit it for a generated local part.\n", "type": "string" }, "webhook_url": { "type": "string" } }, "required": ["agent_id"], "type": "object" }, "AdminIdentity": { "properties": { "clerk_user_id": { "type": "string" }, "email": { "type": "string" } }, "type": "object" }, "AdminInbox": { "properties": { "address": { "type": "string" }, "agent_id": { "type": "string" }, "created_at": { "format": "date-time", "type": "string" }, "daily_send_cap": { "type": "integer" }, "daily_send_used": { "description": "Recipients sent in the rolling 24-hour window.", "type": "integer" }, "direct_smtp_enabled": { "description": "Whether this inbox is configured for direct SMTP outside the review pipeline. Effective access also requires an active paid entitlement.\n", "type": "boolean" }, "domain": { "type": "string" }, "id": { "description": "Stable inbox ID used for explicit connection consent.", "type": "string" }, "webhook_url": { "type": "string" } }, "type": "object" }, "AdminInboxList": { "properties": { "inboxes": { "items": { "$ref": "#/components/schemas/AdminInbox" }, "type": "array" }, "next_page": { "type": "string" } }, "type": "object" }, "AdminMe": { "description": "The authenticated console identity's reachable orgs + projects (GET /v1/admin/me). IDENTITY-ONLY: the reachable set is derived from the user's membership rows, never from a preselected/cookie customer. The *_hint fields are landing hints only; the console revalidates them against reachable_orgs/projects_by_org before using them.\n", "properties": { "active_org_hint": { "description": "Landing hint (the user's default org).", "type": "string" }, "active_project_hint": { "description": "Landing hint (the user's default project).", "type": "string" }, "identity": { "$ref": "#/components/schemas/AdminIdentity" }, "last_project_by_org": { "additionalProperties": { "type": "string" }, "description": "Per-org remembered/default project (orgId -> projectId).", "type": "object" }, "pending_signup_claims": { "description": "Live system-seeded owner claims matching the authenticated identity's verified email. Claim ids are selectors, not bearer credentials; no invitation token or hash material is exposed.\n", "items": { "$ref": "#/components/schemas/PendingSignupClaim" }, "type": "array" }, "projects_by_org": { "additionalProperties": { "items": { "$ref": "#/components/schemas/AdminProjectSummary" }, "type": "array" }, "description": "The active projects for each reachable org, keyed by org id.", "type": "object" }, "reachable_orgs": { "items": { "$ref": "#/components/schemas/AdminReachableOrg" }, "type": "array" } }, "required": ["identity", "last_project_by_org", "reachable_orgs", "projects_by_org", "pending_signup_claims"], "type": "object" }, "AdminMessage": { "description": "A source-preserving message shape for the console plane.", "properties": { "body": { "type": "string" }, "cc": { "type": "string" }, "date": { "type": "string" }, "direction": { "enum": ["inbound", "outbound"], "type": "string" }, "extracted_html": { "type": "string" }, "extracted_text": { "type": "string" }, "from": { "type": "string" }, "has_attachments": { "type": "boolean" }, "html": { "type": "string" }, "id": { "type": "string" }, "in_reply_to": { "type": "string" }, "message_id": { "type": "string" }, "references": { "type": "string" }, "reply_to": { "type": "string" }, "seen": { "type": "boolean" }, "sent_copy_status": { "$ref": "#/components/schemas/SentCopyStatus" }, "sent_message_id": { "nullable": true, "type": "string" }, "seq": { "type": "string" }, "subject": { "type": "string" }, "submission_id": { "type": "string" }, "text": { "type": "string" }, "thread_id": { "type": "string" }, "to": { "type": "string" }, "transport": { "$ref": "#/components/schemas/TransportCounts" } }, "type": "object" }, "AdminMessageDetail": { "allOf": [{ "$ref": "#/components/schemas/Message" }, { "properties": { "attachments": { "items": { "$ref": "#/components/schemas/Attachment" }, "type": "array" } }, "type": "object" }] }, "AdminMessageList": { "properties": { "messages": { "items": { "$ref": "#/components/schemas/AdminMessage" }, "type": "array" } }, "type": "object" }, "AdminOrgLimits": { "properties": { "max_child_orgs": { "type": "integer" }, "max_projects": { "type": "integer" } }, "type": "object" }, "AdminReachableOrg": { "description": "One org the identity can reach, with the effective role + source.", "properties": { "breadcrumb": { "items": { "type": "string" }, "type": "array" }, "customer_id": { "description": "Compatibility customer id linked to the org.", "type": "string" }, "depth": { "description": "Distance from the root org (0 = root).", "type": "integer" }, "display_name": { "type": "string" }, "id": { "description": "Canonical org UUID.", "type": "string" }, "limits": { "$ref": "#/components/schemas/AdminOrgLimits" }, "parent_org_id": { "description": "Null for a root org.", "nullable": true, "type": "string" }, "plan_tier": { "type": "string" }, "role": { "enum": ["owner", "admin", "member", "viewer", "billing"], "type": "string" }, "root_org_id": { "type": "string" }, "source": { "description": "How the identity reaches this org.", "enum": ["direct", "inherited", "msp_grant"], "type": "string" } }, "required": ["id", "customer_id", "display_name", "root_org_id", "role", "source", "depth", "breadcrumb", "plan_tier", "limits"], "type": "object" }, "AdminRegisterWebhookRequest": { "allOf": [{ "$ref": "#/components/schemas/RegisterWebhookRequest" }, { "properties": { "agent_id": { "description": "Active agent that owns the webhook registration.", "type": "string" } }, "required": ["agent_id"], "type": "object" }] }, "AdminReviewAction": { "description": "A human-authority review action body (console plane, D17). revision + version are the CAS naming the draft the human acted on (a mismatch is a 409 STALE). subject/body are supplied only on edit-send; feedback is the optional rule-birth signal (D7, empty allowed).\n", "properties": { "body": { "description": "Edited body text (edit-send only).", "type": "string" }, "feedback": { "description": "Optional decision comment / rule-birth signal.", "type": "string" }, "revision": { "type": "integer" }, "subject": { "description": "Edited subject (edit-send only).", "type": "string" }, "version": { "type": "integer" } }, "required": ["revision", "version"], "type": "object" }, "AdminReviewChatRequest": { "description": "The console chat side-panel body (M5; spec \xA710): a human comment whose OTHER party is the composing agent. CONSOLE-ONLY (never an MCP tool, D17).\n", "properties": { "text": { "description": "The human's comment for the composing agent.", "type": "string" } }, "required": ["text"], "type": "object" }, "AdminReviewDetail": { "description": "Full console review detail (console plane): the review (intent + current draft + diff if revised) plus the append-only thread turns.\n", "properties": { "review": { "$ref": "#/components/schemas/Review" }, "turns": { "items": { "$ref": "#/components/schemas/ReviewTurn" }, "type": "array" } }, "required": ["review", "turns"], "type": "object" }, "AdminReviewListItem": { "description": "One Approvals-queue row (console plane, D17). Metadata + intent summary + subject + a body snippet only; never the full body (loaded on detail open).\n", "properties": { "agent_id": { "type": "string" }, "category_id": { "type": "string" }, "created_at": { "format": "date-time", "type": "string" }, "effective_mode": { "enum": ["review", "direct"], "type": "string" }, "escalation_reason": { "description": "Why a reviewer-loop draft landed back in the human queue (M8; \xA79): a reviewer's escalate, or a circuit breaker (max_hops / review_deadline) forcing it to the human. Empty for an ordinary review.", "type": "string" }, "from_address": { "type": "string" }, "gate_outcome": { "description": "The auto-send divert reason (held:<reason>) when the submit-time gate routed this message to the human (M6); empty for an ordinary review.", "type": "string" }, "hop_count": { "description": "The monotonic reviewer hand-back counter (M8 breaker (a)); surfaced so a maxed-out review reads as forced-to-human.", "type": "integer" }, "id": { "type": "string" }, "intent_summary": { "type": "string" }, "kind": { "enum": ["send", "reply", "forward"], "type": "string" }, "mode": { "enum": ["review", "direct"], "type": "string" }, "revision": { "type": "integer" }, "snippet": { "type": "string" }, "stale_reason": { "type": "string" }, "state": { "enum": ["needs_review", "in_review", "chatting", "stale", "approved", "sent", "auto_sent", "rejected", "stalled", "cancelled", "failed"], "type": "string" }, "subject": { "type": "string" }, "updated_at": { "format": "date-time", "type": "string" }, "version": { "type": "integer" } }, "required": ["id", "state", "mode", "effective_mode", "kind", "revision", "version"], "type": "object" }, "AdminReviewPage": { "properties": { "items": { "items": { "$ref": "#/components/schemas/AdminReviewListItem" }, "type": "array" }, "next_cursor": { "type": "string" }, "total": { "type": "integer" } }, "required": ["items", "total"], "type": "object" }, "AdminReviewRejectResult": { "properties": { "review_id": { "type": "string" }, "state": { "type": "string" }, "status": { "example": "rejected", "type": "string" } }, "required": ["status", "review_id", "state"], "type": "object" }, "AdminReviewSendResult": { "description": "The approve / edit-send success result. The platform performed the authenticated send via the COMPOSER's inbox; the send is irreversible once returned.\n", "properties": { "message_id": { "type": "string" }, "review_id": { "type": "string" }, "sent_copy_status": { "$ref": "#/components/schemas/SentCopyStatus" }, "sent_message_id": { "nullable": true, "type": "string" }, "state": { "type": "string" }, "status": { "example": "sent", "type": "string" }, "submission_id": { "type": "string" }, "thread_id": { "type": "string" }, "transport": { "$ref": "#/components/schemas/TransportCounts" } }, "required": ["status", "review_id", "state", "message_id"], "type": "object" }, "AdminSaveProjectRuleRequest": { "properties": { "category_id": { "type": "string" }, "kind": { "enum": ["soft", "hard"], "type": "string" }, "priority": { "type": "integer" }, "propagate_to_pending": { "default": false, "type": "boolean" }, "rule_text": { "type": "string" }, "scope": { "enum": ["general", "category"], "type": "string" }, "suggested_batch": { "type": "integer" }, "supersedes_id": { "type": "string" } }, "required": ["rule_text"], "type": "object" }, "AdminThreadDetail": { "properties": { "last_message_at": { "type": "string" }, "last_message_id": { "type": "string" }, "message_count": { "type": "integer" }, "messages": { "items": { "$ref": "#/components/schemas/AdminMessage" }, "type": "array" }, "participants": { "items": { "type": "string" }, "type": "array" }, "snippet": { "type": "string" }, "subject": { "type": "string" }, "thread_id": { "type": "string" }, "unread": { "type": "boolean" } }, "type": "object" }, "AdminThreadList": { "description": "A cursor page of persistent thread summaries for one inbox.", "properties": { "next_cursor": { "type": "string" }, "threads": { "items": { "$ref": "#/components/schemas/AdminUnifiedThread" }, "type": "array" }, "total": { "type": "integer" } }, "type": "object" }, "AdminUnifiedThread": { "description": "One row in the shared-inbox feed, tagged with its owning inbox.", "properties": { "id": { "type": "string" }, "inbox": { "type": "string" }, "last_message_at": { "type": "string" }, "last_message_has_attachments": { "type": "boolean" }, "last_message_id": { "type": "string" }, "message_count": { "type": "integer" }, "participants": { "items": { "type": "string" }, "type": "array" }, "snippet": { "type": "string" }, "subject": { "type": "string" }, "unread": { "type": "boolean" } }, "type": "object" }, "AdminUnifiedThreadFeed": { "description": "Stable keyset page merged newest-first across the active project's inboxes.", "properties": { "failed_inboxes": { "items": { "type": "string" }, "type": "array" }, "inbox_count": { "type": "integer" }, "next_cursor": { "description": "Opaque global keyset cursor; pass back unchanged.", "type": "string" }, "partial_failure": { "type": "boolean" }, "threads": { "items": { "$ref": "#/components/schemas/AdminUnifiedThread" }, "type": "array" }, "total": { "type": "integer" } }, "type": "object" }, "AdminUpdateInboxRequest": { "additionalProperties": false, "minProperties": 1, "properties": { "daily_send_limit": { "maximum": 1e4, "minimum": 1, "type": "integer" }, "direct_smtp_enabled": { "description": "Explicit per-inbox raw SMTP bypass. It is disabled by default and can be enabled only by a human for an account with an active paid entitlement. Disabling is always allowed. Agent API, SDK, and MCP sends continue through the normal review controls regardless of this setting.\n", "type": "boolean" } }, "type": "object" }, "AgentKeyList": { "properties": { "keys": { "items": { "$ref": "#/components/schemas/AgentKeySummary" }, "type": "array" }, "next_page": { "type": "string" } }, "type": "object" }, "AgentKeySummary": { "properties": { "agent_handle": { "type": "string" }, "agent_id": { "type": "string" }, "agent_name": { "type": "string" }, "ceiling_inbox_id": { "type": "string" }, "created_at": { "format": "date-time", "type": "string" }, "enrollment_token_id": { "type": "string" }, "expires_at": { "format": "date-time", "type": "string" }, "id": { "type": "string" }, "key_tier": { "enum": ["org", "project", "inbox"], "type": "string" }, "last_used_at": { "format": "date-time", "type": "string" }, "prefix": { "type": "string" }, "revoked": { "type": "boolean" }, "scopes": { "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "AgentList": { "properties": { "agents": { "items": { "$ref": "#/components/schemas/AgentSummary" }, "type": "array" }, "next_page": { "type": "string" } }, "type": "object" }, "AgentStatusResult": { "properties": { "agent_id": { "type": "string" }, "status": { "enum": ["active", "disabled"], "type": "string" } }, "type": "object" }, "AgentSummary": { "properties": { "created_at": { "format": "date-time", "type": "string" }, "handle": { "type": "string" }, "id": { "type": "string" }, "last_seen_at": { "description": "Latest authenticated API-key activity.", "format": "date-time", "nullable": true, "type": "string" }, "mailbox_count": { "description": "Inboxes owned by this agent in the active project.", "minimum": 0, "type": "integer" }, "name": { "type": "string" }, "status": { "enum": ["active", "disabled"], "type": "string" } }, "type": "object" }, "Attachment": { "description": "Attachment metadata. Download the bytes from the attachment endpoint.", "properties": { "content_type": { "example": "application/pdf", "type": "string" }, "filename": { "type": "string" }, "id": { "type": "string" }, "size": { "description": "Size in bytes.", "type": "integer" } }, "type": "object" }, "AttachmentInput": { "description": "An outbound attachment on send/reply/forward.", "properties": { "content_base64": { "description": "Standard base64-encoded attachment bytes.", "type": "string" }, "content_type": { "type": "string" }, "filename": { "type": "string" } }, "required": ["content_base64"], "type": "object" }, "AttachmentPage": { "properties": { "items": { "items": { "$ref": "#/components/schemas/Attachment" }, "type": "array" }, "total": { "type": "integer" } }, "type": "object" }, "AuditEvent": { "properties": { "action": { "type": "string" }, "actor": { "type": "string" }, "created_at": { "format": "date-time", "type": "string" }, "id": { "type": "string" }, "metadata": { "additionalProperties": { "type": "string" }, "type": "object" }, "severity": { "enum": ["info", "warn", "error"], "type": "string" }, "target": { "type": "string" } }, "type": "object" }, "AuditList": { "properties": { "events": { "items": { "$ref": "#/components/schemas/AuditEvent" }, "type": "array" }, "next_page": { "type": "string" } }, "type": "object" }, "Category": { "description": "A category (cat_\u2026) in the registry (Review Loop, D9/D10). name + description are the skill-style metadata an agent fuzzy-matches against (NO LLM on our side; the agent does the matching). Categories are CUSTOMER-scoped and agent-attributed; nothing keys on the name (renames never break a reference).\n", "properties": { "author_kind": { "enum": ["agent", "human", "connection"], "type": "string" }, "clean_approval_count": { "description": "Clean human-approve-as-is count toward the maturity gate (D16).", "type": "integer" }, "created_at": { "format": "date-time", "type": "string" }, "created_by_agent_id": { "type": "string" }, "description": { "type": "string" }, "drift_count": { "description": "Human edit/reject count in a graduated category toward drift auto-demote (K; \xA77).", "type": "integer" }, "graduated_at": { "description": "When the category was last graduated (omitted if never).", "format": "date-time", "type": "string" }, "graduated_by": { "description": "Who last graduated it ('human:<sub>'); empty if never/demoted.", "type": "string" }, "id": { "description": "Opaque category id (cat_\u2026).", "type": "string" }, "last_used_at": { "description": "Most recent accepted message creation time; absent when unused.", "format": "date-time", "type": "string" }, "merged_into": { "description": "Survivor category id when this one was merged/soft-deleted (cat_\u2026).", "type": "string" }, "message_count_30d": { "description": "Logical accepted messages created in the last 30 days in the authorized project.", "type": "integer" }, "message_count_7d": { "description": "Logical accepted messages created in the last 7 days in the authorized project.", "type": "integer" }, "message_count_90d": { "description": "Logical accepted messages created in the last 90 days in the authorized project.", "type": "integer" }, "name": { "type": "string" }, "never_graduate": { "description": "Human lock pinning the category at supervised (no live auto-send; D16).", "type": "boolean" }, "pending_review_count": { "description": "Current nonterminal reviews across composers in the authorized project.", "type": "integer" }, "rule_high_water": { "type": "integer" }, "rules_version": { "type": "integer" }, "scope": { "enum": ["org_shared", "agent_private"], "type": "string" }, "state": { "enum": ["supervised", "auto_notify", "auto_silent"], "type": "string" }, "updated_at": { "format": "date-time", "type": "string" } }, "required": ["id", "name", "description", "scope", "state", "author_kind", "rule_high_water", "rules_version"], "type": "object" }, "CategoryPacingState": { "description": "The demand-driven pacing snapshot for a category (agent-readable, $0-LLM, M7 Slice B/\xA78): the human review cursor position, the effective window/ceiling/ interval, the queued count, and each queued draft's in-window/redrafting/ behind-cursor classification. Read-only; the cursor advances from the human's console approve/reject/edit actions.\n", "properties": { "category_id": { "type": "string" }, "cursor_advanced_count": { "description": "Monotonic count of cursor advances.", "type": "integer" }, "cursor_review_id": { "description": "The last queued draft the human acted on (the cursor); omitted when nothing reviewed yet.", "type": "string" }, "in_window": { "description": "Of the queued, how many sit in the freshness-guaranteed window.", "type": "integer" }, "items": { "items": { "$ref": "#/components/schemas/PacingItem" }, "type": "array" }, "lookahead_window": { "description": "Effective freshness window (default org_settings.lookahead_window=3).", "type": "integer" }, "nudge_min_interval_ms": { "description": "Per-agent token-bucket interval that coalesces feedback storms (default 5000).", "type": "integer" }, "queued": { "description": "How many drafts are in the human queue (needs_review|in_review|chatting).", "type": "integer" }, "redrafting": { "description": "Of the in-window, how many are stale and being redrafted (the console shimmer set).", "type": "integer" }, "rework_batch_max": { "description": "HARD per-nudge fan-out ceiling (default org_settings.rework_batch_max=10); one nudge can never fan to 500.", "type": "integer" } }, "required": ["category_id", "cursor_advanced_count", "lookahead_window", "rework_batch_max", "nudge_min_interval_ms", "queued", "in_window", "redrafting", "items"], "type": "object" }, "CategoryPage": { "properties": { "items": { "items": { "$ref": "#/components/schemas/Category" }, "type": "array" }, "next_cursor": { "description": "Opaque next page cursor.", "type": "string" }, "total": { "type": "integer" } }, "required": ["items", "total"], "type": "object" }, "CategoryRiskDial": { "description": "One category's risk-dial OVERRIDE columns (null = inherit the account default; D12) alongside the resolved effective dial. A null field means the category inherits that value from the account default.\n", "properties": { "canary_rate": { "format": "double", "nullable": true, "type": "number" }, "category_id": { "type": "string" }, "drift_demote_after": { "nullable": true, "type": "integer" }, "effective": { "$ref": "#/components/schemas/EffectiveRiskDial" }, "first_contact_gate": { "nullable": true, "type": "boolean" }, "graduate_min_age_hours": { "nullable": true, "type": "integer" }, "graduate_min_approvals": { "nullable": true, "type": "integer" }, "min_confidence": { "format": "double", "nullable": true, "type": "number" } }, "required": ["category_id", "effective"], "type": "object" }, "CategoryRiskDialRequest": { "description": "Set / clear a category's risk-dial overrides (console plane, D12). For each field, a non-null value SETS the override; an explicit JSON null RESETS it to inherit; an omitted field is unchanged.\n", "properties": { "canary_rate": { "format": "double", "nullable": true, "type": "number" }, "drift_demote_after": { "nullable": true, "type": "integer" }, "first_contact_gate": { "nullable": true, "type": "boolean" }, "graduate_min_age_hours": { "nullable": true, "type": "integer" }, "graduate_min_approvals": { "nullable": true, "type": "integer" }, "min_confidence": { "format": "double", "nullable": true, "type": "number" } }, "type": "object" }, "CommerceBlocker": { "properties": { "code": { "type": "string" }, "limit_cents": { "format": "int64", "type": "integer" }, "limit_count": { "format": "int64", "type": "integer" }, "limit_id": { "type": "string" }, "manage_url": { "format": "uri", "type": "string" }, "message": { "type": "string" }, "requested_cents": { "format": "int64", "type": "integer" }, "reserved_cents": { "format": "int64", "type": "integer" }, "reserved_count": { "format": "int64", "type": "integer" }, "reset_at": { "format": "date-time", "type": "string" }, "scope": { "type": "string" }, "used_cents": { "format": "int64", "type": "integer" }, "used_count": { "format": "int64", "type": "integer" } }, "required": ["code", "message"], "type": "object" }, "CommerceRequest": { "properties": { "agent_id": { "description": "Present when an agent initiated the request.", "type": "string" }, "agent_next_action": { "type": "string" }, "approval_url": { "format": "uri", "type": "string" }, "approved_max_cents": { "format": "int64", "type": "integer" }, "auto_renew": { "type": "boolean" }, "blocker_code": { "type": "string" }, "blockers": { "items": { "$ref": "#/components/schemas/CommerceBlocker" }, "type": "array" }, "created_at": { "format": "date-time", "type": "string" }, "currency": { "type": "string" }, "current_plan": { "type": "string" }, "domain": { "type": "string" }, "domain_scope": { "enum": ["org", "project"], "type": "string" }, "effective_at": { "format": "date-time", "type": "string" }, "external_job_id": { "type": "string" }, "id": { "type": "string" }, "kind": { "enum": ["domain_purchase", "plan_change"], "type": "string" }, "notification_last_error": { "type": "string" }, "notification_state": { "type": "string" }, "object": { "enum": ["commerce_request"], "type": "string" }, "payment_action_url": { "format": "uri", "type": "string" }, "poll_after_seconds": { "type": "integer" }, "project_id": { "type": "string" }, "quote_cents": { "format": "int64", "type": "integer" }, "quote_expires_at": { "format": "date-time", "type": "string" }, "rationale": { "type": "string" }, "renewal_cents": { "format": "int64", "type": "integer" }, "required_plan": { "type": "string" }, "required_plan_price_cents": { "format": "int64", "type": "integer" }, "retry_safe": { "type": "boolean" }, "state": { "type": "string" }, "target_plan": { "type": "string" }, "updated_at": { "format": "date-time", "type": "string" }, "version": { "format": "int64", "type": "integer" } }, "required": ["object", "id", "kind", "state", "currency", "quote_cents", "renewal_cents", "auto_renew", "blockers", "agent_next_action", "retry_safe", "poll_after_seconds", "version", "created_at", "updated_at"], "type": "object" }, "CommerceRequestPage": { "properties": { "items": { "items": { "$ref": "#/components/schemas/CommerceRequest" }, "type": "array" }, "next_cursor": { "type": "string" }, "total": { "type": "integer" } }, "required": ["items", "total"], "type": "object" }, "CommerceSpendLimit": { "allOf": [{ "$ref": "#/components/schemas/CommerceSpendLimitInput" }, { "properties": { "created_at": { "format": "date-time", "type": "string" }, "id": { "type": "string" }, "org_id": { "type": "string" }, "period_end": { "format": "date-time", "type": "string" }, "period_start": { "format": "date-time", "type": "string" }, "purchased_count": { "format": "int64", "type": "integer" }, "reserved_cents": { "format": "int64", "type": "integer" }, "reserved_count": { "format": "int64", "type": "integer" }, "spent_cents": { "format": "int64", "type": "integer" }, "updated_at": { "format": "date-time", "type": "string" }, "version": { "format": "int64", "type": "integer" } }, "required": ["id", "org_id", "currency", "period_start", "spent_cents", "reserved_cents", "purchased_count", "reserved_count", "active", "version", "created_at", "updated_at"], "type": "object" }] }, "CommerceSpendLimitInput": { "properties": { "active": { "type": "boolean" }, "agent_id": { "type": "string" }, "allow_premium": { "type": "boolean" }, "allowed_tlds": { "items": { "type": "string" }, "type": "array" }, "budget_cents": { "format": "int64", "minimum": 0, "type": "integer" }, "budget_enabled": { "type": "boolean" }, "cadence": { "enum": ["does_not_repeat", "weekly", "monthly", "quarterly", "annually"], "type": "string" }, "currency": { "default": "usd", "type": "string" }, "domain_count_enabled": { "type": "boolean" }, "domain_count_limit": { "format": "int64", "minimum": 0, "type": "integer" }, "expected_version": { "format": "int64", "type": "integer" }, "expires_at": { "format": "date-time", "type": "string" }, "name": { "type": "string" }, "per_purchase_enabled": { "type": "boolean" }, "per_purchase_max_cents": { "format": "int64", "minimum": 0, "type": "integer" }, "project_id": { "type": "string" }, "scope": { "enum": ["org", "project", "agent"], "type": "string" } }, "required": ["scope", "name", "cadence", "budget_cents", "budget_enabled", "per_purchase_max_cents", "per_purchase_enabled", "domain_count_limit", "domain_count_enabled", "allow_premium"], "type": "object" }, "ConnectionConsent": { "properties": { "agent_id": { "type": "string" }, "agent_org_id": { "type": "string" }, "duration": { "description": "Full account control defaults to 24h.", "enum": ["24h", "until_revoked"], "type": "string" }, "full_control_confirmed": { "description": "Required explicit consent for full account control including self-approval and lasting created credentials.", "type": "boolean" }, "identity": { "enum": ["personal_assistant", "dedicated_agent"], "type": "string" }, "inbox_ids": { "items": { "type": "string" }, "maxItems": 100, "type": "array" }, "name": { "maxLength": 100, "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" }, "reach": { "enum": ["inboxes", "project", "organization", "full_account"], "type": "string" }, "scopes": { "items": { "type": "string" }, "maxItems": 64, "type": "array" } }, "required": ["name", "identity", "reach", "scopes"], "type": "object" }, "ConnectionConsentResult": { "properties": { "connection": { "$ref": "#/components/schemas/ConnectionGrant" }, "redirect_url": { "description": "Registered OAuth callback with a single-use PKCE authorization code.", "type": "string" } }, "type": "object" }, "ConnectionCreatedCredential": { "description": "Provenance and current status of an independently surviving agent key or enrollment token. Contains no secret or hash.", "properties": { "agent_id": { "type": "string" }, "authorizer_id": { "type": "string" }, "consumed": { "description": "A non-reusable enrollment token has already been redeemed. Its issued keys survive.", "type": "boolean" }, "created_at_ms": { "format": "int64", "type": "integer" }, "created_by_connection_id": { "type": "string" }, "created_via_enrollment_id": { "type": "string" }, "expires_at_ms": { "description": "Zero means until revoked.", "format": "int64", "type": "integer" }, "id": { "type": "string" }, "kind": { "enum": ["agent_key", "enrollment_token"], "type": "string" }, "name": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" }, "revoked": { "type": "boolean" }, "scopes": { "items": { "type": "string" }, "type": "array" } }, "required": ["id", "created_by_connection_id", "authorizer_id", "kind", "org_id", "project_id", "name", "scopes", "created_at_ms", "expires_at_ms", "revoked", "consumed"], "type": "object" }, "ConnectionCreatedCredentialList": { "properties": { "data": { "items": { "$ref": "#/components/schemas/ConnectionCreatedCredential" }, "type": "array" }, "has_more": { "type": "boolean" }, "next_cursor": { "nullable": true, "type": "string" }, "object": { "enum": ["list"], "type": "string" } }, "required": ["object", "data", "has_more", "next_cursor"], "type": "object" }, "ConnectionEvent": { "properties": { "action": { "type": "string" }, "actor": { "description": "Explicit user or delegated connection identity.", "type": "string" }, "authorizer_id": { "type": "string" }, "connection_id": { "type": "string" }, "created_at_ms": { "format": "int64", "type": "integer" }, "id": { "type": "string" }, "outcome": { "type": "string" }, "target": { "type": "string" } }, "type": "object" }, "ConnectionEventList": { "properties": { "data": { "items": { "$ref": "#/components/schemas/ConnectionEvent" }, "type": "array" }, "has_more": { "type": "boolean" }, "next_cursor": { "nullable": true, "type": "string" }, "object": { "enum": ["list"], "type": "string" } }, "required": ["object", "data", "has_more"], "type": "object" }, "ConnectionGrant": { "description": "Explicit consent bound to one connection; token refresh never extends grant expiry. Created credentials survive independently.", "properties": { "agent_id": { "type": "string" }, "agent_org_id": { "type": "string" }, "authorizer_id": { "type": "string" }, "client_id": { "type": "string" }, "consent_version": { "type": "string" }, "created_at_ms": { "format": "int64", "type": "integer" }, "created_by_connection_id": { "description": "Creation provenance; parent expiry and revocation do not cascade.", "type": "string" }, "expires_at_ms": { "description": "Fixed grant deadline in Unix milliseconds. Zero means until revoked.", "format": "int64", "type": "integer" }, "id": { "type": "string" }, "identity": { "enum": ["personal_assistant", "dedicated_agent"], "type": "string" }, "inbox_ids": { "items": { "type": "string" }, "maxItems": 100, "type": "array" }, "last_used_at_ms": { "format": "int64", "type": "integer" }, "name": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" }, "reach": { "enum": ["inboxes", "project", "organization", "full_account"], "type": "string" }, "revoked_at_ms": { "format": "int64", "type": "integer" }, "scopes": { "items": { "type": "string" }, "type": "array" } }, "required": ["id", "authorizer_id", "client_id", "name", "identity", "reach", "scopes", "created_at_ms", "expires_at_ms", "revoked_at_ms"], "type": "object" }, "ConnectionGrantList": { "properties": { "data": { "items": { "$ref": "#/components/schemas/ConnectionGrant" }, "type": "array" }, "has_more": { "type": "boolean" }, "next_cursor": { "nullable": true, "type": "string" }, "object": { "enum": ["list"], "type": "string" } }, "required": ["object", "data", "has_more"], "type": "object" }, "CreateAgentRequest": { "additionalProperties": false, "properties": { "name": { "description": "Human-facing agent name. The server generates its technical handle.", "maxLength": 120, "minLength": 1, "type": "string" } }, "required": ["name"], "type": "object" }, "CreateBillingCheckoutRequest": { "properties": { "cancel_url": { "format": "uri", "type": "string" }, "plan_tier": { "enum": ["developer", "startup"], "type": "string" }, "success_url": { "format": "uri", "type": "string" } }, "required": ["plan_tier", "success_url", "cancel_url"], "type": "object" }, "CreateBillingCheckoutResponse": { "properties": { "id": { "description": "Stripe Checkout Session id.", "type": "string" }, "mode": { "enum": ["test", "live"], "type": "string" }, "plan_tier": { "enum": ["developer", "startup"], "type": "string" }, "status": { "type": "string" }, "subscription": { "$ref": "#/components/schemas/AdminBillingSubscription" }, "url": { "format": "uri", "type": "string" } }, "required": ["id", "url", "status", "plan_tier", "mode", "subscription"], "type": "object" }, "CreateBillingPortalRequest": { "properties": { "return_url": { "format": "uri", "type": "string" } }, "required": ["return_url"], "type": "object" }, "CreateBillingPortalResponse": { "properties": { "id": { "description": "Stripe Billing Portal Session id.", "type": "string" }, "mode": { "enum": ["test", "live"], "type": "string" }, "url": { "format": "uri", "type": "string" } }, "required": ["id", "url", "mode"], "type": "object" }, "CreateDomainBillingCheckoutRequest": { "properties": { "cancel_url": { "format": "uri", "type": "string" }, "domain": { "example": "agent.agency", "type": "string" }, "success_url": { "format": "uri", "type": "string" } }, "required": ["domain", "success_url", "cancel_url"], "type": "object" }, "CreateDomainBillingCheckoutResponse": { "properties": { "baseline_com_cost_cents": { "format": "int64", "type": "integer" }, "currency": { "example": "usd", "type": "string" }, "domain": { "type": "string" }, "domain_annual_price_cents": { "format": "int64", "type": "integer" }, "id": { "description": "Stripe Checkout Session id.", "type": "string" }, "mode": { "enum": ["test", "live"], "type": "string" }, "plan_tier": { "enum": ["developer", "startup"], "type": "string" }, "registrar_cost_cents": { "format": "int64", "type": "integer" }, "status": { "type": "string" }, "stripe_price_id": { "type": "string" }, "url": { "format": "uri", "type": "string" } }, "required": ["id", "url", "status", "mode", "domain", "plan_tier", "currency", "registrar_cost_cents", "baseline_com_cost_cents", "domain_annual_price_cents", "stripe_price_id"], "type": "object" }, "CreateDomainPurchaseRequest": { "properties": { "auto_renew": { "default": true, "type": "boolean" }, "domain": { "type": "string" }, "project_id": { "type": "string" }, "rationale": { "maxLength": 2e3, "type": "string" }, "scope": { "default": "org", "enum": ["org", "project"], "type": "string" } }, "required": ["domain"], "type": "object" }, "CreateInvitationRequest": { "description": "Invite an email to the org. Role-capped: the inviter cannot grant a role above their own effective role. Idempotent: one pending invitation per (org, email). The raw token is returned ONCE on a fresh create.\n", "properties": { "email": { "format": "email", "type": "string" }, "expires_in_days": { "description": "Optional TTL in days.", "type": "integer" }, "role": { "enum": ["owner", "admin", "member", "viewer", "billing"], "type": "string" } }, "required": ["email", "role"], "type": "object" }, "CreateOrgRequest": { "description": "Create a CHILD org. parent_org_id is required (only child orgs are creatable from the console in v1; a user's single root org is bootstrapped on first sign-in). admin+ on the parent is required. Client-supplied org ids are NEVER accepted; the server creates a UUID and a compatibility customer id.\n", "properties": { "display_name": { "type": "string" }, "parent_org_id": { "type": "string" }, "slug": { "type": "string" } }, "required": ["parent_org_id"], "type": "object" }, "CreatePlanChangeRequest": { "properties": { "project_id": { "description": "Required on the console creation route; agent routes derive it from the key.", "type": "string" }, "rationale": { "maxLength": 2e3, "type": "string" }, "target_plan": { "enum": ["free", "developer", "startup"], "type": "string" } }, "required": ["target_plan"], "type": "object" }, "CreateProjectRequest": { "description": "Create a project under the org. Enforced against the org's max_projects cap inside the same transaction as the create. Client-supplied ids are never accepted; the server creates a UUID.\n", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": ["name"], "type": "object" }, "CreateReviewLinkRequest": { "description": "Link a reviewer agent to an inbox (or account-wide). transport defaults to webhook; a webhook transport REQUIRES webhook_url. The timing knobs default at the server when omitted (escalate_after_s=300, max_hops=3, review_deadline_s= 86400). One link per scope; a duplicate scope is 409.\n", "properties": { "escalate_after_s": { "type": "integer" }, "hmac_secret": { "description": "Write-only signing secret for webhook deliveries.", "type": "string" }, "inbox_address": { "description": "Empty = account-wide.", "type": "string" }, "max_hops": { "type": "integer" }, "review_deadline_s": { "type": "integer" }, "reviewer_agent_id": { "description": "The reviewer agent (agt_\u2026)", "must belong to the customer.": null, "type": "string" }, "transport": { "description": "Defaults webhook.", "enum": ["webhook", "sse", "websocket"], "type": "string" }, "webhook_url": { "description": "Required for the webhook transport.", "type": "string" } }, "required": ["reviewer_agent_id"], "type": "object" }, "DecideCommerceRequest": { "properties": { "approved_max_cents": { "format": "int64", "minimum": 0, "type": "integer" }, "auto_renew": { "type": "boolean" }, "expected_version": { "format": "int64", "type": "integer" }, "future_authority": { "$ref": "#/components/schemas/CommerceSpendLimitInput" }, "reason": { "type": "string" } }, "required": ["expected_version"], "type": "object" }, "DelegationHealth": { "description": "Customer nameserver health, independent of mail setup. Confirmed DNS is not mail readiness. Action required means restore the instructed nameservers; mail may be disrupted.", "properties": { "checked_at": { "format": "date-time", "type": "string" }, "confirmed_at": { "format": "date-time", "type": "string" }, "status": { "enum": ["pending", "confirmed", "rechecking", "check_delayed", "action_required"], "type": "string" } }, "type": "object" }, "DeleteCategoryResult": { "description": "The result of a soft-delete (the row + history survive as training data; D9).", "properties": { "category_id": { "type": "string" }, "merged_into": { "type": "string" }, "status": { "example": "deleted", "type": "string" } }, "required": ["status", "category_id"], "type": "object" }, "DeleteReviewLinkResult": { "description": "The delete outcome plus how many in-flight reviews were swept back to the human queue (no orphan deliveries; \xA79).\n", "properties": { "deleted": { "type": "boolean" }, "swept": { "description": "In-flight reviews returned to the human queue by the delete.", "type": "integer" } }, "required": ["deleted", "swept"], "type": "object" }, "DomainList": { "properties": { "domains": { "items": { "$ref": "#/components/schemas/DomainSummary" }, "type": "array" }, "next_page": { "type": "string" } }, "type": "object" }, "DomainReadiness": { "description": "Authoritative domain outcome shared by the console, API, MCP and SDK. Show summary and next_action instead of interpreting verification_status, mode or dkim_status. ready_for_inboxes describes domain configuration only; creating an inbox still requires permission and available plan capacity. checked_at is the latest DNS observation, not an end-to-end mail test.\n", "properties": { "action_required_by": { "enum": ["customer", "extrovert", "none"], "type": "string" }, "checked_at": { "format": "date-time", "type": "string" }, "inboxes": { "description": "Omitted without inbox-read permission. Agent counts include only that agent's visible inboxes.", "properties": { "needs_attention": { "minimum": 0, "type": "integer" }, "ready": { "minimum": 0, "type": "integer" }, "scope": { "enum": ["agent", "inbox", "selected_inboxes", "project", "organization"], "type": "string" }, "setting_up": { "minimum": 0, "type": "integer" }, "total": { "minimum": 0, "type": "integer" } }, "required": ["scope", "total", "ready", "setting_up", "needs_attention"], "type": "object" }, "label": { "type": "string" }, "next_action": { "enum": ["check_dns_entries", "restore_dns", "wait", "create_inbox", "use_inbox", "ask_owner_to_create_inbox"], "type": "string" }, "next_check_at": { "format": "date-time", "type": "string" }, "poll_after_seconds": { "minimum": 1, "type": "integer" }, "ready_for_inboxes": { "type": "boolean" }, "reason": { "type": "string" }, "status": { "enum": ["waiting_for_dns", "checking", "setting_up", "ready", "action_required", "needs_attention"], "type": "string" }, "summary": { "type": "string" } }, "required": ["status", "label", "summary", "reason", "action_required_by", "next_action", "ready_for_inboxes", "poll_after_seconds"], "type": "object" }, "DomainSummary": { "properties": { "delegation": { "$ref": "#/components/schemas/DelegationHealth" }, "dkim_status": { "type": "string" }, "domain": { "type": "string" }, "id": { "type": "string" }, "mode": { "type": "string" }, "provisioning_error": { "type": "string" }, "provisioning_phase": { "type": "string" }, "readiness": { "$ref": "#/components/schemas/DomainReadiness" }, "shared": { "description": "True for the hosted inbox domain included with the current plan.", "type": "boolean" }, "verification_status": { "type": "string" } }, "type": "object" }, "EffectiveRiskDial": { "description": "The RESOLVED risk dial for a category: the account default with any per- category override applied (null override = inherit; D12). Every field is a concrete value already in force.\n", "properties": { "auto_send_cap_per_day": { "type": "integer" }, "canary_rate": { "format": "double", "type": "number" }, "drift_demote_after": { "type": "integer" }, "first_contact_gate": { "type": "boolean" }, "graduate_min_age_hours": { "type": "integer" }, "graduate_min_approvals": { "type": "integer" }, "min_confidence": { "format": "double", "type": "number" } }, "required": ["min_confidence", "first_contact_gate", "drift_demote_after", "canary_rate", "graduate_min_approvals", "graduate_min_age_hours", "auto_send_cap_per_day"], "type": "object" }, "EmailAddress": { "description": "A structured RFC5322 address.", "properties": { "email": { "example": "support@acme.test", "format": "email", "type": "string" }, "name": { "example": "Acme Support", "type": "string" } }, "required": ["email"], "type": "object" }, "EnrollmentTokenList": { "properties": { "next_page": { "type": "string" }, "tokens": { "items": { "$ref": "#/components/schemas/EnrollmentTokenSummary" }, "type": "array" } }, "type": "object" }, "EnrollmentTokenSummary": { "properties": { "created_at": { "format": "date-time", "type": "string" }, "daily_send_limit": { "type": "integer" }, "id": { "type": "string" }, "label": { "type": "string" }, "max_mailboxes": { "type": "integer" }, "prefix": { "type": "string" }, "reusable": { "type": "boolean" }, "revoked": { "type": "boolean" }, "scopes": { "items": { "type": "string" }, "type": "array" }, "used_count": { "type": "integer" } }, "type": "object" }, "GraduateCategoryRequest": { "description": "Graduate a category ONE rung up to to_state (console plane, D16).", "properties": { "to_state": { "enum": ["auto_notify", "auto_silent"], "type": "string" } }, "required": ["to_state"], "type": "object" }, "GraduationStatus": { "description": "The graduation gate status toward the NEXT rung (Review Loop, D16). Reports clean approvals (N / needed), category age, the maturity gate (auto_silent precondition), the drift counter vs K, and whether a human graduate would succeed right now (can_graduate). Read-only; agents propose but never flip the bit.\n", "properties": { "age_hours": { "format": "double", "type": "number" }, "age_met": { "type": "boolean" }, "approvals_met": { "type": "boolean" }, "can_graduate": { "type": "boolean" }, "category_id": { "type": "string" }, "clean_approval_count": { "type": "integer" }, "drift_count": { "type": "integer" }, "drift_demote_after": { "type": "integer" }, "graduate_min_age_hours": { "type": "integer" }, "graduate_min_approvals": { "type": "integer" }, "maturity_gate_met": { "type": "boolean" }, "never_graduate": { "description": "Pinned at supervised (high-stakes lock).", "type": "boolean" }, "next_state": { "description": "The rung a graduate would move to (empty if none).", "type": "string" }, "state": { "enum": ["supervised", "auto_notify", "auto_silent"], "type": "string" } }, "required": ["category_id", "state", "next_state", "never_graduate", "clean_approval_count", "graduate_min_approvals", "approvals_met", "age_hours", "graduate_min_age_hours", "age_met", "maturity_gate_met", "drift_count", "drift_demote_after", "can_graduate"], "type": "object" }, "InboxReviewPolicy": { "description": "The per-inbox review-policy override view after a set/clear: the raw override (empty = inherit), the account default it inherits from, and the resolved effective policy for this inbox (override-or-account-or-floor; D6).\n", "properties": { "account": { "enum": ["require_review", "allow_direct", "auto_send_graduated"], "type": "string" }, "address": { "type": "string" }, "effective": { "enum": ["require_review", "allow_direct", "auto_send_graduated"], "type": "string" }, "override": { "description": "Per-inbox override; empty = inherit the account default.", "type": "string" } }, "required": ["address", "override", "account", "effective"], "type": "object" }, "InboxReviewPolicyRequest": { "description": "Set the per-inbox override (a non-null policy) or clear it back to inherit the account default (explicit JSON null; D6).\n", "properties": { "policy": { "description": "A value SETS the override; explicit null CLEARS it (= inherit).", "enum": ["require_review", "allow_direct", "auto_send_graduated"], "nullable": true, "type": "string" } }, "type": "object" }, "IssueAgentKeyRequest": { "properties": { "agent_id": { "type": "string" }, "expires_in_hours": { "minimum": 0, "type": "integer" }, "scopes": { "items": { "type": "string" }, "type": "array" } }, "required": ["agent_id", "scopes"], "type": "object" }, "IssueAgentKeyResult": { "properties": { "agent_handle": { "type": "string" }, "agent_id": { "type": "string" }, "agent_name": { "type": "string" }, "ceiling_inbox_id": { "type": "string" }, "created_at": { "format": "date-time", "type": "string" }, "enrollment_token_id": { "type": "string" }, "expires_at": { "format": "date-time", "type": "string" }, "id": { "type": "string" }, "key": { "description": "Raw agent API key", "shown once.": null, "type": "string" }, "key_tier": { "enum": ["org", "project", "inbox"], "type": "string" }, "prefix": { "type": "string" }, "scopes": { "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "IssueEnrollmentTokenRequest": { "properties": { "allowed_domains": { "items": { "type": "string" }, "type": "array" }, "daily_send_limit": { "type": "integer" }, "expires_in_hours": { "type": "integer" }, "label": { "type": "string" }, "max_mailboxes": { "type": "integer" }, "reusable": { "type": "boolean" }, "scopes": { "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "IssueEnrollmentTokenResult": { "properties": { "daily_send_limit": { "type": "integer" }, "id": { "type": "string" }, "max_mailboxes": { "type": "integer" }, "prefix": { "type": "string" }, "scopes": { "items": { "type": "string" }, "type": "array" }, "token": { "description": "Raw enrollment token", "shown once.": null, "type": "string" } }, "type": "object" }, "MergeCategoryRequest": { "description": "Merge the path category (the loser) into into_category_id (the survivor), repointing all rr_/rule_ references by cat_ id in one transaction (D9/D10). A cross-tenant or unknown into_category_id is 404 (never a cross-customer merge).\n", "properties": { "into_category_id": { "description": "The survivor category id (cat_\u2026).", "type": "string" } }, "required": ["into_category_id"], "type": "object" }, "MergeCategoryResult": { "description": "The survivor category plus how many references were repointed by the merge.", "properties": { "category": { "$ref": "#/components/schemas/Category" }, "review_requests_repointed": { "type": "integer" }, "writing_rules_repointed": { "type": "integer" } }, "required": ["category", "review_requests_repointed", "writing_rules_repointed"], "type": "object" }, "Message": { "description": "The canonical message wire shape (agent plane).", "properties": { "cc": { "items": { "$ref": "#/components/schemas/EmailAddress" }, "type": "array" }, "date": { "description": "Original Date header value.", "type": "string" }, "direction": { "description": "Derived relative to the owning inbox.", "enum": ["inbound", "outbound"], "type": "string" }, "extracted_html": { "description": "Best-effort derivative of html with common quoted-history containers removed; null when html is absent or no authored HTML remains. Not authoritative.", "nullable": true, "type": "string" }, "extracted_text": { "description": "Best-effort derivative of text with quoted history and signatures removed; null when text is absent or no authored text remains. Not authoritative.", "nullable": true, "type": "string" }, "folder": { "type": "string" }, "from": { "$ref": "#/components/schemas/EmailAddress" }, "html": { "description": "Decoded text/html MIME alternative; null for text-only mail. Never synthesized from plain text.", "nullable": true, "type": "string" }, "id": { "description": "Opaque", "example": "msg_8Tz", "inbox-resolvable id.": null, "type": "string" }, "in_reply_to": { "description": "RFC5322 In-Reply-To header.", "type": "string" }, "inbox": { "example": "agent7@extrovertmail.com", "type": "string" }, "message_id": { "description": "RFC5322 Message-ID.", "type": "string" }, "references": { "description": "RFC5322 References header chain.", "type": "string" }, "reply_to": { "items": { "$ref": "#/components/schemas/EmailAddress" }, "type": "array" }, "seen": { "description": "Native IMAP \\Seen flag (read state).", "type": "boolean" }, "sent_copy_status": { "$ref": "#/components/schemas/SentCopyStatus" }, "sent_message_id": { "description": "Resolvable msg_ selector when the Sent copy is available.", "nullable": true, "type": "string" }, "subject": { "type": "string" }, "submission_id": { "description": "Opaque status handle for a tracked outbound submission.", "type": "string" }, "text": { "description": "Decoded UTF-8 text/plain MIME alternative; null when the message had no plain-text part. Never derived from HTML.", "nullable": true, "type": "string" }, "thread_id": { "example": "thr_9aB", "type": "string" }, "to": { "items": { "$ref": "#/components/schemas/EmailAddress" }, "type": "array" }, "transport": { "$ref": "#/components/schemas/TransportCounts" } }, "type": "object" }, "NeverGraduateRequest": { "description": "Set/clear the never-graduate lock on a category (console plane, D16).", "properties": { "locked": { "description": "true pins at supervised (demoting first if graduated); false releases the pin.", "type": "boolean" } }, "required": ["locked"], "type": "object" }, "OnboardDomainRequest": { "properties": { "domain": { "type": "string" }, "mode": { "enum": ["ns_delegated", "purchased"], "type": "string" } }, "required": ["domain", "mode"], "type": "object" }, "OnboardDomainResult": { "properties": { "delegation": { "$ref": "#/components/schemas/DelegationHealth" }, "delegation_ns": { "items": { "$ref": "#/components/schemas/RecordInstruction" }, "type": "array" }, "domain": { "type": "string" }, "instruction": { "type": "string" }, "mode": { "enum": ["shared", "ns_delegated", "manual", "purchased"], "type": "string" }, "provisioning_error": { "type": "string" }, "provisioning_phase": { "type": "string" }, "readiness": { "$ref": "#/components/schemas/DomainReadiness" }, "records": { "items": { "$ref": "#/components/schemas/RecordInstruction" }, "type": "array" }, "verification_status": { "type": "string" }, "zone_id": { "type": "string" } }, "type": "object" }, "Org": { "description": "An Extrovert organization (the authority/billing boundary). org ids are plain server-created UUIDs (never client-supplied). A root org has a null parent_org_id; child orgs reference their parent.\n", "properties": { "created_at": { "format": "date-time", "type": "string" }, "customer_id": { "type": "string" }, "display_name": { "type": "string" }, "id": { "type": "string" }, "lifecycle_status": { "enum": ["active", "archived", "deleted"], "type": "string" }, "max_child_orgs": { "type": "integer" }, "max_projects": { "type": "integer" }, "parent_org_id": { "nullable": true, "type": "string" }, "plan_tier": { "type": "string" }, "root_org_id": { "type": "string" }, "slug": { "type": "string" }, "updated_at": { "format": "date-time", "type": "string" }, "version": { "description": "Optimistic-CAS version.", "type": "integer" } }, "required": ["id", "customer_id", "root_org_id", "display_name", "slug", "lifecycle_status", "plan_tier", "max_child_orgs", "max_projects", "version", "created_at", "updated_at"], "type": "object" }, "OrgInvitation": { "description": "An org invitation. `token` is the raw secret returned ONCE on a fresh create (empty when an existing pending invitation was reused, or on accept/revoke).\n", "properties": { "created_at": { "format": "date-time", "type": "string" }, "email": { "type": "string" }, "expires_at": { "format": "date-time", "type": "string" }, "id": { "type": "string" }, "org_id": { "type": "string" }, "role": { "enum": ["owner", "admin", "member", "viewer", "billing"], "type": "string" }, "status": { "enum": ["pending", "accepted", "revoked", "expired"], "type": "string" }, "token": { "description": "Raw invitation token; present only on a fresh create.", "type": "string" }, "token_prefix": { "type": "string" } }, "required": ["id", "org_id", "email", "role", "status", "token_prefix", "expires_at", "created_at"], "type": "object" }, "OrgList": { "properties": { "orgs": { "items": { "$ref": "#/components/schemas/Org" }, "type": "array" } }, "type": "object" }, "OrgMember": { "description": "One org membership row.", "properties": { "clerk_user_id": { "type": "string" }, "created_at": { "format": "date-time", "type": "string" }, "email": { "type": "string" }, "role": { "enum": ["owner", "admin", "member", "viewer", "billing"], "type": "string" }, "updated_at": { "format": "date-time", "type": "string" } }, "required": ["clerk_user_id", "email", "role", "created_at", "updated_at"], "type": "object" }, "OrgMemberList": { "properties": { "members": { "items": { "$ref": "#/components/schemas/OrgMember" }, "type": "array" } }, "type": "object" }, "OrgSettings": { "properties": { "default_domain": { "type": "string" }, "default_mailbox_cap": { "type": "integer" }, "default_onboarding_mode": { "type": "string" }, "early_access": { "type": "boolean" }, "org_name": { "type": "string" }, "webhook_signing_prefix": { "type": "string" }, "x402_mode": { "type": "string" } }, "type": "object" }, "PacingItem": { "description": "One queued draft's pacing classification relative to the human review cursor + lookahead window (M7 Slice B/\xA78). $0-LLM (a cheap integer staleness compare).\n", "properties": { "review_id": { "type": "string" }, "state": { "description": "behind_cursor = the human has reviewed past it; in_window_fresh = in the freshness-guaranteed window and current-enough; in_window_redrafting = in the window but stale (a redraft is in flight; the console shows a shimmer); ahead = queued beyond the window, not yet freshness-guaranteed.\n", "enum": ["behind_cursor", "in_window_fresh", "in_window_redrafting", "ahead"], "type": "string" } }, "required": ["review_id", "state"], "type": "object" }, "PatchOrgRequest": { "description": "Update an org's display fields. Plan/limit fields are not console-patchable in v1.", "properties": { "display_name": { "type": "string" }, "expected_version": { "description": "Optimistic-CAS version of the row being updated.", "type": "integer" }, "slug": { "type": "string" } }, "type": "object" }, "PatchOrgSettingsRequest": { "description": "Any subset of the org settings; omitted fields are unchanged.", "properties": { "default_domain": { "type": "string" }, "default_mailbox_cap": { "type": "integer" }, "default_onboarding_mode": { "type": "string" }, "early_access": { "type": "boolean" }, "org_name": { "type": "string" }, "webhook_signing_prefix": { "type": "string" }, "x402_mode": { "type": "string" } }, "type": "object" }, "PatchProjectRequest": { "description": "Update a project's display fields.", "properties": { "description": { "type": "string" }, "expected_version": { "description": "Optimistic-CAS version of the row being updated.", "type": "integer" }, "name": { "type": "string" }, "slug": { "type": "string" } }, "type": "object" }, "PendingSignupClaim": { "properties": { "created_at": { "format": "date-time", "type": "string" }, "expires_at": { "format": "date-time", "type": "string" }, "id": { "type": "string" }, "org_id": { "type": "string" }, "role": { "enum": ["owner"], "type": "string" } }, "required": ["id", "org_id", "role", "created_at", "expires_at"], "type": "object" }, "PersonalCategory": { "properties": { "description": { "type": "string" }, "email": { "type": "boolean" }, "id": { "enum": ["review", "purchase_approval", "purchase_completed", "purchase_problem", "domain_progress", "domain_action", "domain_ready", "domain_problem", "sending_problem"], "type": "string" }, "label": { "type": "string" }, "push": { "type": "boolean" } }, "required": ["id", "label", "description", "push", "email"], "type": "object" }, "PersonalNotice": { "properties": { "action_path": { "type": "string" }, "actionable": { "type": "boolean" }, "body": { "description": "Safe summary", "or provider diagnostics.": null, "recipients": null, "subjects": null, "type": "string", "without message bodies": null }, "category": { "type": "string" }, "created_ms": { "format": "int64", "type": "integer" }, "email_status": { "enum": ["off", "pending", "sent", "failed", "suppressed"], "type": "string" }, "id": { "type": "string" }, "kind": { "type": "string" }, "notice_id": { "type": "string" }, "org_id": { "type": "string" }, "project_id": { "type": "string" }, "push_status": { "enum": ["off", "pending", "sent", "failed", "suppressed"], "type": "string" }, "source_id": { "type": "string" }, "source_version": { "format": "int64", "type": "integer" }, "title": { "type": "string" } }, "required": ["id", "notice_id", "kind", "source_id", "source_version", "org_id", "project_id", "category", "title", "body", "action_path", "actionable", "created_ms", "push_status", "email_status"], "type": "object" }, "PersonalNotificationBatch": { "properties": { "attempt": { "type": "integer" }, "channel": { "enum": ["push", "email"], "type": "string" }, "created_ms": { "format": "int64", "type": "integer" }, "device_id": { "type": "string" }, "id": { "type": "string" }, "items": { "items": { "$ref": "#/components/schemas/PersonalNotice" }, "type": "array" }, "status": { "type": "string" } }, "required": ["id", "channel", "status", "items"], "type": "object" }, "PersonalNotificationHistory": { "properties": { "items": { "items": { "$ref": "#/components/schemas/PersonalNotice" }, "type": "array" }, "next_cursor": { "type": "string" } }, "required": ["items"], "type": "object" }, "PersonalNotificationSettings": { "properties": { "email": { "type": "string" }, "email_status": { "enum": ["verified", "unavailable"], "type": "string" }, "preferences": { "$ref": "#/components/schemas/PersonalPreferences" }, "push_available": { "type": "boolean" } }, "required": ["preferences", "email", "email_status", "push_available"], "type": "object" }, "PersonalPreferencePatch": { "additionalProperties": false, "properties": { "category": { "type": "string" }, "email": { "type": "boolean" }, "expected_version": { "minimum": 0, "type": "integer" }, "grouping_minutes": { "enum": [1, 5, 15], "type": "integer" }, "push": { "type": "boolean" } }, "required": ["expected_version"], "type": "object" }, "PersonalPreferences": { "properties": { "categories": { "items": { "$ref": "#/components/schemas/PersonalCategory" }, "type": "array" }, "grouping_minutes": { "default": 5, "enum": [1, 5, 15], "type": "integer" }, "version": { "minimum": 0, "type": "integer" } }, "required": ["grouping_minutes", "version", "categories"], "type": "object" }, "PersonalPushDevice": { "properties": { "created_ms": { "format": "int64", "type": "integer" }, "enabled": { "type": "boolean" }, "endpoint": { "description": "Owner-only endpoint used to identify this browser. Subscription encryption keys are never returned.", "type": "string" }, "id": { "type": "string" }, "label": { "maxLength": 80, "type": "string" }, "last_accepted_ms": { "description": "Push provider acceptance time; does not prove device display.", "format": "int64", "type": "integer" }, "status": { "enum": ["active", "expired"], "type": "string" }, "updated_ms": { "format": "int64", "type": "integer" }, "version": { "type": "integer" } }, "required": ["id", "endpoint", "label", "enabled", "status", "version", "created_ms", "updated_ms", "last_accepted_ms"], "type": "object" }, "PersonalPushDevicePatch": { "additionalProperties": false, "properties": { "enabled": { "type": "boolean" }, "expected_version": { "minimum": 1, "type": "integer" }, "label": { "maxLength": 80, "type": "string" } }, "required": ["expected_version"], "type": "object" }, "PersonalPushEnrollment": { "additionalProperties": false, "properties": { "auth": { "description": "Base64url encoded 16-byte authentication secret.", "type": "string" }, "endpoint": { "description": "HTTPS endpoint on a supported browser push service.", "maxLength": 4096, "type": "string" }, "label": { "maxLength": 80, "type": "string" }, "p256dh": { "description": "Base64url encoded uncompressed P-256 public key.", "type": "string" } }, "required": ["endpoint", "p256dh", "auth", "label"], "type": "object" }, "Project": { "description": "An Extrovert project (the resource namespace inside an org). project ids are plain server-created UUIDs (never client-supplied).\n", "properties": { "created_at": { "format": "date-time", "type": "string" }, "customer_id": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "is_default": { "type": "boolean" }, "lifecycle_status": { "enum": ["active", "archived", "deleted"], "type": "string" }, "name": { "type": "string" }, "org_id": { "type": "string" }, "slug": { "type": "string" }, "updated_at": { "format": "date-time", "type": "string" }, "version": { "description": "Optimistic-CAS version.", "type": "integer" } }, "required": ["id", "org_id", "customer_id", "name", "slug", "description", "is_default", "lifecycle_status", "version", "created_at", "updated_at"], "type": "object" }, "ProjectList": { "properties": { "projects": { "items": { "$ref": "#/components/schemas/Project" }, "type": "array" } }, "type": "object" }, "PromoteRuleRequest": { "description": "Move a rule between the category and general/house-style layers (via a supersession).", "properties": { "to_scope": { "enum": ["general", "category"], "type": "string" } }, "required": ["to_scope"], "type": "object" }, "RealtimeTicket": { "description": "A short-lived, single-use ticket the console creates (under its Clerk session) to open the live Approvals SSE stream; EventSource cannot set an Authorization header, so the customer scope is carried by this opaque ticket in the stream's `ticket` query parameter. Bound to the session's customer at create time, consumed on first stream connect, and self-expiring (~60s).\n", "properties": { "expires_at": { "format": "date-time", "type": "string" }, "ticket": { "description": "Opaque single-use ticket (`rtk_\u2026`).", "type": "string" } }, "required": ["ticket", "expires_at"], "type": "object" }, "ReconcileMessageOutcome": { "description": "One per-message reconciliation outcome (D19); WHY a queued draft released or was held. verdict is the integer-compare result; released is true only when a current-enough draft also passed the M6 gate; a stale draft is NEVER released as-is.\n", "properties": { "composed_category_rules_version": { "type": "integer" }, "composed_house_style_version": { "type": "integer" }, "current_category_rules_version": { "type": "integer" }, "current_house_style_version": { "type": "integer" }, "gate_outcome": { "description": "The M6 gate decision for a current-enough draft (auto_silent|auto_notify, or held:<reason>).", "type": "string" }, "held_reason": { "description": "The held token when a gate diverted a current-enough draft.", "type": "string" }, "nudged": { "description": "Whether a reprocess nudge was enqueued (redraft a stale draft, or re-submit a releasable one).", "type": "boolean" }, "released": { "type": "boolean" }, "review_id": { "type": "string" }, "verdict": { "enum": ["current_enough", "stale"], "type": "string" } }, "required": ["review_id", "verdict", "released", "composed_category_rules_version", "composed_house_style_version", "current_category_rules_version", "current_house_style_version", "nudged"], "type": "object" }, "ReconcileResult": { "description": "The D19/\xA78 reconciliation sweep summary (console scan-backlog / graduate / rule-change). Records every per-message decision so the human never hand-touches the backlog and no stale draft slips out. Deterministic, $0-LLM.\n", "properties": { "category_id": { "type": "string" }, "current_category_rules_version": { "type": "integer" }, "current_house_style_version": { "type": "integer" }, "held_by_gate": { "description": "Current-enough drafts that a M6 gate diverted (transient re-supervision).", "type": "integer" }, "outcomes": { "items": { "$ref": "#/components/schemas/ReconcileMessageOutcome" }, "type": "array" }, "released": { "description": "Current-enough drafts released through the M6 gate (re-submit).", "type": "integer" }, "scanned": { "type": "integer" }, "stale": { "description": "Stale drafts nudged to redraft against current rules (held, not released).", "type": "integer" }, "staleness_tolerance": { "type": "integer" }, "trigger": { "description": "What kicked off the sweep.", "enum": ["graduate", "rule_change", "scan_backlog"], "type": "string" } }, "required": ["category_id", "trigger", "scanned", "released", "stale", "held_by_gate", "current_category_rules_version", "current_house_style_version", "staleness_tolerance", "outcomes"], "type": "object" }, "RecordInstruction": { "description": "A DNS record the customer must add for domain onboarding.", "properties": { "name": { "type": "string" }, "priority": { "nullable": true, "type": "integer" }, "ttl": { "type": "integer" }, "type": { "example": "TXT", "type": "string" }, "value": { "type": "string" } }, "type": "object" }, "RegisterWebhookRequest": { "properties": { "address": { "description": "Legacy alias for `inbox`.", "type": "string" }, "client_id": { "description": "Optional idempotency key (alias for the `Idempotency-Key` header). A retry with the same key replays the original webhook registration.\n", "type": "string" }, "event_types": { "description": "AgentMail-compatible alias for `events`.", "items": { "enum": ["message.received"], "example": "message.received", "type": "string" }, "type": "array" }, "events": { "items": { "enum": ["message.received"], "example": "message.received", "type": "string" }, "type": "array" }, "inbox": { "description": "Scope to one mailbox; omit for all.", "type": "string" }, "url": { "format": "uri", "type": "string" } }, "required": ["url"], "type": "object" }, "ReplyRequest": { "description": "Thread-aware reply. Exactly one of `thread_id` / `message_id` selects the parent; recipients, subject, and threading headers are derived server-side.\n", "oneOf": [{ "required": ["thread_id"] }, { "required": ["message_id"] }], "properties": { "attachments": { "items": { "$ref": "#/components/schemas/AttachmentInput" }, "type": "array" }, "bcc": { "items": { "format": "email", "type": "string" }, "type": "array" }, "category_confidence": { "description": "Agent-supplied confidence (0..1) in the category match (see SendRequest.category_confidence). Feeds the min_confidence auto-send gate only; the server never scores.\n", "format": "float", "maximum": 1, "minimum": 0, "type": "number" }, "category_id": { "description": "Opaque category id (cat_\u2026) matched from the registry.", "type": "string" }, "cc": { "items": { "format": "email", "type": "string" }, "type": "array" }, "composition_token": { "description": "Opaque token from a fresh, unfiltered GET /v1/rules for this agent, project, and category.", "type": "string" }, "expected_last_message_id": { "description": "Optional stale-context guard; returns 409 if the thread head changed before request materialization.", "type": "string" }, "headers": { "additionalProperties": { "type": "string" }, "type": "object" }, "html": { "type": "string" }, "idempotency_key": { "deprecated": true, "description": "DEPRECATED body-level alias for the `Idempotency-Key` header (see SendRequest.idempotency_key). Send the header instead.\n", "type": "string" }, "intent": { "$ref": "#/components/schemas/ReviewIntent" }, "message_id": { "type": "string" }, "mode": { "description": "Review Loop per-send assertion (see SendRequest.mode).", "enum": ["review", "direct"], "type": "string" }, "reply_all": { "description": "Include all original recipients (reply-all) when true.", "type": "boolean" }, "reply_to": { "type": "string" }, "text": { "type": "string" }, "thread_id": { "type": "string" } }, "type": "object" }, "ReputationFinding": { "description": "One deliverability finding for the organization.", "properties": { "detail": { "type": "string" }, "domain": { "type": "string" }, "first_seen_at": { "format": "date-time", "type": "string" }, "id": { "type": "string" }, "last_seen_at": { "format": "date-time", "type": "string" }, "resolved_at": { "format": "date-time", "type": "string" }, "sender": { "type": "string" }, "severity": { "enum": ["low", "high", "unknown"], "type": "string" }, "status": { "enum": ["open", "resolved"], "type": "string" }, "title": { "type": "string" }, "type": { "description": "bounce/complaint/feedback_3p/ip_listing/dkim/dmarc/spf/bimi/suppression/account_health/unknown.", "type": "string" } }, "required": ["id", "type", "severity", "status", "title", "detail", "first_seen_at", "last_seen_at"], "type": "object" }, "ReputationFindingsPage": { "description": "The paged list of the org's deliverability findings (newest-first).", "properties": { "items": { "items": { "$ref": "#/components/schemas/ReputationFinding" }, "type": "array" }, "next_cursor": { "description": "Opaque cursor for the next page; absent on the last page.", "type": "string" }, "total": { "type": "integer" } }, "required": ["items", "total"], "type": "object" }, "ReputationMetrics": { "description": "The latest window's Sends/Bounces/Complaints rollup for the org.", "properties": { "bounce_rate": { "type": "number" }, "bounces": { "type": "integer" }, "complaint_rate": { "type": "number" }, "complaints": { "type": "integer" }, "sends": { "type": "integer" }, "window_end": { "format": "date-time", "type": "string" }, "window_start": { "format": "date-time", "type": "string" } }, "required": ["sends", "bounces", "complaints", "bounce_rate", "complaint_rate"], "type": "object" }, "ReputationRollup": { "description": "The org's deliverability rollup: derived status badge, sending readiness, the latest metrics window, and open-finding count.\n", "properties": { "configured": { "description": "Whether sending is configured.", "type": "boolean" }, "last_checked_at": { "format": "date-time", "type": "string" }, "metrics": { "$ref": "#/components/schemas/ReputationMetrics" }, "object": { "enum": ["reputation"], "type": "string" }, "open_findings": { "description": "Count of open findings for the org.", "type": "integer" }, "org_id": { "type": "string" }, "sending_status": { "description": "The org's effective sending status.", "type": "string" }, "status": { "description": "UI badge: healthy/at_risk/paused/enforced/unknown.", "type": "string" } }, "required": ["object", "org_id", "status", "sending_status", "configured", "metrics", "open_findings"], "type": "object" }, "Review": { "description": "A review request (rr_\u2026); the server-owned pre-send record of a message under the Review Loop. Carries intent, the current proposed draft, category, state machine fields, and (once sent) the sent body + diff.\n", "properties": { "agent_id": { "type": "string" }, "category_id": { "type": "string" }, "closed": { "description": 'True once this review will never move again; `sent`, `auto_sent`, `cancelled` OR `failed`. It is the definitive per-review "am I done?" answer and the poll-side companion to the terminal review events; use it after a restart when your event cursor is gone. `failed` is included deliberately: nothing re-approves a failed review, so treating it as open means waiting forever.\n', "type": "boolean" }, "created_at": { "format": "date-time", "type": "string" }, "decided_at": { "format": "date-time", "type": "string" }, "decision_feedback": { "type": "string" }, "diff_unified": { "type": "string" }, "effective_mode": { "enum": ["review", "direct"], "type": "string" }, "from_address": { "type": "string" }, "gate_outcome": { "type": "string" }, "id": { "type": "string" }, "intent_meta": { "additionalProperties": true, "type": "object" }, "intent_summary": { "type": "string" }, "kind": { "enum": ["send", "reply", "forward"], "type": "string" }, "mode": { "enum": ["review", "direct"], "type": "string" }, "proposed_bcc": { "items": { "type": "string" }, "type": "array" }, "proposed_body_html": { "type": "string" }, "proposed_body_text": { "type": "string" }, "proposed_cc": { "items": { "type": "string" }, "type": "array" }, "proposed_subject": { "type": "string" }, "proposed_to": { "items": { "type": "string" }, "type": "array" }, "revision": { "type": "integer" }, "send_error": { "description": "Vendor-scrubbed delivery failure, present on a failed review.", "type": "string" }, "send_path": { "description": "How the message was released, once sent.", "enum": ["human_reviewed", "delegated_reviewed", "reviewer_approved", "graduated_auto", "agent_direct"], "type": "string" }, "sent_at": { "format": "date-time", "type": "string" }, "sent_body_text": { "type": "string" }, "sent_message_id": { "type": "string" }, "sent_subject": { "type": "string" }, "stale_reason": { "type": "string" }, "state": { "enum": ["needs_review", "in_review", "chatting", "stale", "approved", "sent", "auto_sent", "rejected", "stalled", "cancelled", "failed"], "type": "string" }, "updated_at": { "format": "date-time", "type": "string" }, "version": { "type": "integer" } }, "required": ["id", "state", "mode", "effective_mode", "kind", "revision", "version"], "type": "object" }, "ReviewIntent": { "description": 'The agent\'s "for the human reviewer" summary. `summary` is REQUIRED when the resolved mode is review (else the submit is 422).\n', "properties": { "meta": { "description": "Structured intent payload.", "properties": { "goal": { "type": "string" }, "prior_touches": { "type": "integer" }, "recipient": { "type": "string" }, "urgency": { "type": "string" } }, "type": "object" }, "summary": { "description": "Free-text intent summary (who/what/why).", "type": "string" } }, "type": "object" }, "ReviewLink": { "description": "A BYO review-agent link (rvl_\u2026); the subscription that routes a reviewed draft to a linked review-agent (D5; \xA79). One link per scope: inbox_address set = that inbox, empty = account-wide (per-inbox overrides account-wide). The reviewer holds review:act, NEVER mailbox:send; on approve/edit the platform sends with the COMPOSER's creds (credential boundary). hmac_secret is write-only; reads return has_secret only. Opaque ids only (D10).\n", "properties": { "active": { "type": "boolean" }, "consec_failures": { "description": "Consecutive delivery failures; an unhealthy link is skipped by routing until recovery.", "type": "integer" }, "created_at": { "format": "date-time", "type": "string" }, "escalate_after_s": { "description": "Seconds before the reviewer-liveness sweeper auto-escalates to the human (default 300).", "type": "integer" }, "has_secret": { "description": "Whether an hmac signing secret is configured (the secret itself is never echoed).", "type": "boolean" }, "id": { "description": "Opaque review-link id (rvl_\u2026).", "type": "string" }, "inbox_address": { "description": "Scope: a specific inbox; empty = account-wide.", "type": "string" }, "max_hops": { "description": "Circuit breaker: max reviewer hand-backs before the next action is forced to the human (default 3).", "type": "integer" }, "review_deadline_s": { "description": "Circuit breaker: hard per-review deadline in seconds (default 86400).", "type": "integer" }, "reviewer_agent_id": { "description": "The linked reviewer agent (agt_\u2026).", "type": "string" }, "transport": { "enum": ["webhook", "sse", "websocket"], "type": "string" }, "updated_at": { "format": "date-time", "type": "string" }, "webhook_url": { "description": "Delivery URL (webhook transport only).", "type": "string" } }, "required": ["id", "reviewer_agent_id", "transport", "escalate_after_s", "max_hops", "review_deadline_s", "active", "consec_failures", "has_secret", "created_at", "updated_at"], "type": "object" }, "ReviewLinkList": { "properties": { "review_links": { "items": { "$ref": "#/components/schemas/ReviewLink" }, "type": "array" } }, "required": ["review_links"], "type": "object" }, "ReviewPolicy": { "description": "The account-default review policy (D6) plus the effective floor an inbox with no override resolves to (require_review is the safe floor).\n", "properties": { "effective": { "enum": ["require_review", "allow_direct", "auto_send_graduated"], "type": "string" }, "policy": { "enum": ["require_review", "allow_direct", "auto_send_graduated"], "type": "string" } }, "required": ["policy", "effective"], "type": "object" }, "ReviewPolicyRequest": { "description": "Set the account-default review policy (D6). An invalid value is 400.", "properties": { "policy": { "enum": ["require_review", "allow_direct", "auto_send_graduated"], "type": "string" } }, "required": ["policy"], "type": "object" }, "ReviewTurn": { "description": "One immutable turn in a review's append-only thread (turn_\u2026).", "properties": { "actor_id": { "type": "string" }, "actor_kind": { "enum": ["agent", "human", "review_agent", "system", "connection"], "type": "string" }, "body": { "type": "string" }, "created_at": { "format": "date-time", "type": "string" }, "diff_json": { "additionalProperties": true, "type": "object" }, "id": { "type": "string" }, "metadata": { "additionalProperties": true, "type": "object" }, "revision": { "type": "integer" }, "seq": { "type": "integer" }, "turn_type": { "enum": ["agent_draft", "agent_question", "agent_note", "human_comment", "human_question", "human_edit", "human_approve", "human_reject", "human_reconfirm", "system_diff", "state_change", "nudge"], "type": "string" } }, "required": ["id", "seq", "turn_type", "actor_kind", "created_at"], "type": "object" }, "RevokeSuppressionRequest": { "description": "Revoke (un-suppress) one org-scope row. The reason is REQUIRED and audit-logged.\n", "properties": { "reason": { "description": "Why the suppression is being revoked (required, audit-logged).", "type": "string" } }, "required": ["reason"], "type": "object" }, "RiskDial": { "description": "The effective risk dial (Review Loop, agent plane; D4/D12): the account default plus every category's overrides (each with its resolved effective value). Read-only for agents; flipping the dial is a console (human) action (D16).\n", "properties": { "account": { "$ref": "#/components/schemas/AccountRiskDial" }, "categories": { "items": { "$ref": "#/components/schemas/CategoryRiskDial" }, "type": "array" } }, "required": ["account", "categories"], "type": "object" }, "RiskDialRequest": { "description": "Set the account-default risk dial (console plane, D4). A nil field leaves that column unchanged.\n", "properties": { "auto_send_cap_per_day": { "type": "integer" }, "canary_rate": { "format": "double", "type": "number" }, "drift_demote_after": { "type": "integer" }, "first_contact_gate": { "type": "boolean" }, "graduate_min_age_hours": { "type": "integer" }, "graduate_min_approvals": { "type": "integer" }, "min_confidence": { "format": "double", "type": "number" } }, "type": "object" }, "Rule": { "description": "A learned writing rule (rule_\u2026) in the Review Loop (D2/D11). House-style/ general (scope='general', applies across all categories) or category-scoped. Append-only by supersession: an edit is a new rev (same lineage_id) with the prior flipped to superseded. Read by the agent at compose/redraft time via the ordered get_rules ladder; we never apply it. Opaque ids only (D10).\n", "properties": { "author_kind": { "enum": ["agent", "human", "connection"], "type": "string" }, "category_id": { "description": "Set iff scope=category (cat_\u2026).", "type": "string" }, "created_at": { "format": "date-time", "type": "string" }, "id": { "description": "Opaque rule id (rule_\u2026).", "type": "string" }, "kind": { "description": "hard = non-overridable.", "enum": ["soft", "hard"], "type": "string" }, "lineage_id": { "description": "Stable lineage handle across versions (rln_\u2026).", "type": "string" }, "org_id": { "description": "The org this rule belongs to.", "type": "string" }, "priority": { "type": "integer" }, "project_id": { "description": "The project this rule belongs to; empty for an org-layer rule.", "type": "string" }, "rev": { "type": "integer" }, "rule_layer": { "description": "Ownership layer (org/project model). `org` = house-style inherited by every project in the org; `project` = layered on top (the agent-plane default). Hard organization house rules remain mandatory across narrower scopes; the remaining rules follow the ordered precedence ladder.\n", "enum": ["org", "project"], "type": "string" }, "rule_text": { "type": "string" }, "scope": { "description": "general = house-style (D2).", "enum": ["general", "category"], "type": "string" }, "scope_agent_id": { "description": "Set for a per-agent override; empty = all org agents.", "type": "string" }, "source_review_id": { "description": "Review containing the source feedback.", "type": "string" }, "source_turn_id": { "description": "Immutable source feedback turn.", "type": "string" }, "status": { "enum": ["proposed", "active", "superseded", "retired"], "type": "string" }, "supersedes_id": { "description": "The prior rev this row superseded (rule_\u2026).", "type": "string" }, "updated_at": { "format": "date-time", "type": "string" } }, "required": ["id", "lineage_id", "rev", "scope", "rule_text", "kind", "priority", "status", "author_kind", "created_at", "updated_at"], "type": "object" }, "RuleAuditEntry": { "description": "One append-only rule/category change & undo audit row (udo_\u2026). before_json / after_json carry the snapshot enabling an undo. undo = a later 'restore' entry; this row's undone flips true when it has been undone.\n", "properties": { "action": { "enum": ["create", "supersede", "retire", "rename", "redescribe", "merge", "restore"], "type": "string" }, "actor_id": { "type": "string" }, "actor_kind": { "enum": ["agent", "human", "system", "connection"], "type": "string" }, "after_json": { "description": "JSON snapshot of the new version.", "type": "string" }, "before_json": { "description": "JSON snapshot of the prior version.", "type": "string" }, "created_at": { "format": "date-time", "type": "string" }, "entity_id": { "description": "rule_\u2026 (lineage head) or cat_\u2026.", "type": "string" }, "entity_kind": { "enum": ["rule", "category"], "type": "string" }, "id": { "description": "Opaque audit id (udo_\u2026).", "type": "string" }, "undone": { "type": "boolean" } }, "required": ["id", "entity_kind", "entity_id", "action", "actor_kind", "undone", "created_at"], "type": "object" }, "RuleAuditPage": { "properties": { "items": { "items": { "$ref": "#/components/schemas/RuleAuditEntry" }, "type": "array" }, "next_cursor": { "type": "string" }, "total": { "type": "integer" } }, "required": ["items", "total"], "type": "object" }, "RulePage": { "description": "The ORDERED active rule set (the \xA77 precedence ladder applied SERVER-SIDE, capped). Category rules precede general/house-style rules; within each, highest precedence first. The agent reconciles the list semantically (NO LLM on our side).\n", "properties": { "category_rules_version": { "type": "integer" }, "composition_token": { "description": "Opaque short-lived proof of this exact effective rules snapshot. Omitted on filtered scope queries.", "type": "string" }, "composition_token_expires_at": { "format": "date-time", "type": "string" }, "house_style_version": { "type": "integer" }, "items": { "items": { "$ref": "#/components/schemas/Rule" }, "type": "array" }, "rule_high_water": { "type": "integer" }, "total": { "type": "integer" } }, "required": ["items", "total"], "type": "object" }, "ScanBacklogRequest": { "description": "The D19/\xA78 on-demand reconciliation sweep request (console). staleness_tolerance overrides the strict default (0 = must be at/above current); null = the default.\n", "properties": { "staleness_tolerance": { "description": "How many rules-versions behind current a queued draft may be and still release.", "type": "integer" } }, "type": "object" }, "ScanBacklogStatus": { "description": "The D19/\xA78 backlog-reconciliation snapshot for a category (agent-readable, $0-LLM). Counts the QUEUED drafts that are stale vs current-enough against the current category rules-version + house-style version (a pure integer compare). Read-only; the agent READS the picture; the human / hooks TRIGGER the sweep.\n", "properties": { "category_id": { "type": "string" }, "current_category_rules_version": { "type": "integer" }, "current_enough": { "description": "Of the queued, how many are within the staleness tolerance of the current rules-version.", "type": "integer" }, "current_house_style_version": { "type": "integer" }, "queued": { "description": "How many drafts are in the human queue (needs_review|in_review|chatting).", "type": "integer" }, "stale": { "description": "Of the queued, how many were composed under older rules and need a redraft.", "type": "integer" }, "staleness_tolerance": { "description": "How many versions behind current a draft may be and still count current-enough.", "type": "integer" }, "state": { "enum": ["supervised", "auto_notify", "auto_silent", "probation"], "type": "string" } }, "required": ["category_id", "state", "queued", "current_enough", "stale", "current_category_rules_version", "current_house_style_version", "staleness_tolerance"], "type": "object" }, "SendRequest": { "properties": { "attachments": { "items": { "$ref": "#/components/schemas/AttachmentInput" }, "type": "array" }, "bcc": { "items": { "format": "email", "type": "string" }, "type": "array" }, "body": { "deprecated": true, "description": "DEPRECATED alias for `text`, kept accepted indefinitely so already-deployed callers keep working; it will never be removed. Send `text` in new code. Supplying BOTH with different content is a 400 (code bad_request, errors[].code conflicting_alias); the server never guesses which bytes to relay; supplying both with identical content is accepted.\n", "type": "string" }, "category_confidence": { "description": "Agent-supplied confidence (0..1) in the category match. Feeds the submit-time min_confidence auto-send gate ONLY; the server never scores ($0 LLM). Below the effective threshold (or omitted when a threshold is set) the would-be auto-send routes to needs_review (gate_outcome held:low_confidence).\n", "format": "float", "maximum": 1, "minimum": 0, "type": "number" }, "category_id": { "description": "Opaque category id (cat_\u2026) matched from the registry. Never a name.", "type": "string" }, "cc": { "items": { "format": "email", "type": "string" }, "type": "array" }, "composition_token": { "description": "Opaque token from a fresh, unfiltered GET /v1/rules for this agent, project, and category.", "type": "string" }, "headers": { "additionalProperties": { "type": "string" }, "description": "Arbitrary custom headers (reserved/unsafe header names are dropped).", "type": "object" }, "html": { "description": "Optional HTML body", "sent as an alternative alongside the plain-text part.": null, "type": "string" }, "idempotency_key": { "deprecated": true, "description": "DEPRECATED body-level alias for the `Idempotency-Key` header, tolerated for @extrovert.dev/sdk <= 0.1.0 builds that serialize the whole request object. Send the header instead; when both are present the header wins. Note that the replay key is scoped to a hash of the RAW request body, so the same logical message retried once as `body` and once as `text` under one key is a body mismatch and answers 409 idempotency_conflict. Different bytes are a different request.\n", "type": "string" }, "in_reply_to": { "description": "Message-ID to thread under (optional).", "type": "string" }, "intent": { "$ref": "#/components/schemas/ReviewIntent" }, "mode": { "description": "Review Loop (HITL) per-send assertion. `review` (default) routes the message into the human-review queue; `direct` requests an immediate send. The authoritative account/inbox review policy may downgrade `direct` to `review`. Setting any of mode/intent/category_id opts the send into the Review Loop.\n", "enum": ["review", "direct"], "type": "string" }, "reply_to": { "description": "Override the Reply-To header.", "type": "string" }, "subject": { "type": "string" }, "text": { "description": "Plain-text body. This is the canonical name and matches ReplyRequest.text, ForwardRequest.text and Message.text.\n", "type": "string" }, "to": { "items": { "format": "email", "type": "string" }, "minItems": 1, "type": "array" } }, "required": ["to"], "type": "object" }, "SendResult": { "description": "The outcome of a reply or forward.", "properties": { "message_id": { "type": "string" }, "review_id": { "description": "Opaque review id (rr_\u2026) for the review row that governed this send. ADDITIVE. Every agent-plane send now creates one, so an agent that crashes after issuing the request can still call `GET /v1/reviews/{id}` and read `closed` / `sent_message_id` instead of guessing whether the message went out.\n", "type": "string" }, "sent_copy_status": { "$ref": "#/components/schemas/SentCopyStatus" }, "sent_message_id": { "nullable": true, "type": "string" }, "submission_id": { "type": "string" }, "thread_id": { "type": "string" }, "transport": { "$ref": "#/components/schemas/TransportCounts" } }, "type": "object" }, "SentCopyStatus": { "description": "Whether the accepted message has a resolvable saved Sent copy. Archive failure never resends mail.", "enum": ["pending", "stored", "unavailable"], "type": "string" }, "StatusResult": { "properties": { "message_id": { "description": 'A stable identifier for the submitted message the sender can self-correlate on: the opaque msg_ id when the Sent append resolved, else the bracketed RFC5322 Message-ID header value. Present on the direct-send response; always non-empty when status is "sent".\n', "type": "string" }, "review_id": { "description": "Opaque review id (rr_\u2026) for the review row that governed this send. ADDITIVE; see SendResult.review_id.\n", "type": "string" }, "sent_copy_status": { "$ref": "#/components/schemas/SentCopyStatus" }, "sent_message_id": { "nullable": true, "type": "string" }, "status": { "type": "string" }, "submission_id": { "type": "string" }, "transport": { "$ref": "#/components/schemas/TransportCounts" } }, "type": "object" }, "Submission": { "description": "Durable status of an accepted outbound submission. Reading this resource never sends mail.", "properties": { "created_at": { "format": "date-time", "type": "string" }, "inbox": { "format": "email", "type": "string" }, "recipients": { "items": { "$ref": "#/components/schemas/SubmissionRecipient" }, "type": "array" }, "sent_copy_status": { "$ref": "#/components/schemas/SentCopyStatus" }, "sent_message_id": { "description": "Resolvable msg_ selector", "nullable": true, "or null until a saved Sent copy is found.": null, "type": "string" }, "submission_id": { "description": "Opaque submission handle returned by send or reply.", "type": "string" }, "transport": { "$ref": "#/components/schemas/TransportCounts" }, "updated_at": { "format": "date-time", "type": "string" } }, "required": ["submission_id", "inbox", "sent_message_id", "sent_copy_status", "transport", "recipients", "created_at", "updated_at"], "type": "object" }, "SubmissionRecipient": { "properties": { "recipient": { "format": "email", "type": "string" }, "state": { "$ref": "#/components/schemas/SubmissionRecipientState" } }, "required": ["recipient", "state"], "type": "object" }, "SubmissionRecipientState": { "description": "accepted means accepted for onward delivery, not arrival in the recipient inbox. waiting_for_parent retries automatically when the earlier message's identity is ready. unknown is an uncertain outcome that needs reconciliation; do not resend it.\n", "enum": ["queued", "waiting_for_parent", "transmitting", "accepted", "failed", "dependency_failed", "unknown"], "type": "string" }, "Suppression": { "description": "One recipient opt-out (suppression) row visible to the caller's own org. Only org-scope rows are ever returned to the agent/console planes; global and shared_domain rows are operator-only. Rows soft-revoke (revoked_at/by/reason) rather than delete, so opt-out history outlives tenant lifecycle.\n", "properties": { "created_at": { "format": "date-time", "type": "string" }, "id": { "description": "Opaque suppression id (sup_\u2026).", "type": "string" }, "narrow_agent_id": { "description": "Set on a recipient-chosen 'just this sender' narrow row.", "type": "string" }, "narrow_mailbox": { "type": "string" }, "origin_agent_id": { "type": "string" }, "origin_mailbox": { "description": "The sending mailbox that prompted the opt-out (audit).", "type": "string" }, "origin_message_id": { "type": "string" }, "reactivation_count": { "description": "Cumulative unsub\u2192revoke\u2192unsub cycles for this row (the \xA77 abuse input).", "type": "integer" }, "recipient": { "description": "Canonicalized recipient address (NFC, punycode domain, lower-cased).", "type": "string" }, "recipient_raw": { "description": "The address as originally received.", "type": "string" }, "revoke_reason": { "type": "string" }, "revoked": { "type": "boolean" }, "revoked_at": { "description": "Set when the row was soft-revoked.", "format": "date-time", "type": "string" }, "revoked_by": { "type": "string" }, "scope": { "description": "Always 'org' on these planes (global/shared_domain are operator-only).", "enum": ["org"], "type": "string" }, "source": { "enum": ["one_click", "page", "mailto", "reply_stop", "manual", "complaint", "escalation"], "type": "string" } }, "required": ["id", "recipient", "scope", "source", "reactivation_count", "created_at", "revoked"], "type": "object" }, "SuppressionPage": { "description": "The paged list of the caller's own org suppression rows (newest-first).", "properties": { "items": { "items": { "$ref": "#/components/schemas/Suppression" }, "type": "array" }, "next_cursor": { "description": "Opaque cursor for the next page; absent on the last page.", "type": "string" }, "total": { "type": "integer" } }, "required": ["items", "total"], "type": "object" }, "TransportCounts": { "description": "Per-recipient counts by transport state. Absent states have count zero.", "properties": { "accepted": { "minimum": 0, "type": "integer" }, "dependency_failed": { "minimum": 0, "type": "integer" }, "failed": { "minimum": 0, "type": "integer" }, "queued": { "minimum": 0, "type": "integer" }, "transmitting": { "minimum": 0, "type": "integer" }, "unknown": { "minimum": 0, "type": "integer" }, "waiting_for_parent": { "minimum": 0, "type": "integer" } }, "type": "object" }, "UpdateCategoryRequest": { "description": "Rename / re-describe a category; metadata ONLY (D10). Either field may be omitted (unchanged).", "properties": { "description": { "type": "string" }, "name": { "type": "string" } }, "type": "object" }, "UpdateMemberRoleRequest": { "description": "Change an existing member's role. Role-capped: the actor cannot grant a role above their own effective role. Demoting the org's last owner is refused (409).\n", "properties": { "role": { "enum": ["owner", "admin", "member", "viewer", "billing"], "type": "string" } }, "required": ["role"], "type": "object" }, "UpdateWebhookRequest": { "description": "PATCH body for a webhook. Every field is optional; an omitted field leaves the stored value unchanged (PATCH semantics). The signing secret and id are immutable. `inbox` empty-string clears the per-inbox filter (covers all inboxes the agent owns).\n", "properties": { "active": { "description": "Enable or disable delivery without deleting.", "type": "boolean" }, "address": { "description": "Legacy alias for `inbox`.", "type": "string" }, "event_types": { "description": "AgentMail-compatible alias for `events`.", "items": { "enum": ["message.received"], "example": "message.received", "type": "string" }, "type": "array" }, "events": { "items": { "enum": ["message.received"], "example": "message.received", "type": "string" }, "type": "array" }, "inbox": { "description": "Scope to one mailbox; empty string clears the filter.", "type": "string" }, "url": { "format": "uri", "type": "string" } }, "type": "object" }, "Webhook": { "description": "A webhook registration. `secret` is present only on the create response (shown once); list/get redact it. The durable `resource_scope` defines the delivery boundary. `inbox` is an additional address filter; null removes that filter without widening selected stable inbox IDs. Registrations survive the creating connection's expiry and must be deleted separately.\n", "properties": { "active": { "type": "boolean" }, "agent_id": { "description": "Agent identity recorded at creation.", "type": "string" }, "created_at": { "format": "date-time", "type": "string" }, "created_by_connection_id": { "description": "Creating connection ID when applicable.", "type": "string" }, "events": { "items": { "enum": ["message.received"], "type": "string" }, "type": "array" }, "id": { "type": "string" }, "inbox": { "nullable": true, "type": "string" }, "inbox_ids": { "description": "Stable inbox IDs for an inboxes-scoped registration.", "items": { "type": "string" }, "maxItems": 100, "type": "array" }, "resource_scope": { "description": "Agent-owned inboxes for legacy keys; stable selected inbox IDs, project, or organization for connections. Project and organization scopes include future inboxes.", "enum": ["agent", "inboxes", "project", "organization"], "type": "string" }, "secret": { "description": "HMAC signing secret. Create response only.", "type": "string" }, "secret_prefix": { "type": "string" }, "url": { "type": "string" } }, "type": "object" }, "WebhookPage": { "properties": { "items": { "items": { "$ref": "#/components/schemas/Webhook" }, "type": "array" }, "total": { "type": "integer" } }, "type": "object" } };
7
+
8
+ // src/administration.ts
9
+ var actions = administrativeCatalog;
10
+ var schemas = administrativeSchemas;
11
+ var owns = (o, key) => Object.prototype.hasOwnProperty.call(o, key);
12
+ var summary = (a) => ({ id: a.id, summary: a.summary, method: a.method, mode: a.method === "GET" ? "read" : "change" });
13
+ var Administration = class {
14
+ constructor(execute) {
15
+ this.execute = execute;
16
+ }
17
+ list(options = {}) {
18
+ const limit = options.limit ?? 20;
19
+ if (!Number.isInteger(limit) || limit < 1 || limit > 100) throw new Error("limit must be between 1 and 100");
20
+ const search = options.search?.trim().toLowerCase() ?? "";
21
+ if (search.length > 200) throw new Error("search must be at most 200 characters");
22
+ const prefix = encodeURIComponent(`${search}
23
+ ${options.mode ?? ""}`) + ":";
24
+ let offset = 0;
25
+ if (options.cursor !== void 0) {
26
+ if (!options.cursor.startsWith(prefix) || !/^\d+$/.test(options.cursor.slice(prefix.length))) throw new Error("Invalid catalog cursor; keep the same search and mode");
27
+ offset = Number(options.cursor.slice(prefix.length));
28
+ if (!Number.isSafeInteger(offset)) throw new Error("Invalid catalog cursor");
29
+ }
30
+ const matched = actions.filter((a) => (!options.mode || summary(a).mode === options.mode) && `${a.id} ${a.summary} ${a.path}`.toLowerCase().includes(search));
31
+ const data = matched.slice(offset, offset + limit).map(summary);
32
+ const hasMore = offset + data.length < matched.length;
33
+ return { object: "list", data, has_more: hasMore, next_cursor: hasMore ? `${prefix}${offset + data.length}` : null };
34
+ }
35
+ describe(id) {
36
+ const a = this.action(id);
37
+ const definitions = {};
38
+ const rewrite = (value) => {
39
+ if (Array.isArray(value)) return value.map(rewrite);
40
+ if (!value || typeof value !== "object") return value;
41
+ const object = value;
42
+ if (typeof object.$ref === "string") {
43
+ const name = object.$ref.replace("#/components/schemas/", "");
44
+ if (!owns(schemas, name)) throw new Error(`Unknown administrative schema ${name}`);
45
+ if (!owns(definitions, name)) {
46
+ definitions[name] = {};
47
+ definitions[name] = rewrite(schemas[name]);
48
+ }
49
+ return { $ref: `#/$defs/${name}` };
50
+ }
51
+ return Object.fromEntries(Object.entries(object).map(([key, child]) => [key, rewrite(child)]));
52
+ };
53
+ const inputSchema = rewrite(a.inputSchema);
54
+ return {
55
+ ...summary(a),
56
+ description: a.description ?? a.summary,
57
+ input_schema: { ...inputSchema, $defs: definitions },
58
+ required_authority: "Explicit full account control (account:admin); current human customer-admin authority. Private platform access is excluded.",
59
+ result_format: a.responseFormat === "binary" ? "Base64 content with content_type and optional filename" : "API response JSON; list cursors are opaque",
60
+ credential_lifetime: "Created credentials survive independently, including administrative credentials; revoke them separately."
61
+ };
62
+ }
63
+ /** Typed SDK execution. MCP/CLI use run with an explicit read/change mode. */
64
+ call(id, input, signal) {
65
+ return this.run(id, input, void 0, signal);
66
+ }
67
+ async run(id, input = {}, mode, signal) {
68
+ const a = this.action(id);
69
+ if (mode && summary(a).mode !== mode) throw new Error(`${id} is a ${summary(a).mode} action; use the ${summary(a).mode} tool/command`);
70
+ if (JSON.stringify(input).length > 1e6) throw new Error("Administrative input exceeds 1 MB");
71
+ validate(a.inputSchema, input, "input");
72
+ const path = a.path.replace(/\{([^}]+)\}/g, (_, name) => {
73
+ const value = input.path?.[name];
74
+ if (typeof value !== "string" || value.length === 0 || value.length > 1024 || /[/\\\u0000-\u001f]/.test(value) || value === "." || value === "..") throw new Error(`Invalid path.${name}`);
75
+ return encodeURIComponent(value);
76
+ });
77
+ return this.execute({ method: a.method, path, query: input.query, body: input.body, responseFormat: a.responseFormat, signal });
78
+ }
79
+ action(id) {
80
+ const action = actions.find((a) => a.id === id);
81
+ if (!action) throw new Error(`Unknown administrative action ${id}; search the action catalog first`);
82
+ return action;
83
+ }
84
+ };
85
+ function validate(s, value, at, depth = 0) {
86
+ if (depth > 64) throw new Error(`${at}: input nesting is too deep`);
87
+ const fail = (message) => {
88
+ throw new Error(`${at}: ${message}`);
89
+ };
90
+ if (value === null && s.nullable === true) return;
91
+ if (typeof s.$ref === "string") {
92
+ const name = s.$ref.replace("#/components/schemas/", "");
93
+ if (!owns(schemas, name)) fail("unknown schema");
94
+ return validate(schemas[name], value, at, depth + 1);
95
+ }
96
+ if (Array.isArray(s.enum) && !s.enum.includes(value)) fail(`expected one of ${s.enum.join(", ")}`);
97
+ if (Array.isArray(s.allOf)) for (const child of s.allOf) validate(child, value, at, depth + 1);
98
+ for (const key of ["oneOf", "anyOf"]) {
99
+ if (!Array.isArray(s[key])) continue;
100
+ let matches = 0;
101
+ for (const child of s[key]) {
102
+ try {
103
+ validate(child, value, at, depth + 1);
104
+ matches++;
105
+ } catch {
106
+ }
107
+ }
108
+ if (matches === 0 || key === "oneOf" && matches !== 1) fail(`must match ${key === "oneOf" ? "exactly one" : "an"} allowed schema`);
109
+ }
110
+ if (s.type === "object" || s.properties) {
111
+ if (!value || typeof value !== "object" || Array.isArray(value)) fail("expected an object");
112
+ const object = value;
113
+ const properties = s.properties ?? {};
114
+ for (const key of s.required ?? []) if (!owns(object, key) || object[key] === void 0) fail(`missing ${key}`);
115
+ for (const [key, child] of Object.entries(object)) {
116
+ if (child === void 0) continue;
117
+ if (owns(properties, key)) validate(properties[key], child, `${at}.${key}`, depth + 1);
118
+ else if (s.additionalProperties === false) fail(`unknown field ${key}`);
119
+ else if (s.additionalProperties && typeof s.additionalProperties === "object") validate(s.additionalProperties, child, `${at}.${key}`, depth + 1);
120
+ }
121
+ } else if (s.type === "array") {
122
+ if (!Array.isArray(value)) fail("expected an array");
123
+ const array = value;
124
+ if (typeof s.minItems === "number" && array.length < s.minItems) fail(`requires at least ${s.minItems} items`);
125
+ if (typeof s.maxItems === "number" && array.length > s.maxItems) fail(`allows at most ${s.maxItems} items`);
126
+ for (const child of array) validate(s.items ?? {}, child, at + "[]", depth + 1);
127
+ } else if (s.type === "string") {
128
+ if (typeof value !== "string") fail("expected a string");
129
+ const text = value;
130
+ if (typeof s.minLength === "number" && text.length < s.minLength) fail(`requires at least ${s.minLength} characters`);
131
+ if (typeof s.maxLength === "number" && text.length > s.maxLength) fail(`allows at most ${s.maxLength} characters`);
132
+ } else if (s.type === "integer" || s.type === "number") {
133
+ if (typeof value !== "number" || !Number.isFinite(value) || s.type === "integer" && !Number.isInteger(value)) fail(`expected a ${s.type}`);
134
+ if (typeof s.minimum === "number" && value < s.minimum) fail(`minimum is ${s.minimum}`);
135
+ if (typeof s.maximum === "number" && value > s.maximum) fail(`maximum is ${s.maximum}`);
136
+ } else if (s.type === "boolean" && typeof value !== "boolean") fail("expected a boolean");
137
+ }
138
+
3
139
  // src/errors.ts
4
140
  var ApiError = class extends Error {
5
141
  constructor(args) {
@@ -268,7 +404,7 @@ var CURRENT_API_VERSION = "2026-06-23";
268
404
  var API_VERSION_HEADER = "Extrovert-Version";
269
405
 
270
406
  // src/http.ts
271
- var SDK_VERSION = "0.1.0-pre.10";
407
+ var SDK_VERSION = "0.1.0-pre.12";
272
408
  function buildUrl(baseUrl, path, query) {
273
409
  const base = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
274
410
  const rel = path.startsWith("/") ? path : `/${path}`;
@@ -344,6 +480,7 @@ var HttpClient = class {
344
480
  }
345
481
  const response = await this.config.fetch(url, {
346
482
  method: options.method,
483
+ redirect: "error",
347
484
  headers,
348
485
  body: bodyInit,
349
486
  signal
@@ -548,6 +685,54 @@ async function toApiError(response) {
548
685
  });
549
686
  }
550
687
 
688
+ // src/inbox-page.ts
689
+ function normalizeInboxPage(raw, resource = "inbox") {
690
+ const invalid2 = () => {
691
+ throw new Error(`Invalid ${resource} list response; inventory is unavailable, not empty.`);
692
+ };
693
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return invalid2();
694
+ const value = raw;
695
+ const canonical = "object" in value || "data" in value;
696
+ const items = canonical ? value.data : value.inboxes ?? value.items;
697
+ if (!Array.isArray(items)) return invalid2();
698
+ const cursor = value.next_cursor ?? value.next_page;
699
+ if (cursor != null && (typeof cursor !== "string" || canonical && !cursor)) return invalid2();
700
+ if (canonical && (!("next_cursor" in value) || value.object !== "list" || typeof value.has_more !== "boolean" || value.has_more !== Boolean(cursor))) return invalid2();
701
+ if (value.total !== void 0 && (typeof value.total !== "number" || !Number.isSafeInteger(value.total) || value.total < items.length)) return invalid2();
702
+ const page = {
703
+ items,
704
+ has_more: Boolean(cursor)
705
+ };
706
+ if (typeof cursor === "string" && cursor) page.next_cursor = cursor;
707
+ if (typeof value.total === "number") page.total = value.total;
708
+ return page;
709
+ }
710
+
711
+ // src/administration-fixtures.ts
712
+ var ADMINISTRATIVE_FIXTURE_KEY = "ev_credential_mock_full_account";
713
+ var AdministrativeFixtures = class {
714
+ constructor(credential = "") {
715
+ this.credential = credential;
716
+ this.projects = [{ id: "prj_demo", org_id: "org_demo", customer_id: "cus_demo", name: "Demo", slug: "demo", description: "", is_default: true, lifecycle_status: "active", version: 1, created_at: "2026-09-06T00:00:00Z", updated_at: "2026-09-06T00:00:00Z" }];
717
+ }
718
+ async request(request) {
719
+ if (this.credential !== ADMINISTRATIVE_FIXTURE_KEY) throw new Error("Full account control is required. For offline administration use ADMINISTRATIVE_FIXTURE_KEY.");
720
+ const org = { id: "org_demo", name: "Demo organization", role: "owner" };
721
+ if (request.method === "GET" && request.path === "/v1/admin/me") return { user_id: "user_demo", is_admin: false, orgs: [org], projects: this.projects };
722
+ if (request.method === "GET" && request.path === "/v1/admin/orgs") return { orgs: [org] };
723
+ if (request.path === "/v1/admin/orgs/org_demo/projects") {
724
+ if (request.method === "GET") return { projects: this.projects.map((p) => ({ ...p })) };
725
+ if (request.method === "POST") {
726
+ const body = request.body;
727
+ const project = { ...this.projects[0], id: `prj_demo_${this.projects.length}`, name: body.name, slug: body.slug ?? body.name.toLowerCase().replace(/\s+/g, "-"), is_default: false };
728
+ this.projects.push(project);
729
+ return { ...project };
730
+ }
731
+ }
732
+ throw new Error(`No offline administrative fixture for ${request.method} ${request.path}. Use a test HTTP server for this action; no action was performed.`);
733
+ }
734
+ };
735
+
551
736
  // src/extract.ts
552
737
  var OTP_CONTEXT_PATTERNS = [
553
738
  /(?:one[-\s]?time\s*(?:code|password|pin)|verification\s*code|security\s*code|auth(?:entication)?\s*code|access\s*code|login\s*code|confirmation\s*code|your\s*code|otp|pin)\D{0,40}?(\d[\d\s-]{3,9}\d)/i,
@@ -827,20 +1012,20 @@ var TERMINAL_REVIEW_STATES = /* @__PURE__ */ new Set([
827
1012
  "cancelled"
828
1013
  ]);
829
1014
  function allowedAgentActions(state) {
830
- const actions = [];
1015
+ const actions2 = [];
831
1016
  if (state === "needs_review" || state === "in_review" || state === "chatting" || state === "stale" || state === "rejected") {
832
- actions.push("submit_revision");
1017
+ actions2.push("submit_revision");
833
1018
  }
834
1019
  if (state === "needs_review" || state === "in_review" || state === "chatting") {
835
- actions.push("post_review_chat");
1020
+ actions2.push("post_review_chat");
836
1021
  }
837
1022
  if (state === "needs_review" || state === "in_review" || state === "chatting" || state === "stale") {
838
- actions.push("restamp_review");
1023
+ actions2.push("restamp_review");
839
1024
  }
840
1025
  if (state === "needs_review" || state === "in_review" || state === "chatting" || state === "stale" || state === "rejected" || state === "failed") {
841
- actions.push("cancel_review");
1026
+ actions2.push("cancel_review");
842
1027
  }
843
- return [...actions, "get_review", "list_review_events"];
1028
+ return [...actions2, "get_review", "list_review_events"];
844
1029
  }
845
1030
  function mockProblem(code, status, title, detail, fields) {
846
1031
  return {
@@ -937,10 +1122,17 @@ ${parent.text}`;
937
1122
  }
938
1123
  var MockBackend = class {
939
1124
  constructor() {
1125
+ this.administrativeFixtures = new AdministrativeFixtures();
940
1126
  this.state = freshState();
941
1127
  /** Save / edit a rule (mock) - append-only by supersession (D11). */
942
1128
  this.learnedRules = /* @__PURE__ */ new Map();
943
1129
  }
1130
+ configureAdministrativeFixture(credential) {
1131
+ this.administrativeFixtures = new AdministrativeFixtures(credential);
1132
+ }
1133
+ administrativeRequest(request) {
1134
+ return this.administrativeFixtures.request(request);
1135
+ }
944
1136
  reset() {
945
1137
  this.state = freshState();
946
1138
  }
@@ -1078,9 +1270,14 @@ var MockBackend = class {
1078
1270
  let items = [...new Set(this.state.inboxes.values())].filter(
1079
1271
  (ibx) => ibx.id.startsWith("ibx")
1080
1272
  );
1081
- if (params.domain) items = items.filter((i) => i.domain === params.domain);
1273
+ if (params.domain) items = items.filter((i) => i.domain.toLowerCase() === params.domain.trim().toLowerCase());
1082
1274
  if (params.status) items = items.filter((i) => i.status === params.status);
1083
- return { items, total: items.length };
1275
+ items.sort((a, b) => b.created_at.localeCompare(a.created_at) || b.id.localeCompare(a.id));
1276
+ const limit = Math.min(Math.max(params.limit ?? 50, 1), 100);
1277
+ const offset = params.cursor ? decodeMockCursor(params.cursor) : 0;
1278
+ const slice = items.slice(offset, offset + limit);
1279
+ const has_more = offset + limit < items.length;
1280
+ return { items: slice, total: items.length, has_more, ...has_more ? { next_cursor: encodeMockCursor(offset + limit) } : {} };
1084
1281
  }
1085
1282
  getInbox(address) {
1086
1283
  const inbox = this.state.inboxes.get(address);
@@ -1152,6 +1349,8 @@ var MockBackend = class {
1152
1349
  listInboxesInProject(projectId, params = {}) {
1153
1350
  this.resolveProjectSegment(projectId);
1154
1351
  let items = [...new Set(this.state.inboxes.values())].filter((ibx) => ibx.id.startsWith("ibx"));
1352
+ if (params.domain) items = items.filter((i) => i.domain.toLowerCase() === params.domain.trim().toLowerCase());
1353
+ items.sort((a, b) => b.created_at.localeCompare(a.created_at) || b.id.localeCompare(a.id));
1155
1354
  const limit = Math.min(Math.max(params.limit ?? 50, 1), 100);
1156
1355
  const offset = params.cursor ? decodeMockCursor(params.cursor) : 0;
1157
1356
  const slice = items.slice(offset, offset + limit);
@@ -2754,12 +2953,12 @@ var MockBackend = class {
2754
2953
  items.sort((a, b) => b.last_message_at.localeCompare(a.last_message_at));
2755
2954
  return items;
2756
2955
  }
2757
- buildThread(address, id, ms, summary = false) {
2956
+ buildThread(address, id, ms, summary2 = false) {
2758
2957
  const sorted = [...ms].sort((a, b) => a.date.localeCompare(b.date));
2759
2958
  const last = sorted[sorted.length - 1];
2760
2959
  const seen = /* @__PURE__ */ new Set();
2761
2960
  const participants = [];
2762
- const participantMessages = summary ? [last] : sorted;
2961
+ const participantMessages = summary2 ? [last] : sorted;
2763
2962
  for (const m of participantMessages) {
2764
2963
  for (const a of [m.from, ...m.to, ...m.cc ?? [], ...m.reply_to ?? []]) {
2765
2964
  const key = a.email.toLowerCase();
@@ -2878,9 +3077,14 @@ ${text}`)) {
2878
3077
  return { ...webhook };
2879
3078
  }
2880
3079
  /** List registered webhooks (secret redacted, mirroring the server). */
2881
- listWebhooks() {
3080
+ listWebhooks(params = {}) {
2882
3081
  const items = [...this.state.webhooks.values()].map((w) => redactSecret(w));
2883
- return { items, total: items.length };
3082
+ const limit = params.limit ?? 50;
3083
+ if (!Number.isInteger(limit) || limit < 1 || limit > 100) throw new Error("Invalid webhook page limit");
3084
+ if (params.cursor && !/^webhooks:\d+$/.test(params.cursor)) throw new Error("Invalid webhook cursor");
3085
+ const offset = params.cursor ? Number(params.cursor.slice(9)) : 0;
3086
+ const next = offset + limit < items.length ? `webhooks:${offset + limit}` : void 0;
3087
+ return { items: items.slice(offset, offset + limit), total: items.length, has_more: !!next, next_cursor: next };
2884
3088
  }
2885
3089
  /** Get one webhook by id (secret redacted), or undefined when missing. */
2886
3090
  getWebhook(webhookId) {
@@ -3342,6 +3546,12 @@ var HttpTransport = class {
3342
3546
  constructor(http) {
3343
3547
  this.http = http;
3344
3548
  }
3549
+ async administrativeRequest(request) {
3550
+ const options = { method: request.method, path: request.path, query: request.query, body: request.body, signal: request.signal, retryable: request.method === "GET" };
3551
+ if (request.responseFormat !== "binary") return this.http.request(options);
3552
+ const result = await this.http.request({ ...options, binary: true });
3553
+ return { content_type: result.contentType, content_base64: bytesToBase64(result.bytes), filename: filenameFromDisposition(result.contentDisposition) };
3554
+ }
3345
3555
  encodeAddress(address) {
3346
3556
  return encodeURIComponent(address);
3347
3557
  }
@@ -3371,11 +3581,7 @@ var HttpTransport = class {
3371
3581
  }
3372
3582
  async listInboxes(params, signal) {
3373
3583
  const raw = await this.call({ method: "GET", path: "/v1/inboxes", query: { ...params }, signal });
3374
- const items = raw.inboxes ?? raw.items ?? [];
3375
- const page = { items, total: items.length };
3376
- const cursor = raw.next_cursor ?? raw.next_page;
3377
- if (cursor) page.next_cursor = cursor;
3378
- return page;
3584
+ return normalizeInboxPage(raw);
3379
3585
  }
3380
3586
  getInbox(address, signal) {
3381
3587
  return this.call({ method: "GET", path: `/v1/inboxes/${this.encodeAddress(address)}`, signal });
@@ -3408,7 +3614,8 @@ var HttpTransport = class {
3408
3614
  query: {
3409
3615
  limit: params.limit,
3410
3616
  cursor: params.cursor,
3411
- include: serializeInclude(params.include)
3617
+ include: serializeInclude(params.include),
3618
+ domain: params.domain
3412
3619
  },
3413
3620
  signal
3414
3621
  });
@@ -3590,24 +3797,21 @@ var HttpTransport = class {
3590
3797
  });
3591
3798
  }
3592
3799
  registerWebhook(req, signal) {
3593
- return this.call({ method: "POST", path: "/v1/webhooks", body: req, idempotencyKey: req.client_id, signal });
3800
+ const { org_id, project_id, ...body } = req;
3801
+ return this.call({ method: "POST", path: "/v1/webhooks", query: { org_id, project_id }, body, idempotencyKey: req.client_id, signal });
3594
3802
  }
3595
- listWebhooks(signal) {
3596
- return this.call({ method: "GET", path: "/v1/webhooks", signal });
3803
+ async listWebhooks(signal, params = {}) {
3804
+ return normalizeInboxPage(await this.call({ method: "GET", path: "/v1/webhooks", query: { ...params }, signal }), "webhook");
3597
3805
  }
3598
- getWebhook(webhookId, signal) {
3599
- return this.call({ method: "GET", path: `/v1/webhooks/${encodeURIComponent(webhookId)}`, signal });
3806
+ getWebhook(webhookId, signal, selection) {
3807
+ return this.call({ method: "GET", path: `/v1/webhooks/${encodeURIComponent(webhookId)}`, query: { ...selection }, signal });
3600
3808
  }
3601
3809
  updateWebhook(webhookId, req, signal) {
3602
- return this.call({
3603
- method: "PATCH",
3604
- path: `/v1/webhooks/${encodeURIComponent(webhookId)}`,
3605
- body: req,
3606
- signal
3607
- });
3810
+ const { org_id, project_id, ...body } = req;
3811
+ return this.call({ method: "PATCH", path: `/v1/webhooks/${encodeURIComponent(webhookId)}`, query: { org_id, project_id }, body, signal });
3608
3812
  }
3609
- async deleteWebhook(webhookId, signal) {
3610
- await this.call({ method: "DELETE", path: `/v1/webhooks/${encodeURIComponent(webhookId)}`, signal });
3813
+ async deleteWebhook(webhookId, signal, selection) {
3814
+ await this.call({ method: "DELETE", path: `/v1/webhooks/${encodeURIComponent(webhookId)}`, query: { ...selection }, signal });
3611
3815
  }
3612
3816
  addContactListEntry(address, req, signal) {
3613
3817
  return this.call({
@@ -3983,6 +4187,9 @@ var MockTransport = class {
3983
4187
  constructor(backend) {
3984
4188
  this.backend = backend ?? new MockBackend();
3985
4189
  }
4190
+ async administrativeRequest(request) {
4191
+ return this.backend.administrativeRequest(request);
4192
+ }
3986
4193
  async enroll(req) {
3987
4194
  return this.backend.enroll(req);
3988
4195
  }
@@ -4133,22 +4340,27 @@ var MockTransport = class {
4133
4340
  return this.backend.waitForEmail(address, req);
4134
4341
  }
4135
4342
  async registerWebhook(req) {
4343
+ assertWebhookFixtureSelection(req);
4136
4344
  return this.backend.registerWebhook(req);
4137
4345
  }
4138
- async listWebhooks() {
4139
- return this.backend.listWebhooks();
4346
+ async listWebhooks(_signal, params = {}) {
4347
+ assertWebhookFixtureSelection(params);
4348
+ return this.backend.listWebhooks(params);
4140
4349
  }
4141
- async getWebhook(webhookId) {
4350
+ async getWebhook(webhookId, _signal, selection = {}) {
4351
+ assertWebhookFixtureSelection(selection);
4142
4352
  const hook = this.backend.getWebhook(webhookId);
4143
4353
  if (!hook) throw notFound("webhook", webhookId);
4144
4354
  return hook;
4145
4355
  }
4146
4356
  async updateWebhook(webhookId, req) {
4357
+ assertWebhookFixtureSelection(req);
4147
4358
  const hook = this.backend.updateWebhook(webhookId, req);
4148
4359
  if (!hook) throw notFound("webhook", webhookId);
4149
4360
  return hook;
4150
4361
  }
4151
- async deleteWebhook(webhookId) {
4362
+ async deleteWebhook(webhookId, _signal, selection = {}) {
4363
+ assertWebhookFixtureSelection(selection);
4152
4364
  if (!this.backend.deleteWebhook(webhookId)) throw notFound("webhook", webhookId);
4153
4365
  }
4154
4366
  async addContactListEntry(address, req) {
@@ -4387,6 +4599,9 @@ function filenameFromDisposition(disposition) {
4387
4599
  const m = /filename\*?=(?:UTF-8'')?"?([^";]+)"?/i.exec(disposition);
4388
4600
  return m ? decodeURIComponent(m[1].trim()) : "";
4389
4601
  }
4602
+ function assertWebhookFixtureSelection(selection) {
4603
+ if (selection.org_id || selection.project_id) throw new Error("Offline webhook fixtures do not simulate organization/project selection; use live credentials for scoped checks.");
4604
+ }
4390
4605
 
4391
4606
  // src/domain-wait.ts
4392
4607
  async function waitForDomain(get, options = {}) {
@@ -4693,11 +4908,16 @@ var InboxHandle = class {
4693
4908
  };
4694
4909
 
4695
4910
  // src/pagination.ts
4696
- var ListPage = class _ListPage {
4697
- constructor(raw, fetcher) {
4911
+ var _ListPage = class _ListPage {
4912
+ constructor(raw, fetcher, visited = /* @__PURE__ */ new Set()) {
4698
4913
  this.fetcher = fetcher;
4914
+ this.visited = visited;
4699
4915
  /** Always `"list"`. */
4700
4916
  this.object = "list";
4917
+ if (!raw || raw.object !== "list" || !Array.isArray(raw.data) || typeof raw.has_more !== "boolean" || !(raw.next_cursor === null || typeof raw.next_cursor === "string" && raw.next_cursor.length > 0) || raw.has_more !== Boolean(raw.next_cursor)) {
4918
+ throw new Error("Extrovert: invalid list response; inventory is unavailable, not empty.");
4919
+ }
4920
+ if (raw.next_cursor && visited.has(raw.next_cursor)) throw new Error("Extrovert: repeated pagination cursor.");
4701
4921
  this.data = raw.data;
4702
4922
  this.hasMore = raw.has_more;
4703
4923
  this.nextCursor = raw.next_cursor;
@@ -4709,8 +4929,11 @@ var ListPage = class _ListPage {
4709
4929
  if (!this.hasMore || this.nextCursor === null) {
4710
4930
  throw new Error("Extrovert: no more pages (next_cursor is null).");
4711
4931
  }
4932
+ if (this.visited.size + 1 >= _ListPage.maxPages) throw new Error("Extrovert: pagination exceeded the 1,000-page safety limit; narrow your filters.");
4933
+ const visited = new Set(this.visited);
4934
+ visited.add(this.nextCursor);
4712
4935
  const raw = await this.fetcher(this.nextCursor, signal);
4713
- return new _ListPage(raw, this.fetcher);
4936
+ return new _ListPage(raw, this.fetcher, visited);
4714
4937
  }
4715
4938
  /**
4716
4939
  * Auto-paginate: yield every row across every page, fetching subsequent pages
@@ -4735,6 +4958,9 @@ var ListPage = class _ListPage {
4735
4958
  return out;
4736
4959
  }
4737
4960
  };
4961
+ /** Walkers fail visibly after 1,000 pages; they never return truncated success. */
4962
+ _ListPage.maxPages = 1e3;
4963
+ var ListPage = _ListPage;
4738
4964
  function listPage(raw, fetcher) {
4739
4965
  return new ListPage(raw, fetcher);
4740
4966
  }
@@ -5062,12 +5288,14 @@ var Webhooks = class {
5062
5288
  return this.ctx.transport.registerWebhook(req, signal);
5063
5289
  }
5064
5290
  /** List registered webhooks (the one-time signing `secret` is omitted). */
5065
- list(signal) {
5066
- return this.ctx.transport.listWebhooks(signal);
5291
+ list(paramsOrSignal = {}, signal) {
5292
+ if ("aborted" in paramsOrSignal) return this.ctx.transport.listWebhooks(paramsOrSignal);
5293
+ return this.ctx.transport.listWebhooks(signal, paramsOrSignal);
5067
5294
  }
5068
5295
  /** Fetch one webhook by id (the signing `secret` is omitted). */
5069
- get(webhookId, signal) {
5070
- return this.ctx.transport.getWebhook(webhookId, signal);
5296
+ get(webhookId, selectionOrSignal = {}, signal) {
5297
+ if ("aborted" in selectionOrSignal) return this.ctx.transport.getWebhook(webhookId, selectionOrSignal);
5298
+ return this.ctx.transport.getWebhook(webhookId, signal, selectionOrSignal);
5071
5299
  }
5072
5300
  /**
5073
5301
  * Update a webhook in place: change the delivery `url`, the subscribed
@@ -5079,8 +5307,9 @@ var Webhooks = class {
5079
5307
  return this.ctx.transport.updateWebhook(webhookId, req, signal);
5080
5308
  }
5081
5309
  /** Delete a webhook by id. */
5082
- delete(webhookId, signal) {
5083
- return this.ctx.transport.deleteWebhook(webhookId, signal);
5310
+ delete(webhookId, selectionOrSignal = {}, signal) {
5311
+ if ("aborted" in selectionOrSignal) return this.ctx.transport.deleteWebhook(webhookId, selectionOrSignal);
5312
+ return this.ctx.transport.deleteWebhook(webhookId, signal, selectionOrSignal);
5084
5313
  }
5085
5314
  };
5086
5315
  var ContactLists = class {
@@ -5439,6 +5668,7 @@ var ExtrovertClient = class _ExtrovertClient {
5439
5668
  this.handleOptions = { defaultWaitTimeoutMs: timeoutMs };
5440
5669
  if (useMock) {
5441
5670
  this.transport = new MockTransport(options.mockBackend);
5671
+ this.transport.backend.configureAdministrativeFixture(apiKey);
5442
5672
  } else {
5443
5673
  if (!apiKey) {
5444
5674
  throw new Error(
@@ -5462,6 +5692,7 @@ var ExtrovertClient = class _ExtrovertClient {
5462
5692
  };
5463
5693
  this.transport = new HttpTransport(new HttpClient(config));
5464
5694
  }
5695
+ this.administration = new Administration((request) => this.transport.administrativeRequest(request));
5465
5696
  const ctx = { transport: this.transport, handleOptions: this.handleOptions, keyTier: this.keyTier };
5466
5697
  this.inboxes = new Inboxes(ctx);
5467
5698
  this.messages = new Messages(ctx);
@@ -5675,7 +5906,7 @@ async function signWebhook(secret, body, timestampSeconds) {
5675
5906
  }
5676
5907
 
5677
5908
  // src/contract.ts
5678
- var CONTRACT_VERSION = "0.1.0-pre.10";
5909
+ var CONTRACT_VERSION = "0.1.0-pre.12";
5679
5910
  var CONTRACT_MANIFEST = {
5680
5911
  name: "extrovert.review-loop",
5681
5912
  version: CONTRACT_VERSION,
@@ -5751,7 +5982,9 @@ var CONTRACT_MANIFEST = {
5751
5982
  skills: ["extrovert-send-email", "extrovert-writing-rules"]
5752
5983
  };
5753
5984
 
5985
+ exports.ADMINISTRATIVE_FIXTURE_KEY = ADMINISTRATIVE_FIXTURE_KEY;
5754
5986
  exports.API_VERSION_HEADER = API_VERSION_HEADER;
5987
+ exports.Administration = Administration;
5755
5988
  exports.ApiError = ApiError;
5756
5989
  exports.AuthenticationError = AuthenticationError;
5757
5990
  exports.BornStaleError = BornStaleError;