{"openapi":"3.1.0","info":{"title":"Agents API","description":"Unified API for ingestor and integration services","version":"1.0.0"},"paths":{"/token":{"post":{"summary":"Get Access Token","description":"OAuth2 token endpoint for client credentials flow","operationId":"get_access_token_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_get_access_token_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["Health"],"summary":"Health Check","description":"Check the health of all server components.\n\nVerifies connectivity to PostgreSQL, the checkpoint backend, and the\nstore backend. Returns 503 if any component is unhealthy.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}}}}},"/ready":{"get":{"tags":["Health"],"summary":"Readiness Check","description":"Check database, checkpointer and store with a two-second deadline per probe.\n\nReturns 200 only when all probes succeed. Failures return 503 with a fixed\nreason: database, checkpointer, store or timeout, without exception details.","operationId":"readiness_check_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Readiness Check Ready Get"}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}}}}},"/ingestor/health":{"get":{"tags":["ingestor"],"summary":"Health Check","description":"Health check endpoint for K8s liveness/readiness probes.\n\nReturns minimal status info. Operational metrics are available\nvia authenticated endpoints only (e.g., /alerts/queue/stats).","operationId":"health_check_ingestor_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/alerts/dlq":{"get":{"tags":["alerts"],"summary":"Get Dlq Items","description":"Get items from the Dead Letter Queue.\n\nReturns alerts that failed processing after all retry attempts.\nOnly returns items belonging to the user's organization.\nFetches iteratively to ensure 'limit' items are returned if available.","operationId":"get_dlq_items_alerts_dlq_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Dlq Items Alerts Dlq Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/dlq/{message_id}/replay":{"post":{"tags":["alerts"],"summary":"Replay Dlq Item","description":"Replay a failed alert from the DLQ.\n\nMoves the alert back to the pending queue with retry count reset to 0.\nOnly allows replay of items belonging to user's organization.","operationId":"replay_dlq_item_alerts_dlq__message_id__replay_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Replay Dlq Item Alerts Dlq  Message Id  Replay Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/dlq/{message_id}":{"delete":{"tags":["alerts"],"summary":"Delete Dlq Item","description":"Delete an item from the DLQ.\n\nPermanently removes the failed alert. Use with caution.\nOnly allows deletion of items belonging to user's organization.","operationId":"delete_dlq_item_alerts_dlq__message_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Dlq Item Alerts Dlq  Message Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/queue/stats":{"get":{"tags":["alerts"],"summary":"Get Queue Stats","description":"Get alert queue statistics for the current user's organization.\n\nReturns organization-specific DLQ count and general queue health info.\nGlobal processing metrics are not exposed to prevent information disclosure.","operationId":"get_queue_stats_alerts_queue_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Queue Stats Alerts Queue Stats Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/webhooks/ingestor/events":{"post":{"tags":["webhooks","ingestor"],"summary":"Receive Alert","description":"Universal webhook endpoint for receiving events from monitoring systems.\n\n**Webhook URL**: `POST /webhooks/ingestor/events`\n\n**Authentication**: Requires valid JWT token (Bearer authentication)\n\n**Payload**: Accepts webhooks forwarded from RO service with:\n- webhook_id: UUID for correlation with RO audit logs\n- organization_id: Organization ID\n- provider: Monitoring provider (datadog, google, newrelic, pagerduty)\n- payload: Raw webhook JSON from monitoring system\n- marshalled_event: Pre-marshalled StructuredEvent (required — RO is the sole marshaller)\n\nThe webhook_id is stored in LangGraph thread metadata for correlation.\n\n**Cross-tenant guard**: only the internal marshaller (the RO service\naccount, ``auth_source == \"internal\"``) may target an arbitrary\norganization via the payload. An external caller may submit events only\nfor its own organization — otherwise any authenticated customer could\nlaunch an investigation under another tenant's cloud context (and receive\nthat tenant's HITL notifications) simply by setting ``organization_id`` in\nthe body.\n\n**Example from RO**:\n```json\n{\n  \"webhook_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"organization_id\": \"org-123\",\n  \"provider\": \"datadog\",\n  \"payload\": {...},\n  \"marshalled_event\": {\n    \"title\": \"High CPU Usage\",\n    \"id\": \"alert-123\",\n    \"content\": \"**CPU usage** exceeded 90%...\",\n    \"severity\": \"critical\",\n    \"time\": \"2024-01-15T14:30:00Z\",\n    \"transition\": \"triggered\",\n    \"external_links\": [],\n    \"update\": \"false\"\n  }\n}\n```","operationId":"receive_alert_webhooks_ingestor_events_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Event"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/webhooks/auth/users":{"post":{"tags":["webhooks","auth"],"summary":"Sync User Webhook","description":"Webhook endpoint for synchronizing user data from Landing/Auth app.\n\nThis endpoint is secured with an internal API key and allows the Landing/Auth app\nto notify this service about user lifecycle events (created, updated, deleted).\n\n**Webhook URL**: `POST /webhooks/auth/users`\n\n**Headers**:\n- `x-api-key`: Internal API key for authentication\n\n**Payload**:\n```json\n{\n    \"action\": \"created|updated|deleted\",\n    \"user_id\": \"external-user-id\",\n    \"user_data\": {\n        \"external_id\": \"external-user-id\",\n        \"username\": \"username\",\n        \"email\": \"email@example.com\",\n        \"full_name\": \"Full Name\",\n        \"organization_id\": \"org-uuid\",\n        \"roles\": [\"user\", \"admin\"],\n        \"is_active\": true,\n        \"updated_at\": \"2025-10-09T15:00:00Z\"\n    },\n    \"timestamp\": \"2025-10-09T15:00:00Z\"\n}\n```","operationId":"sync_user_webhook_webhooks_auth_users_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSyncPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/auth/users/{external_id}":{"delete":{"tags":["webhooks","auth"],"summary":"Rollback User Creation","description":"Rollback user creation (delete user after failed onboarding).\n\nThis endpoint allows Landing Page to maintain atomicity by rolling back\nuser creation in Agents App if the overall onboarding flow fails.\n\n**Use Case:**\n1. Landing Page creates Auth0 user\n2. Landing Page calls Agents App to sync user\n3. If sync fails, Landing Page deletes Auth0 user\n4. Landing Page calls this endpoint to delete user from Agents App\n\n**Subscription Protection**: If the user has a REVENUE-BEARING subscription\n(active / past_due / unpaid), deletion is prevented (returns 400) and routed\nto support to prevent revenue loss. Non-paying states (trialing / incomplete)\nare allowed and their Stripe subscriptions are cancelled after the DB commit.\n\n**Rollback Window**: Destructive rollback is allowed only during the first\nfive minutes after user creation. Older accounts must go through support.\n\n**Idempotent**: Returns 200 even if user not found (already deleted).\n\n**Example:**\n```\nDELETE /webhooks/auth/users/OofTF1jvX5UQ4R3cRCDYwHXBtz43\nHeaders:\n  x-api-key: <internal-api-key>\n```","operationId":"rollback_user_creation_webhooks_auth_users__external_id__delete","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string","title":"External Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rollback User Creation Webhooks Auth Users  External Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/sendgrid/events":{"post":{"tags":["webhooks"],"summary":"Sendgrid Events","description":"Ingest a signed SendGrid event batch; stamp demo-invite records.","operationId":"sendgrid_events_webhooks_sendgrid_events_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Sendgrid Events Webhooks Sendgrid Events Post"}}}}}}},"/users/me/devices":{"post":{"tags":["devices"],"summary":"Register Device","description":"Idempotent upsert of the caller's device token.","operationId":"register_device_users_me_devices_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceToken"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/users/me/devices/{token}":{"delete":{"tags":["devices"],"summary":"Unregister Device","description":"Drop one of the caller's device tokens (idempotent).","operationId":"unregister_device_users_me_devices__token__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users":{"post":{"tags":["users"],"summary":"Create User","description":"Create a new user (admin only).\n\nCreates an \"internal\" user who authenticates with username/password.\nFor users from external OAuth/SSO systems, they are created automatically\nvia JWT authentication or webhook sync.\n\nOnly superusers can create new users.","operationId":"create_user_users_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["users"],"summary":"List Users","description":"List users with optional filters.\n\n- Superusers can list all users\n- Regular users can only list users in their organization","operationId":"list_users_users_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me":{"get":{"tags":["users"],"summary":"Get Current User Details","description":"Get current user's details.","operationId":"get_current_user_details_users_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/users/{user_id}":{"get":{"tags":["users"],"summary":"Get User","description":"Get user details by UUID.\n\n- Superusers can get any user\n- Regular users can get themselves or users in their organization","operationId":"get_user_users__user_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["users"],"summary":"Update User","description":"Update user details.\n\n- Superusers can update any user\n- Regular users can only update themselves (limited fields)","operationId":"update_user_users__user_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["users"],"summary":"Deactivate User","description":"Deactivate user (admin only).\n\nThis doesn't delete the user, just sets is_active=False.","operationId":"deactivate_user_users__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me/password":{"patch":{"tags":["users"],"summary":"Change Own Password","description":"Change current user's password.\n\nOnly works for internal users (with username/password auth).\nExternal users (OAuth/SSO) cannot change password here.","operationId":"change_own_password_users_me_password_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordUpdate"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/users/{external_id}/subscription":{"get":{"tags":["users"],"summary":"Get User Subscription Status","description":"Get subscription status for a user by external_id (Auth0 User ID).\n\nThis endpoint is called by Landing Page to check subscription status.\nRequires authentication (internal service account or external user JWT).\n\nReturns subscription status with race condition handling for webhook delays.","operationId":"get_user_subscription_status_users__external_id__subscription_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string","title":"External Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get User Subscription Status Users  External Id  Subscription Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations":{"get":{"tags":["organizations"],"summary":"List Organizations","description":"List all organizations the current user belongs to.\n\nReturns an empty array if the user doesn't belong to any organizations.","operationId":"list_organizations_organizations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Organization"},"type":"array","title":"Response List Organizations Organizations Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["organizations"],"summary":"Create Organization","description":"Create a new organization.\n\nThe current user will automatically be added as the owner of the organization.","operationId":"create_organization_organizations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/organizations/{organization_id}":{"get":{"tags":["organizations"],"summary":"Get Organization","description":"Get details of a specific organization.\n\nUser must be a member of the organization to view it.","operationId":"get_organization_organizations__organization_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["organizations"],"summary":"Update Organization","description":"Update organization details.\n\nUser must be an owner or admin of the organization to update it.","operationId":"update_organization_organizations__organization_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["organizations"],"summary":"Delete Organization","description":"Delete an organization.\n\nUser must be the owner of the organization to delete it.\nAll teams and members will be removed when the organization is deleted.","operationId":"delete_organization_organizations__organization_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/admin-view":{"get":{"tags":["organizations"],"summary":"Get Admin View","description":"Read the calling user's admin-view toggle state in this org.\n\nNo role check — any member can query their own state (it's a\nper-membership flag). Non-members get 404.","operationId":"get_admin_view_organizations__organization_id__admin_view_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminViewState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["organizations"],"summary":"Set Admin View","description":"Toggle org-admin-view for the calling user in this org.\n\nWhen enabled AND the caller's role is 'owner' or 'admin', the auth\nfilter switches from owner+team scoping to\n``{\"organization_id\": ...}`` for this user's queries — they see\nevery thread in the org. Reversible at any time; D3 should show a\npersistent banner while ON so the elevated state is visible to the\noperator. Only owners/admins can flip the toggle (defense in depth\neven though a stored ``True`` on a member row is also ignored by\nthe auth filter's role re-check).","operationId":"set_admin_view_organizations__organization_id__admin_view_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminViewUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminViewState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/me/active-team":{"get":{"tags":["organizations"],"summary":"Get Active Team","description":"Read the caller's active team in this org.\n\nThe active team is the audience of the caller's private chats, channel\nDMs and MCP calls when the org isolates brain memory by team. A stored\npick the caller no longer belongs to reads as null, as the resolver\nignores it. Non-members get 404.","operationId":"get_active_team_organizations__organization_id__me_active_team_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveTeamState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["organizations"],"summary":"Set Active Team","description":"Set (or clear, with null) the caller's active team in this org.\n\nThe team must be a team of this org that the caller belongs to (422\notherwise). ``team_ids`` instead picks a multi-team audience: two or\nmore distinct teams of this org, all of which the caller belongs to\n(422 otherwise, and 422 when both fields are set). Storing either pick\nclears the other. Any member may set their own pick; admins and owners keep\nthe all-rows context in their private chats regardless. Cached run\ncontexts are dropped so the pick applies to the next run on this\nreplica. Non-members get 404.","operationId":"set_active_team_organizations__organization_id__me_active_team_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveTeamState"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveTeamState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members":{"get":{"tags":["organizations"],"summary":"List Organization Members","description":"List all members of an organization.\n\nUser must be a member of the organization to view its members.","operationId":"list_organization_members_organizations__organization_id__members_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationMemberResponse"},"title":"Response List Organization Members Organizations  Organization Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["organizations"],"summary":"Add Organization Member","description":"Add a member to an organization.\n\nUser must be an owner or admin of the organization to add members.","operationId":"add_organization_member_organizations__organization_id__members_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationMemberAdd"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members/me":{"get":{"tags":["organizations"],"summary":"Get Current Organization Membership","description":"Return the authenticated caller's current database-backed org role.\n\nThe lookup is deliberately bound to ``current_user.id``; callers cannot\nsupply a user identifier or fall back to email matching. A removed or\notherwise non-member caller receives 403 even when a still-valid token\ncarries stale organization claims.","operationId":"get_current_organization_membership_organizations__organization_id__members_me_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentOrganizationMembershipResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members/{user_id}":{"delete":{"tags":["organizations"],"summary":"Remove Organization Member","description":"Remove a member from an organization.\n\nUser must be an owner or admin of the organization to remove members.\nOwners cannot remove themselves if they are the last owner.","operationId":"remove_organization_member_organizations__organization_id__members__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["organizations"],"summary":"Update Member Role","description":"Update an organization member's role.\n\nUser must be an owner of the organization to update member roles.\nCannot demote the last owner.","operationId":"update_member_role_organizations__organization_id__members__user_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationMemberAdd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/set-primary":{"post":{"tags":["organizations"],"summary":"Set Primary Organization","description":"Set this organization as the user's primary organization.\n\nUser must be a member of the organization to set it as primary.","operationId":"set_primary_organization_organizations__organization_id__set_primary_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Primary Organization Organizations  Organization Id  Set Primary Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams":{"get":{"tags":["teams"],"summary":"List Teams","description":"List all teams the current user belongs to.\n\nReturns an empty array if the user doesn't belong to any teams.","operationId":"list_teams_teams_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Team"},"type":"array","title":"Response List Teams Teams Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["teams"],"summary":"Create Team","description":"Create a new team.\n\nThe current user will automatically be added as an admin of the team.\nThe team organization is always derived from the authenticated user.\nA body organization_id is accepted only as a backwards-compatible assertion.","operationId":"create_team_teams_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/teams/{team_id}":{"get":{"tags":["teams"],"summary":"Get Team","description":"Get details of a specific team.\n\nUser must be a member of the team to view it.","operationId":"get_team_teams__team_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["teams"],"summary":"Update Team","description":"Update a team in the caller's organization.\n\nTeam admins retain their edit rights. Org admins and owners may also\nupdate teams they do not belong to. Foreign and missing teams both\nreturn 404 before checking roles, as on the team-deletion route.","operationId":"update_team_teams__team_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["teams"],"summary":"Delete Team","description":"Delete a team of the caller's organization.\n\n**Org admin/owner only**: a team's deletion changes who reads the\nmemories labeled with it. A team outside the caller's organization\n404s like a missing one. All team members are removed.\n\nMemories: with ``move_memories_to``, every episodes and knowledge row\nwhose label names the team loses that team; a label left empty takes\nthe move target (``org``, ``admins`` or another team of this org),\nexcept a label whose only entries required the team together with\nother teams, which becomes admins-only.\nThe rows are relabeled before the team is deleted, so a failed call\ncan be retried. Without it no memory row changes: a row labeled only\nwith the deleted team keeps the dead id, which no member's team\nmatches, so in effect only admins read it until an admin relabels it\n(``PATCH .../memory/{namespace}/{key}/label``). The same holds for a\nrow a run stamps with the team between the relabel and the delete.\nDerived team facts always lose the team: rows shared with other teams\nnarrow to them, and rows left with no team are dropped. CRM automations\nwhose audience names the team pause (\"Paused: its team was deleted\").\n\nShared mailbox CRM entries always narrow to admins-only. A duplicate\nadmins-only activity is retained without copying another entry's subject.\n\nReturns the number of relabeled memory rows.","operationId":"delete_team_teams__team_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"move_memories_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Where the team's memories go: 'org', 'admins', or the id of another team in this organization.","title":"Move Memories To"},"description":"Where the team's memories go: 'org', 'admins', or the id of another team in this organization."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/members":{"get":{"tags":["teams"],"summary":"List Team Members","description":"List the members of a team with their roles.\n\nReadable by the team's members and by the org admins of its\norganization, who may manage any of its teams.","operationId":"list_team_members_teams__team_id__members_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeamMemberResponse"},"title":"Response List Team Members Teams  Team Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["teams"],"summary":"Add Team Member","description":"Add a person of the team's organization to the team.\n\nTeam admins and org admins only. The person must belong to the\norganization (a team never reaches outside its tenant); 409 when they\nare already in the team.","operationId":"add_team_member_teams__team_id__members_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberAdd"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/members/{user_id}":{"delete":{"tags":["teams"],"summary":"Remove Team Member","description":"Remove a member from a team.\n\nTeam admins and org admins only. A team keeps at least one team admin:\nremoving its last one is a 400, whoever asks.","operationId":"remove_team_member_teams__team_id__members__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["teams"],"summary":"Update Member Role","description":"Change a team member's role (``admin`` or ``member``).\n\nTeam admins and org admins only. The body is ``{\"role\": ...}``; an older\ncaller's extra ``user_id`` is ignored, the path names the member. The\nteam's last admin cannot be made a member.","operationId":"update_member_role_teams__team_id__members__user_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamMemberRole"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/teams":{"get":{"tags":["teams"],"summary":"List Org Teams","description":"List teams the current user belongs to within a specific organization.\n\nReturns ``[]`` if the user has no team memberships in this org.\nThe org-access gate rejects requests where the caller isn't a\nmember of the target org (404, not 403, so cross-tenant probes\ncan't enumerate orgs). ``scope=org`` lists every team of the org for\nan org admin, who may scope memories and pins to any of them.","operationId":"list_org_teams_organizations__organization_id__teams_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"scope","in":"query","required":false,"schema":{"enum":["mine","org"],"type":"string","description":"'mine' (default): the caller's teams. 'org': every team of the organization, admin-only (memory visibility and team pins).","default":"mine","title":"Scope"},"description":"'mine' (default): the caller's teams. 'org': every team of the organization, admin-only (memory visibility and team pins)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Team"},"title":"Response List Org Teams Organizations  Organization Id  Teams Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment":{"get":{"tags":["agent-environment"],"summary":"Get Environment","description":"Get complete Agent Environment for organization.\n\nReturns cloud providers and Kubernetes clusters configured\nfor service account impersonation.","operationId":"get_environment_organizations__organization_id__environment_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentEnvironmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/validate":{"get":{"tags":["agent-environment"],"summary":"Validate Environment","description":"Validate Agent Environment configuration.\n\nChecks for common issues like:\n- Orphaned clusters (referencing non-existent cloud providers)\n- Missing configuration\n- Invalid provider types","operationId":"validate_environment_organizations__organization_id__environment_validate_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentEnvironmentValidationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers":{"post":{"tags":["agent-environment"],"summary":"Create Cloud Provider","description":"Add cloud provider to Agent Environment.\n\nSupports GCP (service account email), AWS (role ARN), and Azure (managed identity or service principal).\nSensitive fields (Azure SP client_secret) are automatically encrypted.\nRequires admin or owner role.","operationId":"create_cloud_provider_organizations__organization_id__environment_cloud_providers_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-environment"],"summary":"List Cloud Providers","description":"List all cloud providers for organization.","operationId":"list_cloud_providers_organizations__organization_id__environment_cloud_providers_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}":{"get":{"tags":["agent-environment"],"summary":"Get Cloud Provider","description":"Get cloud provider details.\n\nNote: Sensitive fields (Azure SP client_secret) are excluded from response.","operationId":"get_cloud_provider_organizations__organization_id__environment_cloud_providers__provider_key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-environment"],"summary":"Update Cloud Provider","description":"Update cloud provider configuration or labels. Requires admin or owner role.","operationId":"update_cloud_provider_organizations__organization_id__environment_cloud_providers__provider_key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-environment"],"summary":"Delete Cloud Provider","description":"Remove cloud provider from Agent Environment. Requires admin or owner role.\n\nWarning: This will orphan any clusters referencing this provider.","operationId":"delete_cloud_provider_organizations__organization_id__environment_cloud_providers__provider_key__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/test":{"post":{"tags":["agent-environment"],"summary":"Test Cloud Provider","description":"Test existing cloud provider credentials (re-verification).\n\nUseful for \"Test Connection\" button in UI after provider creation.\nTests only cloud provider credentials, NOT Kubernetes cluster access.\n\nReturns:\n    {\"result\": \"success\"|\"failed\", \"message\": \"...\"}","operationId":"test_cloud_provider_organizations__organization_id__environment_cloud_providers__provider_key__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/import-bucket/probe":{"post":{"tags":["agent-environment"],"summary":"Probe Import Bucket","description":"Verify the provider's import bucket end to end (write/read/delete).\n\nRuns the roundtrip via the impersonated tenant identity and\npersists the result on the provider entry, so the memory-seed\ncapability endpoint can report bulk-import availability without a\nnetwork round-trip. Admin-only: the result gates a data-path\nfeature. Requires ``import_bucket`` in the provider config.","operationId":"probe_import_bucket_organizations__organization_id__environment_cloud_providers__provider_key__import_bucket_probe_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/media-bucket/probe":{"post":{"tags":["agent-environment"],"summary":"Probe Media Bucket","description":"Verify the provider's media bucket end to end (write/read/delete).\n\nMirror of the import-bucket probe for the durable-attachments bucket\n(a separate consent surface — see the config schema). The persisted\nresult gates media residency: uploads route to the org's bucket only\nafter a successful probe. Admin-only.","operationId":"probe_media_bucket_organizations__organization_id__environment_cloud_providers__provider_key__media_bucket_probe_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/media-storage/setup":{"post":{"tags":["agent-environment"],"summary":"Setup Media Storage","description":"Run the whole media-storage connect flow; return the step report.\n\nMedia twin of the memory-seed ``/storage/setup`` route, minus the\nbrowser origin (no CORS: attachment bytes are written server-side).\nBacks the d3 \"Configure storage\" nudge card with the same one-call\nguided experience as the chat action. Admin-only.","operationId":"setup_media_storage_organizations__organization_id__environment_media_storage_setup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_MediaStorageSetupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Setup Media Storage Organizations  Organization Id  Environment Media Storage Setup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/discover-clusters":{"get":{"tags":["agent-environment"],"summary":"Discover Clusters","description":"Discover GKE clusters in cloud provider's GCP project.\n\nReturns comprehensive result with error handling for permission issues.\nEnables users to select clusters from a dropdown instead of manually typing names.\n\nCurrently supports GCP (GKE) only. Returns 400 for other provider types.\n\nReturns:\n    ClusterDiscoveryResult with success status, clusters list, and error information","operationId":"discover_clusters_organizations__organization_id__environment_cloud_providers__provider_key__discover_clusters_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterDiscoveryResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/clusters":{"post":{"tags":["agent-environment"],"summary":"Create Clusters","description":"Add Kubernetes cluster(s) to Agent Environment (hierarchical - nested under provider).\n\nAccepts one or more clusters in a single request. All clusters are added to the\nspecified provider in a single database write operation.\nRequires admin or owner role.\n\nBehavior:\n- Validates all clusters before any writes\n- For GCP providers: Verifies platformpilot-access=enabled label exists (REQUIRED)\n- Skips duplicate clusters (idempotent)\n- Returns detailed per-cluster results\n- Single environment read/write cycle","operationId":"create_clusters_organizations__organization_id__environment_cloud_providers__provider_key__clusters_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterBatchCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterBatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-environment"],"summary":"List Provider Clusters","description":"List all Kubernetes clusters for a specific cloud provider.","operationId":"list_provider_clusters_organizations__organization_id__environment_cloud_providers__provider_key__clusters_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/clusters":{"get":{"tags":["agent-environment"],"summary":"List Clusters","description":"List all Kubernetes clusters for organization (flattened from hierarchical structure - convenience endpoint).","operationId":"list_clusters_organizations__organization_id__environment_clusters_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/clusters/{cluster_name}":{"get":{"tags":["agent-environment"],"summary":"Get Cluster","description":"Get Kubernetes cluster details (hierarchical path).","operationId":"get_cluster_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-environment"],"summary":"Update Cluster","description":"Update Kubernetes cluster configuration (hierarchical path). Requires admin or owner role.\n\nCurrently only supports updating labels.","operationId":"update_cluster_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-environment"],"summary":"Delete Cluster","description":"Remove Kubernetes cluster from Agent Environment (hierarchical path). Requires admin or owner role.","operationId":"delete_cluster_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/cluster-access":{"post":{"tags":["agent-environment"],"summary":"Verify Cluster Access","description":"Verify access level for specific clusters (Step 4 UI validation).\n\nThis endpoint is called after users grant conditional IAM permissions to validate\nthat PlatformPilot has the expected access level (container.clusterAdmin).\n\nUsed in Step 4 of the UI journey to confirm that:\n1. Service account can get cluster details\n2. Clusters have platformpilot-access=enabled label\n3. Access level is container.clusterAdmin (not just viewer)\n\nReturns detailed verification results per cluster with actionable guidance.","operationId":"verify_cluster_access_organizations__organization_id__environment_cloud_providers__provider_key__cluster_access_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterAccessRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterAccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/discover-services":{"get":{"tags":["agent-environment"],"summary":"Discover Services","description":"Discover enabled GCP services in a provider's project.\n\nReturns categorized list of enabled APIs for selection and registration.\nCurrently supports GCP only. Requires admin/owner: this endpoint also\nauto-enables prerequisite APIs (a mutation on the customer's project), so it\nis gated like the other mutating environment endpoints (grant/enable/etc.).","operationId":"discover_services_organizations__organization_id__environment_cloud_providers__provider_key__discover_services_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceDiscoveryResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/services":{"post":{"tags":["agent-environment"],"summary":"Create Services","description":"Batch register GCP services from discovery results. Requires admin role.","operationId":"create_services_organizations__organization_id__environment_cloud_providers__provider_key__services_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GCPServiceBatchCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GCPServiceBatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-environment"],"summary":"List Services","description":"List registered GCP services for a provider.","operationId":"list_services_organizations__organization_id__environment_cloud_providers__provider_key__services_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GCPServiceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/services/{service_name}":{"delete":{"tags":["agent-environment"],"summary":"Delete Service","description":"Deregister a GCP service. Requires admin role.","operationId":"delete_service_organizations__organization_id__environment_cloud_providers__provider_key__services__service_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"service_name","in":"path","required":true,"schema":{"type":"string","title":"Service Name"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/services/{service_name}/enable":{"post":{"tags":["agent-environment"],"summary":"Enable Service","description":"Enable a GCP API in the project. Requires admin role.","operationId":"enable_service_organizations__organization_id__environment_cloud_providers__provider_key__services__service_name__enable_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"service_name","in":"path","required":true,"schema":{"type":"string","title":"Service Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceEnableResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/services/{service_name}/disable":{"post":{"tags":["agent-environment"],"summary":"Disable Service","description":"Disable a GCP API in the project. Requires admin role. Refuses critical services.","operationId":"disable_service_organizations__organization_id__environment_cloud_providers__provider_key__services__service_name__disable_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"service_name","in":"path","required":true,"schema":{"type":"string","title":"Service Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceEnableResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/iam/check":{"get":{"tags":["agent-environment"],"summary":"Check Iam","description":"Check current IAM roles for the tenant SA and get recommendations.","operationId":"check_iam_organizations__organization_id__environment_cloud_providers__provider_key__iam_check_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceIAMCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/iam/grant":{"post":{"tags":["agent-environment"],"summary":"Grant Iam Role","description":"Grant an IAM role to the tenant SA. Requires admin role.","operationId":"grant_iam_role_organizations__organization_id__environment_cloud_providers__provider_key__iam_grant_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAMGrantRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAMGrantResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/iam/revoke":{"post":{"tags":["agent-environment"],"summary":"Revoke Iam Role","description":"Revoke an IAM role from the tenant SA. Requires admin role.","operationId":"revoke_iam_role_organizations__organization_id__environment_cloud_providers__provider_key__iam_revoke_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAMRevokeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAMGrantResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/deny-list":{"get":{"tags":["agent-environment"],"summary":"Get Provider Deny List","description":"Get command deny list for a cloud provider.","operationId":"get_provider_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__deny_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-environment"],"summary":"Update Provider Deny List","description":"Replace command deny list for a cloud provider. Requires admin role.","operationId":"update_provider_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__deny_list_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/deny-list/reset":{"post":{"tags":["agent-environment"],"summary":"Reset Provider Deny List","description":"Reset provider deny list to built-in defaults. Requires admin role.","operationId":"reset_provider_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__deny_list_reset_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/clusters/{cluster_name}/deny-list":{"get":{"tags":["agent-environment"],"summary":"Get Cluster Deny List","description":"Get command deny list for a Kubernetes cluster.","operationId":"get_cluster_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__deny_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-environment"],"summary":"Update Cluster Deny List","description":"Replace command deny list for a Kubernetes cluster. Requires admin role.","operationId":"update_cluster_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__deny_list_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/clusters/{cluster_name}/deny-list/reset":{"post":{"tags":["agent-environment"],"summary":"Reset Cluster Deny List","description":"Reset cluster deny list to built-in kubectl defaults. Requires admin role.","operationId":"reset_cluster_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__deny_list_reset_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db":{"post":{"tags":["agent-environment","memory-db"],"summary":"Configure Memory Db","description":"Create or replace the BYO Memory DB config under a provider.\n\nIdempotent on repeat: a second POST with the same body re-writes\nthe same blob and returns 201 (the route is treated as a \"set\"\noperation, mirroring the cloud-providers POST upsert behavior).\n\nAuth chain: admin role → paid plan (402) → memory_enabled\n(422) → gcp provider (422) → at-most-one (409). The order matters:\nwe don't want to leak organization plan info to a non-admin, so\nrole gate runs first.","operationId":"configure_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryDbConfigCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryDbConfigResponse"}}}},"402":{"description":"Paid plan required","content":{"application/problem+json":{}}},"409":{"description":"Another provider already has memory_db configured"},"422":{"description":"memory_enabled=False or non-gcp provider"},"429":{"description":"Per-org admin rate limit exhausted (``_enforce_admin_rate_limit``). ``Retry-After`` header carries the wait in seconds."},"502":{"description":"Cloud SQL Admin API call to fetch TLS metadata (``fetch_cloud_sql_tls_metadata``) failed and the config could not be persisted in a CA-pinned shape. Returns RFC 9457 problem-details.","content":{"application/problem+json":{}}}}},"get":{"tags":["agent-environment","memory-db"],"summary":"Get Memory Db","description":"Return the current memory-db config + last health for the provider.\n\nAdmin-only AND paid-plan-only, consistent with the sibling\n``/stats``, ``/events``, POST/PUT/DELETE/test/migrate routes.\nThe record exposes the customer's ``instance_connection_name``,\n``iam_user``, ``public_ip`` and ``instance_dns_name``; a non-\nadmin OR unentitled org shouldn't be able to introspect the\nBYO topology + health any more than they can the pool/breaker\nstate. Without the plan gate a downgraded tenant's admin\ncould still read back the routing surface their plan no longer\nentitles them to. No secrets are stored on the record (IAM auth\nmeans we never keep a password; the server CA PEM is\nintentionally not echoed — only ``server_ca_pinned``).","operationId":"get_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryDbConfigResponse"}}}},"402":{"description":"Paid plan required (RFC 9457 problem-details). The BYO surface — including read access to the topology fields exposed by this endpoint, is gated to paid plans to keep entitlement consistent across POST/GET/PUT/DELETE/test/migrate after a downgrade."},"404":{"description":"No memory-db configured under this provider"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-environment","memory-db"],"summary":"Delete Memory Db","description":"Remove the memory-db config from a provider (revert to platform).\n\nData on the customer's Cloud SQL instance is **NOT** deleted —\nonly the routing config. Customers wanting their rows gone must\nrun the reverse-migration job (Phase 5). The response body\nintentionally surfaces this in the No-Content path via a\n``Warning`` header.\n\nUX safeguard, opt-in: if ``BYO_DELETE_CONFIRM_REQUIRED=true``,\nthe caller MUST supply the ``X-Confirm-Delete`` header set to the\nURL's ``provider_key`` or the request returns 412 Precondition\nFailed. Default is ``false`` for backwards compatibility — when\nthe env flag is off, a missing header logs a warning and proceeds\nso operators can dry-run the requirement before turning it on.\n\n``X-Confirm-Delete`` is a UX safeguard, NOT a security control.\nIt carries no replay-protection (no nonce, no timestamp, no\nsignature) — a copy of the header replays exactly like the\noriginal. The admin-role check + the paid-plan gate are the\nsecurity boundary; the header just forces the caller to spell\nout the resource being deleted.\n\nNo ``?confirm=<provider_key>`` query fallback: query params land\nin HTTP access logs (proxy, CDN, gh-actions); headers don't.\nHeader-only keeps the confirmation gesture out of those log\ndestinations.\n\n``memory_enabled=False`` precondition — mirrors the\n``truncate_memory_db`` route. Deleting a routing config while\n``memory_enabled=True`` lets in-flight ops drain to the BYO store\nwhile new ops in the next ~30s race the routing flip and land in\nEITHER tenant store OR the platform default — split data residency.\nReturns 409 with Problem Details unless ``?force=true`` is passed\n(emergency override; logs WARNING).","operationId":"delete_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","description":"Emergency override of the memory_enabled=False precondition. Setting force=true allows DELETE while memory_enabled=True; logs a WARNING so the override is auditable. Use only when the standard 'flip memory_enabled=False, then delete' sequence is impractical (e.g., customer-side outage).","default":false,"title":"Force"},"description":"Emergency override of the memory_enabled=False precondition. Setting force=true allows DELETE while memory_enabled=True; logs a WARNING so the override is auditable. Use only when the standard 'flip memory_enabled=False, then delete' sequence is impractical (e.g., customer-side outage)."},{"name":"X-Confirm-Delete","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Confirm-Delete"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"No memory-db configured under this provider"},"409":{"description":"``memory_enabled=True`` precondition violated. Flip memory_enabled to False before deleting the routing config, or pass ``?force=true`` for an emergency override."},"412":{"description":"``X-Confirm-Delete`` header did not match the URL's provider_key (only when ``BYO_DELETE_CONFIRM_REQUIRED=true``)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db/test":{"post":{"tags":["agent-environment","memory-db"],"summary":"Test Memory Db","description":"Run the 8-check health probe against the configured BYO instance.\n\nOpens a one-shot psycopg connection (NOT through the registry's\npool — we deliberately exercise the cold path so the probe\nreflects what a fresh runtime replica would see) and runs each\ncheck.  Persists the outcome to ``last_health_status`` and, when\nthe overall report passes AND ``provisioning_state == \"pending\"``,\ntransitions to ``active`` so the dispatcher starts routing memory\nops to the customer's instance.\n\nAlways returns 200 with the per-check report — the operator\nwants to see every failure at once, not one-at-a-time via\ncascading non-200s.\n\nRe-asserts the paid-plan gate: this route transitions\n``pending -> active`` (starts routing memory ops to the customer\ninstance), so a downgraded org must not be able to re-activate\nBYO through it after losing the entitlement. ``memory_enabled``\nis intentionally NOT required for the PROBE itself, operators\nlegitimately probe connectivity before flipping A-Mem on. The\nACTIVATION flip is separately gated by ``ensure_safe_to_activate``:\nan org with existing platform memory rows and memory_enabled=True\nis refused (probe report still returned) so the routing cutover\ncannot open a split-brain window ahead of migration.","operationId":"test_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Probe ran; check ``overall`` for pass/fail.","content":{"application/json":{"schema":{}}}},"402":{"description":"Paid plan required","content":{"application/problem+json":{}}},"404":{"description":"No memory-db configured under this provider."},"422":{"description":"memory-db config exists but is missing public_ip (onboarding not yet complete)."},"429":{"description":"Per-org admin rate limit exhausted. ``Retry-After`` header carries the wait in seconds."},"502":{"description":"Cloud SQL Admin API call (``byo_connect`` / ``fetch_cloud_sql_tls_metadata``) failed. Returns RFC 9457 problem-details.","content":{"application/problem+json":{}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db/stats":{"get":{"tags":["agent-environment","memory-db"],"summary":"Get Memory Db Stats","description":"Return the BYO pool registry's observability snapshot.\n\nAdmin-only AND paid-plan-only, surfaces per-org breaker state,\nwhich a non-admin member shouldn't be able to introspect (it\ncould leak signal about the org's BYO health to people without\noperational responsibility). Plan gate is symmetric with\n``GET /memory-db``, a downgraded org's admin must not\nretain polling access to BYO topology their plan no longer\nentitles them to.\n\nThe global counters (``pool_count``, ``total_opens``,\n``total_evictions``, ``total_invalidations``,\n``total_probe_failures``) are PROCESS-WIDE rather than per-org —\na single replica's view, not aggregated across replicas.  Wire\nthem into LangSmith / Prometheus by polling each replica.","operationId":"get_memory_db_stats_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_stats_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Registry observability snapshot. ``breakers`` and ``last_op_at`` are filtered to the calling org; global counters (pool_count, total_opens, etc.) are process-wide.","content":{"application/json":{"schema":{}}}},"402":{"description":"Paid plan required (RFC 9457 problem-details). Observability surface kept symmetric with GET /memory-db a downgraded org's admin must not retain polling access to BYO topology."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db/events":{"get":{"tags":["agent-environment","memory-db"],"summary":"Get Memory Db Events","description":"Dump the most recent pool events for ``organization_id``.\n\nAdmin-only — events carry breaker state and probe-failure detail\nthat a non-admin member shouldn't be able to introspect (it could\nleak signal about the org's BYO health to people without\noperational responsibility, mirroring ``/stats``).\n\nEach event row carries:\n\n* ``ts`` — ISO-utc timestamp.\n* ``replica_id`` — process-stable tag for the replica that produced\n  the event. Multi-replica deployments grep by this to group events\n  from one replica's view of the world; without it, a customer\n  report of \"my pool keeps reopening\" can't be traced to a single\n  replica's breaker storm vs a multi-replica problem.\n* ``org_id`` — always equal to the path-param ``organization_id``\n  (the route filters via ``TenantStoreRegistry.get_events``).\n* ``event_type`` — one of the documented event types.\n* ``detail`` — optional event-specific context (drift fingerprint\n  diff, breaker count, exception class).\n\n``limit`` slices from the most-recent end of the buffer; capped at\n``MAX_RING_EVENTS`` so a hostile / sloppy caller can't ask for\nstate outside the ring's actual retention.\n\nLike ``/stats``, the output is PROCESS-LOCAL — querying a single\nreplica returns only that replica's view. Wire into a log\naggregator (Cloud Logging, Datadog) by polling each replica and\nde-duplicating by ``(ts, replica_id, org_id, event_type)``.","operationId":"get_memory_db_events_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_events_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Per-replica append-only ring of pool events for this org (open / close / evict / drift / breaker trip + reset / invalidate / probe failure). Process-local — polling is per-replica, same caveat as ``/stats``.","content":{"application/json":{"schema":{}}}},"402":{"description":"Paid plan required (RFC 9457 problem-details). Event ring carries probe-failure detail + breaker state — kept symmetric with ``/stats`` and ``GET /memory-db`` so a downgrade closes the whole observability surface, not just half of it."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db/migrate":{"post":{"tags":["agent-environment","memory-db"],"summary":"Migrate To Memory Db","description":"Kick off platform→BYO (or BYO→platform) migration as a background job.\n\nReturns 202 immediately; the actual copy runs in a FastAPI\nbackground task and stamps ``last_health_status`` on the\nmemory_db record when it finishes.  Operators monitor via logs\nor by polling GET /memory-db (the ``last_health_check`` /\n``last_health_status`` fields).\n\nThe cutover contract is the operator's responsibility:\n\n  1. Flip memory_enabled=False (PUT /agent/settings).\n  2. POST /memory-db/migrate.\n  3. Wait for last_health_check to update (or grep logs for the\n     \"BYO memory-db config mutation: ... action=migrate_done\" line).\n  4. Flip memory_enabled=True only if the run verified clean:\n     errors==0 AND reconciliation passed (payload digests, key\n     parity, vector coverage, counter monotonicity, redirect\n     parity; ``ok=True`` on the migrate_done log line).\n\nFor larger corpora (>10k records) prefer\n``scripts/migrate_memories_to_byo.py`` so progress lands on the\noperator's terminal rather than the server log.\n\nRe-asserts the paid-plan gate: a downgraded org must not be\nable to copy the corpus into a customer instance via this route\nafter losing the BYO entitlement. ``memory_enabled`` is NOT\nasserted here — migration deliberately requires it to be *False*\n(see ``_ensure_memory_disabled_for_migration`` below); the two\nchecks would contradict each other.","operationId":"migrate_to_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_migrate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"reverse","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Reverse"}}],"responses":{"202":{"description":"Migration kicked off as a background job.","content":{"application/json":{"schema":{}}}},"402":{"description":"Paid plan required","content":{"application/problem+json":{}}},"404":{"description":"No memory-db configured under this provider."},"409":{"description":"A migration is already in progress for this organization (rapid double-click on /migrate). Wait for the in-flight job to land its terminal log line, then retry."},"422":{"description":"memory_enabled=True (must be False during migration), or memory-db is in pending/failed state, or public_ip missing."},"429":{"description":"Per-org admin rate limit exhausted. ``Retry-After`` header carries the wait in seconds."},"502":{"description":"Cloud SQL Admin API call failed during pre-migrate TLS metadata fetch. Returns RFC 9457 problem-details.","content":{"application/problem+json":{}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db/truncate":{"post":{"tags":["agent-environment","memory-db"],"summary":"Truncate Memory Db","description":"Wipe BYO memory-DB rows for this org (admin + memory-disabled).\n\nPreconditions (all strict):\n\n  * caller is org admin/owner\n  * org has a paid plan (re-asserted: a downgrade must not be\n    able to nuke the BYO corpus from this route)\n  * per-org admin rate limit not exhausted (429 otherwise)\n  * no migration or truncate in flight (409 otherwise, deleting\n    rows a concurrent forward copy is writing, or vice versa,\n    leaves a silent partial corpus)\n  * ``memory_enabled`` is **False** (409 otherwise — the truncate\n    is non-atomic and live writes would race the delete loop)\n  * a memory-db config is registered on the named provider with\n    a resolved ``public_ip`` and ``provisioning_state == active``\n\nDefaults to ``dry_run=True`` — operators see the per-namespace\nrow counts without writes. Pass ``dry_run=False`` only after\nreviewing the dry-run output.","operationId":"truncate_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_truncate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruncateRequest"}}}},"responses":{"200":{"description":"Truncate report (counts + per-namespace status).","content":{"application/json":{"schema":{}}}},"402":{"description":"Paid plan required","content":{"application/problem+json":{}}},"404":{"description":"No memory-db configured under this provider."},"409":{"description":"memory_enabled=True — flip to False first."},"422":{"description":"memory-db not active or public_ip missing."},"429":{"description":"Per-org admin rate limit exhausted. ``Retry-After`` header carries the wait in seconds."},"502":{"description":"Cloud SQL Admin API call failed during pre-truncate TLS metadata fetch. Returns RFC 9457 problem-details.","content":{"application/problem+json":{}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/encryption":{"post":{"tags":["agent-environment","encryption"],"summary":"Register Encryption","description":"Register a per-org KMS key (BYOK T1 / T2).\n\nIdempotent re-POST of the *identical* ``key_resource`` returns\n200 with the existing record (no mutation). A different\n``key_resource`` returns 409 — use PUT to rotate.\n\nProvisioning_state starts ``pending``. The admin should follow\nup with ``POST .../test`` to verify our SA can call ``encrypt``\non the resource before relying on the BYOK config for production\nwrites (encrypt path falls back to the platform default until\nstate flips to ``active``).","operationId":"register_encryption_organizations__organization_id__environment_cloud_providers__provider_key__encryption_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigResponse"}}}},"200":{"description":"Idempotent re-POST of the same key_resource — existing record returned with no mutation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigResponse"}}}},"402":{"content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionSubscriptionRequiredProblemDetail"}}},"description":"Active paid subscription required"},"409":{"description":"Encryption already configured for this provider"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-environment","encryption"],"summary":"Get Encryption","description":"Read the current encryption config for this provider.\n\nAdmin-only (encryption registration is sensitive operational state).","operationId":"get_encryption_organizations__organization_id__environment_cloud_providers__provider_key__encryption_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigResponse"}}}},"404":{"description":"No encryption config registered"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-environment","encryption"],"summary":"Rotate Encryption","description":"Replace ``key_resource`` (rotation).\n\nExisting ciphertext stays decryptable because the LangGraph SDK\nPERSISTS ``ctx.metadata`` (including ``kms_key_resource``) at\nencrypt time and RESTORES it at decrypt time — verified in\n``langgraph_api/encryption/middleware.py:408``. So an old blob's\npersisted ctx pins the OLD KEK; decrypt later passes the OLD KEK\nto ``_kms_unwrap``, which works as long as the OLD KEK still\nexists in customer KMS. The new KEK only affects writes that\nhappen AFTER this PUT (their ctx is persisted with the new KEK).\n\nNB: this is NOT a GCP-KMS auto-routing property — KMS only\nauto-routes between VERSIONS of the same cryptoKey resource, not\nbetween different cryptoKey resources. Rotation between different\nKEKs works here entirely because of SDK ctx persistence. A future\nrefactor that \"simplifies\" by re-deriving ``kms_key_resource``\nat decrypt time from the current resolver state (instead of using\nthe persisted value) would break decrypt for all pre-rotation\nrows.\n\nResets ``provisioning_state`` to ``pending`` — the admin should\nre-run ``/test`` to verify our SA still has permission on the new\nresource. Also drops the cached active DEK under the OLD KEK so\nwe don't keep encrypting under an obsolete key while the resolver\ncache rolls over.","operationId":"rotate_encryption_organizations__organization_id__environment_cloud_providers__provider_key__encryption_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigResponse"}}}},"402":{"content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionSubscriptionRequiredProblemDetail"}}},"description":"Active paid subscription required"},"404":{"description":"No encryption config to rotate"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-environment","encryption"],"summary":"Delete Encryption","description":"Revert to the platform default KEK.\n\nExisting ciphertext written under the customer's KEK stays\ndecryptable as long as their KEK still exists in customer KMS.\nDeleting THIS config record only tells our encrypt path to stop\nusing the customer's key for FUTURE writes; it does NOT touch\nthe customer's KMS infrastructure.\n\nTo make existing ciphertext irretrievable (GDPR right-to-erasure\npath): the customer deletes/destroys their KMS key in their GCP\nproject AFTER calling DELETE here. The two-step sequence is\nintentional — accidental DELETE here doesn't lose data.\n\nSubscription-gated for parity with POST/PUT/test: an org that\ncancelled its subscription shouldn't be able to delete-then-\nreregister either. Admin-only.","operationId":"delete_encryption_organizations__organization_id__environment_cloud_providers__provider_key__encryption_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"204":{"description":"Successful Response"},"402":{"content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionSubscriptionRequiredProblemDetail"}}},"description":"Active paid subscription required"},"404":{"description":"No encryption config to delete"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/encryption/grantee":{"get":{"tags":["agent-environment","encryption"],"summary":"Get Encryption Grantee","description":"Name the account a customer grants the KMS role to.\n\nDeployment-wide, not per provider: it lives under the provider path so\nit shares the encryption routes' admin gate and proxy allowlist. It reads\nno environment and needs no config, because the admin UI shows it BEFORE\na key is registered. No plan gate either: an address is not a mutation,\nand the 402 still fires on the first write.","operationId":"get_encryption_grantee_organizations__organization_id__environment_cloud_providers__provider_key__encryption_grantee_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionGranteeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/encryption/test":{"post":{"tags":["agent-environment","encryption"],"summary":"Test Encryption","description":"Run a KMS encrypt probe against the registered KEK.\n\nVerifies that:\n1. The KEK resource exists in GCP KMS.\n2. Our platform SA has\n   ``roles/cloudkms.cryptoKeyEncrypterDecrypter`` on it.\n\nFlips ``provisioning_state`` to ``active`` on success or\n``failed`` on permission/availability errors. Stores the error\nmessage (redacted) so the UI / next admin can see why the previous\nprobe failed.\n\nSubscription-gated: a probe flipping state to ``active`` makes\nthe encryption handlers start routing the org's encrypts through\nthat KEK — so an org that cancelled its subscription running\n``/test`` would re-activate BYOK on a lapsed sub. Mirrors POST/PUT.","operationId":"test_encryption_organizations__organization_id__environment_cloud_providers__provider_key__encryption_test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestProbeResult"}}}},"402":{"content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionSubscriptionRequiredProblemDetail"}}},"description":"Active paid subscription required"},"404":{"description":"No encryption config to test"},"409":{"description":"encryption.key_resource was rotated by a concurrent PUT/DELETE between the probe and the state write. Retry /test against the new state."},"503":{"description":"Both the KMS probe and the state persistence failed. Retry — a transient state-write failure does not lose the probe outcome."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/settings/agent":{"get":{"tags":["organization-settings"],"summary":"Get Agent Settings","description":"Get agent settings for an organization.\n\nReturns default settings if not configured. User must belong to the\norganization. The response body carries a monotonic ``revision`` that a\nclient echoes back via ``If-Match`` on a subsequent write to detect a\nconcurrent edit (see ``format_agent_settings_etag`` for the token shape).","operationId":"get_agent_settings_organizations__organization_id__settings_agent_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["organization-settings"],"summary":"Update Agent Settings","description":"Update agent settings for an organization.\n\nOnly updates provided fields, preserves others. Requires admin or owner role.\n\nOptimistic concurrency: build an ``If-Match`` ETag from the ``revision`` in a\nprior GET's response body (``format_agent_settings_etag`` gives the token\nshape) and pass it here; the write is rejected with ``412 Precondition\nFailed`` (carrying the current snapshot + an ``ETag`` header) if another\nwriter changed the settings in the meantime. A missing or non-canonical\nvalidator is rejected with ``428 Precondition Required``; on lock contention\nthe write returns a retryable ``503``.","operationId":"update_agent_settings_organizations__organization_id__settings_agent_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["organization-settings"],"summary":"Reset Agent Settings","description":"Reset agent settings to defaults for an organization.\n\nRequires admin or owner role. Reset is a mutation of the same resource as\nthe PUT, so it carries the identical optimistic-concurrency contract: a\ncanonical ``If-Match`` is required (``428`` otherwise), a stale validator is\nrejected with ``412`` plus the current snapshot and ``ETag``, and contention\nreturns a retryable ``503``.\n\nThe defaults are WRITTEN as ``revision + 1`` rather than the row being\ndeleted, so an ancient validator can never become valid again. The response\nhas no body (``204``), but it carries the new ``ETag`` so the client can\nkeep writing without a re-read.","operationId":"reset_agent_settings_organizations__organization_id__settings_agent_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/settings/agent/deny-list":{"get":{"tags":["organization-settings"],"summary":"Get Deny List","description":"Get the command deny list for an organization.\n\nReturns the current deny list (or defaults if not configured), the settings\n``revision`` it belongs to, and the matching ``ETag`` — an editor echoes\nthat token back via ``If-Match`` so its full replacement cannot silently\nerase a concurrent guardrail change.","operationId":"get_deny_list_organizations__organization_id__settings_agent_deny_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["organization-settings"],"summary":"Update Deny List","description":"Replace the command deny list for an organization.\n\nRequires admin or owner role. The entire deny list is replaced (not merged),\nso this is exactly the mutation that loses a concurrent editor's guardrail:\na canonical ``If-Match`` from the prior GET is required (``428`` otherwise)\nand a stale one is rejected with ``412`` plus the current snapshot and\n``ETag``. The deny list is a projection of the org's agent settings, so the\nvalidator, the conflict payload and the revision line are the settings ones.","operationId":"update_deny_list_organizations__organization_id__settings_agent_deny_list_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DenyListUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/settings/agent/deny-list/reset":{"post":{"tags":["organization-settings"],"summary":"Reset Deny List","description":"Reset the org-level command deny list to built-in defaults (general patterns).\n\nResets only the org-level deny list (general patterns like rm, chmod, dd).\nProvider-level and cluster-level deny lists are managed via the environment API.\nRequires admin or owner role.\n\nA reset discards every org-authored guardrail, so it carries the same\noptimistic-concurrency contract as the deny-list PUT: canonical ``If-Match``\nrequired (``428``), stale validator rejected with ``412`` plus the current\nsnapshot and ``ETag``, contention returns a retryable ``503``.","operationId":"reset_deny_list_organizations__organization_id__settings_agent_deny_list_reset_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/domains":{"get":{"tags":["domains"],"summary":"List Domains","description":"List all domains (built-in + custom) for an organization.","operationId":"list_domains_organizations__organization_id__domains_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DomainResponse"},"title":"Response List Domains Organizations  Organization Id  Domains Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["domains"],"summary":"Create Domain","description":"Create a custom memory domain for an organization.","operationId":"create_domain_organizations__organization_id__domains_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/domains/metadata":{"get":{"tags":["domains"],"summary":"Get Domain Metadata","description":"Return available orchestration graphs and executor types.","operationId":"get_domain_metadata_organizations__organization_id__domains_metadata_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainMetadataResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/domains/{name}":{"get":{"tags":["domains"],"summary":"Get Domain","description":"Get a single domain by name.","operationId":"get_domain_organizations__organization_id__domains__name__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["domains"],"summary":"Update Domain","description":"Update a custom domain (built-in domains cannot be modified).","operationId":"update_domain_organizations__organization_id__domains__name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["domains"],"summary":"Delete Domain","description":"Delete a custom domain (built-in domains cannot be deleted).\n\nBlocked if any custom profile references this domain as its base_domain.","operationId":"delete_domain_organizations__organization_id__domains__name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/defaults":{"get":{"tags":["profiles"],"summary":"Get Profile Defaults","description":"Return current platform defaults for profile prompt fields.\n\nThe frontend calls this to pre-fill the creation form without baking\ndefaults into the stored profile config (which would prevent future\ndefault evolution).","operationId":"get_profile_defaults_organizations__organization_id__profiles_defaults_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileDefaultsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles":{"get":{"tags":["profiles"],"summary":"List Profiles","description":"List all profiles (built-in + custom) for an organization.","operationId":"list_profiles_organizations__organization_id__profiles_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProfileResponse"},"title":"Response List Profiles Organizations  Organization Id  Profiles Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["profiles"],"summary":"Create Profile","description":"Create a custom profile for an organization.","operationId":"create_profile_organizations__organization_id__profiles_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{name}":{"get":{"tags":["profiles"],"summary":"Get Profile Endpoint","description":"Get a single profile by name.","operationId":"get_profile_endpoint_organizations__organization_id__profiles__name__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["profiles"],"summary":"Update Profile","description":"Update a custom profile (built-in profiles cannot be modified).\n\nAccepts ``PUT`` and ``PATCH`` on the same handler: the update is already\na partial merge (``model_dump(exclude_unset=True)`` below sends only the\nfields the caller set), so ``PATCH`` is the REST-correct verb and ``PUT``\nis kept for back-compat. Per-section editor saves PATCH only their own\nfields, so concurrent edits to other sections are not clobbered.","operationId":"update_profile_organizations__organization_id__profiles__name__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["profiles"],"summary":"Update Profile","description":"Update a custom profile (built-in profiles cannot be modified).\n\nAccepts ``PUT`` and ``PATCH`` on the same handler: the update is already\na partial merge (``model_dump(exclude_unset=True)`` below sends only the\nfields the caller set), so ``PATCH`` is the REST-correct verb and ``PUT``\nis kept for back-compat. Per-section editor saves PATCH only their own\nfields, so concurrent edits to other sections are not clobbered.","operationId":"update_profile_organizations__organization_id__profiles__name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["profiles"],"summary":"Delete Profile","description":"Delete a custom profile (built-in profiles cannot be deleted).","operationId":"delete_profile_organizations__organization_id__profiles__name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics":{"get":{"tags":["rubrics"],"summary":"List Rubrics","description":"List every rubric persisted for the org.\n\nAdmin-only — rubrics encode ICP/scoring rules customers may\nconsider sensitive.","operationId":"list_rubrics_organizations__organization_id__rubrics_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rubrics"],"summary":"Create Rubric","description":"Create a new rubric (or overwrite an existing one with the same id).\n\nPer the \"customer edits win\" + \"in-place mutation\" choices, this\nendpoint does NOT 409 on existing — POSTing the same ``rubric_id``\ntwice is well-defined behavior (the second wins). To prevent\naccidental overwrite the UI can read first and confirm.","operationId":"create_rubric_organizations__organization_id__rubrics_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rubric"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}":{"get":{"tags":["rubrics"],"summary":"Get Rubric","description":"Read one rubric by id.\n\nReturns 404 if the row doesn't exist (no auto-seed at the API\nlayer — that only happens during a DR run via ``_load_rubric``).","operationId":"get_rubric_organizations__organization_id__rubrics__rubric_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["rubrics"],"summary":"Replace Rubric","description":"Full replace of an existing rubric (PUT).\n\nReturns:\n    - 422 if the path ``rubric_id`` doesn't match body's ``rubric_id`` —\n      refusing to silently rewrite the path prevents typos that would\n      otherwise create a new row under a different id.\n    - 404 if the rubric doesn't exist — PUT is \"replace existing\", not\n      \"upsert\" (use POST for create-or-replace). M-2 fix: previously\n      this silently created the row, making PUT and POST identical\n      and contradicting the docstring's \"Full replace of an existing\n      rubric\" claim.\n\nRace note (Adversarial-pass-2 M-D): the existence check and the\nwrite are non-atomic. Between the ``get_rubric`` pre-check and the\n``replace_rubric`` write, a concurrent DELETE can land — in which\ncase the PUT will recreate the just-deleted row. Acceptable\ntrade-off vs the prior silent-upsert behavior; clients with strict\n\"must already exist\" needs need to either retry-on-404 after the\nresponse or wait for ``Rubric.version`` CAS support (see\n``rubric_store.py`` module docstring — not yet implemented).","operationId":"replace_rubric_organizations__organization_id__rubrics__rubric_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rubric"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rubrics"],"summary":"Delete Rubric","description":"Delete a rubric.\n\nAfter delete, the next DR run with ``rubric_id`` auto-seeds from\nthe platform's starter factory (if one is registered for that id).\nThis is the documented \"reset to factory default\" UX.\n\nReturns 204 on success, 404 if the row didn't exist.","operationId":"delete_rubric_organizations__organization_id__rubrics__rubric_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/patterns":{"post":{"tags":["rubrics"],"summary":"Upsert Pattern","description":"Add a new disqualifier pattern (or replace by ``Pattern.name``).\n\nSub-resource POST returns 200 + the full updated rubric (rather\nthan 201) so the UI can re-render the whole rubric without a\nfollow-up GET.","operationId":"upsert_pattern_organizations__organization_id__rubrics__rubric_id__patterns_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pattern"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/patterns/{pattern_name}":{"put":{"tags":["rubrics"],"summary":"Replace Pattern","description":"Replace one pattern by name. Body's ``name`` MUST match the path.\n\nRefusing the rename here keeps the URL stable — to rename a\npattern, the client deletes the old one and POSTs the new one.","operationId":"replace_pattern_organizations__organization_id__rubrics__rubric_id__patterns__pattern_name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"pattern_name","in":"path","required":true,"schema":{"type":"string","title":"Pattern Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pattern"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rubrics"],"summary":"Delete Pattern","description":"Remove one pattern by name.\n\nReturns the full updated rubric so the UI can re-render after\ndeletion. Idempotent: deleting a pattern that's already gone\nsucceeds silently (the rubric is still returned unchanged) — the\nclient's intent (\"this pattern should not exist\") is satisfied\neither way.","operationId":"delete_pattern_organizations__organization_id__rubrics__rubric_id__patterns__pattern_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"pattern_name","in":"path","required":true,"schema":{"type":"string","title":"Pattern Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/factors":{"post":{"tags":["rubrics"],"summary":"Upsert Factor","description":"Add a new ranking factor (or replace by ``RankingFactor.name``).","operationId":"upsert_factor_organizations__organization_id__rubrics__rubric_id__factors_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankingFactor"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/factors/{factor_name}":{"put":{"tags":["rubrics"],"summary":"Replace Factor","description":"Replace one factor by name. Body's ``name`` MUST match the path.","operationId":"replace_factor_organizations__organization_id__rubrics__rubric_id__factors__factor_name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"factor_name","in":"path","required":true,"schema":{"type":"string","title":"Factor Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankingFactor"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rubrics"],"summary":"Delete Factor","description":"Remove one factor by name (idempotent on missing).","operationId":"delete_factor_organizations__organization_id__rubrics__rubric_id__factors__factor_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"factor_name","in":"path","required":true,"schema":{"type":"string","title":"Factor Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/disqualifiers":{"patch":{"tags":["rubrics"],"summary":"Patch Disqualifiers Metadata","description":"Update top-level ``Disqualifiers`` metadata.\n\nOnly updates fields that the body sets non-``None``; the patterns\nlist is untouched. Use the patterns sub-resource to edit individual\nrules.","operationId":"patch_disqualifiers_metadata_organizations__organization_id__rubrics__rubric_id__disqualifiers_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DisqualifiersMetadataPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/scoring":{"patch":{"tags":["rubrics"],"summary":"Patch Scoring Metadata","description":"Update top-level ``Scoring`` metadata.\n\nOnly updates fields that the body sets non-``None``; the factors\nlist is untouched.","operationId":"patch_scoring_metadata_organizations__organization_id__rubrics__rubric_id__scoring_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ScoringMetadataPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/output":{"put":{"tags":["rubrics"],"summary":"Replace Output","description":"Full replace of the ``Output`` sub-pack (template + metadata).\n\nOutput has no nested sub-resources, so a full PUT is the right\ngranularity.","operationId":"replace_output_organizations__organization_id__rubrics__rubric_id__output_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Output"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/test":{"post":{"tags":["rubrics"],"summary":"Start Rubric Test","description":"Run authored scenarios through this rubric and grade the outcomes.\n\nEach scenario is one full evaluation run on the normal metered run\npath, so the batch size is capped. Execution is asynchronous; poll\nthe returned test via ``GET .../test/{test_id}``.","operationId":"start_rubric_test_organizations__organization_id__rubrics__rubric_id__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricTestRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricTestStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/replay":{"post":{"tags":["rubrics"],"summary":"Replay Rubric Cases","description":"Re-evaluate captured real cases against the current rubric (item 4b).\n\nSamples captured run inputs by outcome diversity and re-runs them as\nscenarios expecting the ORIGINAL outcome, so a failed final_status\ncheck means the edited rubric changed the verdict for that case.\nEach sampled case is a full evaluation run; the sample size is\ndeliberately small. Requires opt-in input capture\n(``dr_input_capture_enabled`` in agent settings) with accumulated runs.","operationId":"replay_rubric_cases_organizations__organization_id__rubrics__rubric_id__replay_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ReplayRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricTestStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/test/{test_id}":{"get":{"tags":["rubrics"],"summary":"Get Rubric Test","description":"Read one test run's status and (when done) graded results.\n\nA run that stopped reporting (replica restart mid-run) is surfaced\nas ``lost`` once it exceeds twice the per-scenario timeout, so\nclients never poll a zombie forever.","operationId":"get_rubric_test_organizations__organization_id__rubrics__rubric_id__test__test_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Rubric Test Organizations  Organization Id  Rubrics  Rubric Id  Test  Test Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/drafts":{"get":{"tags":["rubrics"],"summary":"List Rubric Drafts","description":"List staged induction drafts (admin).\n\nDrafts exist only for the playbook-gate rubric today; the listing\nfilters by the path's rubric_id so the route stays honest if that\never widens.","operationId":"list_rubric_drafts_organizations__organization_id__rubrics__rubric_id__drafts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"include_resolved","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Resolved"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DraftListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/drafts/{draft_key}":{"get":{"tags":["rubrics"],"summary":"Get Rubric Draft","description":"One staged draft with its full patch (admin).","operationId":"get_rubric_draft_organizations__organization_id__rubrics__rubric_id__drafts__draft_key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"draft_key","in":"path","required":true,"schema":{"type":"string","title":"Draft Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DraftDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/drafts/induce":{"post":{"tags":["rubrics"],"summary":"Induce Rubric Draft","description":"Run induction and stage a draft (admin; metered as Rubric induction).\n\nNever touches the active rubric. 409 for any rubric other than the\nplaybook gate: the harvest source is gate adjudications, so inducing\n\"for\" another rubric would silently produce gate content.","operationId":"induce_rubric_draft_organizations__organization_id__rubrics__rubric_id__drafts_induce_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/_DraftInduceRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DraftInduceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/drafts/{draft_key}/apply":{"post":{"tags":["rubrics"],"summary":"Apply Rubric Draft","description":"Promote SELECTED names from a staged draft into the active rubric.\n\nThe commit contract: names must reference the persisted draft;\n404 unknown draft, 409 already resolved, 422 unknown names or an\nempty selection.","operationId":"apply_rubric_draft_organizations__organization_id__rubrics__rubric_id__drafts__draft_key__apply_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"draft_key","in":"path","required":true,"schema":{"type":"string","title":"Draft Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DraftApplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DraftApplyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/drafts/{draft_key}/dismiss":{"post":{"tags":["rubrics"],"summary":"Dismiss Rubric Draft","description":"Retire a staged draft without applying it (admin).\n\n404 unknown draft, 409 already resolved.","operationId":"dismiss_rubric_draft_organizations__organization_id__rubrics__rubric_id__drafts__draft_key__dismiss_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"draft_key","in":"path","required":true,"schema":{"type":"string","title":"Draft Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Dismiss Rubric Draft Organizations  Organization Id  Rubrics  Rubric Id  Drafts  Draft Key  Dismiss Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/config":{"get":{"tags":["reconciliation"],"summary":"Get Config","description":"Read the current configuration and its public revision.","operationId":"get_config_organizations__organization_id__reconciliation_config_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["reconciliation"],"summary":"Replace Config","description":"Replace configuration only when the supplied revision is current.","operationId":"replace_config_organizations__organization_id__reconciliation_config_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["reconciliation"],"summary":"Delete Config","description":"Tombstone configuration and retain the revision for future recreation.","operationId":"delete_config_organizations__organization_id__reconciliation_config_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"expected_revision","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Expected Revision"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/config/record-types/{name}":{"put":{"tags":["reconciliation"],"summary":"Put Record Type","description":"Replace one record type without overwriting concurrent configuration edits.","operationId":"put_record_type_organizations__organization_id__reconciliation_config_record_types__name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RecordTypeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/config/sources/{label}":{"put":{"tags":["reconciliation"],"summary":"Put Source","description":"Replace one registered source using the current configuration revision.","operationId":"put_source_organizations__organization_id__reconciliation_config_sources__label__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"label","in":"path","required":true,"schema":{"type":"string","title":"Label"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SourceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/config/record-types/{record_type}/fields/{predicate}":{"put":{"tags":["reconciliation"],"summary":"Put Field Rule","description":"Replace a field rule after validating its address and edit precondition.","operationId":"put_field_rule_organizations__organization_id__reconciliation_config_record_types__record_type__fields__predicate__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"record_type","in":"path","required":true,"schema":{"type":"string","title":"Record Type"}},{"name":"predicate","in":"path","required":true,"schema":{"type":"string","title":"Predicate"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_FieldRuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/config/record-types/{record_type}/fields/{predicate}/preview":{"post":{"tags":["reconciliation"],"summary":"Preview Field Rule Settlement","description":"Report which open conflicts a candidate rule would settle, writing nothing.","operationId":"preview_field_rule_settlement_organizations__organization_id__reconciliation_config_record_types__record_type__fields__predicate__preview_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"record_type","in":"path","required":true,"schema":{"type":"string","title":"Record Type"}},{"name":"predicate","in":"path","required":true,"schema":{"type":"string","title":"Predicate"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_FieldRuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Field Rule Settlement Organizations  Organization Id  Reconciliation Config Record Types  Record Type  Fields  Predicate  Preview Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/materials":{"post":{"tags":["reconciliation"],"summary":"Create Material","description":"Durably admit original evidence before starting metered field extraction.","operationId":"create_material_organizations__organization_id__reconciliation_materials_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__resources__reconciliation___MaterialRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Material Organizations  Organization Id  Reconciliation Materials Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["reconciliation"],"summary":"List Materials","description":"List bounded extraction status summaries without exposing original payloads.","operationId":"list_materials_organizations__organization_id__reconciliation_materials_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Materials Organizations  Organization Id  Reconciliation Materials Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/materials/{extraction_id}":{"get":{"tags":["reconciliation"],"summary":"Get Material","description":"Show extraction, review and record-application progress separately.","operationId":"get_material_organizations__organization_id__reconciliation_materials__extraction_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"extraction_id","in":"path","required":true,"schema":{"type":"string","title":"Extraction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Material Organizations  Organization Id  Reconciliation Materials  Extraction Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/materials/{extraction_id}/retry":{"post":{"tags":["reconciliation"],"summary":"Retry Material","description":"Resume durable output or explicitly admit a new immutable extraction revision.","operationId":"retry_material_organizations__organization_id__reconciliation_materials__extraction_id__retry_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"extraction_id","in":"path","required":true,"schema":{"type":"string","title":"Extraction Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/_MaterialRetryRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Retry Material Organizations  Organization Id  Reconciliation Materials  Extraction Id  Retry Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/materials/{extraction_id}/original":{"get":{"tags":["reconciliation"],"summary":"Get Material Original","description":"Serve exact original bytes after current access and source lifecycle checks.","operationId":"get_material_original_organizations__organization_id__reconciliation_materials__extraction_id__original_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"extraction_id","in":"path","required":true,"schema":{"type":"string","title":"Extraction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/report":{"get":{"tags":["reconciliation"],"summary":"Get Report","description":"Return current source-pair reconciliation counts and completeness.","operationId":"get_report_organizations__organization_id__reconciliation_report_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Report Organizations  Organization Id  Reconciliation Report Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/report/{left}/{right}":{"get":{"tags":["reconciliation"],"summary":"Get Pair Report","description":"Page one source-pair section with pending and truncation indicators.","operationId":"get_pair_report_organizations__organization_id__reconciliation_report__left___right__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"left","in":"path","required":true,"schema":{"type":"string","title":"Left"}},{"name":"right","in":"path","required":true,"schema":{"type":"string","title":"Right"}},{"name":"record_type","in":"query","required":true,"schema":{"type":"string","title":"Record Type"}},{"name":"section","in":"query","required":false,"schema":{"type":"string","default":"conflicting","title":"Section"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Pair Report Organizations  Organization Id  Reconciliation Report  Left   Right  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/adjudicate":{"post":{"tags":["reconciliation"],"summary":"Adjudicate","description":"Queue or run residual source adjudication under the shared dream lease.","operationId":"adjudicate_organizations__organization_id__reconciliation_adjudicate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Adjudicate Organizations  Organization Id  Reconciliation Adjudicate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/runs":{"get":{"tags":["reconciliation"],"summary":"List Runs","description":"List bounded operational summaries without raw verification payloads.","operationId":"list_runs_organizations__organization_id__reconciliation_runs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(resolve|extract|pull|adjudicate|writeback)$"},{"type":"null"}],"title":"Kind"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Runs Organizations  Organization Id  Reconciliation Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/discover-sources":{"get":{"tags":["reconciliation"],"summary":"Discover Sources","description":"List connected servers and the read-only tools a source could pull from.","operationId":"discover_sources_organizations__organization_id__reconciliation_discover_sources_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Discover Sources Organizations  Organization Id  Reconciliation Discover Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/discover-sources/probe":{"post":{"tags":["reconciliation"],"summary":"Start Source Probe","description":"Durably admit a probe before calling the connector.\n\nReturned as 202 and polled rather than answered inline: a probe calls a\ncustomer system, and the dashboard proxy gives up on a request long before\na slow connector does.","operationId":"start_source_probe_organizations__organization_id__reconciliation_discover_sources_probe_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ProbeRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Start Source Probe Organizations  Organization Id  Reconciliation Discover Sources Probe Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/discover-sources/probes":{"get":{"tags":["reconciliation"],"summary":"List Source Probes","description":"List recent probes, newest first.","operationId":"list_source_probes_organizations__organization_id__reconciliation_discover_sources_probes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Source Probes Organizations  Organization Id  Reconciliation Discover Sources Probes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/discover-sources/probes/{probe_id}":{"get":{"tags":["reconciliation"],"summary":"Get Source Probe","description":"Report one probe's progress and its proposed mapping.","operationId":"get_source_probe_organizations__organization_id__reconciliation_discover_sources_probes__probe_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"probe_id","in":"path","required":true,"schema":{"type":"string","title":"Probe Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Source Probe Organizations  Organization Id  Reconciliation Discover Sources Probes  Probe Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/discover-sources/probes/{probe_id}/commit":{"post":{"tags":["reconciliation"],"summary":"Commit Source Probe","description":"Write reviewed fields from one probe into the configuration.\n\nAccepts indices into the probe's persisted mapping and a narrow edit model,\nnever a mapping body: the proposal is the contract, so nothing can be\ncommitted that the source did not actually return.","operationId":"commit_source_probe_organizations__organization_id__reconciliation_discover_sources_probes__probe_id__commit_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"probe_id","in":"path","required":true,"schema":{"type":"string","title":"Probe Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DiscoveryCommitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/pulls/run":{"post":{"tags":["reconciliation"],"summary":"Run Pull","description":"Queue a configured pull under the current administrator's identity.","operationId":"run_pull_organizations__organization_id__reconciliation_pulls_run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PullRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Pull Organizations  Organization Id  Reconciliation Pulls Run Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/pulls/schedule":{"put":{"tags":["reconciliation"],"summary":"Set Pull Schedule","description":"Replace or disable this source/type schedule after current tool validation.","operationId":"set_pull_schedule_organizations__organization_id__reconciliation_pulls_schedule_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PullScheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Pull Schedule Organizations  Organization Id  Reconciliation Pulls Schedule Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["reconciliation"],"summary":"Get Pull Schedules","description":"Return schedule addresses without authentication or connector payloads.","operationId":"get_pull_schedules_organizations__organization_id__reconciliation_pulls_schedule_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Pull Schedules Organizations  Organization Id  Reconciliation Pulls Schedule Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/write-back/plan":{"post":{"tags":["reconciliation"],"summary":"Plan Writebacks","description":"Return server-generated operation ids and verified plan digests.","operationId":"plan_writebacks_organizations__organization_id__reconciliation_write_back_plan_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_WriteBackPlanRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Plan Writebacks Organizations  Organization Id  Reconciliation Write Back Plan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/write-back/run":{"post":{"tags":["reconciliation"],"summary":"Run Writebacks","description":"Queue only explicit saved operation ids from this organization.","operationId":"run_writebacks_organizations__organization_id__reconciliation_write_back_run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_WriteBackRunRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Writebacks Organizations  Organization Id  Reconciliation Write Back Run Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/write-back/operations/{op_id}/settle":{"post":{"tags":["reconciliation"],"summary":"Settle Writeback","description":"Record an explicit local ruling for an uncertain source update.","operationId":"settle_writeback_organizations__organization_id__reconciliation_write_back_operations__op_id__settle_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"op_id","in":"path","required":true,"schema":{"type":"string","title":"Op Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SettlementRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Settle Writeback Organizations  Organization Id  Reconciliation Write Back Operations  Op Id  Settle Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/reconciliation/write-back/recover":{"post":{"tags":["reconciliation"],"summary":"Recover Writebacks","description":"Replay verified local application debt without issuing remote writes.","operationId":"recover_writebacks_organizations__organization_id__reconciliation_write_back_recover_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RecoveryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Recover Writebacks Organizations  Organization Id  Reconciliation Write Back Recover Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/activity":{"get":{"tags":["private-mailbox","private-mailbox-activity"],"summary":"Personal Activity","description":"Read bounded aggregates with fresh membership before and after the read.","operationId":"personal_activity_organizations__organization_id__mailboxes__connection_id__activity_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalActivity"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/sources/events":{"get":{"tags":["private-mailbox","mailbox-source-events"],"summary":"Source Events","description":"Page admitted source investigations, silently omitting inaccessible rows.","operationId":"source_events_organizations__organization_id__mailboxes_sources_events_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64,"pattern":"^[0-9a-f]{64}$"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceEventPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/sources/health":{"get":{"tags":["private-mailbox","mailbox-source-health"],"summary":"Source Health","description":"Return only source connection labels, availability and hourly counters.","operationId":"source_health_organizations__organization_id__mailboxes_sources_health_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SourceHealthView"},"title":"Response Source Health Organizations  Organization Id  Mailboxes Sources Health Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/imap-sender-trust":{"get":{"tags":["private-mailbox"],"summary":"Get Imap Sender Trust","description":"Read choices without exposing another owner's connection or settings.","operationId":"get_imap_sender_trust_organizations__organization_id__mailboxes__connection_id__imap_sender_trust_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImapTrustView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["private-mailbox"],"summary":"Set Imap Sender Trust","description":"Commit a CAS winner and finish its recoverable revocations before success.","operationId":"set_imap_sender_trust_organizations__organization_id__mailboxes__connection_id__imap_sender_trust_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImapTrustUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImapTrustView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/sources/onboarding":{"post":{"tags":["private-mailbox","mailbox-sources"],"summary":"Begin Source","description":"Create disabled source purpose and owner intent in one storage transaction.","operationId":"begin_source_organizations__organization_id__mailboxes_sources_onboarding_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SourceConnect"},{"$ref":"#/components/schemas/DestinationConnect"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingIntent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/sources":{"get":{"tags":["private-mailbox","mailbox-sources"],"summary":"List Sources","description":"List only this administrator's source connections.","operationId":"list_sources_organizations__organization_id__mailboxes_sources_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SourceView"},"title":"Response List Sources Organizations  Organization Id  Mailboxes Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/sources/connections":{"get":{"tags":["private-mailbox","mailbox-sources"],"summary":"Source Connections","description":"Let active owners discover lifecycle controls after administrator demotion.","operationId":"source_connections_organizations__organization_id__mailboxes_sources_connections_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SourceConnection"},"title":"Response Source Connections Organizations  Organization Id  Mailboxes Sources Connections Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/sources/destinations":{"get":{"tags":["private-mailbox","mailbox-sources"],"summary":"Destination Catalog","description":"Let a current administrator discover modules before any source exists.","operationId":"destination_catalog_organizations__organization_id__mailboxes_sources_destinations_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DestinationCatalogEntry"},"title":"Response Destination Catalog Organizations  Organization Id  Mailboxes Sources Destinations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/sources/{connection_id}":{"get":{"tags":["private-mailbox","mailbox-sources"],"summary":"Get Source","description":"Return the source's current choices and fixed blocking state.","operationId":"get_source_organizations__organization_id__mailboxes_sources__connection_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["private-mailbox","mailbox-sources"],"summary":"Replace Source","description":"Update a source with CAS; every accepted edit gets a new receipt cutoff.","operationId":"replace_source_organizations__organization_id__mailboxes_sources__connection_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SourceReplace"},{"$ref":"#/components/schemas/DestinationReplace"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/sources/{connection_id}/reconnect":{"post":{"tags":["private-mailbox","mailbox-sources"],"summary":"Reconnect Source","description":"Use ordinary owner credentials while retaining source purpose.","operationId":"reconnect_source_organizations__organization_id__mailboxes_sources__connection_id__reconnect_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceReconnect"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingIntent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/onboarding":{"post":{"tags":["private-mailbox"],"summary":"Begin Onboarding","description":"Record a bounded, retryable owner request before the provider handoff.","operationId":"begin_onboarding_organizations__organization_id__mailboxes_onboarding_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingIntent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/onboarding/{intent_id}/cancel":{"post":{"tags":["private-mailbox"],"summary":"Cancel Onboarding","description":"Invalidate a pending callback using authenticated owner authority.","operationId":"cancel_onboarding_organizations__organization_id__mailboxes_onboarding__intent_id__cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"intent_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Intent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingIntent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/onboarding/{intent_id}/authorize":{"post":{"tags":["private-mailbox"],"summary":"Authorize Onboarding","description":"Give the owner a one-use RO form handoff; credentials remain server-side.","operationId":"authorize_onboarding_organizations__organization_id__mailboxes_onboarding__intent_id__authorize_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"intent_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Intent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Authorize Onboarding Organizations  Organization Id  Mailboxes Onboarding  Intent Id  Authorize Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/admission":{"get":{"tags":["private-mailbox"],"summary":"Admission","description":"Tell a member whether Connect is available, so a client can hide it.\n\nListing, disconnect and erasure never depend on this: an organization\nthat loses admission can still revoke and erase what it connected.","operationId":"admission_organizations__organization_id__mailboxes_admission_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Admission"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes":{"get":{"tags":["private-mailbox"],"summary":"List Connections","description":"List the caller's own connections; other members' never appear.","operationId":"list_connections_organizations__organization_id__mailboxes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MailboxGrant"},"title":"Response List Connections Organizations  Organization Id  Mailboxes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/connections":{"get":{"tags":["private-mailbox"],"summary":"Connection Views","description":"List the owner's connection labels and dates, including legacy null values.","operationId":"connection_views_organizations__organization_id__mailboxes_connections_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PrivateConnectionView"},"title":"Response Connection Views Organizations  Organization Id  Mailboxes Connections Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/admin-consent":{"get":{"tags":["private-mailbox"],"summary":"Admin Consent","description":"Return Microsoft's admin-consent link to an admitted current member.","operationId":"admin_consent_organizations__organization_id__mailboxes_admin_consent_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Admin Consent Organizations  Organization Id  Mailboxes Admin Consent Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/health":{"get":{"tags":["private-mailbox"],"summary":"Connection Health","description":"Show provider health to the current owner, also after admission is lost.","operationId":"connection_health_organizations__organization_id__mailboxes__connection_id__health_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/folders":{"get":{"tags":["private-mailbox"],"summary":"Folder View","description":"Show discovered provider folders and the owner's current custom roots.","operationId":"folder_view_organizations__organization_id__mailboxes__connection_id__folders_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["private-mailbox"],"summary":"Select Folders","description":"Replace custom roots under compare-and-swap; RO rescans on its next pass.","operationId":"select_folders_organizations__organization_id__mailboxes__connection_id__folders_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderSelectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderSelection"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/exclusions":{"get":{"tags":["private-mailbox"],"summary":"Get Exclusions","description":"Read an active owner's sender list even when ingestion admission is off.","operationId":"get_exclusions_organizations__organization_id__mailboxes__connection_id__exclusions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderExclusions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["private-mailbox"],"summary":"Replace Exclusions","description":"Replace sender exclusions; RO retains original mail until mailbox erasure.","operationId":"replace_exclusions_organizations__organization_id__mailboxes__connection_id__exclusions_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExclusionsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderExclusions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}":{"get":{"tags":["private-mailbox"],"summary":"Connection Status","description":"Read the owner's current connection state, including a revoked connection.","operationId":"connection_status_organizations__organization_id__mailboxes__connection_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxGrant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/evidence/{evidence_id}":{"get":{"tags":["private-mailbox"],"summary":"Citation","description":"Reauthorize a citation; an old ID never acts as a public download token.","operationId":"citation_organizations__organization_id__mailboxes__connection_id__evidence__evidence_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}},{"name":"evidence_id","in":"path","required":true,"schema":{"type":"string","title":"Evidence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishedEvidence"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/jobs/{operation_id}":{"get":{"tags":["private-mailbox"],"summary":"Job Status","description":"Read content-free processing diagnostics under the same owner boundary.","operationId":"job_status_organizations__organization_id__mailboxes__connection_id__jobs__operation_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}},{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessingJob"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/disconnect":{"post":{"tags":["private-mailbox"],"summary":"Disconnect","description":"Revoke private reads and fence processing before responding.","operationId":"disconnect_organizations__organization_id__mailboxes__connection_id__disconnect_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxGrant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/erasure":{"post":{"tags":["private-mailbox"],"summary":"Begin Erasure","description":"Revoke access and durably request cleanup; the same request is retryable.","operationId":"begin_erasure_organizations__organization_id__mailboxes__connection_id__erasure_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErasureReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["private-mailbox"],"summary":"Erasure Status","description":"Report active-store cleanup without claiming backup deletion.","operationId":"erasure_status_organizations__organization_id__mailboxes__connection_id__erasure_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErasureReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/crm-sharing":{"get":{"tags":["private-mailbox"],"summary":"Get Crm Sharing","description":"Read only the current owner's choices; internal epochs stay private.","operationId":"get_crm_sharing_organizations__organization_id__mailboxes__connection_id__crm_sharing_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSharingView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["private-mailbox"],"summary":"Set Crm Sharing","description":"Commit a CAS winner and finish external revocation before returning success.","operationId":"set_crm_sharing_organizations__organization_id__mailboxes__connection_id__crm_sharing_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSharingUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSharingView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/rules/jobs":{"get":{"tags":["private-mailbox"],"summary":"Rule Jobs","description":"Show waiting, uncertain and finished jobs only in the owner's mailbox dialog.","operationId":"rule_jobs_organizations__organization_id__mailboxes__connection_id__rules_jobs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/rules":{"get":{"tags":["private-mailbox"],"summary":"List Rules","description":"Read private rules and the owner's global daily allowance.","operationId":"list_rules_organizations__organization_id__mailboxes__connection_id__rules_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/rules/{rule_id}":{"put":{"tags":["private-mailbox"],"summary":"Save Rule","description":"Create with revision zero or replace exactly the owner's current revision.","operationId":"save_rule_organizations__organization_id__mailboxes__connection_id__rules__rule_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredRule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["private-mailbox"],"summary":"Delete Rule","description":"Tombstone one CAS revision and complete its external revocation before success.","operationId":"delete_rule_organizations__organization_id__mailboxes__connection_id__rules__rule_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRule"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredRule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/rule-notifications":{"get":{"tags":["private-mailbox"],"summary":"Notifications","description":"Read an owner-only activity page with its exact unread count.","operationId":"notifications_organizations__organization_id__mailboxes__connection_id__rule_notifications_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unread Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoticePage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/rule-notifications/{notification_id}":{"get":{"tags":["private-mailbox"],"summary":"Notification","description":"Read a retained notification without changing its read state.","operationId":"notification_organizations__organization_id__mailboxes__connection_id__rule_notifications__notification_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}},{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoticeView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mailboxes/{connection_id}/rule-notifications/{notification_id}/read":{"post":{"tags":["private-mailbox"],"summary":"Read Notification","description":"Mark one retained owner notification read, preserving the first read time.","operationId":"read_notification_organizations__organization_id__mailboxes__connection_id__rule_notifications__notification_id__read_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512,"title":"Connection Id"}},{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoticeView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mailboxes/onboarding/cancel":{"post":{"tags":["private-mailbox-service"],"summary":"Cancel Onboarding","description":"Fence a callback after RO cancels, including retries after cancellation.","operationId":"cancel_onboarding_internal_mailboxes_onboarding_cancel_post","parameters":[{"name":"x-mailbox-service-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Mailbox-Service-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelIntentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingIntent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mailboxes/erasure/advance":{"post":{"tags":["private-mailbox-service"],"summary":"Advance Erasure","description":"Purge revoked content even after the owner has left the organization.","operationId":"advance_erasure_internal_mailboxes_erasure_advance_post","parameters":[{"name":"x-mailbox-service-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Mailbox-Service-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceErasureProgress"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErasureReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mailboxes/onboarding/resolve":{"post":{"tags":["private-mailbox-service"],"summary":"Resolve Onboarding","description":"Resolve owner intent for RO; an intent ID alone is never a bearer grant.","operationId":"resolve_onboarding_internal_mailboxes_onboarding_resolve_post","parameters":[{"name":"x-mailbox-service-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Mailbox-Service-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingIntent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mailboxes/onboarding/complete":{"post":{"tags":["private-mailbox-service"],"summary":"Complete Onboarding","description":"Consume owner intent atomically after RO verifies the provider account.","operationId":"complete_onboarding_internal_mailboxes_onboarding_complete_post","parameters":[{"name":"x-mailbox-service-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Mailbox-Service-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteIntentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxGrant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mailboxes/grant":{"post":{"tags":["private-mailbox-service"],"summary":"Grant","description":"Return authority for ingestion or cleanup, without authorizing content reads.","operationId":"grant_internal_mailboxes_grant_post","parameters":[{"name":"x-mailbox-service-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Mailbox-Service-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxGrant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mailboxes/folders":{"post":{"tags":["private-mailbox-service"],"summary":"Folder Selection","description":"Give RO the owner's current custom roots for an active, admitted grant.","operationId":"folder_selection_internal_mailboxes_folders_post","parameters":[{"name":"x-mailbox-service-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Mailbox-Service-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderSelection"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mailboxes/operations":{"post":{"tags":["private-mailbox-service"],"summary":"Accept","description":"Accept a source operation only under its registered owner and grant.","operationId":"accept_internal_mailboxes_operations_post","parameters":[{"name":"x-mailbox-service-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Mailbox-Service-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxOperation"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptanceReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mailboxes/source-authorize":{"post":{"tags":["private-mailbox-service"],"summary":"Source Authorize","description":"Authorize a source read without issuing a reusable download capability.","operationId":"source_authorize_internal_mailboxes_source_authorize_post","parameters":[{"name":"x-mailbox-service-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Mailbox-Service-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxGrant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mailboxes/job-status":{"post":{"tags":["private-mailbox-service"],"summary":"Job Status","description":"Report processing independently from durable acceptance.","operationId":"job_status_internal_mailboxes_job_status_post","parameters":[{"name":"x-mailbox-service-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Mailbox-Service-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessingJob"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects":{"get":{"tags":["crm"],"summary":"List Objects","description":"List every object of the org (built-in, custom and turned-off) with its fields.","operationId":"list_objects_organizations__organization_id__crm_objects_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Objects Organizations  Organization Id  Crm Objects Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["crm"],"summary":"Post Object","description":"Define a new object (admins). It starts with a ``name`` field.","operationId":"post_object_organizations__organization_id__crm_objects_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Object Organizations  Organization Id  Crm Objects Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}":{"get":{"tags":["crm"],"summary":"Get Object","description":"Return one object's metadata by singular or plural name (turned-off included).","operationId":"get_object_organizations__organization_id__crm_objects__object_name__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Object Organizations  Organization Id  Crm Objects  Object Name  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["crm"],"summary":"Patch Object","description":"Change any object's openRecordIn, or an org-defined object's definition.","operationId":"patch_object_organizations__organization_id__crm_objects__object_name__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Patch Object Organizations  Organization Id  Crm Objects  Object Name  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["crm"],"summary":"Remove Object","description":"Delete an org-defined object with all its records (admins).\n\nIts automations go too: without ``deleteAutomations=true`` an object that\nhas any answers 409 ``HAS_AUTOMATIONS`` naming them, for the confirmation.","operationId":"remove_object_organizations__organization_id__crm_objects__object_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"deleteAutomations","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Deleteautomations"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove Object Organizations  Organization Id  Crm Objects  Object Name  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records":{"get":{"tags":["crm"],"summary":"List Records","description":"List records with a filter, ordering and keyset paging.","operationId":"list_records_organizations__organization_id__crm_objects__object_name__records_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RecordGqlOperationFilter as JSON","title":"Filter"},"description":"RecordGqlOperationFilter as JSON"},{"name":"order_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"orderBy list as JSON","title":"Order By"},"description":"orderBy list as JSON"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":60,"title":"Limit"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"depth","in":"query","required":false,"schema":{"type":"integer","maximum":1,"minimum":0,"default":0,"title":"Depth"}},{"name":"with_count","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"With Count"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Deleted"}},{"name":"with_brain","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"With Brain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Records Organizations  Organization Id  Crm Objects  Object Name  Records Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["crm"],"summary":"Create Record","description":"Create one record (``position`` defaults to ``first``).\n\n``allowedTeams`` (optional) is who may read it, in the Brain's label wire\nform; the default is the whole organization.","operationId":"create_record_organizations__organization_id__crm_objects__object_name__records_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Record Organizations  Organization Id  Crm Objects  Object Name  Records Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/query":{"post":{"tags":["crm"],"summary":"Query Records","description":"List records; same as the GET form, with the arguments in the body.","operationId":"query_records_organizations__organization_id__crm_objects__object_name__records_query_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordQuery"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Query Records Organizations  Organization Id  Crm Objects  Object Name  Records Query Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/{record_id}":{"get":{"tags":["crm"],"summary":"Get Record","description":"Return one record.","operationId":"get_record_organizations__organization_id__crm_objects__object_name__records__record_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"depth","in":"query","required":false,"schema":{"type":"integer","maximum":1,"minimum":0,"default":0,"title":"Depth"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Deleted"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Record Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["crm"],"summary":"Update Record","description":"Update some fields of a record; composites merge by sub-field.","operationId":"update_record_organizations__organization_id__crm_objects__object_name__records__record_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"confirmPromotion","in":"query","required":false,"schema":{"type":"boolean","description":"true after a 409 PROMOTION_CONFIRM_REQUIRED: the member confirmed promoting (a query parameter, so it never meets a field name)","default":false,"title":"Confirmpromotion"},"description":"true after a 409 PROMOTION_CONFIRM_REQUIRED: the member confirmed promoting (a query parameter, so it never meets a field name)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Record Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["crm"],"summary":"Delete Record","description":"Move a record to the trash, or delete it for good with ``hard=true``.","operationId":"delete_record_organizations__organization_id__crm_objects__object_name__records__record_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"hard","in":"query","required":false,"schema":{"type":"boolean","description":"Delete for good (admins only)","default":false,"title":"Hard"},"description":"Delete for good (admins only)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Record Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/{record_id}/delegate":{"post":{"tags":["crm"],"summary":"Delegate Task","description":"Hand a CRM task to your own agent (\"Hand to my agent\").\n\nOnly the task's assignee may. Creates the delegation (the task's\naudience; linked by the ledger only) and returns ``{delegation, brief}``:\nopen a new conversation whose first message is ``brief``. 403\n``NOT_ASSIGNEE``; 409 ``TASK_CLOSED``, ``ALREADY_DELEGATED``,\n``NOT_DELEGABLE`` (a task visible to several teams or admins only).","operationId":"delegate_task_organizations__organization_id__crm_objects__object_name__records__record_id__delegate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delegate Task Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Delegate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/batch":{"post":{"tags":["crm"],"summary":"Create Records","description":"Create up to 200 records in one transaction, in payload order.","operationId":"create_records_organizations__organization_id__crm_objects__object_name__records_batch_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordBatch"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Records Organizations  Organization Id  Crm Objects  Object Name  Records Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/positions":{"post":{"tags":["crm"],"summary":"Move Records","description":"Reposition up to 200 records (and optionally set values) in one transaction.\n\nEach item is ``{id, position, values?}``. All or nothing: 404 when any id\nis not a live record the caller reads, 400 for any invalid item or value.\nA change of ``position`` alone writes no timeline entry. Crowded\npositions are renumbered to integers in the same transaction, so clients\nre-read after a move. Emits one ``records_changed`` for all ids.","operationId":"move_records_organizations__organization_id__crm_objects__object_name__records_positions_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordMoves"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Move Records Organizations  Organization Id  Crm Objects  Object Name  Records Positions Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/from-entity":{"post":{"tags":["crm"],"summary":"Add To Crm","description":"Add a Brain entity to the CRM: create, restore or link its record.\n\n201 when a record was created, 200 when a trashed one was restored or an\nexisting one linked. 409 ``POSSIBLE_DUPLICATES`` lists look-alike records;\nlink one with ``linkRecordId`` or create anyway with ``force``. The new\nrecord is prefilled from the entity's org-wide facts, under ``fields``.\n\n``dryRun`` writes nothing and answers 200 with ``{payload, candidates,\nexistingRecord}``: what a create would write, the look-alikes it would\nrefuse on, and the record already linked (``add_to_crm.preview_entity_add``).","operationId":"add_to_crm_organizations__organization_id__crm_objects__object_name__records_from_entity_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddToCrm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Add To Crm Organizations  Organization Id  Crm Objects  Object Name  Records From Entity Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/records/by-entities":{"post":{"tags":["crm"],"summary":"Get Records By Entities","description":"Return the CRM company or person behind each Brain entity key (up to 200).\n\n``{items: {key: {object, state, recordId?, label?, ...}}}``; a key with\nno record, or whose entity the caller cannot see, is absent\n(``crm.entity_records``). 503 ``BRAIN_UNAVAILABLE`` when the org may not\nuse its Brain now (not entitled, or memory off: ``brain_access_allowed``,\nthe gate the list summaries use) or the store is missing.","operationId":"get_records_by_entities_organizations__organization_id__crm_records_by_entities_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordsByEntities"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Records By Entities Organizations  Organization Id  Crm Records By Entities Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/{record_id}/restore":{"post":{"tags":["crm"],"summary":"Restore Record","description":"Bring a record back from the trash (409 if its unique value was reused).","operationId":"restore_record_organizations__organization_id__crm_objects__object_name__records__record_id__restore_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Restore Record Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Restore Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/{record_id}/label":{"patch":{"tags":["crm"],"summary":"Relabel Record","description":"Set who may read one record. **Admin/owner only**, as a Brain relabel.\n\nBody ``{label}`` in the Brain's wire form: ``org``, ``admins``, or team\nids of this organization joined with ',' (any) and '&' (all). Children\nkeep their own labels. 422 for a foreign or malformed label.","operationId":"relabel_record_organizations__organization_id__crm_objects__object_name__records__record_id__label_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryLabelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Relabel Record Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Label Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/edit-proposals":{"get":{"tags":["crm"],"summary":"List Edit Proposals","description":"List the caller's pending edit proposals (their agents' edits of wider records).","operationId":"list_edit_proposals_organizations__organization_id__crm_edit_proposals_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Edit Proposals Organizations  Organization Id  Crm Edit Proposals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/edit-proposals/{proposal_id}":{"get":{"tags":["crm"],"summary":"Get Edit Proposal","description":"Return one of your edit proposals, in any state.\n\n``state`` is pending, approved, declined, expired or superseded (with\n``supersededBy``: stale or signal); 404 for anyone else's.","operationId":"get_edit_proposal_organizations__organization_id__crm_edit_proposals__proposal_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Edit Proposal Organizations  Organization Id  Crm Edit Proposals  Proposal Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/edit-proposals/{proposal_id}/approve":{"post":{"tags":["crm"],"summary":"Approve Edit Proposal","description":"Apply an edit your agent proposed, as you (validated again now).\n\n404 for someone else's proposal; 409 ``PROPOSAL_DECIDED`` /\n``PROPOSAL_EXPIRED``; 409 ``PROPOSAL_STALE`` with ``status:\n\"superseded\"`` and ``current`` when a stage change's record left the\nstage it was proposed from (the proposal is closed as superseded); the\nCRM's own errors when the edit no longer fits.","operationId":"approve_edit_proposal_organizations__organization_id__crm_edit_proposals__proposal_id__approve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Approve Edit Proposal Organizations  Organization Id  Crm Edit Proposals  Proposal Id  Approve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/edit-proposals/{proposal_id}/decline":{"post":{"tags":["crm"],"summary":"Decline Edit Proposal","description":"Drop an edit your agent proposed.","operationId":"decline_edit_proposal_organizations__organization_id__crm_edit_proposals__proposal_id__decline_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Decline Edit Proposal Organizations  Organization Id  Crm Edit Proposals  Proposal Id  Decline Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/aggregate":{"post":{"tags":["crm"],"summary":"Aggregate Records","description":"Totals over the filtered records, e.g. ``[{\"op\": \"sum\", \"field\": \"amount.amountMicros\"}]``.","operationId":"aggregate_records_organizations__organization_id__crm_objects__object_name__records_aggregate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Aggregate Records Organizations  Organization Id  Crm Objects  Object Name  Records Aggregate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/group-by":{"post":{"tags":["crm"],"summary":"Group Records","description":"Totals (and optionally first records) per group; groups with records only.","operationId":"group_records_organizations__organization_id__crm_objects__object_name__records_group_by_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupByBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Group Records Organizations  Organization Id  Crm Objects  Object Name  Records Group By Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/merge":{"post":{"tags":["crm"],"summary":"Merge","description":"Merge 2 to 9 records into the one at ``priorityIndex`` (``dryRun`` previews).","operationId":"merge_organizations__organization_id__crm_objects__object_name__records_merge_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Merge Organizations  Organization Id  Crm Objects  Object Name  Records Merge Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/upsert":{"post":{"tags":["crm"],"summary":"Upsert Rows","description":"Create or update records by id or unique field; each row reports its outcome.\n\nThe server half of a spreadsheet import (the client maps columns and drops\nempty cells). Trashed matches are restored, except by an import\n(``asImport``) or a Prospect row. A person row may carry a ``company``\nhint ({name, domain, linkedinUrl, website, city, country}).","operationId":"upsert_rows_organizations__organization_id__crm_objects__object_name__records_upsert_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Upsert Rows Organizations  Organization Id  Crm Objects  Object Name  Records Upsert Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/signals":{"post":{"tags":["crm"],"summary":"Post Signal","description":"Record a prospect's human reply, accepted meeting or opt-out.\n\nThe ``engagement_signal`` operation (crm/signals.py): ``email`` or\n``linkedinUrl``, ``kind`` (reply, meeting, opt_out), ``occurredAt``,\n``source``, and optional ``summary``, ``externalId``, ``messageId`` and\n``promote``. ``matched`` is null when no person (or several) match; then\nnothing is written. ``duplicate`` is true for a repeat of a recorded\nsignal.","operationId":"post_signal_organizations__organization_id__crm_signals_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Signal Organizations  Organization Id  Crm Signals Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/{record_id}/timeline":{"get":{"tags":["crm"],"summary":"Get Timeline","description":"Return what happened to a record, newest first.\n\n``kinds`` filters by kind; with ``brain`` in it, the record's derived\nBrain lines (facts learned, investigations and sessions citing its\nentity) join the stored entries under one cursor. When the Brain cannot\nbe read, the stored entries come back without derived lines.","operationId":"get_timeline_organizations__organization_id__crm_objects__object_name__records__record_id__timeline_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"kinds","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma list of edit, brain and email","title":"Kinds"},"description":"Comma list of edit, brain and email"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Timeline Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Timeline Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/{record_id}/brain":{"get":{"tags":["crm"],"summary":"Get Record Brain","description":"Return the record page's Brain column: the linked entity and disagreements.","operationId":"get_record_brain_organizations__organization_id__crm_objects__object_name__records__record_id__brain_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Record Brain Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Brain Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/{record_id}/brain/apply":{"post":{"tags":["crm"],"summary":"Apply Record Brain","description":"Write the Brain's value of one field into this record (admin).\n\nPlans exactly this record's slot (docs/crm-brain-link-design.md Step B)\nand runs it at once when the org's guardrails allow it. Otherwise it\nanswers with the plan, whose ``verdict`` says why nothing ran (``shadow``\nwithout an enforcing ``crm_writeback`` policy, ``hold``, ``forbid``).","operationId":"apply_record_brain_organizations__organization_id__crm_objects__object_name__records__record_id__brain_apply_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainApplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Apply Record Brain Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Brain Apply Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/{record_id}/files":{"get":{"tags":["crm"],"summary":"Get Record Files","description":"List a company's or person's files (anchored Brain imports), newest first.\n\n404 for other objects and for records the caller cannot read. Adding a\nfile is the Brain import flow with an ``anchor`` (``/memory/seed``).","operationId":"get_record_files_organizations__organization_id__crm_objects__object_name__records__record_id__files_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Record Files Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Files Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/me/attention":{"get":{"tags":["crm"],"summary":"Get Attention","description":"Home's \"Needs you\": the caller's due tasks and deals with no next step.","operationId":"get_attention_organizations__organization_id__crm_me_attention_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of the caller's day (ISO-8601)","title":"Until"},"description":"End of the caller's day (ISO-8601)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Attention Organizations  Organization Id  Crm Me Attention Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/me/learned":{"get":{"tags":["crm"],"summary":"Get Learned","description":"Home's \"Learned this week\": Brain lines on the caller's own records (plan 3.3).","operationId":"get_learned_organizations__organization_id__crm_me_learned_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Oldest line to return (ISO-8601); default seven days ago","title":"Since"},"description":"Oldest line to return (ISO-8601); default seven days ago"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Learned Organizations  Organization Id  Crm Me Learned Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/views":{"get":{"tags":["crm"],"summary":"Get Views","description":"List an object's views (its defaults are created the first time).","operationId":"get_views_organizations__organization_id__crm_objects__object_name__views_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Views Organizations  Organization Id  Crm Objects  Object Name  Views Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["crm"],"summary":"Post View","description":"Create a view.","operationId":"post_view_organizations__organization_id__crm_objects__object_name__views_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post View Organizations  Organization Id  Crm Objects  Object Name  Views Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/views/{view_id}":{"get":{"tags":["crm"],"summary":"Read View","description":"Return one view.","operationId":"read_view_organizations__organization_id__crm_objects__object_name__views__view_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"view_id","in":"path","required":true,"schema":{"type":"string","title":"View Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Read View Organizations  Organization Id  Crm Objects  Object Name  Views  View Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["crm"],"summary":"Patch View","description":"Change a view's layout, filter, ordering or kanban settings.","operationId":"patch_view_organizations__organization_id__crm_objects__object_name__views__view_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"view_id","in":"path","required":true,"schema":{"type":"string","title":"View Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Patch View Organizations  Organization Id  Crm Objects  Object Name  Views  View Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["crm"],"summary":"Remove View","description":"Delete a view (an object keeps at least one).","operationId":"remove_view_organizations__organization_id__crm_objects__object_name__views__view_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"view_id","in":"path","required":true,"schema":{"type":"string","title":"View Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove View Organizations  Organization Id  Crm Objects  Object Name  Views  View Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/fields":{"post":{"tags":["crm"],"summary":"Post Field","description":"Add a field (or a relation with its inverse) to an object (admins).","operationId":"post_field_organizations__organization_id__crm_objects__object_name__fields_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Field Organizations  Organization Id  Crm Objects  Object Name  Fields Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/fields/{field_name}":{"patch":{"tags":["crm"],"summary":"Patch Field","description":"Change a custom field (admins); names and types are fixed.","operationId":"patch_field_organizations__organization_id__crm_objects__object_name__fields__field_name__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"field_name","in":"path","required":true,"schema":{"type":"string","title":"Field Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Patch Field Organizations  Organization Id  Crm Objects  Object Name  Fields  Field Name  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["crm"],"summary":"Remove Field","description":"Delete a custom field and its data (admins).","operationId":"remove_field_organizations__organization_id__crm_objects__object_name__fields__field_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"field_name","in":"path","required":true,"schema":{"type":"string","title":"Field Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove Field Organizations  Organization Id  Crm Objects  Object Name  Fields  Field Name  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/fields/{field_name}/index":{"post":{"tags":["crm"],"summary":"Post Field Index","description":"Ask for an expression index on a custom field (built out of band).","operationId":"post_field_index_organizations__organization_id__crm_objects__object_name__fields__field_name__index_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"field_name","in":"path","required":true,"schema":{"type":"string","title":"Field Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Field Index Organizations  Organization Id  Crm Objects  Object Name  Fields  Field Name  Index Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations":{"get":{"tags":["crm-automations"],"summary":"List Automations","description":"List the automations the caller may see, newest first.","operationId":"list_automations_organizations__organization_id__crm_automations_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}},{"name":"owner","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"}},{"name":"object","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object"}},{"name":"needsAttention","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Needsattention"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Automations Organizations  Organization Id  Crm Automations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["crm-automations"],"summary":"Create Automation","description":"Create an automation; a new webhook's signing secret is returned once.","operationId":"create_automation_organizations__organization_id__crm_automations_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Automation Organizations  Organization Id  Crm Automations Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/preview":{"post":{"tags":["crm-automations"],"summary":"Preview Automation","description":"Return the estimate and matching count for a draft rule.","operationId":"preview_automation_organizations__organization_id__crm_automations_preview_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Automation Organizations  Organization Id  Crm Automations Preview Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/held/{how}":{"post":{"tags":["crm-automations"],"summary":"Release Org Held Runs","description":"Deliver or discard the runs held while automations were off (admins).","operationId":"release_org_held_runs_organizations__organization_id__crm_automations_held__how__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"how","in":"path","required":true,"schema":{"enum":["deliver","discard"],"type":"string","title":"How"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Release Org Held Runs Organizations  Organization Id  Crm Automations Held  How  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/drafts/turn-on":{"post":{"tags":["crm-automations"],"summary":"Turn On Org Drafts","description":"Turn on the automations saved while automations were off (admins).","operationId":"turn_on_org_drafts_organizations__organization_id__crm_automations_drafts_turn_on_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Turn On Org Drafts Organizations  Organization Id  Crm Automations Drafts Turn On Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}":{"get":{"tags":["crm-automations"],"summary":"Get Automation","description":"Return one automation.","operationId":"get_automation_organizations__organization_id__crm_automations__rule_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Automation Organizations  Organization Id  Crm Automations  Rule Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["crm-automations"],"summary":"Update Automation","description":"Edit an automation (name, filter, audience, config, cooldown, chains).","operationId":"update_automation_organizations__organization_id__crm_automations__rule_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Automation Organizations  Organization Id  Crm Automations  Rule Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["crm-automations"],"summary":"Delete Automation","description":"Delete an automation and its queued runs.","operationId":"delete_automation_organizations__organization_id__crm_automations__rule_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/pause":{"post":{"tags":["crm-automations"],"summary":"Pause Automation","description":"Pause an automation (a team member's safety stop for agent rules).","operationId":"pause_automation_organizations__organization_id__crm_automations__rule_id__pause_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Pause Automation Organizations  Organization Id  Crm Automations  Rule Id  Pause Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/resume":{"post":{"tags":["crm-automations"],"summary":"Resume Automation","description":"Turn a paused automation back on; say what to do with held runs.","operationId":"resume_automation_organizations__organization_id__crm_automations__rule_id__resume_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResumeBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Resume Automation Organizations  Organization Id  Crm Automations  Rule Id  Resume Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/impact":{"get":{"tags":["crm-automations"],"summary":"Automation Impact","description":"Return held and queued runs, reviews waiting and records matching now.","operationId":"automation_impact_organizations__organization_id__crm_automations__rule_id__impact_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Automation Impact Organizations  Organization Id  Crm Automations  Rule Id  Impact Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/take-over":{"post":{"tags":["crm-automations"],"summary":"Take Over Automation","description":"Make the caller the automation's owner.","operationId":"take_over_automation_organizations__organization_id__crm_automations__rule_id__take_over_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Take Over Automation Organizations  Organization Id  Crm Automations  Rule Id  Take Over Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/rotate-secret":{"post":{"tags":["crm-automations"],"summary":"Rotate Automation Secret","description":"Give a webhook a new signing secret, shown once (the old one works 24 h).","operationId":"rotate_automation_secret_organizations__organization_id__crm_automations__rule_id__rotate_secret_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Rotate Automation Secret Organizations  Organization Id  Crm Automations  Rule Id  Rotate Secret Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/test":{"post":{"tags":["crm-automations"],"summary":"Test Automation","description":"Test an automation: a webhook gets a signed sample, an agent a dry run.\n\nWebhooks (admins): the answer of the endpoint. Agents (the owner and\nadmins; body ``{\"recordId\"}``): ``{\"testId\", \"warning\"?}``; poll\n``GET /{id}/test/{testId}``.","operationId":"test_automation_organizations__organization_id__crm_automations__rule_id__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AgentTestBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Automation Organizations  Organization Id  Crm Automations  Rule Id  Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/test/{test_id}":{"get":{"tags":["crm-automations"],"summary":"Automation Test Result","description":"Return a test on a record: running, done or failed (with why).","operationId":"automation_test_result_organizations__organization_id__crm_automations__rule_id__test__test_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Automation Test Result Organizations  Organization Id  Crm Automations  Rule Id  Test  Test Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/test-records":{"get":{"tags":["crm-automations"],"summary":"Automation Test Records","description":"List records the automation's audience can see (the test picker).","operationId":"automation_test_records_organizations__organization_id__crm_automations__rule_id__test_records_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Automation Test Records Organizations  Organization Id  Crm Automations  Rule Id  Test Records Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/retry-now":{"post":{"tags":["crm-automations"],"summary":"Retry Automation Now","description":"Make a webhook's waiting retries due now (admins).","operationId":"retry_automation_now_organizations__organization_id__crm_automations__rule_id__retry_now_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/activity/{activity_id}/resend":{"post":{"tags":["crm-automations"],"summary":"Resend Automation Delivery","description":"Send a delivery again with its original delivery id (admins).","operationId":"resend_automation_delivery_organizations__organization_id__crm_automations__rule_id__activity__activity_id__resend_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"activity_id","in":"path","required":true,"schema":{"type":"string","title":"Activity Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/estimate":{"get":{"tags":["crm-automations"],"summary":"Automation Estimate","description":"Return about how many runs a month (null: no estimate yet).","operationId":"automation_estimate_organizations__organization_id__crm_automations__rule_id__estimate_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]},"title":"Response Automation Estimate Organizations  Organization Id  Crm Automations  Rule Id  Estimate Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/run-once":{"post":{"tags":["crm-automations"],"summary":"Run Automation Once","description":"Queue Run once: 20 records every 10 minutes, at most 1,000.","operationId":"run_automation_once_organizations__organization_id__crm_automations__rule_id__run_once_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunOnceBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Automation Once Organizations  Organization Id  Crm Automations  Rule Id  Run Once Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/activity":{"get":{"tags":["crm-automations"],"summary":"Automation Activity","description":"Return the automation's activity, newest first, with the next cursor.","operationId":"automation_activity_organizations__organization_id__crm_automations__rule_id__activity_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Automation Activity Organizations  Organization Id  Crm Automations  Rule Id  Activity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/unlock-automatic":{"post":{"tags":["crm-automations"],"summary":"Unlock Automatic","description":"Unlock Automatic before an agent automation earned it (admins).","operationId":"unlock_automatic_organizations__organization_id__crm_automations__rule_id__unlock_automatic_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Unlock Automatic Organizations  Organization Id  Crm Automations  Rule Id  Unlock Automatic Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automations/{rule_id}/mode":{"post":{"tags":["crm-automations"],"summary":"Set Automation Mode","description":"Switch an agent automation between Ask the owner first and Automatic.","operationId":"set_automation_mode_organizations__organization_id__crm_automations__rule_id__mode_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModeBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Automation Mode Organizations  Organization Id  Crm Automations  Rule Id  Mode Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/objects/{object_name}/records/{record_id}/automations":{"get":{"tags":["crm-automations"],"summary":"Record Automations","description":"Return what automations did on one record, as the caller may see it.\n\n404 when the caller cannot read the record. Webhook rows are shown to\nmembers as \"Sent to an external system\" (no name); agent rows only for\nautomations the caller may see.","operationId":"record_automations_organizations__organization_id__crm_objects__object_name__records__record_id__automations_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object_name","in":"path","required":true,"schema":{"type":"string","title":"Object Name"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Record Automations Organizations  Organization Id  Crm Objects  Object Name  Records  Record Id  Automations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automation-reviews":{"get":{"tags":["crm-automations"],"summary":"List Reviews","description":"List the held changes and questions the caller reviews, newest first.","operationId":"list_reviews_organizations__organization_id__crm_automation_reviews_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Reviews Organizations  Organization Id  Crm Automation Reviews Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automation-reviews/{review_id}/apply":{"post":{"tags":["crm-automations"],"summary":"Apply Review","description":"Apply a held set's approved items under the automation's audience.","operationId":"apply_review_organizations__organization_id__crm_automation_reviews__review_id__apply_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"review_id","in":"path","required":true,"schema":{"type":"string","title":"Review Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ApplyBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Apply Review Organizations  Organization Id  Crm Automation Reviews  Review Id  Apply Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automation-reviews/{review_id}/run":{"post":{"tags":["crm-automations"],"summary":"Run Question","description":"Answer \"Not sure, run it?\" with Run: the automation runs for the record.","operationId":"run_question_organizations__organization_id__crm_automation_reviews__review_id__run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"review_id","in":"path","required":true,"schema":{"type":"string","title":"Review Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/automation-reviews/{review_id}/skip":{"post":{"tags":["crm-automations"],"summary":"Skip Review","description":"Skip a held set (what is left of it) or a \"Not sure\" question.","operationId":"skip_review_organizations__organization_id__crm_automation_reviews__review_id__skip_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"review_id","in":"path","required":true,"schema":{"type":"string","title":"Review Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/imports":{"post":{"tags":["crm-imports"],"summary":"Analyze Import","description":"Analyze one contact file into a preview: format, object, source, columns.\n\nThe file is parsed in memory and never stored; its rows wait 24 hours for\nthe start. ``object`` (person or company) defaults to what detection finds.\n``objectDetection`` says what the rows are, whatever ``object`` was sent.\nWhen they are the other object, nothing is mapped: the preview answers\nwith ``objectConfirmed`` false and no columns, and waits for ``PATCH``\nwith the ``object`` the member wants.","operationId":"analyze_import_organizations__organization_id__crm_imports_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_import_organizations__organization_id__crm_imports_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Analyze Import Organizations  Organization Id  Crm Imports Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["crm-imports"],"summary":"List Imports","description":"List the member's own imports, newest first (``?status=running`` finds one).\n\nItems have the shape of ``GET .../imports/{importId}`` without the preview.","operationId":"list_imports_organizations__organization_id__crm_imports_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Imports Organizations  Organization Id  Crm Imports Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/imports/targets":{"get":{"tags":["crm-imports"],"summary":"Import Targets","description":"List the fields a column of an import may go to, in picker order.\n\n``ignore`` is included. The same list validates a column edit, so a\nclient never keeps its own copy of the field rules.","operationId":"import_targets_organizations__organization_id__crm_imports_targets_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"object","in":"query","required":true,"schema":{"type":"string","description":"person or company (people, companies)","title":"Object"},"description":"person or company (people, companies)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Import Targets Organizations  Organization Id  Crm Imports Targets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/imports/{import_id}/rows":{"get":{"tags":["crm-imports"],"summary":"Failed Import Rows","description":"Page through the rows that did not import, with their original cells.\n\nKept 7 days after the import ends; ``cells`` follow ``header``.","operationId":"failed_import_rows_organizations__organization_id__crm_imports__import_id__rows_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Failed Import Rows Organizations  Organization Id  Crm Imports  Import Id  Rows Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/imports/{import_id}":{"get":{"tags":["crm-imports"],"summary":"Get Import","description":"Return one of the member's imports: its preview, progress or report.","operationId":"get_import_organizations__organization_id__crm_imports__import_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Import Organizations  Organization Id  Crm Imports  Import Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["crm-imports"],"summary":"Adjust Import","description":"Change a preview's columns, sheet, object, audience, source or left-out rows.\n\nThe checks are recounted. On a preview with ``objectConfirmed`` false,\n``object`` is the member's answer (either object) and maps the columns;\ncolumn edits before it are refused with 409 ``IMPORT_OBJECT_UNCONFIRMED``.","operationId":"adjust_import_organizations__organization_id__crm_imports__import_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportChanges"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Adjust Import Organizations  Organization Id  Crm Imports  Import Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["crm-imports"],"summary":"Cancel Import","description":"Drop a preview, or stop a running import between batches.\n\nRows already imported stay. A finished import is returned unchanged.","operationId":"cancel_import_organizations__organization_id__crm_imports__import_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Import Organizations  Organization Id  Crm Imports  Import Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/imports/{import_id}/plan":{"post":{"tags":["crm-imports"],"summary":"Plan Import","description":"Propose a field for the columns the preview keeps in the note.\n\nThe answer is the import with ``plan``: ``{summary, warnings, fields:\n[{index, header, label, type, options, namedBy, fit, suggested}]}``. A\nfast model names the fields from a card of the file (never its rows) and\nJev checks each name; it takes a few seconds, so the screen asks for it\nafter the preview is up. Nothing is created: see ``/fields``.","operationId":"plan_import_organizations__organization_id__crm_imports__import_id__plan_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Plan Import Organizations  Organization Id  Crm Imports  Import Id  Plan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/imports/{import_id}/fields":{"post":{"tags":["crm-imports"],"summary":"Create Import Fields","description":"Make proposed fields and send their columns to them (admins).\n\nEach entry names a column of ``plan.fields``; ``label`` replaces the\nproposed label. The fields are custom fields of the object, like any an\nadmin adds: they stay when the import is cancelled.","operationId":"create_import_fields_organizations__organization_id__crm_imports__import_id__fields_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportFields"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Import Fields Organizations  Organization Id  Crm Imports  Import Id  Fields Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/crm/imports/{import_id}/start":{"post":{"tags":["crm-imports"],"summary":"Start Import","description":"Start the import; the job runs in the background (poll ``GET`` or SSE).\n\nAt most one running import per member (409 ``IMPORT_RUNNING``). A preview\nthat waits for its object is refused (409 ``IMPORT_OBJECT_UNCONFIRMED``).","operationId":"start_import_organizations__organization_id__crm_imports__import_id__start_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ImportStart"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Start Import Organizations  Organization Id  Crm Imports  Import Id  Start Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks":{"get":{"tags":["playbooks"],"summary":"List Playbooks","description":"List every learned/authored playbook for this (org, profile).","operationId":"list_playbooks_organizations__organization_id__profiles__profile_name__playbooks_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["playbooks"],"summary":"Create Playbook","description":"Hand-author a playbook.\n\nWritten ``created_by=\"admin\"`` so the autonomous lifecycle loop\nwill NEVER auto-stale/archive it (the Hermes bundled-skill analog).\nRouted through ``process_and_store_memory`` so it gets the ``_amem``\nenvelope + embedding and is therefore injectable like any learned\nplaybook.","operationId":"create_playbook_organizations__organization_id__profiles__profile_name__playbooks_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_CreatePlaybook"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}":{"get":{"tags":["playbooks"],"summary":"Get Playbook","description":"Fetch a single playbook by slug.","operationId":"get_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["playbooks"],"summary":"Archive Playbook","description":"Soft-delete a playbook by archiving it (recoverable).\n\nNever a hard delete — the row persists and ``restore`` brings it\nback. An archived row is excluded from injection (the resolver\nonly surfaces ``active`` rows). B2: archiving a row the gate had\nescalated (``gate_status == \"escalated_admin\"``) is an admin\nrejection — it resolves the escalation (``→ \"rejected_admin\"``) so\nthe row leaves the ``needs_review`` tally. Non-escalated archives\nkeep their gate audit untouched.","operationId":"archive_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}/pin":{"post":{"tags":["playbooks"],"summary":"Pin Playbook","description":"Pin a playbook — exempt it from the loop's auto stale/archive.","operationId":"pin_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__pin_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}/unpin":{"post":{"tags":["playbooks"],"summary":"Unpin Playbook","description":"Unpin a playbook — re-subject it to the lifecycle loop.","operationId":"unpin_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__unpin_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}/restore":{"post":{"tags":["playbooks"],"summary":"Restore Playbook","description":"Restore an ARCHIVED playbook back to ``active`` (recoverability).\n\nRejects non-``archived`` rows with 409: ``restore`` un-archives; it\nis NOT an approve. Promoting a ``proposed`` playbook is ``approve``\n— keeping the two verbs disjoint removes the overload ``restore``\npreviously carried (a ``proposed`` row could be silently promoted\nthrough it).\n\nFinding-2: a proposed escalation the admin ignores is GC-archived\nafter ``_PLAYBOOK_PROPOSED_GC_DAYS`` with ``gate_status`` still\n``\"escalated_admin\"``. Restoring such a row IS an implicit approve,\nso it routes through ``_apply_admin_lifecycle`` (not bare\n``_set_fields``): the escalation is resolved (``→ \"approved_admin\"``)\nso the restored row does not go live while still flagged for\nreview. A normal archived row (non-escalated ``gate_status``) is\nuntouched by the surgical re-stamp — identical to the prior\nbehavior.","operationId":"restore_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__restore_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}/approve":{"post":{"tags":["playbooks"],"summary":"Approve Playbook","description":"Approve a ``proposed`` playbook — the human-review safety net.\n\nB1: the dedicated promote verb the escalation flow needs. The gate\nescalates a low-confidence proposal as ``gate_status =\n\"escalated_admin\"`` and leaves it ``proposed`` (NOT injected — the\nresolver serves only ``active``). This promotes it to ``active``\nand, via ``_apply_admin_lifecycle``, resolves the escalation\n(``→ \"approved_admin\"``) so it leaves ``needs_review`` (B2).\n\nRejects non-``proposed`` rows with 409 so ``approve`` cannot itself\nbecome an overloaded verb (the failure mode that motivated splitting\nit from ``restore``). A ``proposed`` row the gate merely held\n(not escalated) is still promotable here; its gate audit is left\nuntouched (only an ``escalated_admin`` status is re-stamped).","operationId":"approve_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__approve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}/attachments/{att_name}":{"put":{"tags":["playbooks"],"summary":"Upsert Attachment","description":"Add or replace a playbook attachment (reference/template/script).\n\nLazy by design — never inlined into the injected prompt; the\nformatter surfaces only the name. ``index=False``: attachments are\nnot embedded (see ``Playbook.__embed_fields__``).\n\nL6 — concurrency: this is an unconditional read-modify-write of the\nwhole row (no compare-and-set in the langgraph store), the same\naccepted race as ``_set_fields`` but with a LARGER blast radius —\nit rewrites the ``attachments`` content array, so two concurrent\nattachment edits (or a racing pin/lifecycle write) can silently\ndrop one side's change. Accepted, not locked: attachments are\nadmin-managed and recoverable (re-PUT), and a lock here would not\ncompose with the other RMW seams on the same key.","operationId":"upsert_attachment_organizations__organization_id__profiles__profile_name__playbooks__slug__attachments__att_name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"att_name","in":"path","required":true,"schema":{"type":"string","title":"Att Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_Attachment"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["playbooks"],"summary":"Delete Attachment","description":"Remove a playbook attachment by name.\n\n404 if the playbook or the named attachment is absent.\n\nL6 — concurrency: same accepted unconditional row read-modify-write\nas ``upsert_attachment`` / ``_set_fields`` (no store CAS), with the\nlarger attachment-array blast radius. Accepted, not locked —\nadmin-managed + recoverable.","operationId":"delete_attachment_organizations__organization_id__profiles__profile_name__playbooks__slug__attachments__att_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"att_name","in":"path","required":true,"schema":{"type":"string","title":"Att Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/reflect-now":{"post":{"tags":["playbooks"],"summary":"Reflect Now","description":"Force a reflection pass now, bypassing the drift gate.\n\nBypasses cold-start / threshold / debounce but NOT the scope guard\n(custom HD only) nor the ≥3-citation guard — it's a manual \"look\nnow\", not a way to fabricate playbooks. Runs inline and is wholly\nfailure-isolated inside ``maybe_reflect_on_profile``.","operationId":"reflect_now_organizations__organization_id__profiles__profile_name__reflect_now_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ReflectNowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/reflections":{"get":{"tags":["playbooks"],"summary":"List Reflections","description":"Audit ledger: what the autonomous loop did, newest first.\n\nScoped to this profile. The recoverable analog of Hermes' per-run\ncurator report (design §7.2).","operationId":"list_reflections_organizations__organization_id__profiles__profile_name__reflections_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ReflectionAuditList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/reflections/{run_id}":{"get":{"tags":["playbooks"],"summary":"Get Reflection","description":"Fetch one reflection-run audit record by id.","operationId":"get_reflection_organizations__organization_id__profiles__profile_name__reflections__run_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ReflectionAudit"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/reflections/{run_id}/revert":{"post":{"tags":["playbooks"],"summary":"Revert Reflection","description":"Batch-revert a reflection run (recoverable).\n\nArchives every playbook it touched; admin/pinned rows are skipped.\nThe recoverable analog of Hermes' `curator rollback` (design §7.2).","operationId":"revert_reflection_organizations__organization_id__profiles__profile_name__reflections__run_id__revert_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RevertResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/playbooks":{"get":{"tags":["playbooks"],"summary":"List Org Playbooks","description":"Org-wide playbook lifecycle + gate-decision visibility.\n\nAdmin-gated, consistent with the per-profile router. The optional\n``profile_name`` / ``lifecycle_state`` / ``gate_status`` filters\nnarrow the returned list, but ``summary`` is ALWAYS computed over\nthe full org set — so ``needs_review`` is a truthful escalation\ncount, not a side effect of the caller's filter.","operationId":"list_org_playbooks_organizations__organization_id__playbooks_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Name"}},{"name":"lifecycle_state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle State"}},{"name":"gate_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gate Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_OrgPlaybookListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/webhook-sources":{"get":{"tags":["webhook-sources"],"summary":"List Webhook Sources","description":"List all webhook sources for an organization.","operationId":"list_webhook_sources_organizations__organization_id__webhook_sources_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSourceResponse"},"title":"Response List Webhook Sources Organizations  Organization Id  Webhook Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["webhook-sources"],"summary":"Create Webhook Source","description":"Create a webhook source (upserts if provider already exists).\n\nOn an upsert, an omitted ``team_id`` keeps the stored pin.","operationId":"create_webhook_source_organizations__organization_id__webhook_sources_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSourceCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/webhook-sources/{provider}":{"get":{"tags":["webhook-sources"],"summary":"Get Webhook Source","description":"Get a single webhook source by provider.","operationId":"get_webhook_source_organizations__organization_id__webhook_sources__provider__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["webhook-sources"],"summary":"Update Webhook Source","description":"Update a webhook source.","operationId":"update_webhook_source_organizations__organization_id__webhook_sources__provider__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSourceUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["webhook-sources"],"summary":"Delete Webhook Source","description":"Delete a webhook source.","operationId":"delete_webhook_source_organizations__organization_id__webhook_sources__provider__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities":{"get":{"tags":["channel-identities"],"summary":"List Channel Identities","description":"List all linked channel identities for an organization.","operationId":"list_channel_identities_organizations__organization_id__channel_identities_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelIdentityResponse"},"title":"Response List Channel Identities Organizations  Organization Id  Channel Identities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channel-identities"],"summary":"Create Channel Identity","description":"Link a channel sender to a PlatformPilot user.\n\nLinking a sender to somebody else's user_id requires admin/owner, and so\ndoes taking over a sender another user already holds; members can only bind\nan unclaimed sender to their own account.","operationId":"create_channel_identity_organizations__organization_id__channel_identities_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/by-user/{user_id}":{"get":{"tags":["channel-identities"],"summary":"List User Channel Identities","description":"List all channel identities linked to a specific user.","operationId":"list_user_channel_identities_organizations__organization_id__channel_identities_by_user__user_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelIdentityResponse"},"title":"Response List User Channel Identities Organizations  Organization Id  Channel Identities By User  User Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/invite/{token}":{"get":{"tags":["channel-identities"],"summary":"Get Invite","description":"Read an invite so the claim page can name the chat account first.\n\nNever claims. Any org member may read: the token is the secret, and the\nsender it names is already visible to members in the pending queue. The\nerror codes match ``/claim``: 404 unknown, 409 claimed, 410 expired.","operationId":"get_invite_organizations__organization_id__channel_identities_invite__token__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteDetailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/{channel_id}/{sender_id}":{"get":{"tags":["channel-identities"],"summary":"Get Channel Identity","description":"Get a specific channel identity link.","operationId":"get_channel_identity_organizations__organization_id__channel_identities__channel_id___sender_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["channel-identities"],"summary":"Delete Channel Identity","description":"Remove a channel identity link.\n\nThe target is whoever the link currently points at, so removing somebody\nelse's link requires admin/owner; members can unlink their own.","operationId":"delete_channel_identity_organizations__organization_id__channel_identities__channel_id___sender_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/pending":{"get":{"tags":["channel-identities"],"summary":"List Pending Identities","description":"List all unlinked channel senders waiting for admin review.","operationId":"list_pending_identities_organizations__organization_id__channel_identities_pending_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PendingIdentityResponse"},"title":"Response List Pending Identities Organizations  Organization Id  Channel Identities Pending Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/pending/{channel_id}/{sender_id}/link":{"post":{"tags":["channel-identities"],"summary":"Link Pending Identity","description":"Link a pending sender to a PlatformPilot user (clears pending).\n\nSame rule as the direct create route: naming somebody else's user_id or a\nsender another user already holds requires admin/owner. The path sender is\nfree text and is never checked against the pending queue, so this route\nreaches exactly the same write as the create route.","operationId":"link_pending_identity_organizations__organization_id__channel_identities_pending__channel_id___sender_id__link_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/pending/{channel_id}/{sender_id}":{"delete":{"tags":["channel-identities"],"summary":"Dismiss Pending Identity","description":"Dismiss a pending sender (remove from queue without linking).","operationId":"dismiss_pending_identity_organizations__organization_id__channel_identities_pending__channel_id___sender_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/self-link":{"post":{"tags":["channel-identities"],"summary":"Self Link Channel Identity","description":"Link the authenticated user's own channel identity.\n\nThe target is forced to the caller, so the only thing left to authorize is\nthe sender: an unclaimed one needs no admin, taking one off another user\ndoes. Without that check this route is the whole attack, since it is the\nmember-accessible way to point somebody else's sender at your own account.","operationId":"self_link_channel_identity_organizations__organization_id__channel_identities_self_link_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelfLinkRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/oauth/discord/authorize":{"get":{"tags":["channel-identities"],"summary":"Discord Profile Authorize","description":"Generate a Discord OAuth URL for profile identity linking.\n\nUses 'identify' scope only — not installing the bot, just capturing\nthe user's Discord ID.","operationId":"discord_profile_authorize_organizations__organization_id__channel_identities_oauth_discord_authorize_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/oauth/discord/callback":{"post":{"tags":["channel-identities"],"summary":"Discord Profile Callback","description":"Exchange Discord OAuth code and link the user's Discord identity.\n\nThe sender here is whatever Discord says the authorizing account is, not\nsomething the caller can name, so this route is not reachable for the\nsender-takeover attack. It still creates a binding, so it runs the same\ncheck rather than carrying an exception nobody can see from the call site:\na Discord account already linked to a different user moves only by\nadmin/owner.","operationId":"discord_profile_callback_organizations__organization_id__channel_identities_oauth_discord_callback_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthCallbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/invite":{"post":{"tags":["channel-identities"],"summary":"Create Invite","description":"Generate a single-use invite link for channel identity linking.\n\nNaming somebody else as the target needs an admin, as linking does\n(``_authorize_link_target``): the target claims by opening the link, so a\nmember who could name anyone could send an admin a link that binds the\nmember's own channel account to the admin's identity. Naming a sender\nanother user holds needs it too, because a claim ends in the same\noverwrite as the create route.","operationId":"create_invite_organizations__organization_id__channel_identities_invite_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/pending/{channel_id}/{sender_id}/invite":{"post":{"tags":["channel-identities"],"summary":"Create Invite From Pending","description":"Generate an invite link for a pending sender (convenience shortcut).\n\nSame rules as ``/invite``: naming somebody else as the target needs an\nadmin, and the path sender is free text that is never checked against the\npending queue, so it can name a sender linked to somebody else.","operationId":"create_invite_from_pending_organizations__organization_id__channel_identities_pending__channel_id___sender_id__invite_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/claim":{"post":{"tags":["channel-identities"],"summary":"Claim Invite","description":"Claim an invite token to link a channel sender to the authenticated user.\n\nThe claim is the write, so the sender check lives here too and not only at\nmint time: a member can mint an invite for a sender that is unclaimed right\nnow and claim it after its real owner appears. An invite may still hand\nover a binding that predates it, which is how an admin moves a sender to a\nnew owner without unlinking it first.","operationId":"claim_invite_organizations__organization_id__channel_identities_claim_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/jobs":{"get":{"tags":["jobs"],"summary":"List Jobs","description":"List all scheduled jobs for an organization.","operationId":"list_jobs_organizations__organization_id__jobs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JobResponse"},"title":"Response List Jobs Organizations  Organization Id  Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["jobs"],"summary":"Create Job","description":"Create a new scheduled job.","operationId":"create_job_organizations__organization_id__jobs_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/jobs/{cron_id}":{"get":{"tags":["jobs"],"summary":"Get Job","description":"Get a single scheduled job by ID.","operationId":"get_job_organizations__organization_id__jobs__cron_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"cron_id","in":"path","required":true,"schema":{"type":"string","title":"Cron Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["jobs"],"summary":"Update Job","description":"Update a scheduled job's schedule, task, or enabled state.","operationId":"update_job_organizations__organization_id__jobs__cron_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"cron_id","in":"path","required":true,"schema":{"type":"string","title":"Cron Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["jobs"],"summary":"Delete Job","description":"Delete a scheduled job.","operationId":"delete_job_organizations__organization_id__jobs__cron_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"cron_id","in":"path","required":true,"schema":{"type":"string","title":"Cron Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/metrics/escalations/stats":{"get":{"tags":["escalations"],"summary":"Get Escalation Stats","description":"Aggregate escalation pair stats.","operationId":"get_escalation_stats_organizations__organization_id__metrics_escalations_stats_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date to filter from (default 30d ago)","title":"Since"},"description":"ISO date to filter from (default 30d ago)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/metrics/escalations/events":{"get":{"tags":["escalations"],"summary":"List Escalation Events","description":"List raw escalation events.","operationId":"list_escalation_events_organizations__organization_id__metrics_escalations_events_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"from_profile","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Profile"}},{"name":"to_profile","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Profile"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationEventsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/metrics/escalations/recommendations":{"get":{"tags":["escalations"],"summary":"Get Escalation Recommendations","description":"Advisory webhook source profile-pin suggestions based on escalation patterns.","operationId":"get_escalation_recommendations_organizations__organization_id__metrics_escalations_recommendations_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"min_threshold","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":3,"title":"Min Threshold"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationRecommendationsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/metrics/profiles":{"get":{"tags":["profile-metrics"],"summary":"Get Profile Metrics","description":"Return per-investigation profile metrics for an organization.\n\nReads from the ``(\"profile_metrics\", org_id)`` namespace in the\nruntime store (Go Core gRPC-backed in LangGraph Cloud v0.7+).","operationId":"get_profile_metrics_organizations__organization_id__metrics_profiles_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileMetricsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/autonomy":{"get":{"tags":["autonomy"],"summary":"Get Autonomy","description":"Get autonomy settings and earned-capability progress.\n\nMember-level read. Capability read failures degrade to 0 (the UI\nshows a locked slider rather than a 500) with ``capability_truncated``\nset so the degradation is visible.","operationId":"get_autonomy_organizations__organization_id__autonomy_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["autonomy"],"summary":"Update Autonomy","description":"Update the org's autonomy level (admin/owner only).\n\nThe requested level is clamped to the earned capability rung. A\ncapability read failure is a 503, NOT a clamp-to-0: a transient\nstore blip must never write down the admin's persisted level.","operationId":"update_autonomy_organizations__organization_id__autonomy_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/navigation-counts":{"get":{"tags":["entities"],"summary":"Get Navigation Counts","description":"Return the curation and changed-evidence badge counts for one org.\n\n``proposals`` is the whole open queue. ``needs_you`` is the part of it that\nis a person's to rule on (``curation_progress.review_needs_reader``), which\nis what d3 lights its navigation dot from; it is absent when it cannot be\nknown. ``team_disputes`` counts the open disagreements between an org\nfact and a team fact the reader may see (``GET /team-disputes``); it is\nnot part of ``proposals``, which stays the overview's queue.","operationId":"get_navigation_counts_organizations__organization_id__memory_entities_navigation_counts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"integer"},{"type":"boolean"}]},"title":"Response Get Navigation Counts Organizations  Organization Id  Memory Entities Navigation Counts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/identity-policy":{"get":{"tags":["entities"],"summary":"Get Identity Policy","description":"Read effective policy for the current tenant.","operationId":"get_identity_policy_organizations__organization_id__memory_entities_identity_policy_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Identity Policy Organizations  Organization Id  Memory Entities Identity Policy Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["entities"],"summary":"Save Identity Policy","description":"Save only policy; a later sweep independently reassesses eligible pairs.","operationId":"save_identity_policy_organizations__organization_id__memory_entities_identity_policy_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__resources__entity_identity_policy__SaveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Save Identity Policy Organizations  Organization Id  Memory Entities Identity Policy Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/identity-policy/preview":{"post":{"tags":["entities"],"summary":"Preview Identity Policy","description":"Require admin access before scanning the affected proposal inventory.","operationId":"preview_identity_policy_organizations__organization_id__memory_entities_identity_policy_preview_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__resources__entity_identity_policy__PreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Identity Policy Organizations  Organization Id  Memory Entities Identity Policy Preview Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/entity-types":{"get":{"tags":["entities"],"summary":"Get Entity Types","description":"Every type the organization holds, built-ins first, retired ones included.","operationId":"get_entity_types_organizations__organization_id__memory_entities_entity_types_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Entity Types Organizations  Organization Id  Memory Entities Entity Types Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["entities"],"summary":"Save Entity Type Change","description":"Apply a previewed change while what it rests on is unchanged.","operationId":"save_entity_type_change_organizations__organization_id__memory_entities_entity_types_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__resources__entity_types__SaveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Save Entity Type Change Organizations  Organization Id  Memory Entities Entity Types Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/entity-types/drift":{"get":{"tags":["entities"],"summary":"Get Entity Type Drift","description":"How far the use of each of the organization's own types has moved (admin).\n\nInformation only (Plan C 4b-ii): the dream measures it, the older half of\na type's recent uses against the newer half (1 - cosine of their usage\nsignatures), and it never changes a type. Active types only; a type not\nmeasured yet is absent.","operationId":"get_entity_type_drift_organizations__organization_id__memory_entities_entity_types_drift_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Entity Type Drift Organizations  Organization Id  Memory Entities Entity Types Drift Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/entity-types/proposals":{"get":{"tags":["entities"],"summary":"List Entity Type Proposals","description":"List the labels the learner proposes, with evidence counted now.","operationId":"list_entity_type_proposals_organizations__organization_id__memory_entities_entity_types_proposals_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Entity Type Proposals Organizations  Organization Id  Memory Entities Entity Types Proposals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/entity-types/rule-proposals":{"get":{"tags":["entities"],"summary":"List Identity Rule Proposals","description":"List the identity rules learned in shadow, with their agreement counted now.\n\nPlan C 4a. A rule is information until its capability is live: nothing\nhere is applied, and no identifier value is ever returned.","operationId":"list_identity_rule_proposals_organizations__organization_id__memory_entities_entity_types_rule_proposals_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Identity Rule Proposals Organizations  Organization Id  Memory Entities Entity Types Rule Proposals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/entity-types/staleness-proposals":{"get":{"tags":["entities"],"summary":"List Staleness Proposals","description":"How long each type's facts stay true, and which predicates hold one value (admin).\n\nPlan C 5a: learned in shadow, numbers only. A proposal ages no fact until\nits capability is live (5b makes the readers take the type, 6c the flag).","operationId":"list_staleness_proposals_organizations__organization_id__memory_entities_entity_types_staleness_proposals_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Staleness Proposals Organizations  Organization Id  Memory Entities Entity Types Staleness Proposals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/entity-types/capabilities":{"get":{"tags":["entities"],"summary":"Get Entity Type Capabilities","description":"Whether each capability of the learner is live, and what it is measured on (admin).\n\nPlan C 6a (decision 12): read only; the dream evaluates the gates.","operationId":"get_entity_type_capabilities_organizations__organization_id__memory_entities_entity_types_capabilities_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Entity Type Capabilities Organizations  Organization Id  Memory Entities Entity Types Capabilities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/entity-types/rule-proposals/{key}":{"put":{"tags":["entities"],"summary":"Rule On Identity Rule","description":"Accept or Dismiss an identity rule learned in shadow (admin, Plan C 6a).\n\nRecorded on the rule and counted toward the rules capability; nothing is\napplied. 409 when the rule is gone, withdrawn, already ruled on, or no\nlonger what ``expected`` says was read.","operationId":"rule_on_identity_rule_organizations__organization_id__memory_entities_entity_types_rule_proposals__key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^type_rule_proposal:[0-9a-f]{16}$","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rule On Identity Rule Organizations  Organization Id  Memory Entities Entity Types Rule Proposals  Key  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/entity-types/staleness-proposals/{key}":{"put":{"tags":["entities"],"summary":"Rule On Staleness Proposal","description":"Accept or Dismiss a staleness proposal learned in shadow (admin, Plan C 6a).\n\nRecorded on the proposal and counted toward the staleness capability;\nnothing ages a fact by it. 409 as for a rule.","operationId":"rule_on_staleness_proposal_organizations__organization_id__memory_entities_entity_types_staleness_proposals__key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^type_staleness_proposal:[0-9a-f]{16}$","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rule On Staleness Proposal Organizations  Organization Id  Memory Entities Entity Types Staleness Proposals  Key  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/entity-types/proposals/{key}":{"get":{"tags":["entities"],"summary":"Get Entity Type Proposal","description":"One learned label: its evidence, examples and what promoting it would narrow.","operationId":"get_entity_type_proposal_organizations__organization_id__memory_entities_entity_types_proposals__key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^entity_type_proposal:[0-9a-f]{16}$","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Entity Type Proposal Organizations  Organization Id  Memory Entities Entity Types Proposals  Key  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/entity-types/preview":{"post":{"tags":["entities"],"summary":"Preview Entity Type Change","description":"Say what a change would do; change nothing.","operationId":"preview_entity_type_change_organizations__organization_id__memory_entities_entity_types_preview_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__resources__entity_types__PreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Entity Type Change Organizations  Organization Id  Memory Entities Entity Types Preview Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/lifecycle-review":{"get":{"tags":["entities"],"summary":"Get Lifecycle Review","description":"Return both original identity tokens, including a retired split member.","operationId":"get_lifecycle_review_organizations__organization_id__memory_entities__entity_id__lifecycle_review_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"other_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Other Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Lifecycle Review Organizations  Organization Id  Memory Entities  Entity Id  Lifecycle Review Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/aliases/{alias_id}/review":{"get":{"tags":["entities"],"summary":"Get Alias Review","description":"Supply exact current alias and identity tokens from one bounded snapshot.","operationId":"get_alias_review_organizations__organization_id__memory_entities_aliases__alias_id__review_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"alias_id","in":"path","required":true,"schema":{"type":"string","title":"Alias Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Alias Review Organizations  Organization Id  Memory Entities Aliases  Alias Id  Review Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/identity/review":{"post":{"tags":["entities"],"summary":"Review Entity Identity","description":"Apply a token-bound admin identity, type or unambiguous alias decision.","operationId":"review_entity_identity_organizations__organization_id__memory_entities__entity_id__identity_review_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdentityReviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Review Entity Identity Organizations  Organization Id  Memory Entities  Entity Id  Identity Review Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/claim-candidates":{"get":{"tags":["entities"],"summary":"List Claim Candidates","description":"Page review work independently of the entity namespace sweep budget.","operationId":"list_claim_candidates_organizations__organization_id__memory_entities_claim_candidates_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Claim Candidates Organizations  Organization Id  Memory Entities Claim Candidates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/claim-candidates/{candidate_id}/adopt":{"post":{"tags":["entities"],"summary":"Adopt Claim Candidate","description":"Adopt a reviewed qualified claim even when no accepted fact exists.","operationId":"adopt_claim_candidate_organizations__organization_id__memory_entities_claim_candidates__candidate_id__adopt_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"candidate_id","in":"path","required":true,"schema":{"type":"string","title":"Candidate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimCandidateDecisionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Adopt Claim Candidate Organizations  Organization Id  Memory Entities Claim Candidates  Candidate Id  Adopt Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/claim-candidates/{candidate_id}/veto":{"post":{"tags":["entities"],"summary":"Veto Claim Candidate","description":"Veto the exact reviewed candidate without deleting its audit trail.","operationId":"veto_claim_candidate_organizations__organization_id__memory_entities_claim_candidates__candidate_id__veto_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"candidate_id","in":"path","required":true,"schema":{"type":"string","title":"Candidate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimCandidateDecisionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Veto Claim Candidate Organizations  Organization Id  Memory Entities Claim Candidates  Candidate Id  Veto Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/claims/veto":{"post":{"tags":["entities"],"summary":"Veto Published Claim","description":"Apply an intentional veto of the displayed exact publication basis.","operationId":"veto_published_claim_organizations__organization_id__memory_entities_claims_veto_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishedClaimVetoRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Veto Published Claim Organizations  Organization Id  Memory Entities Claims Veto Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities":{"get":{"tags":["entities"],"summary":"List Entities","description":"Return the entity registry + curation queue for the org.\n\nMembers see only entities (and links, facts, aliases and proposals\nnaming them) whose derived team label they may read.","operationId":"list_entities_organizations__organization_id__memory_entities_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitiesOverviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/search":{"get":{"tags":["entities"],"summary":"Search Entities","description":"Find entities by canonical name or confirmed alias, for pickers.\n\nMembers see only entities their teams may read; each item says whether\nthe entity is a company or person in Home (``inHome``).","operationId":"search_entities_organizations__organization_id__memory_entities_search_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Q"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}],"title":"Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"default":8,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitySearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/predicates":{"get":{"tags":["entities"],"summary":"List Predicates","description":"Return the org's predicate vocabulary, aliases, and open proposals.\n\nRead-only curation view for the ontology ladder: vocabulary with row\ncounts (fragmentation watch), active alias mappings, and pending\nreconcile proposals awaiting a ruling. Edge counts cover only edges\nbetween entities the viewer may read.","operationId":"list_predicates_organizations__organization_id__memory_entities_predicates_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Predicates Organizations  Organization Id  Memory Entities Predicates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/predicates/{predicate}/edges":{"get":{"tags":["entities"],"summary":"List Predicate Edges","description":"Return the org's edges for one predicate: the predicate-first query.\n\nThe entity-less relational surface (\"list everything anyone\n`invested in`\"): an equality scan over rel rows served by the\nexisting GIN containment index, never embeddings. The predicate\nresolves through the alias layer, and a miss falls back to a single\nunambiguous vocabulary match (``matched_predicate`` reports what was\nactually queried). Read-only, so not admin-gated; members see only\nedges between entities they may read.","operationId":"list_predicate_edges_organizations__organization_id__memory_entities_predicates__predicate__edges_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"predicate","in":"path","required":true,"schema":{"type":"string","title":"Predicate"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Predicate Edges Organizations  Organization Id  Memory Entities Predicates  Predicate  Edges Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/predicates/aliases/review":{"get":{"tags":["entities"],"summary":"Get Predicate Alias Review","description":"Return exact bounded remap-scope metadata without asserting source propositions.","operationId":"get_predicate_alias_review_organizations__organization_id__memory_entities_predicates_aliases_review_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"variant","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Variant"}},{"name":"canonical","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Canonical"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Predicate Alias Review Organizations  Organization Id  Memory Entities Predicates Aliases Review Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/predicates/aliases":{"post":{"tags":["entities"],"summary":"Create Predicate Alias","description":"Map a variant predicate to a canonical one (admin).\n\nRedirect semantics, never renames: chains collapse, origins\nre-point, and any matching pending reconcile proposal is marked\nmerged so it never re-mints. Application at edge-write time is\nadditionally gated by ``ENTITY_PREDICATE_ALIASES_ENABLED``.","operationId":"create_predicate_alias_organizations__organization_id__memory_entities_predicates_aliases_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredicateAliasIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Predicate Alias Organizations  Organization Id  Memory Entities Predicates Aliases Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/predicates/proposals/reject":{"post":{"tags":["entities"],"summary":"Reject Predicate Proposal","description":"Rule a reconcile proposal not-the-same (admin); suppresses re-mint.","operationId":"reject_predicate_proposal_organizations__organization_id__memory_entities_predicates_proposals_reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredicateProposalRef"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reject Predicate Proposal Organizations  Organization Id  Memory Entities Predicates Proposals Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/graph":{"get":{"tags":["entities"],"summary":"Get Entity Graph","description":"Bounded org-wide panoramic view: nodes + edges + structure stats.\n\nThe Phase C bulk surface for the knowledge-graph view: one call\nreturns active entities (hubs first when the cap bites), the edges\nbetween them (closed edges included, carrying their interval so the\nUI can style history), per-node degree, connected components, and\nthe top hubs. Analytics stay deliberately minimal: degree and\ncomponents are the primitives the panoramic view needs; anything\nfancier (centrality, paths, communities) waits for a product\nquestion that reduces to it. Read-only, so not admin-gated.\n\nDegree contract: ``degree_in`` / ``degree_out`` report ORG-WIDE\nconnectivity (over all scanned edges between active entities), NOT\nthe rendered subgraph, so a capped view still shows which nodes are\nreal hubs; ``edges_dropped_offview`` quantifies the mismatch a\nrenderer will see. ``stats.scan_truncated`` flags when the\nunderlying scans hit their bound and ranking/counts cover a window\nrather than the whole org. Members see only entities they may read\nand the edges between them; counts cover that view.","operationId":"get_entity_graph_organizations__organization_id__memory_entities_graph_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":150,"title":"Limit"}},{"name":"states","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["accepted","reported","history"],"type":"string"}},{"type":"null"}],"title":"States"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Entity Graph Organizations  Organization Id  Memory Entities Graph Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/me":{"get":{"tags":["entities"],"summary":"Get Caller Brain","description":"Return what the Brain holds about the CALLER (welcome-screen greeting).\n\nDeclared BEFORE ``/{entity_id}``: that route is a catch-all on this\nprefix and would otherwise swallow ``/me`` and 422 on the key check.\n\nResolves the caller through the same exact-surface, person-only rule the\nchat caller card uses, so the greeting can never claim to know someone\nthe agent itself would not. Every miss (feature flag off, no entity, no\nlinked memories, store trouble) is an EMPTY body, never an error: the UI\nfalls back to an unpersonalized greeting, and a welcome screen must not\nbe able to fail.\n\nTask cards are composed FRESH per request (not from the cached\nsnapshot): a handoff minted a minute ago must show now, and a completed\ntask must leave now — the ledger moves at conversation cadence, not the\nsnapshot's. They outrank the snapshot's suggestions in the merged list\n(an incoming ask beats the caller's own trail).","operationId":"get_caller_brain_organizations__organization_id__memory_entities_me_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerBrainResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/record-cases/{case_key}":{"post":{"tags":["entities"],"summary":"Rule Record Case","description":"Apply an explicit binding or reviewed extraction correction (admin).","operationId":"rule_record_case_organizations__organization_id__memory_entities_record_cases__case_key__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"case_key","in":"path","required":true,"schema":{"type":"string","title":"Case Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordCaseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rule Record Case Organizations  Organization Id  Memory Entities Record Cases  Case Key  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/facts/rule":{"post":{"tags":["entities"],"summary":"Rule Entity Fact","description":"Rule on a displayed source conflict or change a supported fact (admin).","operationId":"rule_entity_fact_organizations__organization_id__memory_entities__entity_id__facts_rule_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Predicate"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactRulingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rule Entity Fact Organizations  Organization Id  Memory Entities  Entity Id  Facts Rule Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/team-disputes":{"get":{"tags":["entities"],"summary":"List Team Disputes","description":"List org and team values that disagree, for an admin to rule (admin).\n\nA disagreement is a conflict for a person to rule, never a precedence\nrule (decision 2): keep the team value with ``/{entity_id}/team-rows/keep``\nor veto it with ``/{entity_id}/team-rows/veto``. Applying a team value\norg-wide is a relabel of its source memory, never a ruling, so no ruling\nhere publishes team text org-wide.","operationId":"list_team_disputes_organizations__organization_id__memory_entities_team_disputes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TeamDisputeOut"}},"title":"Response List Team Disputes Organizations  Organization Id  Memory Entities Team Disputes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/team-rows/veto":{"post":{"tags":["entities"],"summary":"Veto Team Fact","description":"Rule a team fact value or team edge never true (admin).\n\nThe team counterpart of ``DELETE /facts`` and ``DELETE /relations``:\nre-derivation never writes the vetoed value or edge again, and a new\nvalue at the same predicate still lands.","operationId":"veto_team_fact_organizations__organization_id__memory_entities__entity_id__team_rows_veto_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamRowRuling"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Veto Team Fact Organizations  Organization Id  Memory Entities  Entity Id  Team Rows Veto Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/team-rows/keep":{"post":{"tags":["entities"],"summary":"Keep Team Fact","description":"Rule that a team fact or edge stands (admin).\n\nCloses its dispute with the org value it disagrees with now; a later\nchange of that org value reopens it.","operationId":"keep_team_fact_organizations__organization_id__memory_entities__entity_id__team_rows_keep_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamRowRuling"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Keep Team Fact Organizations  Organization Id  Memory Entities  Entity Id  Team Rows Keep Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/team-rows/close":{"post":{"tags":["entities"],"summary":"Close Team Edge","description":"Close a team edge's validity interval (admin); it stays as history.","operationId":"close_team_edge_organizations__organization_id__memory_entities__entity_id__team_rows_close_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamRowRuling"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Close Team Edge Organizations  Organization Id  Memory Entities  Entity Id  Team Rows Close Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}":{"get":{"tags":["entities"],"summary":"Get Entity Detail","description":"Return one entity's registry row, fact sheet, and member sample.\n\nRead-only, so triple-gated but NOT admin-gated (unlike the curation\nmutations). A merged loser key forward-resolves to its survivor and\nreports ``redirected`` so the UI can explain the jump.","operationId":"get_entity_detail_organizations__organization_id__memory_entities__entity_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"states","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["accepted","reported","history","conflict","pending","candidate"],"type":"string"}},{"type":"null"}],"title":"States"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/merge":{"post":{"tags":["entities"],"summary":"Merge Entity","description":"Merge ``entity_id`` with ``body.other_id`` (admin; revisable).\n\nStrong pair evidence (memories that describe the two as different\nthings) answers 409 carrying that evidence until the caller repeats\nthe request with ``acknowledge_evidence``; the precedent then records\nthe override, quote included.","operationId":"merge_entity_organizations__organization_id__memory_entities__entity_id__merge_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/relations":{"delete":{"tags":["entities"],"summary":"Veto Relation","description":"Kill one edge permanently (admin): tombstone + delete.\n\nA bare row delete would resurrect at the subject's next\nre-distillation; the ``rel_veto:`` tombstone is a human ruling the\nwrite path checks first, so the deletion sticks. Requires the edge\n(or an existing veto, for idempotent retries) to exist: a typo must\nnot mint a garbage tombstone.","operationId":"veto_relation_organizations__organization_id__memory_entities__entity_id__relations_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","title":"Predicate"}},{"name":"object_id","in":"query","required":true,"schema":{"type":"string","title":"Object Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Veto Relation Organizations  Organization Id  Memory Entities  Entity Id  Relations Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/facts":{"delete":{"tags":["entities"],"summary":"Veto Fact","description":"Remove one fact's CURRENT value permanently (admin): tombstone + delete.\n\n``rel_veto``'s value-scoped sibling: a bare row delete would\nresurrect the value at the entity's next re-distillation, so the\n``fact_veto:`` tombstone records the removed VALUE and the write\npath skips its re-emission. The address stays open: a genuinely new\nvalue at the same predicate lands normally. This is the \"remove\"\nruling on an unsupported-fact queue item (and works on any fact).","operationId":"veto_fact_organizations__organization_id__memory_entities__entity_id__facts_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","title":"Predicate"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Veto Fact Organizations  Organization Id  Memory Entities  Entity Id  Facts Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/type":{"post":{"tags":["entities"],"summary":"Confirm Entity Type","description":"Confirm or correct one entity's type (item 7, emergent-first).\n\nThe vocabulary stays closed and emergent (no upfront schema\nauthoring): this verb only lets a human snap an entity onto one of\nthe existing types (or back to ``unknown``) and stamps the choice\nas human-confirmed so automatic resolution never silently\nreclassifies it. An off-vocabulary value is a 422, not a new type.","operationId":"confirm_entity_type_organizations__organization_id__memory_entities__entity_id__type_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"entity_type","in":"query","required":true,"schema":{"type":"string","title":"Entity Type"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IdentityReviewRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Confirm Entity Type Organizations  Organization Id  Memory Entities  Entity Id  Type Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/facts/keep":{"post":{"tags":["entities"],"summary":"Keep Fact","description":"Rule that an unsupported-flagged value stands (admin).\n\nClears the ``unsupported_at`` queue signal and stamps ``kept`` so\nthe grounding backfill neither rescans nor re-stamps the row; the\nruling dissolves automatically when the value changes (a new value\nis a new question).","operationId":"keep_fact_organizations__organization_id__memory_entities__entity_id__facts_keep_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","title":"Predicate"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Keep Fact Organizations  Organization Id  Memory Entities  Entity Id  Facts Keep Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/relations/keep":{"post":{"tags":["entities"],"summary":"Keep Relation","description":"Rule that an evidence-stamped edge stands (admin).\n\nThe edge mirror of ``/facts/keep``: stamps ``kept`` so the evidence\nsweep neither re-stamps nor re-queues the row, and clears a standing\n``ineffective_at`` signal. Never touches the edge's temporal state —\nclosing or vetoing remain separate, explicit actions.","operationId":"keep_relation_organizations__organization_id__memory_entities__entity_id__relations_keep_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","title":"Predicate"}},{"name":"object_id","in":"query","required":true,"schema":{"type":"string","title":"Object Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Keep Relation Organizations  Organization Id  Memory Entities  Entity Id  Relations Keep Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/relations/close":{"post":{"tags":["entities"],"summary":"Close Relation","description":"Close one edge's validity interval (admin): closure rung 3.\n\nDistinct from the veto: closed means the relationship WAS true until\n``valid_to`` (defaulting to now) and the row stays queryable as\nhistory; vetoed means never true / never show. A human closure\nsticks: re-distillation refreshes the row but never reopens it (the\nsame human-beats-machine rule the veto follows). Re-closing updates\nthe interval; latest ruling wins.","operationId":"close_relation_organizations__organization_id__memory_entities__entity_id__relations_close_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","title":"Predicate"}},{"name":"object_id","in":"query","required":true,"schema":{"type":"string","title":"Object Id"}},{"name":"valid_to","in":"query","required":false,"schema":{"type":"string","default":"","title":"Valid To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Close Relation Organizations  Organization Id  Memory Entities  Entity Id  Relations Close Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/split":{"post":{"tags":["entities"],"summary":"Split Entity","description":"Declare not-same: reverse a merge OR reject a proposal (admin).","operationId":"split_entity_organizations__organization_id__memory_entities__entity_id__split_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Split Entity Organizations  Organization Id  Memory Entities  Entity Id  Split Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/aliases/{alias_id}/confirm":{"post":{"tags":["entities"],"summary":"Confirm Alias","description":"Promote a pending alias to confirmed (admin curation).","operationId":"confirm_alias_organizations__organization_id__memory_entities_aliases__alias_id__confirm_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"alias_id","in":"path","required":true,"schema":{"type":"string","title":"Alias Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IdentityReviewRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Confirm Alias Organizations  Organization Id  Memory Entities Aliases  Alias Id  Confirm Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/aliases/{alias_id}/reject":{"post":{"tags":["entities"],"summary":"Reject Alias Candidate","description":"Declare that a surface form does NOT mean a candidate (admin).\n\nThe candidate joins the alias's ``rejected`` G-Set: Tier-0 excludes\nit, the Tier-2 applier refuses it, and the surface form re-learns\nthrough the normal escalation path (a future mention mints a fresh\nentity if nothing else matches). This is the alias-level negative\nruling, the counterpart of \"Not the same\" on merge suggestions, and\nit counts toward the earned-autonomy gate's polarity requirement.","operationId":"reject_alias_candidate_organizations__organization_id__memory_entities_aliases__alias_id__reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"alias_id","in":"path","required":true,"schema":{"type":"string","title":"Alias Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reject Alias Candidate Organizations  Organization Id  Memory Entities Aliases  Alias Id  Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed":{"post":{"tags":["memory-seed"],"summary":"Start Seed Batch","description":"Import rows through the distiller (async; poll the batch id).\n\nRows land immediately searchable; the deferred evolution pass then\nanalyzes and links each new row once against the complete corpus.\nThe pass's model usage is metered to the organization as\n\"Memory import\".","operationId":"start_seed_batch_organizations__organization_id__memory_seed_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SeedRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SeedStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["memory-seed"],"summary":"List Seed Batches","description":"Import history: every batch with status, counts, and metered usage.\n\nPer-row results are stripped (a batch row can carry hundreds of\nentries); fetch one batch by id for those. Newest first.","operationId":"list_seed_batches_organizations__organization_id__memory_seed_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Seed Batches Organizations  Organization Id  Memory Seed Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/records":{"post":{"tags":["memory-seed"],"summary":"Start Record Batch","description":"Persist accepted source rows before scheduling their deterministic application.","operationId":"start_record_batch_organizations__organization_id__memory_seed_records_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RecordsRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Start Record Batch Organizations  Organization Id  Memory Seed Records Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/preview":{"post":{"tags":["memory-seed"],"summary":"Preview Seed Batch","description":"Distill raw material into a persisted proposal set (nothing committed).\n\nThe distiller splits the material into self-contained candidate\nmemories, classifies each as a durable fact or a past event, and\nextracts stated dates. Proposals persist server-side under a\n``preview_id``; commit references that id + selected indices, so\nnothing outside this set can be committed. The analysis is metered\nas \"Memory import\" whether or not anything is committed.","operationId":"preview_seed_batch_organizations__organization_id__memory_seed_preview_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/preview/{preview_id}":{"get":{"tags":["memory-seed"],"summary":"Get Seed Preview Row","description":"Read one persisted preview (proposals + status; survives reload).","operationId":"get_seed_preview_row_organizations__organization_id__memory_seed_preview__preview_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"preview_id","in":"path","required":true,"schema":{"type":"string","title":"Preview Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Seed Preview Row Organizations  Organization Id  Memory Seed Preview  Preview Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/capabilities":{"get":{"tags":["memory-seed"],"summary":"Get Seed Capabilities","description":"Report which import paths this org can use right now.\n\nMember-readable (the chat surface needs it to render \"ask your\nadmin\" for non-admins). Reports stored probe state only — no\nnetwork round-trip; the register step re-verifies for real.","operationId":"get_seed_capabilities_organizations__organization_id__memory_seed_capabilities_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Seed Capabilities Organizations  Organization Id  Memory Seed Capabilities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/storage/setup":{"post":{"tags":["memory-seed"],"summary":"Setup Import Storage","description":"Run the whole storage-connect flow and return a per-step report.\n\nCreates the bucket when missing, applies the browser-upload CORS\nrule, saves the config, and verifies end to end — everything the\ntenant identity can do itself. Steps a human must finish come back\nwith an exact one-line fix. Safe to re-run any time (idempotent).","operationId":"setup_import_storage_organizations__organization_id__memory_seed_storage_setup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_StorageSetupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Setup Import Storage Organizations  Organization Id  Memory Seed Storage Setup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/material":{"post":{"tags":["memory-seed"],"summary":"Request Material Upload","description":"Issue a presigned upload URL into the org's OWN import bucket.\n\nBytes go browser -> bucket directly; PlatformPilot never proxies\nor stores the content. A pending pointer row (TTL-bounded) tracks\nthe material until the client confirms the upload via\n``POST /material/{material_id}/register``.","operationId":"request_material_upload_organizations__organization_id__memory_seed_material_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__resources__memory_seed___MaterialRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Request Material Upload Organizations  Organization Id  Memory Seed Material Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/material/{material_id}/register":{"post":{"tags":["memory-seed"],"summary":"Register Material","description":"Confirm the upload landed and mark the material ready.\n\nServer-side verification via the impersonated tenant identity:\nhead_object proves the object exists and enforces the byte cap (the\nuniversal size gate — presigned length limits are vendor-specific\nbest-effort). Idempotent: re-registering re-verifies.","operationId":"register_material_organizations__organization_id__memory_seed_material__material_id__register_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"material_id","in":"path","required":true,"schema":{"type":"string","title":"Material Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Register Material Organizations  Organization Id  Memory Seed Material  Material Id  Register Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/sources":{"get":{"tags":["memory-seed"],"summary":"List Seed Sources","description":"Import sources: one row per source with its version history.\n\nA source groups every import of the same material (the display\nlabel, folded case/whitespace); versions carry checksum, size,\nfilename, and the batch that recorded them. Newest-imported first.","operationId":"list_seed_sources_organizations__organization_id__memory_seed_sources_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Seed Sources Organizations  Organization Id  Memory Seed Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/sources/{source_id}":{"get":{"tags":["memory-seed"],"summary":"Get Seed Source Detail","description":"One source row plus a live ``memory_count``.\n\n``memory_count`` is computed with the same two filter passes the\nforget-source deletion uses, so a confirm dialog can show the exact\nblast radius. Kept off the list endpoint deliberately: counting is\nper-source work, and the list would multiply it.","operationId":"get_seed_source_detail_organizations__organization_id__memory_seed_sources__source_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Seed Source Detail Organizations  Organization Id  Memory Seed Sources  Source Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["memory-seed"],"summary":"Forget Seed Source","description":"Forget a source: delete every memory derived from it (async).\n\nThe erasure-by-source lever (data-subject requests, poisoned or\nobsolete imports): removes all rows stamped with this source id\nplus pre-registry rows carrying its label, then the registry entry\nitself. Agent-earned memories are untouched. Deliberately REST-only,\nnever a chat action, same reasoning as BYO delete.","operationId":"forget_seed_source_organizations__organization_id__memory_seed_sources__source_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Forget Seed Source Organizations  Organization Id  Memory Seed Sources  Source Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/{batch_id}":{"get":{"tags":["memory-seed"],"summary":"Get Seed Batch","description":"Read one batch's status, per-row results, and metered usage.","operationId":"get_seed_batch_organizations__organization_id__memory_seed__batch_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Seed Batch Organizations  Organization Id  Memory Seed  Batch Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["memory-seed"],"summary":"Delete Seed Batch","description":"Delete every memory row this batch imported (async).\n\nTargets only rows stamped with this batch id; agent-earned memories\nare untouched. Deletion goes through the canonical path so links on\nneighboring memories are cleaned up.","operationId":"delete_seed_batch_organizations__organization_id__memory_seed__batch_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Seed Batch Organizations  Organization Id  Memory Seed  Batch Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/action-policies":{"get":{"tags":["action-policies"],"summary":"List Action Policies","description":"List every guardrail policy for the org.","operationId":"list_action_policies_organizations__organization_id__action_policies_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PolicyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/action-policies/evidence":{"get":{"tags":["action-policies"],"summary":"Action Policy Evidence","description":"Summarize per-graduation-key exposure plus per-policy re-earning.\n\nExposure, not agreement: shadow mode produces no human\ncounterfactual, so these fields say how much real traffic a policy\nhas seen and how varied it was, never whether anyone agreed with it.\nCallers must not render these as approval or correctness rates.\n\nTWO SOURCES, deliberately distinguished. ``keys`` is a summary of the\naction log, which is a capped sample by construction. ``policies`` is\nthe per-policy counter rows, which are exact and are what readiness\nactually fires on. Returning only the former would leave the console\nshowing one set of numbers while the Brain proposed on another.","operationId":"action_policy_evidence_organizations__organization_id__action_policies_evidence_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Action Policy Evidence Organizations  Organization Id  Action Policies Evidence Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/action-policies/{policy_id}":{"put":{"tags":["action-policies"],"summary":"Upsert Action Policy","description":"Create or replace one policy.\n\nValidated through the same ``ActionPolicy`` model the interceptor\nenforces, so a row that stores is a row that matches.","operationId":"upsert_action_policy_organizations__organization_id__action_policies__policy_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PolicyBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Upsert Action Policy Organizations  Organization Id  Action Policies  Policy Id  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["action-policies"],"summary":"Delete Action Policy","description":"Delete one policy (404 if absent).","operationId":"delete_action_policy_organizations__organization_id__action_policies__policy_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/action-policies/{policy_id}/readiness/dismiss":{"post":{"tags":["action-policies"],"summary":"Dismiss Policy Readiness","description":"Mark ONE readiness generation reviewed without promoting.\n\n\"Reviewed, declining for now.\" Without this, an admin who looks at the\nevidence and decides against enforcement has no way to say so, and the\nproposal re-surfaces at every dream.\n\nDeliberately does not touch ``enforce``: dismissing is not a verdict on\nthe policy, and promotion stays a separate deliberate action.\n\nStatus mapping: 404 when there is no such policy evidence, 409 when the\nwindow is already closed or the caller named a generation that is no\nlonger current (a card composed before a profile sweep). A repeat\ndismissal of the same generation is idempotent, not an error, and does\nnot re-emit the analytics event.","operationId":"dismiss_policy_readiness_organizations__organization_id__action_policies__policy_id__readiness_dismiss_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/_DismissBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Dismiss Policy Readiness Organizations  Organization Id  Action Policies  Policy Id  Readiness Dismiss Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/action-log":{"get":{"tags":["action-policies"],"summary":"List Action Log","description":"Most recent action/proposal log rows (newest first).","operationId":"list_action_log_organizations__organization_id__action_log_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Action Log Organizations  Organization Id  Action Log Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/tasks":{"get":{"tags":["tasks"],"summary":"List Tasks","description":"List tasks visible to the caller (admins: all org tasks).\n\n``mine_only`` narrows the visible set to tasks FOR the caller (their\nresolved ``assignee_user_id``, or their email-authorized person\nentity) — the supervision surfaces' filter, so \"your agent finished\"\ncopy is only ever attached to the caller's own work. It narrows even\nthe admin recovery view: \"mine\" means mine for admins too.\n\n``awaiting_my_review`` is the review lane: handed-in tasks the caller\nreviews under the org's approver setting (the requester too, when the\nsetting names them) and has not approved yet. It implies\n``needs_review``.","operationId":"list_tasks_organizations__organization_id__tasks_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"enum":["open","working","needs_review","done","dropped"],"type":"string"},{"type":"null"}],"title":"Status Filter"}},{"name":"mine_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Mine Only"}},{"name":"awaiting_my_review","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Awaiting My Review"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tasks"],"summary":"Create Task","description":"Create a task (scope authorization enforced here).","operationId":"create_task_organizations__organization_id__tasks_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/tasks/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task","description":"Read one visible task.","operationId":"get_task_organizations__organization_id__tasks__task_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tasks"],"summary":"Patch Task","description":"Update fields and/or rescope (escalation rules enforced).\n\n``status`` done or dropped closes the task through the same path as\n``POST .../complete`` (the approver rule, 403 ``NOT_APPROVER``; with\n\"both\", an approval that still waits for the other approver; the CRM\nDone sync when the audiences match), after the other fields change.","operationId":"patch_task_organizations__organization_id__tasks__task_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tasks"],"summary":"Delete Task","description":"Hard-delete a visible task.","operationId":"delete_task_organizations__organization_id__tasks__task_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/tasks/{task_id}/complete":{"post":{"tags":["tasks"],"summary":"Complete Task","description":"Mark a visible task done (a human's approval).\n\nA delegation someone asked of someone else follows the org's approver\nsetting (403 ``NOT_APPROVER``); with \"both\", the first approval is\nrecorded and the task stays in review until the second. A delegation\nlinked to a CRM task marks it Done when their audiences match, or when\n``alsoMarkCrmDone`` says so.","operationId":"complete_task_organizations__organization_id__tasks__task_id__complete_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CompleteRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/tasks/{task_id}/crm-sync":{"get":{"tags":["tasks"],"summary":"Crm Sync Preview","description":"Say what approving does to the linked CRM task (for the approval popover).\n\n``{crmTaskId, automatic}``: ``automatic`` true when approval marks it\nDone by itself (the audiences match); false when the person chooses\n(``alsoMarkCrmDone``); ``crmTaskId`` null when there is no linked task\nthe caller can see.","operationId":"crm_sync_preview_organizations__organization_id__tasks__task_id__crm_sync_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Crm Sync Preview Organizations  Organization Id  Tasks  Task Id  Crm Sync Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/tasks/{task_id}/send-back":{"post":{"tags":["tasks"],"summary":"Send Back Task","description":"Send finished work back to the agent, with a comment (409 unless in review).","operationId":"send_back_task_organizations__organization_id__tasks__task_id__send_back_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendBackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/tasks/{task_id}/work-thread":{"post":{"tags":["tasks"],"summary":"Bind Work Thread","description":"Make a new conversation of the assignee the task's working conversation.\n\nCall it after creating the conversation and before its first run (\"Hand\nto my agent\" opens one). With team isolation on, the conversation gets\nthe task's audience (the org for an org-wide task, the team for a team\ntask), so the agent there recalls only what that audience may read and\ncan hand its work in (``submit_for_review``) without the note reaching\nanyone who could not read it. The conversation stays private. Sets\n``working_thread_id``.\n\n403 ``NOT_ASSIGNEE``; 409 ``TASK_CLOSED``; 409 ``THREAD_NOT_USABLE``\n(not the caller's conversation in this org, shared outside the task's\naudience, or it already ran under another audience).","operationId":"bind_work_thread_organizations__organization_id__tasks__task_id__work_thread_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkThreadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/tasks/{task_id}/promote":{"post":{"tags":["tasks"],"summary":"Promote Task","description":"Make a delegation a CRM task, visible to the audience the person picks.\n\nLinked both ways (the delegation keeps working as before). 409\n``ALREADY_LINKED`` / ``TASK_CLOSED``; 403 for a label the person may not\ngive; 422 for a malformed one.","operationId":"promote_task_organizations__organization_id__tasks__task_id__promote_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Promote Task Organizations  Organization Id  Tasks  Task Id  Promote Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/dreaming":{"get":{"tags":["dreaming"],"summary":"Get Dreaming Status","description":"Report dream pressure, the gates, and recent runs (admin only).","operationId":"get_dreaming_status_organizations__organization_id__memory_dreaming_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"reports_limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Reports Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DreamingStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/dreaming/queue":{"get":{"tags":["dreaming"],"summary":"Get Dreaming Queue","description":"List the live tidy-ups the last pass left for the next one (admin only).\n\nThe status endpoint counts these entries; this one shows them. Entries\nstore keys, not text, so the member join happens here, server-side and\norg-scoped: an entry whose namespace does not name this org is dropped\nunread (and logged) instead of fetched, and member previews go through\nthe same ``row_label`` discipline as Brain cards.","operationId":"get_dreaming_queue_organizations__organization_id__memory_dreaming_queue_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DreamQueueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/dreaming/runs":{"post":{"tags":["dreaming"],"summary":"Start Dreaming Run","description":"Start one dreaming pass now (admin only).\n\nPre-checks mirror the gates the graph re-applies, so a refusal is an\nexplanatory error rather than a run that quietly ends at its first\nnode. The trigger-side daily BURST ceiling is deliberately not\nenforced here: that brake exists to damp automatic self-excitation,\nand an admin pressing the button is explicit demand. The graph's\ntotal daily bound still applies and is checked below, so a manual\nrun can never exceed the day's cost envelope.","operationId":"start_dreaming_run_organizations__organization_id__memory_dreaming_runs_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DreamRunRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DreamRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/dreaming/health/resume":{"post":{"tags":["dreaming"],"summary":"Resume Dreaming Health","description":"Resume the observed model-health generation without starting a run.","operationId":"resume_dreaming_health_organizations__organization_id__memory_dreaming_health_resume_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DreamHealthResumeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DreamHealthResumeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/graph":{"get":{"tags":["memory-graph"],"summary":"Get Memory Graph","description":"Return A-mem memories as a D3.js-compatible force graph.\n\nThe graph shows only rows the caller may read (``access.row_visible``):\nhidden rows are dropped before the display budget is spent, so nodes,\nedges, counts and the truncation flag all describe the visible set.","operationId":"get_memory_graph_organizations__organization_id__memory_graph_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"query","required":false,"schema":{"enum":["episodes","knowledge","all"],"type":"string","description":"Which namespace(s) to include","default":"all","title":"Namespace"},"description":"Which namespace(s) to include"},{"name":"max_nodes","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"description":"Maximum number of nodes to return","default":500,"title":"Max Nodes"},"description":"Maximum number of nodes to return"},{"name":"time_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO start bound for temporal filtering","title":"Time Start"},"description":"ISO start bound for temporal filtering"},{"name":"time_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO end bound for temporal filtering","title":"Time End"},"description":"ISO end bound for temporal filtering"},{"name":"time_bucket","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Month filter, e.g. '2026-03'","title":"Time Bucket"},"description":"Month filter, e.g. '2026-03'"},{"name":"focus","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A memory key the graph must include when the caller may read it (a deep link lands on it even past the node budget)","title":"Focus"},"description":"A memory key the graph must include when the caller may read it (a deep link lands on it even past the node budget)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryGraphResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/ontology":{"get":{"tags":["memory-graph"],"summary":"Get Ontology Overview","description":"Return curated-vocabulary adoption + emergent categories, read-only.\n\nCounts categories over LIVE rows only (superseded/absorbed rows are\nexcluded by :func:`collect_category_labels`, the same population the\ndream reconcile surveys), so this panel and the reconcile agree about\nwhich categories exist. Matching against the curated vocabulary is\ncase-insensitive with the curated spelling winning display — the same\nnormalization rule the §P3 seeding path uses — so a spelling variant\ncan never show up as both a dead curated term and a hot emergent one.\n\nThe vocabulary is read from the canonical ``reference_vocabulary`` row\n(not the per-term ``vocab_term:`` projection, which exists for kNN and\ncan transiently drift during re-seeding). Reads are fail-soft: an\nunseeded org gets ``vocabulary_size=0`` and an emergent-only list.\n\nEvery block is computed over the rows the caller may read\n(``access.row_visible``), and a restricted viewer sees only ledger folds\nonto a category it already sees.","operationId":"get_ontology_overview_organizations__organization_id__memory_ontology_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OntologyOverviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/{namespace}/{memory_key}":{"get":{"tags":["memory-graph"],"summary":"Get Memory Node Detail","description":"Return the heavy per-memory fields for a single node, on demand.\n\nThe graph projection (:func:`get_memory_graph`) is lean — it omits\n``context``/``keywords``/``tags`` to keep the whole-graph payload small.\nThe detail panel fetches them here for the ONE node the user selected.\n\nSame plan/settings/namespace gates as :func:`delete_memory_node`,\nbut org-member auth: reading a memory the org already shares is not\nthe destructive operation, so only the DELETE is admin-gated.\nA single ``store.aget`` read on the happy\npath; on a miss it follows the ``_amem_redirects`` chain (via\n:func:`resolve_redirects`) to the surviving memory a citation was merged\ninto, echoing the original key back as ``resolved_from``. 404 only when the\nmemory truly doesn't exist (deleted with no redirect, or never existed),\nor when the caller may not read it: a row outside the caller's scope\ngets the SAME 404 as a missing one, so its existence never leaks.","operationId":"get_memory_node_detail_organizations__organization_id__memory__namespace___memory_key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"path","required":true,"schema":{"enum":["episodes","knowledge"],"type":"string","title":"Namespace"}},{"name":"memory_key","in":"path","required":true,"schema":{"type":"string","title":"Memory Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryNodeDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["memory-graph"],"summary":"Delete Memory Node","description":"Delete a single memory node from the graph.\n\n**Admin/owner only.** This is a hard, cascading delete of shared org\nmemory: it removes the node and rewrites every neighbor's\n``_amem.links`` / ``_amem.link_strengths``. Memories are org-scoped\nwith no per-user owner, so an org-membership check would let any\nmember destroy the whole org's knowledge one key at a time. Every\nsibling surface over this substrate is admin-gated —\n``resources/entities.py`` requires admin even to *veto* a single\nfact (a soft, reversible suppression), and rubrics / playbooks /\nprofiles / domains / memory_db do the same.\n\nAddressable namespaces are only the user-facing memory ones\n(``episodes``, ``knowledge``); internal namespaces cannot be named\ndirectly. The delete is an ERASURE, though — the canonical\n``manage_memory(action=\"delete\")`` path cascades into the entity\nlayer, so the blast radius can exceed the one node:\n\n  - Strip the deleted key from each neighbor's ``_amem.links`` and\n    ``_amem.link_strengths`` map; sweep redirects pointing AT it.\n  - Remove the memory's entity link rows. An entity whose ONLY live\n    link was this memory is deleted along with its facts and\n    relations; its alias rows are pruned (a current member's email\n    alias is demoted, never deleted); the org-map digest and the\n    task ledger are scrubbed of the erased names.\n\nA cascade that removed durable rows is logged at WARNING by the\ndelete path (counts only, never content). Audit-trail fields\n(``evolution_history``) on neighbors are intentionally preserved —\nthey record what happened at the time even if the referenced memory\nis later deleted.\n\nReturns 204 No Content on success, 404 if the memory doesn't exist.","operationId":"delete_memory_node_organizations__organization_id__memory__namespace___memory_key__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"path","required":true,"schema":{"enum":["episodes","knowledge"],"type":"string","title":"Namespace"}},{"name":"memory_key","in":"path","required":true,"schema":{"type":"string","title":"Memory Key"}},{"name":"ci_report_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"description":"Deletion report id acknowledging the trade-off (memory CI). Required for a load-bearing memory while the deletion guard is on; a 409 carries the report to acknowledge. Same name as the chat and MCP tool argument and as the 409 body field.","title":"Ci Report Id"},"description":"Deletion report id acknowledging the trade-off (memory CI). Required for a load-bearing memory while the deletion guard is on; a 409 carries the report to acknowledge. Same name as the chat and MCP tool argument and as the 409 body field."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/{namespace}/{memory_key}/media/{media_id}":{"get":{"tags":["memory-graph"],"summary":"Get Memory Node Media","description":"Serve the bytes of ONE attachment on one memory.\n\nSame four gates as :func:`get_memory_node_detail`, at org-member level:\nreading an attachment on a memory the org already shares is not a\ndestructive operation, so this is deliberately not admin-gated. A memory\noutside the caller's scope 404s exactly like a missing one.\n\nDeliberately NOT gated on ``MEMORY_MEDIA_ENABLED``. That switch stops\ncapturing new attachments; it does not un-retain the objects records\nalready reference, and gating reads on it would retroactively blank\nimages in memories that still legitimately point at them.\n\n``media_id`` is the keyed derivation of the entry's checksum\n(:func:`media_url_id`), never an address: the object key comes from the\nmatched entry, and a caller cannot name one. The raw checksum stays off\nthe wire entirely — including out of the ``ETag``, which reaches strictly\nMORE places than the URL does (devtools, HAR exports, the browser cache,\nand every revalidation's ``If-None-Match``).","operationId":"get_memory_node_media_organizations__organization_id__memory__namespace___memory_key__media__media_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"path","required":true,"schema":{"enum":["episodes","knowledge"],"type":"string","title":"Namespace"}},{"name":"memory_key","in":"path","required":true,"schema":{"type":"string","title":"Memory Key"}},{"name":"media_id","in":"path","required":true,"schema":{"type":"string","title":"Media Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/{namespace}/{memory_key}/media/{media_id}/poster":{"get":{"tags":["memory-graph"],"summary":"Get Memory Node Media Poster","description":"Serve a rendered first-page poster for ONE document attachment.\n\nA document's bytes are deliberately NOT servable (see\n``SERVABLE_MEDIA_MIMES``): a PDF rendered inline from our own origin is\nan active-content surface. A poster is the safe inversion — the\nuntrusted bytes are parsed here, in-process and sandboxed by ceilings,\nand only a flat image ever reaches a browser. It is also the only\nrepresentation of a document that is portable to a chat channel.\n\nSame gates and same tenant bind as the byte route, via the shared\nresolver. Refusals are 404/415, never a placeholder image: a caller\nthat cannot see the memory must not learn that a document exists on it.","operationId":"get_memory_node_media_poster_organizations__organization_id__memory__namespace___memory_key__media__media_id__poster_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"path","required":true,"schema":{"enum":["episodes","knowledge"],"type":"string","title":"Namespace"}},{"name":"memory_key","in":"path","required":true,"schema":{"type":"string","title":"Memory Key"}},{"name":"media_id","in":"path","required":true,"schema":{"type":"string","title":"Media Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/{namespace}/{memory_key}/label":{"patch":{"tags":["memory-graph"],"summary":"Relabel Memory Node","description":"Set who may read one memory and every row that holds its content.\n\n**Admin/owner only.** A label decides which members recall and see a\nrow, so changing it is an org-level decision like a delete.\n\nThe key leads to the live row: a merged-away key follows its redirect,\nand an absorbed archive follows ``absorbed_into`` to its canonical\n(404 when nothing live remains). The same label is then written to\nthe rows derived from it that hold its content: the split hub and\nparts, and its stored archives (``merged_from`` / ``redirected_from``\nrows that are absorbed or superseded, and the pre-merge archive).\nLinked rows keep their own labels. Each write is a row-locked\nmetadata update with no re-embedding (the label is not embedded).\n\nReturns the new label and the cascaded keys; 422 for a label that is\nnot ``org``, ``admins`` or a team of this organization.","operationId":"relabel_memory_node_organizations__organization_id__memory__namespace___memory_key__label_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"path","required":true,"schema":{"enum":["episodes","knowledge"],"type":"string","title":"Namespace"}},{"name":"memory_key","in":"path","required":true,"schema":{"type":"string","title":"Memory Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryLabelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryLabelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/links/ruling":{"post":{"tags":["memory-graph"],"summary":"Rule On Link","description":"Record a reviewer's verdict on one connection between two memories.\n\n**Admin/owner only**, matching every other write over this shared\nsubstrate (node delete, entity fact veto, rubrics, playbooks). A ruling\nchanges what the agent trusts org-wide, so it is not a per-member action.\n\nThe verdict is stamped on BOTH stored directions of the edge, so the\ncollapsed display tier is the same whichever endpoint a reader visits.\nWrites go through ``atomic_amem_merge`` (row lock), so two reviewers\nruling at once serialize and the last ruling wins, which is the intended\nsemantics for confirm-then-dispute-then-reconfirm.\n\nThis is metadata only. Nothing is deleted, no content changes, and no\nre-embedding happens: a dispute marks a connection as rejected rather\nthan removing it, so the record of the review survives.\n\nReturns 404 when either memory is missing or the two are not linked.","operationId":"rule_on_link_organizations__organization_id__memory_links_ruling_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkRulingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkRulingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/decisions":{"get":{"tags":["decisions"],"summary":"List Decisions","description":"List the standing decisions the caller may read, with grounding status.","operationId":"list_decisions_organizations__organization_id__decisions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/decisions/{key}":{"get":{"tags":["decisions"],"summary":"Get Decision","description":"Return one decision with its premises verified live (bounded keyed gets).","operationId":"get_decision_organizations__organization_id__decisions__key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/decisions/{key}/ruling":{"post":{"tags":["decisions"],"summary":"Mint Grounding Ruling","description":"Send a flagged decision for human review (admin).\n\nMints (or idempotently re-mints, same dedupe key) one\n``needs_review`` ledger task assigned to the caller. Refuses with\n409 when the decision's premises verify clean right now: a review\ntask over nothing teaches admins to ignore review tasks.","operationId":"mint_grounding_ruling_organizations__organization_id__decisions__key__ruling_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulingMintResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory-ci/reports":{"post":{"tags":["memory-ci"],"summary":"Create Report","description":"Start (or, for a deletion, compute) one memory-CI report.\n\nReturns the report row: 202 while a rubric or import report runs\nin the background (poll ``GET .../reports/{report_id}``), 200 for a\ndeletion report, which is computed inline.","operationId":"create_report_organizations__organization_id__memory_ci_reports_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/RubricEditReportRequest"},{"$ref":"#/components/schemas/ImportReportRequest"},{"$ref":"#/components/schemas/DeleteReportRequest"}],"discriminator":{"propertyName":"kind","mapping":{"rubric_edit":"#/components/schemas/RubricEditReportRequest","memory_import":"#/components/schemas/ImportReportRequest","memory_delete":"#/components/schemas/DeleteReportRequest"}},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory-ci/reports/{report_id}":{"get":{"tags":["memory-ci"],"summary":"Get Report","description":"Read one report; a job that stopped reporting reads back as ``lost``.","operationId":"get_report_organizations__organization_id__memory_ci_reports__report_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Report Organizations  Organization Id  Memory Ci Reports  Report Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers":{"get":{"tags":["MCP Configuration"],"summary":"List Servers","description":"List all MCP server configurations accessible to the user.","operationId":"list_servers_organizations__organization_id__mcp_servers_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}":{"get":{"tags":["MCP Configuration"],"summary":"Get Server","description":"Get configuration for a specific MCP server.","operationId":"get_server_organizations__organization_id__mcp_servers__server_name__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["MCP Configuration"],"summary":"Create Server","description":"Create a new MCP server configuration. Requires admin or owner role.","operationId":"create_server_organizations__organization_id__mcp_servers__server_name__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPServerConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["MCP Configuration"],"summary":"Update Server","description":"Replace an existing MCP server configuration (full replacement). Requires admin or owner role.","operationId":"update_server_organizations__organization_id__mcp_servers__server_name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPServerConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["MCP Configuration"],"summary":"Delete Server","description":"Delete an MCP server configuration. Requires admin or owner role.","operationId":"delete_server_organizations__organization_id__mcp_servers__server_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/active":{"get":{"tags":["MCP Configuration"],"summary":"Get Active Servers","description":"Get list of actually connected/working MCP servers with exclusion info.\n\nReturns active servers and information about any excluded servers,\nincluding the reason for exclusion (e.g., OAuth token missing,\nconnection timeout, unsupported transport).","operationId":"get_active_servers_organizations__organization_id__mcp_active_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveServersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/health":{"get":{"tags":["MCP Configuration"],"summary":"Mcp Health Check","description":"MCP Configuration service health check.","operationId":"mcp_health_check_organizations__organization_id__mcp_health_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/discover":{"post":{"tags":["MCP OAuth"],"summary":"Discover Oauth","description":"Discover OAuth endpoints from MCP server and persist to config.\n\nFetches OAuth metadata from the server's .well-known endpoints and\nautomatically updates the server's OAuth configuration with discovered\nendpoints. This saves users from manually configuring endpoints.","operationId":"discover_oauth_organizations__organization_id__mcp_servers__server_name__oauth_discover_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthDiscoveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/setup":{"post":{"tags":["MCP OAuth"],"summary":"Setup Oauth","description":"One-click OAuth setup: discover, register, and get authorization URL.\n\nThis endpoint handles the complete OAuth setup flow:\n1. Discovers OAuth endpoints from the MCP server\n2. Registers a client dynamically (if dynamic_registration is enabled)\n3. Returns authorization URL (for authorization_code) or acquires token (for client_credentials)\n\nRequires admin role.","operationId":"setup_oauth_organizations__organization_id__mcp_servers__server_name__oauth_setup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthSetupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/register":{"post":{"tags":["MCP OAuth"],"summary":"Register Oauth Client","description":"Register OAuth client dynamically (RFC 7591).\n\nRequires admin role. Uses the server's registration_endpoint from OAuth config.","operationId":"register_oauth_client_organizations__organization_id__mcp_servers__server_name__oauth_register_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ClientRegistrationRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRegistrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/authorize/start":{"get":{"tags":["MCP OAuth"],"summary":"Start Authorization","description":"Start OAuth authorization code flow with PKCE.\n\nReturns an authorization URL for the user to visit.","operationId":"start_authorization_organizations__organization_id__mcp_servers__server_name__oauth_authorize_start_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/authorize/callback":{"post":{"tags":["MCP OAuth"],"summary":"Complete Authorization","description":"Complete OAuth authorization code flow.\n\nExchanges the authorization code for tokens.","operationId":"complete_authorization_organizations__organization_id__mcp_servers__server_name__oauth_authorize_callback_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationCallbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/token":{"post":{"tags":["MCP OAuth"],"summary":"Acquire Token","description":"Acquire OAuth token using client_credentials grant.\n\nNo user interaction required. Uses stored client credentials.","operationId":"acquire_token_organizations__organization_id__mcp_servers__server_name__oauth_token_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/refresh":{"post":{"tags":["MCP OAuth"],"summary":"Refresh Token","description":"Refresh OAuth access token.\n\nUses the stored refresh token to get a new access token.","operationId":"refresh_token_organizations__organization_id__mcp_servers__server_name__oauth_refresh_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/status":{"get":{"tags":["MCP OAuth"],"summary":"Get Token Status","description":"Get OAuth token status for an MCP server.\n\nReturns information about the current token state.","operationId":"get_token_status_organizations__organization_id__mcp_servers__server_name__oauth_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/tokens":{"delete":{"tags":["MCP OAuth"],"summary":"Revoke Tokens","description":"Revoke and delete OAuth tokens for an MCP server.\n\nRequires admin role. If a revocation_endpoint is configured, attempts to\nrevoke tokens at the authorization server (RFC 7009) before deleting\nlocal copies. Local tokens are always deleted regardless of remote\nrevocation success.","operationId":"revoke_tokens_organizations__organization_id__mcp_servers__server_name__oauth_tokens_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/probe":{"post":{"tags":["MCP OAuth"],"summary":"Probe Server","description":"Detect how an MCP server signs in, given only its URL.\n\nThe same discovery as POST .../servers/{name}/oauth/discover, for a URL\nthat is not a server yet, so the dashboard can show the verdict before\nanything is created. Nothing is stored.\n\nThe URL passes the same check as creating a server (HTTPS, resolvable, no\ninternal or private address); a URL that fails it is a 400 carrying the\ncheck's own message. The per-organization rate limit answers 429 with a\nRetry-After header.\n\nRequires admin role.","operationId":"probe_server_organizations__organization_id__mcp_probe_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPProbeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPProbeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/secrets":{"get":{"tags":["Secrets"],"summary":"List Secrets","description":"List all secrets for an organization (values hidden).\n\nReturns only key names and metadata, not the actual secret values.","operationId":"list_secrets_organizations__organization_id__secrets_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/secrets/{key}":{"post":{"tags":["Secrets"],"summary":"Create Secret","description":"Create a new organization secret.\n\nThe secret value is encrypted at rest. Reference it in MCP configs\nusing ${secrets.KEY_NAME} syntax.","operationId":"create_secret_organizations__organization_id__secrets__key__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Secrets"],"summary":"Update Secret","description":"Create or update (upsert) an organization secret.\n\nPUT is idempotent: it sets the secret regardless of whether it already\nexists, so the first save of a credential does not 404. Use POST when you\nneed create-only semantics (409 on conflict).","operationId":"update_secret_organizations__organization_id__secrets__key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Secrets"],"summary":"Delete Secret","description":"Delete an organization secret.\n\nWarning: This will break any MCP configurations that reference this secret.","operationId":"delete_secret_organizations__organization_id__secrets__key__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/secrets/{key}/exists":{"get":{"tags":["Secrets"],"summary":"Check Secret Exists","description":"Check if a secret exists (without revealing its value).","operationId":"check_secret_exists_organizations__organization_id__secrets__key__exists_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/plans":{"get":{"tags":["billing"],"summary":"List Plans","description":"List all available subscription plans.\n\nReturns plan details including pricing and features.\nEnterprise plan shows as contact-sales (no checkout available).","operationId":"list_plans_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PlanResponse"},"type":"array","title":"Response List Plans Billing Plans Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/plans/{plan_id}":{"get":{"tags":["billing"],"summary":"Get Plan","description":"Get details for a specific subscription plan.\n\nArgs:\n    plan_id: Plan identifier (starter, professional, enterprise)\n\nReturns:\n    Plan details","operationId":"get_plan_billing_plans__plan_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/SubscriptionPlan"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/checkout":{"post":{"tags":["billing"],"summary":"Create Checkout","description":"Create a Stripe Checkout session for subscription purchase.\n\nRedirects user to Stripe's hosted checkout page.\nAfter successful payment, user is redirected to success_url.\n\nArgs:\n    request: Checkout creation request with plan_id and optional URLs\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Checkout session with redirect URL\n\nRaises:\n    400: Invalid plan or plan not available for checkout\n    500: Stripe API error","operationId":"create_checkout_billing_checkout_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["billing"],"summary":"List User Checkout Sessions","description":"List checkout sessions for the current user.\n\nArgs:\n    status_filter: Filter by status (pending, completed, expired)\n    limit: Maximum results (default: 10)\n    offset: Pagination offset (default: 0)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of checkout sessions","operationId":"list_user_checkout_sessions_billing_checkout_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutSessionResponse"},"title":"Response List User Checkout Sessions Billing Checkout Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/checkout/{session_id}":{"get":{"tags":["billing"],"summary":"Get Checkout Session","description":"Get details of a specific checkout session.\n\nArgs:\n    session_id: Checkout session ID\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Checkout session details\n\nRaises:\n    404: Session not found\n    403: Session belongs to another user","operationId":"get_checkout_session_billing_checkout__session_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/trial":{"post":{"tags":["billing"],"summary":"Start Trial","description":"Start a card-on-file Brain evaluation trial (MCP-only, one month).\n\nOpens a Stripe Checkout redirect so the card is collected up front; the\nsubscription auto-charges at trial end unless the user cancels first. The\ntrial length is read from the anchor price's metadata.trial_period_days in\nStripe, never hard-coded here.\n\nRaises:\n    400: Invalid plan / unknown user / no price configured.\n    403: Caller is not the organization owner.\n    409: A subscription already exists (already_active or subscription_exists).\n    503: Billing not configured for the region.\n    500: Stripe API error.","operationId":"start_trial_billing_trial_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartTrialRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartTrialResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/brain-pass/grant":{"post":{"tags":["billing"],"summary":"Grant Pass","description":"Record (idempotently) a Brain access pass after the wallet charge settles.\n\nIdempotent on ``jti``: a client retry, or the webhook backstop racing the\nclient, returns the existing pass without a duplicate charge or row.\n\nRaises:\n    403: Caller is not an internal service account.\n    400: Unknown SKU.\n    404: Unknown organization (FK).","operationId":"grant_pass_billing_brain_pass_grant_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantBrainPassRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantBrainPassResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/subscriptions/current":{"get":{"tags":["billing"],"summary":"Get Current Subscription","description":"Get the current active subscription for the authenticated user.\n\nReturns None if user has no active subscription.\n\nArgs:\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Current subscription details or None","operationId":"get_current_subscription_billing_subscriptions_current_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionResponse"},{"type":"null"}],"title":"Response Get Current Subscription Billing Subscriptions Current Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/subscriptions":{"get":{"tags":["billing"],"summary":"List Subscriptions","description":"List all subscriptions for the authenticated user.\n\nIncludes current and past subscriptions.\n\nArgs:\n    status_filter: Filter by status (active, canceled, etc.)\n    limit: Maximum results (default: 10)\n    offset: Pagination offset (default: 0)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of subscriptions","operationId":"list_subscriptions_billing_subscriptions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionResponse"},"title":"Response List Subscriptions Billing Subscriptions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/subscriptions/{subscription_id}":{"get":{"tags":["billing"],"summary":"Get Subscription","description":"Get details of a specific subscription.\n\nArgs:\n    subscription_id: Subscription ID\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Subscription details\n\nRaises:\n    404: Subscription not found\n    403: Subscription belongs to another user","operationId":"get_subscription_billing_subscriptions__subscription_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/subscriptions/{subscription_id}/cancel":{"post":{"tags":["billing"],"summary":"Cancel Subscription","description":"Cancel a subscription.\n\nArgs:\n    subscription_id: Subscription ID\n    request: Cancellation options (cancel_at_period_end)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Updated subscription\n\nRaises:\n    404: Subscription not found\n    403: Subscription belongs to another user\n    500: Stripe API error","operationId":"cancel_subscription_billing_subscriptions__subscription_id__cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/subscriptions/{subscription_id}/reactivate":{"post":{"tags":["billing"],"summary":"Reactivate Subscription","description":"Reactivate a subscription marked for cancellation.\n\nOnly works if subscription is marked to cancel at period end.\n\nArgs:\n    subscription_id: Subscription ID\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Updated subscription\n\nRaises:\n    404: Subscription not found\n    403: Subscription belongs to another user\n    400: Subscription not marked for cancellation\n    500: Stripe API error","operationId":"reactivate_subscription_billing_subscriptions__subscription_id__reactivate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/subscriptions/upgrade":{"post":{"tags":["billing"],"summary":"Upgrade Subscription","description":"Upgrade the user's subscription to a higher tier.\n\nUpgrades are processed immediately with prorated charges.\n\nArgs:\n    request: Target plan for upgrade\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Upgrade result with new plan details\n\nRaises:\n    503: Billing not configured\n    400: No active subscription, already on target plan, or invalid upgrade\n    500: Stripe API error","operationId":"upgrade_subscription_billing_subscriptions_upgrade_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/subscriptions/convert-trial":{"post":{"tags":["billing"],"summary":"Convert Trial","description":"End the user's Brain trial now and start the paid subscription immediately.\n\nFor a trialing user who does not want to wait for trial end: ends the trial in\nStripe (``trial_end='now'``), which charges the card on file for their current\nplan and transitions the subscription trialing -> active. Works for ANY\ntrialing user (it is \"start paying now\", not a tier upgrade, so it covers a\nuser already on the top tier too). Credit allocation and the local-row update\nare handled by the existing trialing -> active webhook\n(``customer.subscription.updated``), so this endpoint is a thin trigger and\nnever double-allocates.\n\nRaises:\n    503: Billing not configured for the user's region.\n    400: No trial to convert (no subscription, or it is not trialing).\n    500: Stripe API error.","operationId":"convert_trial_billing_subscriptions_convert_trial_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertTrialResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/subscriptions/downgrade":{"post":{"tags":["billing"],"summary":"Downgrade Subscription","description":"Downgrade the user's subscription to a lower tier.\n\nUses Stripe Subscription Schedules to truly delay the plan change until\nthe billing period ends. User keeps current tier features AND credits\nuntil the scheduled change takes effect.\n\nArgs:\n    request: Target plan for downgrade\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Downgrade result with effective date\n\nRaises:\n    503: Billing not configured\n    400: No active subscription, already on target plan, or invalid downgrade\n    500: Stripe API error","operationId":"downgrade_subscription_billing_subscriptions_downgrade_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DowngradeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DowngradeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["billing"],"summary":"Cancel Scheduled Downgrade","description":"Cancel a scheduled subscription downgrade.\n\nReleases the subscription schedule, keeping the user on their current plan.\nOnly works if there is a pending scheduled downgrade.\n\nArgs:\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Cancellation confirmation\n\nRaises:\n    503: Billing not configured\n    400: No active subscription or no scheduled downgrade\n    500: Stripe API error","operationId":"cancel_scheduled_downgrade_billing_subscriptions_downgrade_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelDowngradeResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/subscriptions/resubscribe":{"post":{"tags":["billing"],"summary":"Resubscribe","description":"Resubscribe after a cancelled or expired subscription.\n\nCreates a Stripe Checkout session for users with no active subscription.\nReturns a checkout URL to redirect the user to Stripe for payment.\n\nArgs:\n    request: Plan to subscribe to (defaults to starter)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Checkout URL for redirect\n\nRaises:\n    400: User already has an active subscription\n    503: Billing not configured\n    500: Stripe API error","operationId":"resubscribe_billing_subscriptions_resubscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResubscribeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credits/balance":{"get":{"tags":["billing"],"summary":"Get Credit Balance","description":"Get current credit balance and summary for the authenticated user.\n\nReturns current period credits and lifetime totals.\n\nArgs:\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Credit balance summary","operationId":"get_credit_balance_billing_credits_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalanceResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credits/allocations":{"get":{"tags":["billing"],"summary":"Get Allocation History","description":"Get credit allocation history for the authenticated user.\n\nShows monthly credit grants over time.\n\nArgs:\n    limit: Maximum results (default: 12 months)\n    offset: Pagination offset (default: 0)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of credit allocations","operationId":"get_allocation_history_billing_credits_allocations_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":12,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreditAllocationResponse"},"title":"Response Get Allocation History Billing Credits Allocations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/credits/transactions":{"get":{"tags":["billing"],"summary":"Get Transaction History","description":"Get credit transaction history for the authenticated user.\n\nShows all credit movements (usage, allocations, refunds, adjustments).\n\nArgs:\n    transaction_type: Filter by type (usage, allocation, refund, adjustment)\n    limit: Maximum results (default: 100)\n    offset: Pagination offset (default: 0)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of credit transactions","operationId":"get_transaction_history_billing_credits_transactions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"transaction_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreditTransactionResponse"},"title":"Response Get Transaction History Billing Credits Transactions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/credits/threads/{thread_id}/transactions":{"get":{"tags":["billing"],"summary":"Get Thread Transactions","description":"Get all credit transactions for a specific LangGraph thread.\n\nShows credit usage for a particular conversation/workflow.\n\nArgs:\n    thread_id: LangGraph thread ID\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of credit transactions for the thread\n\nNote:\n    Only returns transactions for threads owned by the current user.","operationId":"get_thread_transactions_billing_credits_threads__thread_id__transactions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreditTransactionResponse"},"title":"Response Get Thread Transactions Billing Credits Threads  Thread Id  Transactions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/credits/deduct":{"post":{"tags":["billing"],"summary":"Deduct Credits","description":"Deduct credits from the authenticated user's balance.\n\nThis endpoint is typically called by internal services (LangGraph workflows)\nto track credit usage.\n\nArgs:\n    request: Credit usage details (amount, reason, thread_id, metadata)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Credit transaction record\n\nRaises:\n    400: No active allocation or insufficient credits","operationId":"deduct_credits_billing_credits_deduct_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditUsageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditTransactionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credits/check/{amount}":{"get":{"tags":["billing"],"summary":"Check Sufficient Credits","description":"Check if user has sufficient credits for an operation.\n\nArgs:\n    amount: Credits required\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Dict with sufficient status and current balance","operationId":"check_sufficient_credits_billing_credits_check__amount__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"amount","in":"path","required":true,"schema":{"type":"integer","title":"Amount"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Check Sufficient Credits Billing Credits Check  Amount  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/credits/refund":{"post":{"tags":["billing"],"summary":"Create Refund For Run","description":"Create refund for all refundable transactions in a LangGraph run.\n\nRefunds all credit usage transactions associated with a specific run ID.\nThis is typically used when a LangGraph workflow fails or produces\nunsatisfactory results.\n\nArgs:\n    request: Refund request with run_id, reason, and optional metadata\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Refund creation summary with all refund pairs\n\nRaises:\n    400: No refundable transactions found for the run\n    403: Run does not belong to the authenticated user\n    404: Run not found","operationId":"create_refund_for_run_billing_credits_refund_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credits/refunds/{run_id}":{"get":{"tags":["billing"],"summary":"Get Refunds For Run","description":"Get all refund transactions for a specific LangGraph run.\n\nShows all refunds that have been issued for a particular run.\n\nArgs:\n    run_id: LangGraph run ID\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of refund transactions with total refunded amount\n\nRaises:\n    403: Run does not belong to the authenticated user","operationId":"get_refunds_for_run_billing_credits_refunds__run_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/credits/stream":{"get":{"tags":["billing"],"summary":"Stream Credit Updates","description":"Stream real-time credit balance updates via Server-Sent Events (SSE).\n\nThis endpoint establishes a persistent connection that sends credit updates\nin real-time whenever the user's credit balance changes.\n\nNote: This endpoint requires the SSE feature flag to be enabled.\nSet FEATURE_SSE_ENABLED=true in environment variables.\n\nArgs:\n    current_user: Authenticated user\n\nReturns:\n    StreamingResponse with text/event-stream content type\n\nRaises:\n    503: SSE feature is disabled\n\nExample client usage (JavaScript):\n    ```javascript\n    const eventSource = new EventSource('/billing/credits/stream', {\n        headers: { 'Authorization': 'Bearer <token>' }\n    });\n\n    eventSource.addEventListener('credit_update', (event) => {\n        const data = JSON.parse(event.data);\n        console.log('Balance:', data.current_balance);\n        console.log('Change:', data.change);\n    });\n\n    eventSource.addEventListener('heartbeat', (event) => {\n        console.log('Connection alive');\n    });\n    ```\n\nEvent format:\n    ```\n    event: credit_update\n    data: {\n        \"user_id\": \"user_123\",\n        \"current_balance\": 850,\n        \"change\": -150,\n        \"reason\": \"LangGraph workflow execution\",\n        \"timestamp\": \"2025-10-21T12:34:56Z\"\n    }\n    ```","operationId":"stream_credit_updates_billing_credits_stream_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/webhooks/stripe/us":{"post":{"tags":["billing"],"summary":"Stripe Webhook Us","description":"Handle Stripe webhook events from US account (DynG AI, Inc.).\n\nThis endpoint receives and processes webhook events from the US Stripe account.\nConfigure in US Stripe dashboard:\nhttps://agents.platformpilot.ai/billing/webhooks/stripe/us\n\nSecurity:\n- Verifies Stripe webhook signature using STRIPE_WEBHOOK_SECRET_US\n- No authentication required (webhook signature is the auth)\n\nReturns:\n    Success/error status for Stripe's webhook retry logic","operationId":"stripe_webhook_us_billing_webhooks_stripe_us_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stripe Webhook Us Billing Webhooks Stripe Us Post"}}}}}}},"/billing/webhooks/stripe/eu":{"post":{"tags":["billing"],"summary":"Stripe Webhook Eu","description":"Handle Stripe webhook events from EU account (PlatformPilot Limited).\n\nThis endpoint receives and processes webhook events from the EU Stripe account.\nConfigure in EU Stripe dashboard:\nhttps://agents.platformpilot.ai/billing/webhooks/stripe/eu\n\nSecurity:\n- Verifies Stripe webhook signature using STRIPE_WEBHOOK_SECRET_EU\n- No authentication required (webhook signature is the auth)\n\nReturns:\n    Success/error status for Stripe's webhook retry logic","operationId":"stripe_webhook_eu_billing_webhooks_stripe_eu_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stripe Webhook Eu Billing Webhooks Stripe Eu Post"}}}}}}},"/billing/webhooks/stripe":{"post":{"tags":["billing"],"summary":"Stripe Webhook","description":"Handle Stripe webhook events (legacy endpoint - defaults to US).\n\nThis endpoint maintains backwards compatibility with existing webhook\nconfigurations. New deployments should use region-specific endpoints:\n- /webhooks/stripe/us for US account\n- /webhooks/stripe/eu for EU account\n\nEvents handled:\n- checkout.session.completed: Mark checkout as complete\n- checkout.session.expired: Mark checkout as expired\n- customer.subscription.created: Create subscription + allocate credits\n- customer.subscription.updated: Update subscription status\n- customer.subscription.deleted: Cancel subscription\n- invoice.payment_succeeded: Allocate credits on renewal\n- invoice.payment_failed: Log payment failure\n\nSecurity:\n- Verifies Stripe webhook signature to ensure authenticity\n- No authentication required (webhook signature is the auth)\n\nReturns:\n    Success/error status for Stripe's webhook retry logic\n\nRaises:\n    400: Invalid signature or payload\n    500: Processing error","operationId":"stripe_webhook_billing_webhooks_stripe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stripe Webhook Billing Webhooks Stripe Post"}}}}}}},"/billing/subscription/status":{"get":{"summary":"Get Subscription Status","description":"Get user's subscription status with race condition handling.\n\nReturns:\n    Structured response with user, subscription, credits, and billing objects.\n    Status can be: \"active\", \"processing\", \"pending_payment\", \"expired\", \"none\"","operationId":"get_subscription_status_billing_subscription_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_uid","in":"query","required":false,"schema":{"type":"string","description":"User UID from Landing Page (Auth0 User ID)","title":"User Uid"},"description":"User UID from Landing Page (Auth0 User ID)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/invoices":{"get":{"tags":["billing"],"summary":"List Invoices","description":"List invoices for the authenticated user.\n\nReturns paginated list of invoices with caching (5-minute TTL).\nCache is invalidated automatically when invoice webhook events occur.\n\nArgs:\n    limit: Maximum invoices to return (1-100, default: 10)\n    starting_after: Invoice ID for cursor-based pagination\n    status_filter: Filter by invoice status\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Paginated invoice list with total count\n\nRaises:\n    503: If Stripe is not configured\n    502: If Stripe API call fails","operationId":"list_invoices_billing_invoices_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of invoices to return","default":10,"title":"Limit"},"description":"Number of invoices to return"},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Invoice ID for pagination (cursor)","title":"Starting After"},"description":"Invoice ID for pagination (cursor)"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status (draft, open, paid, uncollectible, void)","title":"Status"},"description":"Filter by status (draft, open, paid, uncollectible, void)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/portal":{"post":{"tags":["billing"],"summary":"Create Portal Session","description":"Create a Stripe Billing Portal session for the authenticated user.\n\nUses the user's stored stripe_region to route to the correct Stripe account.\n\nThe portal allows customers to:\n- Update payment methods\n- View billing history and download invoices\n- Cancel or update subscriptions\n\nArgs:\n    request: Request with return URL\n    current_user: Authenticated user\n\nReturns:\n    Portal session URL to redirect the user to\n\nRaises:\n    503: Billing not configured for user's region\n    400: User has no Stripe customer ID\n    500: Stripe API error","operationId":"create_portal_session_billing_portal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/extra-usage/settings":{"get":{"tags":["billing"],"summary":"Get Extra Usage Settings","description":"Get extra usage settings for the authenticated user.\n\nReturns the user's current extra usage configuration including:\n- Whether extra usage is enabled\n- Spending cap (if set)\n- Current overage spend this period\n- Plan-specific overage pricing","operationId":"get_extra_usage_settings_billing_extra_usage_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtraUsageSettingsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["billing"],"summary":"Update Extra Usage Settings","description":"Update extra usage settings.\n\nAllows users to:\n- Enable/disable extra usage (overage billing)\n- Set a monthly spending cap\n\nWhen enabling for the first time, this adds the metered price component\nto the user's Stripe subscription for end-of-period billing.","operationId":"update_extra_usage_settings_billing_extra_usage_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtraUsageSettingsUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtraUsageSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/extra-usage/usage":{"get":{"tags":["billing"],"summary":"Get Overage Usage","description":"Get current period overage usage summary.\n\nReturns a detailed breakdown of the current billing period including:\n- Included credits granted and remaining\n- Overage credits consumed\n- Current overage spend\n- Whether the user has hit their spending cap","operationId":"get_overage_usage_billing_extra_usage_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverageUsageResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credit-packs/checkout":{"post":{"tags":["billing"],"summary":"Create Credit Pack Checkout","description":"Create a Stripe Checkout session for purchasing a credit pack.\n\nCredit packs are one-time purchases that add prepaid credits to the user's\nbalance. These credits never expire and can be used after included credits\nare exhausted.\n\nUses the user's stored stripe_region to route to the correct Stripe account.\n\nArgs:\n    request: Credit pack checkout request with amount_cents\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Checkout session URL and credits to receive\n\nRaises:\n    400: User not on a prepaid plan or invalid amount\n    503: Stripe not configured","operationId":"create_credit_pack_checkout_billing_credit_packs_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditPackCheckoutRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditPackCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credit-packs/balance":{"get":{"tags":["billing"],"summary":"Get Credit Pack Balance","description":"Get user's prepaid credit balance and recent purchase history.\n\nArgs:\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Prepaid credit balance and purchase history","operationId":"get_credit_pack_balance_billing_credit_packs_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditPackBalanceResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/status/{organization_id}":{"get":{"tags":["billing"],"summary":"Check Org Billing Status","description":"Get billing status for an organization.\n\nUsed by RO service for pre-flight billing checks before marshalling.\n\nAuthorization:\n    - Internal service accounts (auth_source=\"internal\") can access any org\n    - External users can only access their own organization\n\nArgs:\n    organization_id: Organization ID (slug) to check\n\nReturns:\n    Billing status with can_process_alert flag","operationId":"check_org_billing_status_billing_status__organization_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Check Org Billing Status Billing Status  Organization Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/create":{"post":{"tags":["organizations"],"summary":"Create Organization","description":"Create organization for external user (called by Landing Page during onboarding).\n\n**Call Sequence**:\n1. Landing Page creates user via `POST /webhooks/auth/users`\n2. Landing Page calls this endpoint to create organization\n\n**Prerequisites**: User MUST exist (created via `/webhooks/auth/users` first)\n\n**Behavior**: IDEMPOTENT - Returns existing org if already created for this user\n\n**Authentication**: API key via `x-api-key` header\n\n**Request**:\n```json\n{\n    \"external_id\": \"auth0|abc123\",\n    \"owner_email\": \"user@example.com\",\n    \"owner_name\": \"John Doe\"\n}\n```\n\n**Response**:\n```json\n{\n    \"organization_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n    \"organization_name\": \"John Doe's Organization\",\n    \"created_at\": \"2025-11-15T12:00:00Z\"\n}\n```","operationId":"create_organization_organizations_create_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/bots/health":{"get":{"tags":["Bot Configuration"],"summary":"Bot Health Check","description":"Bot Configuration service health check.","operationId":"bot_health_check_organizations__organization_id__bots_health_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/bots":{"get":{"tags":["Bot Configuration"],"summary":"List Bots","description":"List all bot configurations for the organization.","operationId":"list_bots_organizations__organization_id__bots_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/bots/{provider}":{"get":{"tags":["Bot Configuration"],"summary":"Get Bot","description":"Get configuration for a specific bot provider.","operationId":"get_bot_organizations__organization_id__bots__provider__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Bot Configuration"],"summary":"Create Bot","description":"Create a new bot configuration. Requires admin or owner role.","operationId":"create_bot_organizations__organization_id__bots__provider__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotConfigCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bot Configuration"],"summary":"Update Bot","description":"Update an existing bot configuration. Requires admin or owner role.","operationId":"update_bot_organizations__organization_id__bots__provider__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bot Configuration"],"summary":"Delete Bot","description":"Delete a bot configuration. Requires admin or owner role.","operationId":"delete_bot_organizations__organization_id__bots__provider__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/bots/{provider}/test":{"post":{"tags":["Bot Configuration"],"summary":"Test Bot","description":"Send a test notification to verify bot configuration.","operationId":"test_bot_organizations__organization_id__bots__provider__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels":{"get":{"tags":["Channel Configuration"],"summary":"List Channels","description":"List all configured channels with account summaries.","operationId":"list_channels_organizations__organization_id__channels_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/available":{"get":{"tags":["Channel Configuration"],"summary":"List Available Channels","description":"List all registered channel plugins with their capabilities.","operationId":"list_available_channels_organizations__organization_id__channels_available_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableChannelsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/health/status":{"get":{"tags":["Channel Configuration"],"summary":"Get Channel Health Status","description":"Return health status for all channel accounts (for dashboard).\n\nIncludes per-account probe results, failure counts, and restart history.","operationId":"get_channel_health_status_organizations__organization_id__channels_health_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/bindings":{"get":{"tags":["Channel Configuration"],"summary":"List Channel Bindings","description":"List all configured conversation-to-graph bindings.","operationId":"list_channel_bindings_organizations__organization_id__channels_bindings_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Channel Bindings Organizations  Organization Id  Channels Bindings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Channel Configuration"],"summary":"Create Channel Binding","description":"Create or replace a conversation-to-graph binding. Requires admin role.\n\n``team_id`` pins the conversation's shared-channel memory to a team of\nthis org (422 otherwise). An omitted field keeps its stored value, so a\nclient that sends only ``team_id`` never resets the graph or\ndescription; an explicit ``null`` team clears the pin.","operationId":"create_channel_binding_organizations__organization_id__channels_bindings_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/bindings/{channel_id}/{conversation_id}":{"delete":{"tags":["Channel Configuration"],"summary":"Delete Channel Binding","description":"Delete a conversation-to-graph binding. Requires admin role.","operationId":"delete_channel_binding_organizations__organization_id__channels_bindings__channel_id___conversation_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/accounts":{"get":{"tags":["Channel Configuration"],"summary":"List Channel Accounts","description":"List all accounts for a specific channel.","operationId":"list_channel_accounts_organizations__organization_id__channels__channel_id__accounts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelAccountResponse"},"title":"Response List Channel Accounts Organizations  Organization Id  Channels  Channel Id  Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Channel Configuration"],"summary":"Create Channel Account","description":"Create a new channel account. Requires admin or owner role.","operationId":"create_channel_account_organizations__organization_id__channels__channel_id__accounts_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelAccountCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/accounts/{account_id}":{"get":{"tags":["Channel Configuration"],"summary":"Get Channel Account","description":"Get a specific channel account.","operationId":"get_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelAccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Channel Configuration"],"summary":"Update Channel Account","description":"Update a channel account. Requires admin or owner role.","operationId":"update_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelAccountUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Channel Configuration"],"summary":"Delete Channel Account","description":"Delete a channel account. Requires admin or owner role.","operationId":"delete_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/accounts/{account_id}/enable":{"post":{"tags":["Channel Configuration"],"summary":"Enable Channel Account","description":"Enable a channel account. Requires admin or owner role.","operationId":"enable_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__enable_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/accounts/{account_id}/disable":{"post":{"tags":["Channel Configuration"],"summary":"Disable Channel Account","description":"Disable a channel account. Requires admin or owner role.","operationId":"disable_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__disable_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/accounts/{account_id}/test":{"post":{"tags":["Channel Configuration"],"summary":"Test Channel Account","description":"Test channel account connectivity via probe.","operationId":"test_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/config-schema":{"get":{"tags":["Channel Configuration"],"summary":"Get Channel Config Schema","description":"Return the config schema for a channel (for frontend form generation).","operationId":"get_channel_config_schema_organizations__organization_id__channels__channel_id__config_schema_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/directory/peers":{"get":{"tags":["Channel Configuration"],"summary":"List Channel Peers","description":"List peers (phone numbers, users) from a channel's directory adapter.","operationId":"list_channel_peers_organizations__organization_id__channels__channel_id__directory_peers_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/directory/groups":{"get":{"tags":["Channel Configuration"],"summary":"List Channel Groups","description":"List the group conversations (channels) the bot is part of (admin only).\n\nAdmin only: it names private channels, which a member outside them must\nnot learn about. Each row says whether PlatformPilot learns from it.","operationId":"list_channel_groups_organizations__organization_id__channels__channel_id__directory_groups_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/commands":{"get":{"tags":["Channel Configuration"],"summary":"Get Channel Commands","description":"List native commands for a channel.","operationId":"get_channel_commands_organizations__organization_id__channels__channel_id__commands_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/oauth/authorize":{"get":{"tags":["Channel Configuration"],"summary":"Channel Oauth Authorize","description":"Generate OAuth authorize URL for channel installation.\n\nRequires admin or owner role.","operationId":"channel_oauth_authorize_organizations__organization_id__channels__channel_id__oauth_authorize_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelAuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/oauth/callback":{"post":{"tags":["Channel Configuration"],"summary":"Channel Oauth Callback","description":"Handle OAuth callback: exchange code and store workspace/guild info.\n\nRequires admin or owner role, like every other channel account write.","operationId":"channel_oauth_callback_organizations__organization_id__channels__channel_id__oauth_callback_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOAuthCallbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOAuthCallbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/digest":{"get":{"tags":["Channel Configuration"],"summary":"Get Brain Digest Config","description":"Return the org's Brain digest opt-in (defaults when never set).","operationId":"get_brain_digest_config_organizations__organization_id__channels_digest_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainDigestConfig"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Channel Configuration"],"summary":"Put Brain Digest Config","description":"Set the org's Brain digest opt-in (admin).\n\nEnabling requires a real, outbound-capable channel account and the\naudience attestation; disabling needs nothing. The stored row is the\nsingle gate the dream-time sender reads.","operationId":"put_brain_digest_config_organizations__organization_id__channels_digest_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainDigestConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/channels/googlechat/oauth/callback":{"get":{"tags":["Channel Webhooks"],"summary":"Googlechat Oauth Callback","description":"Direct OAuth callback for Google Chat reactions scope.\n\nGoogle redirects the browser here after the admin authorizes.\nWe exchange the code for tokens, store them, and redirect to D3.\n\nOn success: redirect to D3 with ``?channel_oauth=success&channel=googlechat``\nOn failure: redirect with ``?channel_oauth=error&channel=googlechat&channel_oauth_error=<msg>``","operationId":"googlechat_oauth_callback_webhooks_channels_googlechat_oauth_callback_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/channels/{channel_id}":{"get":{"tags":["Channel Webhooks"],"summary":"Verify Channel Webhook","description":"Handle GET-based webhook verification (e.g. Meta's hub.challenge).\n\nUsed by WhatsApp Cloud API and other Meta platforms. Meta sends:\n``GET /webhooks/channels/whatsapp?org_id=X&hub.mode=subscribe&hub.verify_token=T&hub.challenge=C``\n\nThe plugin's inbound adapter verifies the token and returns the challenge.","operationId":"verify_channel_webhook_webhooks_channels__channel_id__get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Channel Webhooks"],"summary":"Receive Channel Webhook","description":"Handle inbound webhook for a channel.\n\nPipeline:\n1. Challenge response (Slack URL verification, Discord PING).\n2. Signature verification: before the org lookup for platform-signed\n   channels, whose failed signatures alone spend the per-IP budget;\n   other channels keep the per-IP limit up front.\n3. Inline interactions (Teams card clicks and message actions), answered\n   synchronously by the plugin's interactivity adapter.\n4. Event parsing (cheap: no per-message API calls).\n5. For each message:\n   a. Buffer it when its conversation is tracked (encrypted, all\n      messages including chatter), then the cheap gate (invitees,\n      unmentioned chatter), then enrichment.\n   b. Mention gating (skip unmentioned group messages).\n   c. Ack reaction (fire-and-forget).\n   d. Debounce (batch rapid-fire messages from same sender).","operationId":"receive_channel_webhook_webhooks_channels__channel_id__post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/channels/{channel_id}/interactive":{"post":{"tags":["Channel Webhooks"],"summary":"Receive Channel Interaction","description":"Handle a rich-message interaction callback (button click).\n\nVerifies the platform signature via the plugin's interactivity\nadapter, parses the callback, and acks immediately — the actual\nhandling runs in the background so the platform's ack window\n(Slack: 3s) is never at risk.","operationId":"receive_channel_interaction_webhooks_channels__channel_id__interactive_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/summaries/threads/{thread_id}":{"get":{"tags":["summaries"],"summary":"Get Summary","description":"Get summary for a thread.\n\nReturns the summary from thread state if available,\nor status \"pending\" if summary hasn't been generated yet.\n\nArgs:\n    thread_id: Thread ID to get summary for\n    current_user: Authenticated user\n    db: Async DB session (team membership for the access check)\n\nReturns:\n    SummaryResponse with status and optional summary data\n\nNote:\n    Summary generation is triggered by the billing_node after\n    workflow completion. This endpoint only fetches existing summaries.","operationId":"get_summary_summaries_threads__thread_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/summaries/threads/{thread_id}/regenerate":{"post":{"tags":["summaries"],"summary":"Regenerate Summary","description":"Trigger (re)generation of a thread summary, idempotently.\n\nIdempotent by default: if the thread already has a summary, or one is\nalready being generated (a fresh pending marker), this skips the expensive\nHaiku call instead of duplicating it. This guards the inbox backfill path,\nwhere many clients (multiple tabs, or every user in an org) can request the\nsame summary-less thread at once. Pass ``force=true`` to force a fresh\nregeneration (an explicit user action), bypassing the idempotency checks.\n\nAsync: the client should listen for the SSE summary_complete event.\n\nArgs:\n    thread_id: Thread ID to (re)generate the summary for\n    force: Bypass idempotency and always regenerate\n    current_user: Authenticated user\n    db: Async DB session (team membership for the access check)\n\nReturns:\n    202 Accepted with thread_id (skipped=True when nothing was started)","operationId":"regenerate_summary_summaries_threads__thread_id__regenerate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Regenerate Summary Summaries Threads  Thread Id  Regenerate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/context-window":{"get":{"tags":["context-window"],"summary":"Get Context Window","description":"Return current context-window utilization for the indicator UI.","operationId":"get_context_window_threads__thread_id__context_window_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"selection_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextWindowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/steer":{"post":{"tags":["steer"],"summary":"Steer Thread","description":"Queue a mid-turn steer for the thread's live run.","operationId":"steer_thread_threads__thread_id__steer_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SteerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SteerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["steer"],"summary":"List Steer Queue","description":"List queued-but-not-yet-drained steers (queue UI rendering).","operationId":"list_steer_queue_threads__thread_id__steer_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SteerQueueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/steer/{steer_id}":{"delete":{"tags":["steer"],"summary":"Remove Steer Item","description":"Remove one queued steer (queue-item delete before the drain).\n\n404 when the item is gone: already drained into the run, or never\nexisted. Removal races the drain safely (exact-value LREM).","operationId":"remove_steer_item_threads__thread_id__steer__steer_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"steer_id","in":"path","required":true,"schema":{"type":"string","title":"Steer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove Steer Item Threads  Thread Id  Steer  Steer Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inbox/threads/search":{"post":{"tags":["inbox"],"summary":"Inbox Threads Search","description":"Search the inbox-visible threads for the calling user.\n\nWire-compatible with ``POST /threads/search`` for the body shape d3\nalready sends (``metadata``, ``values``, ``status``, ``limit``,\n``offset``, ``select``). Response is the same list-of-thread shape.","operationId":"inbox_threads_search_inbox_threads_search_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Inbox Threads Search Inbox Threads Search Post"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/eval/locomo/run":{"post":{"tags":["eval"],"summary":"Run Locomo Experiment","description":"Run the LoCoMo benchmark: seed memories, search, generate answers.\n\nReturns Mem0-compatible results JSON. Feed into ``POST /eval/locomo/score``\nto compute BLEU-1, set-F1, and LLM Judge metrics.","operationId":"run_locomo_experiment_eval_locomo_run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"technique","in":"query","required":false,"schema":{"type":"string","description":"Memory system: 'platformpilot' or 'mem0'","default":"platformpilot","title":"Technique"},"description":"Memory system: 'platformpilot' or 'mem0'"},{"name":"search_limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"(platformpilot only) Results per search query","default":10,"title":"Search Limit"},"description":"(platformpilot only) Results per search query"},{"name":"seed_granularity","in":"query","required":false,"schema":{"enum":["atomic","atomic_evolve","session"],"type":"string","description":"(platformpilot only) Memory ingestion granularity / evolution schedule. 'atomic' (online, default/headline) decomposes each session into fact bullets via extract_facts, one memory per fact, evolving each per-write — matches the product write path. 'atomic_evolve' (batch) seeds the same atoms EMBED-ONLY then runs ONE deferred evolve_namespace_once pass over the complete corpus (no O(N^2) per-insert re-touch). 'session' (legacy) is the whole-session chunk, kept for re-baselining. Numbers are NOT comparable across values (different ingestion).","default":"atomic","title":"Seed Granularity"},"description":"(platformpilot only) Memory ingestion granularity / evolution schedule. 'atomic' (online, default/headline) decomposes each session into fact bullets via extract_facts, one memory per fact, evolving each per-write — matches the product write path. 'atomic_evolve' (batch) seeds the same atoms EMBED-ONLY then runs ONE deferred evolve_namespace_once pass over the complete corpus (no O(N^2) per-insert re-touch). 'session' (legacy) is the whole-session chunk, kept for re-baselining. Numbers are NOT comparable across values (different ingestion)."},{"name":"max_conversations","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":10,"minimum":1},{"type":"null"}],"description":"Max conversations to evaluate (1-10)","default":1,"title":"Max Conversations"},"description":"Max conversations to evaluate (1-10)"},{"name":"mem0_api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"(mem0 only) Mem0 API key","title":"Mem0 Api Key"},"description":"(mem0 only) Mem0 API key"},{"name":"mem0_org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"(mem0 only) Mem0 organization ID","title":"Mem0 Org Id"},"description":"(mem0 only) Mem0 organization ID"},{"name":"mem0_project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"(mem0 only) Mem0 project ID","title":"Mem0 Project Id"},"description":"(mem0 only) Mem0 project ID"},{"name":"enable_graph","in":"query","required":false,"schema":{"type":"boolean","description":"(mem0 only) Enable graph memory (Mem0+ mode, requires Pro plan)","default":false,"title":"Enable Graph"},"description":"(mem0 only) Enable graph memory (Mem0+ mode, requires Pro plan)"},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional path to a checkpoint JSON file. When set, per-conversation progress is persisted after every QA pair, and a subsequent run with the same path resumes from the last completed conversation. Required when running large benchmarks with rate-limited tokens.","title":"Checkpoint Path"},"description":"Optional path to a checkpoint JSON file. When set, per-conversation progress is persisted after every QA pair, and a subsequent run with the same path resumes from the last completed conversation. Required when running large benchmarks with rate-limited tokens."},{"name":"pace_seconds","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":120.0,"minimum":0.0},{"type":"null"}],"description":"Seconds to sleep between answer LLM calls. Start with ~10 for Sonnet via OAuth; bump to 15–20 only if 429s persist. Falls back to the EVAL_PACE_SECONDS env var (default 0).","title":"Pace Seconds"},"description":"Seconds to sleep between answer LLM calls. Start with ~10 for Sonnet via OAuth; bump to 15–20 only if 429s persist. Falls back to the EVAL_PACE_SECONDS env var (default 0)."},{"name":"seed_only","in":"query","required":false,"schema":{"type":"boolean","description":"Seed-only: the backend seeds + drains evolution per conversation and stops (no retrieve, no reader, no teardown). Namespaces persist so a client-side reader can retrieve + answer + tear down. A conversation showing was_seeded in the checkpoint means its evolution has fully settled — poll GET /eval/locomo/checkpoint for readiness.","default":false,"title":"Seed Only"},"description":"Seed-only: the backend seeds + drains evolution per conversation and stops (no retrieve, no reader, no teardown). Namespaces persist so a client-side reader can retrieve + answer + tear down. A conversation showing was_seeded in the checkpoint means its evolution has fully settled — poll GET /eval/locomo/checkpoint for readiness."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/locomo/cancel":{"post":{"tags":["eval"],"summary":"Cancel Locomo Run","description":"Cancel an in-flight LoCoMo run on this worker.\n\nRequired because ``/eval/locomo/run`` is synchronous-await and FastAPI\ndoes not cancel handler coroutines when the client disconnects. A\nrunaway run (e.g. 429-storming on rate limits) would otherwise persist\nuntil the worker rotates. This endpoint calls ``task.cancel()`` on the\nregistered asyncio.Task, which propagates ``CancelledError`` into the\nnext ``await`` point in the run loop and unwinds gracefully.\n\nPer-worker scope: the registry is in-process. A run on a different\nworker can't be cancelled from here — but worker rotation kills those\nanyway. In a multi-worker cluster, repeat the cancel call until you hit\nthe right worker (or wait for rotation).","operationId":"cancel_locomo_run_eval_locomo_cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"checkpoint_path","in":"query","required":true,"schema":{"type":"string","description":"The checkpoint_path of the in-flight run to cancel. Must match exactly the path used in the original /run request.","title":"Checkpoint Path"},"description":"The checkpoint_path of the in-flight run to cancel. Must match exactly the path used in the original /run request."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/locomo/score":{"post":{"tags":["eval"],"summary":"Score Locomo Results","description":"Score raw experiment results with BLEU-1, set-F1, and LLM Judge.\n\nAccepts the ``results`` dict from the run phase and returns scored\nresults with per-category and overall summaries.","operationId":"score_locomo_results_eval_locomo_score_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"pace_seconds","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":120.0,"minimum":0.0},{"type":"null"}],"description":"Seconds to sleep between judge LLM calls. ~10s for Sonnet is usually fine. Falls back to EVAL_PACE_SECONDS (default 0).","title":"Pace Seconds"},"description":"Seconds to sleep between judge LLM calls. ~10s for Sonnet is usually fine. Falls back to EVAL_PACE_SECONDS (default 0)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":true}},"description":"Raw results from /eval/locomo/run (Mem0-format JSON)","title":"Results"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/locomo/checkpoint":{"get":{"tags":["eval"],"summary":"Read Locomo Checkpoint","description":"Read a LoCoMo run checkpoint from the LangGraph store.\n\nThe checkpoint is now Postgres-backed (under namespace\n``(\"eval_checkpoints\",)``) so it survives LangGraph Cloud worker\nrotation and is readable from any replica — fixing the stickiness\nissue where the file-on-/tmp version was lost on every deploy.\n\nSet ``include_qa=true`` to fetch the full QA payload — that turns\nthis endpoint into a \"result-extraction\" hop that's safe even when\nthe original /run request lost its client connection.","operationId":"read_locomo_checkpoint_eval_locomo_checkpoint_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","description":"Checkpoint key. (Historically a worker-local file path; now an opaque key into the LangGraph store namespace ``eval_checkpoints``. Same string used to write it.)","title":"Path"},"description":"Checkpoint key. (Historically a worker-local file path; now an opaque key into the LangGraph store namespace ``eval_checkpoints``. Same string used to write it.)"},{"name":"include_qa","in":"query","required":false,"schema":{"type":"boolean","description":"When true, include the full ``qa_results`` payload for each conversation. Use this to fetch the run's answers without holding open the synchronous /eval/locomo/run connection.","default":false,"title":"Include Qa"},"description":"When true, include the full ``qa_results`` payload for each conversation. Use this to fetch the run's answers without holding open the synchronous /eval/locomo/run connection."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval__CheckpointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/locomo/cleanup":{"post":{"tags":["eval"],"summary":"Cleanup Locomo Memories","description":"Wipe all memories seeded by a prior LoCoMo run.\n\nUse this between runs to ensure each experiment starts from a clean\nslate. The previous run may have crashed mid-conversation (e.g. on\nrate limits) leaving partial memories that would skew the next run's\nscores.\n\nFor ``platformpilot``: deletes the eval namespace, evolution counter,\nand merge redirects for each conversation.\nFor ``mem0``: deletes the user_id ``locomo_<idx>`` for each conv.","operationId":"cleanup_locomo_memories_eval_locomo_cleanup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"technique","in":"query","required":false,"schema":{"type":"string","description":"Memory system whose namespaces should be wiped","default":"platformpilot","title":"Technique"},"description":"Memory system whose namespaces should be wiped"},{"name":"max_conversations","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Wipe data for conversations 0..max_conversations-1","default":10,"title":"Max Conversations"},"description":"Wipe data for conversations 0..max_conversations-1"},{"name":"mem0_api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"(mem0) Mem0 API key — required when technique='mem0'","title":"Mem0 Api Key"},"description":"(mem0) Mem0 API key — required when technique='mem0'"},{"name":"mem0_org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mem0 Org Id"}},{"name":"mem0_project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mem0 Project Id"}},{"name":"enable_graph","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Enable Graph"}},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"If set, delete this checkpoint file too","title":"Checkpoint Path"},"description":"If set, delete this checkpoint file too"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval__CleanupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/longmemeval/run":{"post":{"tags":["eval"],"summary":"Run Longmemeval Experiment","description":"Run LongMemEval: seed each haystack, retrieve, answer, record recall.","operationId":"run_longmemeval_experiment_eval_longmemeval_run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"search_limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Search Limit"}},{"name":"prompt_variant","in":"query","required":false,"schema":{"enum":["v1","v2"],"type":"string","description":"Reader answer-prompt variant: 'v2' (default; curbs over-abstention by forcing a full scan plus paraphrase/date/relational matching before the same abstention path) or 'v1' (original, abstention-first). Both keep the _abs abstention path, so abstention questions still decline. Pass 'v1' to reproduce the original policy or to A/B the two.","default":"v2","title":"Prompt Variant"},"description":"Reader answer-prompt variant: 'v2' (default; curbs over-abstention by forcing a full scan plus paraphrase/date/relational matching before the same abstention path) or 'v1' (original, abstention-first). Both keep the _abs abstention path, so abstention questions still decline. Pass 'v1' to reproduce the original policy or to A/B the two."},{"name":"seed_granularity","in":"query","required":false,"schema":{"enum":["atomic","atomic_evolve","session"],"type":"string","description":"Memory ingestion granularity / evolution schedule. 'session' (legacy, default) is the one-memory-per-session dump: the fast, low-contention, proven baseline (~50 memories/example). 'atomic' (online) decomposes each session into standalone fact bullets via extract_facts, one freeform memory per fact, each evolved per-write (matches the product write path) but seeds far more memories per example. 'atomic_evolve' (batch) seeds the same atoms EMBED-ONLY then runs ONE deferred evolve_namespace_once pass over the complete corpus (no O(N^2) per-insert re-touch). Numbers are NOT comparable across values (different ingestion); the value is recorded in the run config.","default":"session","title":"Seed Granularity"},"description":"Memory ingestion granularity / evolution schedule. 'session' (legacy, default) is the one-memory-per-session dump: the fast, low-contention, proven baseline (~50 memories/example). 'atomic' (online) decomposes each session into standalone fact bullets via extract_facts, one freeform memory per fact, each evolved per-write (matches the product write path) but seeds far more memories per example. 'atomic_evolve' (batch) seeds the same atoms EMBED-ONLY then runs ONE deferred evolve_namespace_once pass over the complete corpus (no O(N^2) per-insert re-touch). Numbers are NOT comparable across values (different ingestion); the value is recorded in the run config."},{"name":"max_examples","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Evaluate the first N examples in dataset order (None = all).","title":"Max Examples"},"description":"Evaluate the first N examples in dataset order (None = all)."},{"name":"sample_per_type","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Stratified sampling: take the first N examples of EACH ability bucket (information_extraction, multi_session_reasoning, knowledge_updates, temporal_reasoning, abstention). Representative across abilities; takes precedence over max_examples.","title":"Sample Per Type"},"description":"Stratified sampling: take the first N examples of EACH ability bucket (information_extraction, multi_session_reasoning, knowledge_updates, temporal_reasoning, abstention). Representative across abilities; takes precedence over max_examples."},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"LongMemEval data URL or local path. Falls back to LONGMEMEVAL_DATA_PATH / LONGMEMEVAL_DATA_URL.","title":"Source"},"description":"LongMemEval data URL or local path. Falls back to LONGMEMEVAL_DATA_PATH / LONGMEMEVAL_DATA_URL."},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Checkpoint key for resumable, Postgres-backed progress.","title":"Checkpoint Path"},"description":"Checkpoint key for resumable, Postgres-backed progress."},{"name":"question_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated question_ids to run exactly (targeted re-run). Takes precedence over max_examples / sample_per_type.","title":"Question Ids"},"description":"Comma-separated question_ids to run exactly (targeted re-run). Takes precedence over max_examples / sample_per_type."},{"name":"pace_seconds","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":120.0,"minimum":0.0},{"type":"null"}],"title":"Pace Seconds"}},{"name":"retrieve_only","in":"query","required":false,"schema":{"type":"boolean","description":"Retrieve-only: the deployment seeds + retrieves but does NOT run the reader. Each row carries the retrieved 'context' and an empty 'response' for a client-side reader to fill before scoring, keeping the reader LLM and its spend off the deployment.","default":false,"title":"Retrieve Only"},"description":"Retrieve-only: the deployment seeds + retrieves but does NOT run the reader. Each row carries the retrieved 'context' and an empty 'response' for a client-side reader to fill before scoring, keeping the reader LLM and its spend off the deployment."},{"name":"example_concurrency","in":"query","required":false,"schema":{"type":"integer","maximum":16,"minimum":1,"description":"How many examples to seed/retrieve concurrently. Each example is an isolated namespace (own seed lease, evolution, consolidation), so this overlaps the long per-example seeds WITHOUT reintroducing the intra-namespace contention the serial evolve pass guards against. 1 (default) = the original sequential behavior. Raise it to shorten wall-clock on multi-example runs; bounded to keep one replica's event loop and Haiku QPS sane. Ignored when pace_seconds > 0.","default":1,"title":"Example Concurrency"},"description":"How many examples to seed/retrieve concurrently. Each example is an isolated namespace (own seed lease, evolution, consolidation), so this overlaps the long per-example seeds WITHOUT reintroducing the intra-namespace contention the serial evolve pass guards against. 1 (default) = the original sequential behavior. Raise it to shorten wall-clock on multi-example runs; bounded to keep one replica's event loop and Haiku QPS sane. Ignored when pace_seconds > 0."},{"name":"skip_consolidation","in":"query","required":false,"schema":{"type":"boolean","description":"atomic_evolve only: skip the deferred Phase-C consolidation (consolidate=False on evolve_namespace_once). Phase C is a serial single-writer compaction (~25-30% of per-example wall-time) that barely moves recall@k for a seed-then-query-once eval (it never deletes atoms; superseded reaping is off by default). Off by default to keep the production-faithful baseline; opt in to A/B the delta.","default":false,"title":"Skip Consolidation"},"description":"atomic_evolve only: skip the deferred Phase-C consolidation (consolidate=False on evolve_namespace_once). Phase C is a serial single-writer compaction (~25-30% of per-example wall-time) that barely moves recall@k for a seed-then-query-once eval (it never deletes atoms; superseded reaping is off by default). Off by default to keep the production-faithful baseline; opt in to A/B the delta."},{"name":"batch_concurrency","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":16,"minimum":1},{"type":"null"}],"description":"atomic_evolve only: override the within-example Phase-B evolution fan-out (AMEM_BATCH_EVOLVE_CONCURRENCY, default 8). This is the per-source decider+merge concurrency on ONE event loop, distinct from example_concurrency (which overlaps whole examples). None (default) uses the global setting; 1 runs Phase B serially to measure the baseline without event-loop oversubscription or hot-hub lock contention.","title":"Batch Concurrency"},"description":"atomic_evolve only: override the within-example Phase-B evolution fan-out (AMEM_BATCH_EVOLVE_CONCURRENCY, default 8). This is the per-source decider+merge concurrency on ONE event loop, distinct from example_concurrency (which overlaps whole examples). None (default) uses the global setting; 1 runs Phase B serially to measure the baseline without event-loop oversubscription or hot-hub lock contention."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LongMemEvalRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/longmemeval/score":{"post":{"tags":["eval"],"summary":"Score Longmemeval Results","description":"Judge QA accuracy and aggregate recall@k (both overall + per ability).","operationId":"score_longmemeval_results_eval_longmemeval_score_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"pace_seconds","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":120.0,"minimum":0.0},{"type":"null"}],"title":"Pace Seconds"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Per-question rows from /eval/longmemeval/run","title":"Rows"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LongMemEvalScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/longmemeval/cancel":{"post":{"tags":["eval"],"summary":"Cancel Longmemeval Run","description":"Cancel an in-flight LongMemEval run on this worker.","operationId":"cancel_longmemeval_run_eval_longmemeval_cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"checkpoint_path","in":"query","required":true,"schema":{"type":"string","title":"Checkpoint Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/longmemeval/checkpoint":{"get":{"tags":["eval"],"summary":"Read Longmemeval Checkpoint","description":"Read a LongMemEval run checkpoint from the LangGraph store.","operationId":"read_longmemeval_checkpoint_eval_longmemeval_checkpoint_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","description":"Checkpoint key used in the /run request.","title":"Path"},"description":"Checkpoint key used in the /run request."},{"name":"include_rows","in":"query","required":false,"schema":{"type":"boolean","description":"Include each example's full result rows (answers + recall).","default":false,"title":"Include Rows"},"description":"Include each example's full result rows (answers + recall)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval_longmemeval__CheckpointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/longmemeval/cleanup":{"post":{"tags":["eval"],"summary":"Cleanup Longmemeval Memories","description":"Wipe memories seeded by a prior run (idempotent) and optional checkpoint.\n\nThe run already cleans up per example on success and sweeps its own tag\nat run end; this mops up after an interrupted run (per-example via the\ndataset, or everything eval-tagged via ``wipe_all_eval``).","operationId":"cleanup_longmemeval_memories_eval_longmemeval_cleanup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"max_examples","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Max Examples"}},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Path"}},{"name":"wipe_all_eval","in":"query","required":false,"schema":{"type":"boolean","description":"Sweep EVERY LongMemEval namespace regardless of run tag — seeds, leases, redirects, evolution counters — without needing the dataset. This is the mop-up for runs that died mid-flight and will never be re-run (leaked seeds sit in the shared vector index and degrade production search). Do NOT use while another eval run is in flight: it deletes that run's seeds too.","default":false,"title":"Wipe All Eval"},"description":"Sweep EVERY LongMemEval namespace regardless of run tag — seeds, leases, redirects, evolution counters — without needing the dataset. This is the mop-up for runs that died mid-flight and will never be re-run (leaked seeds sit in the shared vector index and degrade production search). Do NOT use while another eval run is in flight: it deletes that run's seeds too."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval_longmemeval__CleanupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/memoryagentbench/run":{"post":{"tags":["eval"],"summary":"Run Mab Experiment","description":"Run MemoryAgentBench: incremental seed + probe + deterministic scoring.","operationId":"run_mab_experiment_eval_memoryagentbench_run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"competency","in":"query","required":false,"schema":{"type":"string","default":"Conflict_Resolution","title":"Competency"}},{"name":"max_records","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Max Records"}},{"name":"search_limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Search Limit"}},{"name":"chunk_chars","in":"query","required":false,"schema":{"type":"integer","maximum":200000,"minimum":512,"default":16000,"title":"Chunk Chars"}},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Run id + resumable checkpoint key.","title":"Checkpoint Path"},"description":"Run id + resumable checkpoint key."},{"name":"pace_seconds","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":120.0,"minimum":0.0},{"type":"null"}],"title":"Pace Seconds"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MABRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/memoryagentbench/score":{"post":{"tags":["eval"],"summary":"Score Mab Results","description":"Aggregate already-scored rows (substring_exact_match is computed at run time).","operationId":"score_mab_results_eval_memoryagentbench_score_post","requestBody":{"content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"Scored rows from /run"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MABScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/eval/memoryagentbench/cancel":{"post":{"tags":["eval"],"summary":"Cancel Mab Run","description":"Cancel an in-flight MemoryAgentBench run on this worker.","operationId":"cancel_mab_run_eval_memoryagentbench_cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"checkpoint_path","in":"query","required":true,"schema":{"type":"string","title":"Checkpoint Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/memoryagentbench/checkpoint":{"get":{"tags":["eval"],"summary":"Read Mab Checkpoint","description":"Read a MemoryAgentBench run checkpoint.","operationId":"read_mab_checkpoint_eval_memoryagentbench_checkpoint_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","title":"Path"}},{"name":"include_rows","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Rows"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval_memoryagentbench__CheckpointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/memoryagentbench/cleanup":{"post":{"tags":["eval"],"summary":"Cleanup Mab Memories","description":"Wipe a run's seeded memories (by run_id=checkpoint_path) and the checkpoint.","operationId":"cleanup_mab_memories_eval_memoryagentbench_cleanup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"competency","in":"query","required":false,"schema":{"type":"string","default":"Conflict_Resolution","title":"Competency"}},{"name":"max_records","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Max Records"}},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval_memoryagentbench__CleanupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/media/upload":{"post":{"tags":["media"],"summary":"Upload Media","description":"Accept an image or PDF upload and return a Claude content block.\n\nValidates format, size, and content signature, base64-encodes the bytes,\nand returns the content block (``image`` for images, ``document`` for\nPDFs) that the client embeds into a multi-part HumanMessage.","operationId":"upload_media_media_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_media_media_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/internal/gateway/accounts":{"get":{"tags":["Internal Gateway"],"summary":"List Gateway Accounts","description":"Return all enabled accounts that need gateway connections.\n\nCalled once on sidecar startup for bootstrap. Subsequent changes\nare delivered via Redis pub/sub (gateway:account_changes channel).\n\nThe payload spans every org on the platform (org_id, account_id, linked\nsender phone numbers, Discord guild_id), so it is gated on the internal\nAPI key, not on a customer bearer token.","operationId":"list_gateway_accounts_internal_gateway_accounts_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Gateway Accounts Internal Gateway Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/rollout-gate":{"get":{"tags":["Internal"],"summary":"Rollout Gate","description":"Report executing runs so a release can wait for an idle worker.","operationId":"rollout_gate_internal_rollout_gate_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolloutGateStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp_memory/mcp":{"get":{"summary":"Mcp Memory Sse Not Supported","description":"Signal to MCP clients that this server does not expose an SSE stream.\n\nThe MCP Streamable HTTP transport opens a GET to the same URL to\nestablish a server→client SSE notifications stream. This server is\nstateless and JSON-only, so we return 405 per the MCP spec instead\nof letting the request fall through as a 404.","operationId":"mcp_memory_sse_not_supported_mcp_memory_mcp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Mcp Memory Endpoint","description":"MCP server: Streamable HTTP transport, stateless, JSON-RPC over POST.\n\nImplements the minimum surface needed by external clients: initialize,\nping, tools/list, tools/call, plus notifications/* (which expect no\nresponse).\n\n``initialize`` and ``tools/call`` require a token. Challenging the\ninitial connection starts OAuth before clients try to load tools; a\nsuccessful anonymous handshake can leave interactive clients without\nan authorization link. Direct ``tools/list``, ``ping`` and notification\nrequests remain public; anonymous discovery exposes only the base tool\nsurface, never organization data or per-org guidance.","operationId":"mcp_memory_endpoint_mcp_memory_mcp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/":{"get":{"summary":"Root","description":"Root endpoint for Studio.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/info":{"get":{"tags":["Health"],"summary":"Info","description":"Get service information.\n\nReturns the server name, version, and feature flags. This endpoint does\nnot require authentication.","operationId":"info_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfoResponse"}}}}}}},"/live":{"get":{"tags":["Health"],"summary":"Liveness Check","description":"Kubernetes liveness probe.\n\nAlways returns 200 to indicate the process is alive. Does not check\nbackend connectivity.","operationId":"liveness_check_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Liveness Check Live Get"}}}}}}},"/assistants":{"get":{"tags":["Assistants"],"summary":"List Assistants","description":"List all assistants owned by the authenticated user.\n\nReturns every assistant without filtering. Use the search endpoint for\nfiltered queries.","operationId":"list_assistants_assistants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantList"}}}}}},"post":{"tags":["Assistants"],"summary":"Create Assistant","description":"Create a new assistant.\n\nAn assistant is a configured instance of a graph. Provide a `graph_id`\nreferencing a graph defined in your `aegra.json`. If `assistant_id` is\nomitted, one is auto-generated. Set `if_exists` to `\"do_nothing\"` for\nidempotent creation; otherwise a taken `assistant_id` or an identical\ngraph/config pair answers 409.","operationId":"create_assistant_assistants_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"409":{"description":"Resource state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assistants/search":{"post":{"tags":["Assistants"],"summary":"Search Assistants","description":"Search assistants with filters.\n\nFilter by name, description, graph ID, or metadata. Results are paginated\nvia `limit` and `offset`.","operationId":"search_assistants_assistants_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Assistant"},"type":"array","title":"Response Search Assistants Assistants Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assistants/count":{"post":{"tags":["Assistants"],"summary":"Count Assistants","description":"Count assistants matching the given filters.\n\nAccepts the same filter parameters as the search endpoint but returns only\nthe total count.","operationId":"count_assistants_assistants_count_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"integer","title":"Response Count Assistants Assistants Count Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assistants/{assistant_id}":{"get":{"tags":["Assistants"],"summary":"Get Assistant","description":"Get an assistant by its ID.\n\nReturns the latest version of the assistant. Returns 404 if the assistant\ndoes not exist or does not belong to the authenticated user.","operationId":"get_assistant_assistants__assistant_id__get","parameters":[{"name":"assistant_id","in":"path","required":true,"schema":{"type":"string","title":"Assistant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Assistants"],"summary":"Update Assistant","description":"Update an assistant by its ID.\n\nPartial update: only fields included in the request body are changed.\nCreates a new version of the assistant.","operationId":"update_assistant_assistants__assistant_id__patch","parameters":[{"name":"assistant_id","in":"path","required":true,"schema":{"type":"string","title":"Assistant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Assistants"],"summary":"Delete Assistant","description":"Delete an assistant by its ID.\n\nPermanently removes the assistant and all of its versions. This action\ncannot be undone.","operationId":"delete_assistant_assistants__assistant_id__delete","parameters":[{"name":"assistant_id","in":"path","required":true,"schema":{"type":"string","title":"Assistant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assistants/{assistant_id}/latest":{"post":{"tags":["Assistants"],"summary":"Set Assistant Latest","description":"Pin a specific version as the latest version of an assistant.\n\nAfter calling this endpoint, the assistant will use the specified version's\nconfiguration when executing runs.","operationId":"set_assistant_latest_assistants__assistant_id__latest_post","parameters":[{"name":"assistant_id","in":"path","required":true,"schema":{"type":"string","title":"Assistant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_set_assistant_latest_assistants__assistant_id__latest_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assistants/{assistant_id}/versions":{"post":{"tags":["Assistants"],"summary":"List Assistant Versions","description":"Page versions newest first, filtering metadata before applying the offset.\n\nDefaults to ten versions. An empty page returns 404, matching Cloud.","operationId":"list_assistant_versions_assistants__assistant_id__versions_post","parameters":[{"name":"assistant_id","in":"path","required":true,"schema":{"type":"string","title":"Assistant Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantVersionsSearchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Assistant"},"title":"Response List Assistant Versions Assistants  Assistant Id  Versions Post"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assistants/{assistant_id}/schemas":{"get":{"tags":["Assistants"],"summary":"Get Assistant Schemas","description":"Get the JSON schemas for an assistant's graph.\n\nReturns ``graph_id`` and the input, output, state, config and context\nschemas derived from the graph's type annotations. A schema the server\ncould not derive is ``null``; the key is always present.","operationId":"get_assistant_schemas_assistants__assistant_id__schemas_get","parameters":[{"name":"assistant_id","in":"path","required":true,"schema":{"type":"string","title":"Assistant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSchemas"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assistants/{assistant_id}/graph":{"get":{"tags":["Assistants"],"summary":"Get Assistant Graph","description":"Get the graph structure for visualization.\n\nReturns a JSON representation of the graph's nodes and edges suitable for\nrendering in graph visualizers. Use `xray` to expand subgraph nodes into\ntheir internal structure.","operationId":"get_assistant_graph_assistants__assistant_id__graph_get","parameters":[{"name":"assistant_id","in":"path","required":true,"schema":{"type":"string","title":"Assistant Id"}},{"name":"xray","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"null"}],"description":"Expand subgraph nodes. Pass true or a depth integer to control nesting.","title":"Xray"},"description":"Expand subgraph nodes. Pass true or a depth integer to control nesting."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assistants/{assistant_id}/subgraphs":{"get":{"tags":["Assistants"],"summary":"Get Assistant Subgraphs","description":"Get subgraphs of an assistant.\n\nReturns the subgraph definitions used by this assistant's graph. Set\n`recurse=true` to include deeply nested subgraphs, or filter to a single\nnamespace.","operationId":"get_assistant_subgraphs_assistants__assistant_id__subgraphs_get","parameters":[{"name":"assistant_id","in":"path","required":true,"schema":{"type":"string","title":"Assistant Id"}},{"name":"recurse","in":"query","required":false,"schema":{"type":"boolean","description":"Recursively include nested subgraphs.","default":false,"title":"Recurse"},"description":"Recursively include nested subgraphs."},{"name":"namespace","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to a specific subgraph namespace.","title":"Namespace"},"description":"Filter to a specific subgraph namespace."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads":{"get":{"tags":["Threads"],"summary":"List Threads","description":"List all threads owned by the authenticated user.\n\nReturns every thread without filtering. Use the search endpoint for\nfiltered queries.","operationId":"list_threads_threads_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadList"}}}}}},"post":{"tags":["Threads"],"summary":"Create Thread","description":"Create a new conversation thread.\n\nThreads hold conversation state and checkpoint history. Provide a\n`thread_id` for idempotent creation, or let the server generate one.\nSet `if_exists` to `\"do_nothing\"` to return the existing thread when the\nID already exists instead of raising a 409 conflict.","operationId":"create_thread_threads_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"409":{"description":"Resource state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}":{"get":{"tags":["Threads"],"summary":"Get Thread","description":"Get a thread by its ID.\n\nReturns 404 if the thread does not exist or does not belong to the\nauthenticated user.","operationId":"get_thread_threads__thread_id__get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Threads"],"summary":"Update Thread","description":"Update a thread's metadata.\n\nMerges the provided metadata with the existing metadata (shallow merge).","operationId":"update_thread_threads__thread_id__patch","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Threads"],"summary":"Delete Thread","description":"Delete a thread by its ID.\n\nPermanently removes the thread, its metadata, and its checkpoint history\nstored in the graph backend. Any active runs on the thread are\nautomatically cancelled before deletion.\n\nReturns 409 and preserves the thread if rollback is in progress,\ncancellation cannot be acknowledged, or the thread remains busy until the deadline.","operationId":"delete_thread_threads__thread_id__delete","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Thread Threads  Thread Id  Delete"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"409":{"description":"Resource state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"500":{"description":"Checkpoint cleanup failed; the thread is preserved and the delete can be retried","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/state":{"get":{"tags":["Threads"],"summary":"Get Thread State","description":"Get the current state of a thread.\n\nReturns the latest checkpoint's values, pending next nodes, interrupt\ndata, and metadata. If the thread has no associated graph yet (no runs\nexecuted), returns an empty state.","operationId":"get_thread_state_threads__thread_id__state_get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"subgraphs","in":"query","required":false,"schema":{"type":"boolean","description":"Include states from subgraphs","default":false,"title":"Subgraphs"},"description":"Include states from subgraphs"},{"name":"checkpoint_ns","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Checkpoint namespace to scope lookup","title":"Checkpoint Ns"},"description":"Checkpoint namespace to scope lookup"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadState"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Threads"],"summary":"Update Thread State","description":"Update thread state or retrieve it via POST.\n\nWhen `values` is provided, creates a new checkpoint with the updated state.\nUse `as_node` to attribute the update to a specific graph node. When\n`values` is null AND `as_node` is not provided, this endpoint acts as a\nPOST-based alternative to the GET state endpoint (useful when passing\ncomplex checkpoint/subgraph parameters in the request body).\n\nWhen `values` is null AND `as_node` is provided (e.g. ``as_node=\"__copy__\"``\nas LangGraph Studio sends for \"Re-run from here\"), this creates a new\ncheckpoint derived from the supplied ``checkpoint_id`` without applying\nany state change — used to anchor a subsequent run as a fork of that\ncheckpoint rather than of the thread's latest state.\n\nState mutations hold the thread against deletion until the request ends.\nTTL skips it, while explicit deletion retries within its bounded deadline.","operationId":"update_thread_state_threads__thread_id__state_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadStateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ThreadState"},{"$ref":"#/components/schemas/ThreadStateUpdateResponse"}],"title":"Response Update Thread State Threads  Thread Id  State Post"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/state/{checkpoint_id}":{"get":{"tags":["Threads"],"summary":"Get Thread State At Checkpoint","description":"Get the thread state at a specific checkpoint.\n\nUse this to inspect historical state at any point in the thread's\nexecution history. Returns 404 if the checkpoint does not exist.","operationId":"get_thread_state_at_checkpoint_threads__thread_id__state__checkpoint_id__get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"checkpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Checkpoint Id"}},{"name":"subgraphs","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Include states from subgraphs","default":false,"title":"Subgraphs"},"description":"Include states from subgraphs"},{"name":"checkpoint_ns","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Checkpoint namespace to scope lookup","title":"Checkpoint Ns"},"description":"Checkpoint namespace to scope lookup"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadState"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/state/checkpoint":{"post":{"tags":["Threads"],"summary":"Get Thread State At Checkpoint Post","description":"Get the thread state at a specific checkpoint (POST variant).\n\nIdentical to the GET checkpoint endpoint but accepts the checkpoint\nconfiguration in the request body. Useful when the checkpoint namespace\ncontains characters that are awkward in URL paths.","operationId":"get_thread_state_at_checkpoint_post_threads__thread_id__state_checkpoint_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadCheckpointPostRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadState"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/history":{"post":{"tags":["Threads"],"summary":"Get Thread History Post","description":"Get the checkpoint history for a thread (POST variant).\n\nReturns a list of past states ordered from newest to oldest. Use `limit`\nto control how many states are returned and `before` to paginate.","operationId":"get_thread_history_post_threads__thread_id__history_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadHistoryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThreadState"},"title":"Response Get Thread History Post Threads  Thread Id  History Post"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Threads"],"summary":"Get Thread History Get","description":"Get the checkpoint history for a thread.\n\nReturns a list of past states ordered from newest to oldest. Use `limit`\nto control how many states are returned and `before` to paginate.","operationId":"get_thread_history_get_threads__thread_id__history_get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Number of states to return","default":10,"title":"Limit"},"description":"Number of states to return"},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return states before this checkpoint ID","title":"Before"},"description":"Return states before this checkpoint ID"},{"name":"subgraphs","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Include states from subgraphs","default":false,"title":"Subgraphs"},"description":"Include states from subgraphs"},{"name":"checkpoint_ns","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Checkpoint namespace","title":"Checkpoint Ns"},"description":"Checkpoint namespace"},{"name":"metadata","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON-encoded metadata filter","title":"Metadata"},"description":"JSON-encoded metadata filter"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThreadState"},"title":"Response Get Thread History Get Threads  Thread Id  History Get"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/prune":{"post":{"tags":["Threads"],"summary":"Prune Threads","description":"Immediately apply TTL policies to the caller's expired threads.\n\nThreads whose TTL has expired are deleted (strategy `delete`) or have\ntheir checkpoint history compacted (strategy `keep_latest`). Threads with\nactive runs are skipped and handled once their runs settle.","operationId":"prune_threads_threads_prune_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadPruneResponse"}}}}}}},"/threads/search":{"post":{"tags":["Threads"],"summary":"Search Threads","description":"Search threads with filters.\n\nFilter by status or metadata key-value pairs. Results are paginated via\n`limit` and `offset` and ordered by creation time (newest first).","operationId":"search_threads_threads_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Thread"},"type":"array","title":"Response Search Threads Threads Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/runs":{"post":{"tags":["Thread Runs"],"summary":"Create Run","description":"Create and execute a new run.\n\nStarts graph execution asynchronously and returns the run record\nimmediately with status `pending`. Poll the run or use the stream\nendpoint to follow progress. Provide either `input` or `command` (for\nhuman-in-the-loop resumption) but not both.","operationId":"create_run_threads__thread_id__runs_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"409":{"description":"Resource state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Thread Runs"],"summary":"List Runs","description":"List runs for a thread.\n\nReturns runs ordered by creation time (newest first). Use `status` to\nfilter and `limit`/`offset` to paginate.","operationId":"list_runs_threads__thread_id__runs_get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Maximum number of runs to return","default":10,"title":"Limit"},"description":"Maximum number of runs to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of runs to skip for pagination","default":0,"title":"Offset"},"description":"Number of runs to skip for pagination"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by run status (e.g. pending, running, success, error, interrupted)","title":"Status"},"description":"Filter by run status (e.g. pending, running, success, error, interrupted)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Run"},"title":"Response List Runs Threads  Thread Id  Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/runs/stream":{"post":{"tags":["Thread Runs"],"summary":"Create And Stream Run","description":"Create a new run and stream its execution via SSE.\n\nReturns a `text/event-stream` response with Server-Sent Events. Each\nevent has a `type` field (e.g. `values`, `updates`, `messages`,\n`metadata`, `end`) and a JSON `data` payload.\n\nSet `on_disconnect` to `\"continue\"` if the run should keep executing\nafter the client disconnects (default is `\"cancel\"`). Use `stream_mode`\nto control which event types are emitted.\n\nA periodic SSE keepalive comment is sent every\n``KEEPALIVE_INTERVAL_SECS`` so idle proxies don't drop long-running\nsilent nodes (e.g. agents holding an upstream WebSocket).","operationId":"create_and_stream_run_threads__thread_id__runs_stream_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}}},"responses":{"200":{"description":"Server-Sent Events stream","content":{"application/json":{"schema":{}},"text/event-stream":{"schema":{"type":"string"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"409":{"description":"Resource state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/runs/{run_id}":{"get":{"tags":["Thread Runs"],"summary":"Get Run","description":"Get a run by its ID.\n\nReturns the current state of the run including its status, input, output,\nand error information.","operationId":"get_run_threads__thread_id__runs__run_id__get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Thread Runs"],"summary":"Update Run","description":"Update a run's status.\n\nPrimarily used to interrupt a running execution. Set `status` to\n`\"interrupted\"` to cooperatively stop the run. When a live worker owns\nthe run, interruption is asynchronous and the response may still report\n`pending` or `running`. Poll or stream the run until it becomes terminal.","operationId":"update_run_threads__thread_id__runs__run_id__patch","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStatus"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Thread Runs"],"summary":"Delete Run","description":"Delete a stopped run, waiting for worker acknowledgment when needed.\n\nActive runs require force=1. A bounded stop timeout returns 409 and retains\nthe row so lease recovery and a later retry remain possible.","operationId":"delete_run_threads__thread_id__runs__run_id__delete","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"integer","maximum":1,"minimum":0,"description":"Set to 1 to cancel an active run before deleting it.","default":0,"title":"Force"},"description":"Set to 1 to cancel an active run before deleting it."}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"409":{"description":"Resource state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/runs/{run_id}/join":{"get":{"tags":["Thread Runs"],"summary":"Join Run","description":"Wait for a run to complete and return its output.\n\nReturns a chunked ``application/json`` response. While the run is still\nexecuting, the server sends periodic ``\\n`` heartbeat bytes to keep the\nconnection alive through proxies and load balancers (AWS ALB, Cloudflare,\netc.). The final chunk is the JSON result. Leading whitespace is ignored\nby JSON parsers, so clients can parse the concatenated body normally.\n\nIf the run is already in a terminal state, the output is returned\nimmediately with no heartbeat overhead.\n\nA run that failed, or that the wait gave up on, returns\n``{\"__error__\": {\"error\": ..., \"message\": ...}}`` instead of an output.\n``langgraph_sdk``'s ``runs.join`` hands that body back as-is, unlike\n``runs.wait``, which inspects the key and raises.\n\nSessions are managed manually (not via ``Depends``) to avoid holding a\npool connection during the long wait.","operationId":"join_run_threads__thread_id__runs__run_id__join_get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/runs/wait":{"post":{"tags":["Thread Runs"],"summary":"Wait For Run","description":"Create a run, execute it, and wait for completion.\n\nReturns a chunked ``application/json`` response with periodic ``\\n``\nheartbeat bytes to keep the connection alive. The final chunk is the\nJSON result. Uses ``BG_JOB_TIMEOUT_SECS`` (default 1 hour) as the\nsafety-net timeout.\n\nA run that failed, or that the wait gave up on, returns\n``{\"__error__\": {\"error\": ..., \"message\": ...}}`` instead of an output;\nthe LangGraph SDK reads that key and raises.\n\nSessions are managed manually (not via ``Depends``) to avoid holding a\npool connection during the long wait.","operationId":"wait_for_run_threads__thread_id__runs_wait_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"409":{"description":"Resource state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/runs/{run_id}/stream":{"get":{"tags":["Thread Runs"],"summary":"Stream Run","description":"Stream an existing run's execution via SSE.\n\nAttach to a run that was created without streaming (e.g. via the create\nendpoint) to receive its events in real time. If the run has already\nfinished, a single `end` event is emitted. Use the `Last-Event-ID`\nheader to resume from a specific event after a disconnect.\n\nA periodic SSE keepalive comment is sent every\n``KEEPALIVE_INTERVAL_SECS`` so idle proxies don't drop attached streams.","operationId":"stream_run_threads__thread_id__runs__run_id__stream_get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"_stream_mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Override the stream mode for this connection.","title":" Stream Mode"},"description":"Override the stream mode for this connection."},{"name":"Last-Event-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last-Event-Id"}}],"responses":{"200":{"description":"Server-Sent Events stream","content":{"application/json":{"schema":{}},"text/event-stream":{"schema":{"type":"string"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/runs/{run_id}/cancel":{"post":{"tags":["Thread Runs"],"summary":"Cancel Run Endpoint","description":"Cancel or interrupt a running execution.\n\nUse `action=cancel` to hard-cancel the run immediately, or\n`action=interrupt` to cooperatively interrupt (the graph can handle the\ninterrupt and save partial state). Set `wait=1` to wait up to 10 seconds\nfor the background task to settle before returning the updated run. The\nresponse may still report `pending` or `running` if the timeout expires.\nWithout `wait=1`, a live-owned run is cancelled asynchronously, so the\nresponse may still report `pending` or `running`.","operationId":"cancel_run_endpoint_threads__thread_id__runs__run_id__cancel_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"wait","in":"query","required":false,"schema":{"type":"integer","maximum":1,"minimum":0,"description":"Set to 1 to wait up to 10 seconds for the run task to settle before returning.","default":0,"title":"Wait"},"description":"Set to 1 to wait up to 10 seconds for the run task to settle before returning."},{"name":"action","in":"query","required":false,"schema":{"enum":["cancel","interrupt"],"type":"string","description":"Cancellation strategy: 'cancel' for hard cancel, 'interrupt' for cooperative interrupt.","default":"cancel","title":"Action"},"description":"Cancellation strategy: 'cancel' for hard cancel, 'interrupt' for cooperative interrupt."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/cancel":{"post":{"tags":["Thread Runs"],"summary":"Cancel Runs","description":"Cancel several runs at once, by status or by thread_id plus run_ids.\n\nRuns outside the caller's access boundary or that already finished are skipped. The\nthread must exist for the run_ids form; unknown run ids are ignored.","operationId":"cancel_runs_runs_cancel_post","parameters":[{"name":"action","in":"query","required":false,"schema":{"enum":["cancel","interrupt"],"type":"string","description":"Cancellation strategy: 'cancel' for hard cancel, 'interrupt' for cooperative interrupt.","default":"interrupt","title":"Action"},"description":"Cancellation strategy: 'cancel' for hard cancel, 'interrupt' for cooperative interrupt."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunsCancel"}}}},"responses":{"204":{"description":"Successful Response"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/wait":{"post":{"tags":["Stateless Runs"],"summary":"Stateless Wait For Run","description":"Create a stateless run and wait for completion.\n\nGenerates an ephemeral thread, delegates to the threaded ``wait_for_run``\nendpoint, and deletes the thread after the response finishes streaming\n(unless ``on_completion=\"keep\"``).","operationId":"stateless_wait_for_run_runs_wait_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"409":{"description":"Resource state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/stream":{"post":{"tags":["Stateless Runs"],"summary":"Stateless Stream Run","description":"Create a stateless run and stream its execution.\n\nGenerates an ephemeral thread, delegates to the threaded\n``create_and_stream_run`` endpoint, and deletes the thread after the\nstream finishes (unless ``on_completion=\"keep\"``).","operationId":"stateless_stream_run_runs_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}},"required":true},"responses":{"200":{"description":"Server-Sent Events stream","content":{"application/json":{"schema":{}},"text/event-stream":{"schema":{"type":"string"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"409":{"description":"Resource state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs":{"post":{"tags":["Stateless Runs"],"summary":"Stateless Create Run","description":"Create a stateless background run.\n\nGenerates an ephemeral thread, delegates to the threaded ``create_run``\nendpoint, and schedules cleanup as a background task (unless\n``on_completion=\"keep\"``).","operationId":"stateless_create_run_runs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"409":{"description":"Resource state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/crons":{"post":{"tags":["Crons"],"summary":"Create Cron","description":"Create a cron job that fires on a schedule (stateless).\n\nReturns the persisted ``Cron`` record. The first run starts at its next\nscheduled time; disabled crons remain stored without executing.","operationId":"create_cron_runs_crons_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Run"},{"$ref":"#/components/schemas/CronResponse"}],"title":"Response Create Cron Runs Crons Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/runs/crons":{"post":{"tags":["Crons"],"summary":"Create Cron For Thread","description":"Create a cron job bound to an existing thread.\n\nThe thread is reused for every scheduled run. Returns the persisted\n``Cron`` record; execution begins at the next scheduled time.","operationId":"create_cron_for_thread_threads__thread_id__runs_crons_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Run"},{"$ref":"#/components/schemas/CronResponse"}],"title":"Response Create Cron For Thread Threads  Thread Id  Runs Crons Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/crons/{cron_id}":{"patch":{"tags":["Crons"],"summary":"Update Cron","description":"Update an existing cron job.\n\nOnly provided fields are updated (partial patch). Returns the full\n``Cron`` object after update.","operationId":"update_cron_runs_crons__cron_id__patch","parameters":[{"name":"cron_id","in":"path","required":true,"schema":{"type":"string","title":"Cron Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Crons"],"summary":"Delete Cron","description":"Delete a cron job.","operationId":"delete_cron_runs_crons__cron_id__delete","parameters":[{"name":"cron_id","in":"path","required":true,"schema":{"type":"string","title":"Cron Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/crons/search":{"post":{"tags":["Crons"],"summary":"Search Crons","description":"Search cron jobs with filters and pagination.","operationId":"search_crons_runs_crons_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CronResponse"},"type":"array","title":"Response Search Crons Runs Crons Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/crons/count":{"post":{"tags":["Crons"],"summary":"Count Crons","description":"Count cron jobs matching filters.","operationId":"count_crons_runs_crons_count_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"integer","title":"Response Count Crons Runs Crons Count Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/store/items":{"put":{"tags":["Store"],"summary":"Put Store Item","description":"Create or update an item in the store.\n\nIf an item with the same namespace and key already exists, its value is\noverwritten. Values must be JSON objects (dictionaries).","operationId":"put_store_item_store_items_put","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorePutRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Store"],"summary":"Get Store Item","description":"Get an item from the store by key.\n\nReturns 404 if no item exists at the given namespace and key.","operationId":"get_store_item_store_items_get","parameters":[{"name":"key","in":"query","required":true,"schema":{"type":"string","description":"Key of the item to retrieve.","title":"Key"},"description":"Key of the item to retrieve."},{"name":"namespace","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Namespace path. Use dot-separated string or repeated query params.","title":"Namespace"},"description":"Namespace path. Use dot-separated string or repeated query params."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreGetResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProtocolError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Store"],"summary":"Delete Store Item","description":"Delete an item from the store.\n\nAccepts parameters via JSON body (`namespace` + `key`) or query\nparameters. The JSON body takes precedence when both are provided.","operationId":"delete_store_item_store_items_delete","parameters":[{"name":"key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Key of the item to delete (query param alternative).","title":"Key"},"description":"Key of the item to delete (query param alternative)."},{"name":"namespace","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Namespace path (query param alternative).","title":"Namespace"},"description":"Namespace path (query param alternative)."}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/StoreDeleteRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/store/items/search":{"post":{"tags":["Store"],"summary":"Search Store Items","description":"Search items in the store.\n\nFilter items by namespace prefix, key-value metadata filters, or semantic\nquery. Results are paginated via `limit` and `offset`.","operationId":"search_store_items_store_items_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/store/namespaces":{"post":{"tags":["Store"],"summary":"List Namespaces","description":"List namespaces in the store.\n\nReturns the namespace paths that contain items. Filter by prefix, suffix,\nor maximum depth.","operationId":"list_namespaces_store_namespaces_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreListNamespacesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreListNamespacesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/stream/events":{"post":{"tags":["Event Streaming"],"summary":"Stream Thread Events","description":"Open a channel-filtered SSE stream of the thread's run events.\n\nThread-scoped: events for any run on the thread flow through, so a\nclient can open the stream then issue ``run.start``. Each SSE frame's\n``data:`` is a protocol event envelope; ``id:`` is the ``seq`` a client\nechoes back as ``since`` on resume.\n\nDB work runs in short-lived sessions (the upfront ownership check here, and\neach run-lister poll) so no connection is held for the SSE lifetime (#423).","operationId":"stream_thread_events_threads__thread_id__stream_events_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventStreamRequest"}}}},"responses":{"200":{"description":"SSE stream of protocol event envelopes","content":{"text/event-stream":{}}},"400":{"description":"Invalid request (unsupported channels, malformed command)"},"404":{"description":"Thread owned by another user"},"503":{"description":"v2 disabled by flag, or runtime too old for native v3 events"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/commands":{"post":{"tags":["Event Streaming"],"summary":"Post Thread Command","description":"Run a single v2 command on the thread and return its response envelope.\n\nUses a short-lived session (the run created by ``run.start`` executes on\nthe worker; the response returns before streaming begins).","operationId":"post_thread_command_threads__thread_id__commands_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadCommand"}}}},"responses":{"200":{"description":"Protocol response envelope (success or error)","content":{"application/json":{"schema":{}}}},"404":{"description":"Thread owned by another user"},"503":{"description":"v2 disabled by flag, or runtime too old for native v3 events"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"APIResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"data":{"anyOf":[{},{"type":"null"}],"title":"Data"}},"type":"object","required":["success","message"],"title":"APIResponse","description":"Standard API response."},"AcceptanceReceipt":{"properties":{"operation":{"$ref":"#/components/schemas/MailboxOperation"},"payload_digest":{"type":"string","pattern":"^[0-9a-f]{64}$","title":"Payload Digest"},"accepted_at":{"type":"string","format":"date-time","title":"Accepted At"}},"additionalProperties":false,"type":"object","required":["operation","payload_digest","accepted_at"],"title":"AcceptanceReceipt","description":"Acknowledge committed intake only; processing status is separate."},"ActiveServersResponse":{"properties":{"active_servers":{"items":{"type":"string"},"type":"array","title":"Active Servers"},"excluded_servers":{"items":{"$ref":"#/components/schemas/ExcludedServer"},"type":"array","title":"Excluded Servers"},"total_enabled":{"type":"integer","title":"Total Enabled"}},"type":"object","required":["active_servers","excluded_servers","total_enabled"],"title":"ActiveServersResponse","description":"Response for active servers endpoint."},"ActiveTeamState":{"properties":{"team_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Team Id","description":"The caller's active team in this org, or null (no pick). Must be a team of this org the caller belongs to."},"team_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":16},{"type":"null"}],"title":"Team Ids","description":"A multi-team audience instead of one active team: two or more teams of this org the caller belongs to, or null. The caller's private chats then read and write as a member of all of them, and those chats cannot be shared. At most one of team_id and team_ids is set."}},"type":"object","title":"ActiveTeamState","description":"Request and response body of the active-team endpoints."},"AddToCrm":{"properties":{"entityId":{"type":"string","minLength":1,"title":"Entityid"},"fields":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Fields"},"linkRecordId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linkrecordid"},"force":{"type":"boolean","title":"Force","default":false},"dryRun":{"type":"boolean","title":"Dryrun","default":false}},"type":"object","required":["entityId"],"title":"AddToCrm","description":"Body of ``POST .../records/from-entity`` (Add to CRM)."},"AdjudicatorSpec":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"max_slots_per_run":{"type":"integer","maximum":2000.0,"minimum":1.0,"title":"Max Slots Per Run","default":50}},"additionalProperties":false,"type":"object","title":"AdjudicatorSpec","description":"Bound source adjudication independently of its shared autonomy gate."},"AdminViewState":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"AdminViewState","description":"Response shape for the admin-view endpoints."},"AdminViewUpdate":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"AdminViewUpdate","description":"Request body for PUT /organizations/{org_id}/admin-view."},"Admission":{"properties":{"can_connect":{"type":"boolean","title":"Can Connect"},"blocker":{"anyOf":[{"type":"string","enum":["unavailable","memory","team_isolation"]},{"type":"null"}],"title":"Blocker"},"can_enable":{"type":"boolean","title":"Can Enable","default":false},"has_teams":{"type":"boolean","title":"Has Teams","default":false},"crm_sharing":{"type":"boolean","title":"Crm Sharing","default":false},"sources_available":{"type":"boolean","title":"Sources Available","default":false},"providers":{"items":{"type":"string","enum":["outlook","gmail","imap"]},"type":"array","title":"Providers"}},"type":"object","required":["can_connect"],"title":"Admission","description":"Say whether the caller can start a new connection, and what stops it.\n\n``blocker`` names the first failed requirement. ``team_isolation`` is the\none a person can clear: ``can_enable`` says this caller (an admin or\nowner) may turn the setting on through the agent settings route, and\n``has_teams`` says whether doing so changes what members see (with no\nteam, no memory carries a team label, so nothing changes)."},"AgentEnvironmentResponse":{"properties":{"cloud_providers":{"additionalProperties":{"$ref":"#/components/schemas/CloudProviderResponse"},"type":"object","title":"Cloud Providers"},"clusters":{"additionalProperties":{"$ref":"#/components/schemas/KubernetesClusterResponse"},"type":"object","title":"Clusters"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["cloud_providers","clusters"],"title":"AgentEnvironmentResponse","description":"Response schema for complete Agent Environment."},"AgentEnvironmentValidationResult":{"properties":{"valid":{"type":"boolean","title":"Valid"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"cloud_providers_count":{"type":"integer","title":"Cloud Providers Count"},"clusters_count":{"type":"integer","title":"Clusters Count"}},"type":"object","required":["valid","cloud_providers_count","clusters_count"],"title":"AgentEnvironmentValidationResult","description":"Response schema for environment validation."},"AgentProtocolError":{"properties":{"error":{"type":"string","title":"Error","description":"Error type"},"message":{"type":"string","title":"Message","description":"Human-readable error message"},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details","description":"Additional error details"}},"type":"object","required":["error","message"],"title":"AgentProtocolError","description":"Standard Agent Protocol error response"},"AgentSchemas":{"properties":{"graph_id":{"type":"string","title":"Graph Id","description":"Identifier of the graph these schemas describe."},"input_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Schema","description":"JSON Schema for agent inputs"},"output_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output Schema","description":"JSON Schema for agent outputs"},"state_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"State Schema","description":"JSON Schema for agent state"},"config_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config Schema","description":"JSON Schema for agent config"},"context_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context Schema","description":"JSON Schema for the graph's run context"}},"type":"object","required":["graph_id","input_schema","output_schema","state_schema","config_schema","context_schema"],"title":"AgentSchemas","description":"Agent schema definitions for client integration.\n\nMirrors ``langgraph_sdk.schema.GraphSchema``. A schema the server could not\nderive from the graph is ``null``."},"AgentSettingsResponse":{"properties":{"model_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Model Policy"},"chat_model_catalog":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Chat Model Catalog"},"memory_model_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Memory Model Policy"},"memory_model_catalog":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Memory Model Catalog"},"compaction_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Compaction Policy"},"event_threads_enabled":{"type":"boolean","title":"Event Threads Enabled","description":"Whether automatic thread creation from events is enabled"},"web_search_enabled":{"type":"boolean","title":"Web Search Enabled","description":"Whether web search is enabled"},"web_search_max_uses":{"type":"integer","title":"Web Search Max Uses","description":"Tavily searches per minute (rolling window)"},"web_search_requests_per_minute":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Web Search Requests Per Minute","description":"TinyFish session requests/minute override; null inherits provider ceiling"},"web_extract_urls_per_minute":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Web Extract Urls Per Minute","description":"TinyFish session URLs/minute override; null inherits provider ceiling"},"web_extract_enabled":{"type":"boolean","title":"Web Extract Enabled","description":"Whether URL extraction is enabled"},"web_extract_max_uses":{"type":"integer","title":"Web Extract Max Uses","description":"Tavily extraction calls per minute (rolling window)"},"web_extract_depth":{"type":"string","title":"Web Extract Depth","description":"Tavily extraction depth; inactive for TinyFish"},"memory_enabled":{"type":"boolean","title":"Memory Enabled","description":"Whether investigation memory (A-mem) is enabled"},"memory_maintenance_enabled":{"type":"boolean","title":"Memory Maintenance Enabled","description":"Whether background memory maintenance is enabled"},"memory_team_isolation":{"type":"boolean","title":"Memory Team Isolation","description":"Whether brain memory rows are scoped to teams"},"memory_team_isolation_effective":{"type":"boolean","title":"Memory Team Isolation Effective","description":"Whether team isolation actually applies now: the org setting AND the platform switch (read-only). Labels are inert when false."},"delegation_approver":{"type":"string","title":"Delegation Approver","description":"Who approves a cross-person delegation (assignee, requester, both)"},"crm_automations_enabled":{"type":"boolean","title":"Crm Automations Enabled","description":"Whether CRM automations run for the org","default":false},"crm_automations_ever_enabled":{"type":"boolean","title":"Crm Automations Ever Enabled","description":"Whether CRM automations were ever turned on (read-only)","default":false},"crm_automations":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Crm Automations","description":"Set when this update turned automations on: held_runs (queued when they were turned off) and drafts (saved while off)"},"crm_automation_daily_cap":{"type":"integer","title":"Crm Automation Daily Cap","description":"Agent runs CRM automations may start per UTC day","default":200},"crm_lifecycle_enabled":{"type":"boolean","title":"Crm Lifecycle Enabled","description":"Whether CRM lifecycle stages are on for the org","default":true},"crm_brain_feed_paused":{"type":"boolean","title":"Crm Brain Feed Paused","description":"Whether the org's CRM Brain feed is paused","default":false},"dr_input_capture_enabled":{"type":"boolean","title":"Dr Input Capture Enabled","description":"Whether evaluation-run input capture is enabled"},"dr_gate_auto_delta_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Dr Gate Auto Delta Max","description":"Org override for the 'auto' consumption-gate ceiling (null = deployment default)"},"dr_gate_suggest_delta_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Dr Gate Suggest Delta Max","description":"Org override for the 'suggest' consumption-gate ceiling (null = deployment default)"},"dream_daily_run_cap":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dream Daily Run Cap","description":"Org override for daily background memory-maintenance runs (null = deployment default)"},"tracing_enabled":{"type":"boolean","title":"Tracing Enabled","description":"Whether per-run LangSmith trace forwarding is enabled for this org. False by default; admin opts in. When False, no node inputs/outputs are sent to LangSmith, even if the global ``LANGSMITH_TRACING`` env var is set."},"grounding_reminders_enabled":{"type":"boolean","title":"Grounding Reminders Enabled","description":"Whether the fresh DISPATCH-CLAIM CONTRACT is injected in the system prompt for modes that have one (currently DR Research)."},"profile_suggestions_enabled":{"type":"boolean","title":"Profile Suggestions Enabled","description":"Whether proactive next-session profile suggestions are enabled for admin chat sessions."},"default_chat_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Profile","description":"Profile name used for chat memory extraction + recall. None = platform default (SRE)."},"default_chat_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Model","description":"Org default model id for the chat executor. None = platform default (see ``chat_model_default``)."},"default_chat_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Effort","description":"Org default effort for the chat executor. None = platform default (see ``chat_effort_default``)."},"agent_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Effort","description":"Single effort cap for non-chat reasoning (HDR/DR executor + HDR hypothesis/solution). None = per-model platform default. Does NOT affect chat."},"chat_model_options":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Chat Model Options","description":"Selectable chat models as [{id, label}] (read-only)."},"chat_effort_options":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Chat Effort Options","description":"Selectable effort levels as [{id, label}] (read-only)."},"chat_efforts_by_model":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Chat Efforts By Model","description":"Valid effort ids per model id (read-only). The UI filters the effort picker by the selected model (Sonnet 5.5 and Opus both expose low–xhigh)."},"chat_model_default":{"type":"string","title":"Chat Model Default","description":"Platform default model id when default_chat_model is null."},"chat_effort_default":{"type":"string","title":"Chat Effort Default","description":"Platform default effort when default_chat_effort is null."},"default_thread_visibility":{"type":"string","title":"Default Thread Visibility","description":"Default visibility for new conversations in the d3 composer. 'private' | 'org' | 'team:<uuid>'."},"cron_thread_ttl_minutes":{"type":"integer","title":"Cron Thread Ttl Minutes","description":"Minutes before cron-created threads are auto-deleted"},"command_deny_list":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Command Deny List","description":"Command patterns blocked from execution"},"compaction_trigger_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Compaction Trigger Tokens","description":"Input token threshold for context compaction (50k–900k). None = inherit deployment policy (automatic model capacity by default)."},"playbook_failure_archive_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Playbook Failure Archive Rate","description":"Per-org playbook archive rate (0, 1]. None = platform default (0.5)."},"amem_superseded_ttl_days":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amem Superseded Ttl Days","description":"Per-org supersession reap window (days). None = platform default (keep forever unless AMEM_SUPERSEDED_TTL_DAYS is set). Inert unless the platform-global AMEM_SUPERSEDED_RECALL='hide'."},"revision":{"type":"integer","title":"Revision","description":"Monotonic settings revision (also surfaced as the ETag)","default":0},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By","description":"User who last updated"}},"type":"object","required":["event_threads_enabled","web_search_enabled","web_search_max_uses","web_extract_enabled","web_extract_max_uses","web_extract_depth","memory_enabled","memory_maintenance_enabled","memory_team_isolation","memory_team_isolation_effective","delegation_approver","dr_input_capture_enabled","tracing_enabled","grounding_reminders_enabled","profile_suggestions_enabled","default_thread_visibility","cron_thread_ttl_minutes","command_deny_list"],"title":"AgentSettingsResponse","description":"Response schema for agent settings."},"AgentSettingsUpdate":{"properties":{"model_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Model Policy"},"memory_model_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Memory Model Policy","description":"Memory model preferences. Use profile (anthropic, openai, openrouter, or cerebras) and optional tier_overrides (fast, balanced, deep) from memory_model_catalog.profile_catalog. Lab profiles have fixed tiers. Clear legacy default_model and role_overrides when selecting a profile. Objects merge recursively; nested null removes a field; top-level null resets all memory model preferences. Omission preserves current values."},"event_threads_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Event Threads Enabled","description":"Enable/disable automatic thread creation from alert events"},"web_search_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Web Search Enabled","description":"Enable/disable web search tool"},"web_search_max_uses":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":1.0},{"type":"null"}],"title":"Web Search Max Uses","description":"Tavily searches per minute (rolling window, 1-20)"},"web_search_requests_per_minute":{"anyOf":[{"type":"integer","maximum":100000.0,"minimum":1.0},{"type":"null"}],"title":"Web Search Requests Per Minute","description":"TinyFish session requests/minute; null resets to provider ceiling (default 30)"},"web_extract_urls_per_minute":{"anyOf":[{"type":"integer","maximum":100000.0,"minimum":1.0},{"type":"null"}],"title":"Web Extract Urls Per Minute","description":"TinyFish session URLs/minute; null resets to provider ceiling (default 150)"},"web_extract_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Web Extract Enabled","description":"Enable/disable URL content extraction tool"},"web_extract_max_uses":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":1.0},{"type":"null"}],"title":"Web Extract Max Uses","description":"Tavily extraction calls per minute (rolling window, 1-20)"},"web_extract_depth":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Extract Depth","description":"Tavily extraction depth; inactive for TinyFish"},"memory_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Memory Enabled","description":"Enable/disable investigation memory (A-mem)"},"memory_maintenance_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Memory Maintenance Enabled","description":"Enable/disable background memory maintenance (paid-plan opt-in; cannot be enabled while the subscription is in trial)"},"delegation_approver":{"anyOf":[{"type":"string","enum":["assignee","requester","both"]},{"type":"null"}],"title":"Delegation Approver","description":"Who approves a delegation someone asked of someone else: the assignee (default), the requester, or both"},"crm_automations_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Crm Automations Enabled","description":"Turn CRM automations on or off for the org (off is the kill switch: nothing is evaluated or delivered; rules keep their modes)"},"crm_automation_daily_cap":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":1.0},{"type":"null"}],"title":"Crm Automation Daily Cap","description":"Agent runs CRM automations may start per UTC day across the org (default 200); a run past it waits for the next day"},"crm_lifecycle_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Crm Lifecycle Enabled","description":"Turn CRM lifecycle stages on or off for the org (off refuses new Prospects; staged records keep working, and Prospects stay out of the Brain either way)"},"crm_brain_feed_paused":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Crm Brain Feed Paused","description":"Pause or resume the CRM Brain feed for the org (paused, CRM changes are queued instead of reaching the Brain; resumed, the queue is replayed in order)"},"memory_team_isolation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Memory Team Isolation","description":"Enable/disable team isolation of brain memory: members read their teams' rows plus org-wide rows, and agent runs recall and write only what their audience can read. Turning it off makes existing labels inert; it never deletes them."},"dr_input_capture_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Dr Input Capture Enabled","description":"Opt-in capture of evaluation run inputs (encrypted, retention-capped) so rubric replay can re-test real cases"},"dr_gate_auto_delta_max":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Dr Gate Auto Delta Max","description":"Org override for the 'auto' consumption-gate ceiling. Explicit null clears back to the deployment default. The effective auto ceiling must stay <= the suggest ceiling."},"dr_gate_suggest_delta_max":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Dr Gate Suggest Delta Max","description":"Org override for the 'suggest' consumption-gate ceiling. Explicit null clears back to the deployment default."},"dream_daily_run_cap":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Dream Daily Run Cap","description":"Org override for the total background memory-maintenance runs allowed per UTC day, chained continuations included. Explicit null clears back to the deployment default; values above the deployment ceiling are refused."},"tracing_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tracing Enabled","description":"Enable/disable LangSmith trace forwarding per-run for this org. Default False platform-wide — admin opts in. When False, node inputs/outputs are not sent to LangSmith regardless of the global ``LANGSMITH_TRACING`` env var, preserving the operator-blind posture set by E2EE-at-rest."},"grounding_reminders_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Grounding Reminders Enabled","description":"Inject a fresh DISPATCH-CLAIM CONTRACT in the system prompt for modes that have one (currently DR Research). Set False to disable per-org if the reminder is interfering."},"profile_suggestions_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Profile Suggestions Enabled","description":"Enable proactive next-session profile suggestions for admin chat sessions (opt-in canary; default off). When on, a long exploratory admin session may prompt 'save this as a reusable profile?' at the start of the next session."},"default_chat_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Profile","description":"Profile name used for chat memory extraction + recall (built-in or custom). Set to ``null`` to clear the override and revert to the platform default; omitting the field entirely leaves the current value alone. Validated at write time — unknown profile names return 422. Empty strings are coerced to ``null`` (clear) on read."},"default_chat_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Model","description":"Model id the PlatformPilot chat executor uses. Must be one of the curated options from GET /settings/agent (``chat_model_options``). ``null`` clears the override (revert to the platform default); omitting the field leaves it alone. Empty strings are coerced to ``null``; unknown ids return 422."},"default_chat_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Effort","description":"Anthropic effort level for the chat executor: 'low', 'medium', or 'high'. ``null`` clears the override (revert to the platform default of 'high'); omitting the field leaves it alone. Empty strings are coerced to ``null``; unknown values return 422."},"agent_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Effort","description":"Single effort cap for non-chat agent reasoning (HDR/DR executor + HDR hypothesis/solution): 'low', 'medium', 'high', or 'xhigh'. ``null`` clears it (each model reverts to its platform default); omitting leaves it alone. Applied clamped per model (Sonnet 5.5 and Opus both accept up to xhigh). Empty strings coerce to ``null``; unknown values return 422. Does NOT affect chat."},"default_thread_visibility":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Default Thread Visibility","description":"Per-org default visibility applied to new conversations in the d3 composer when the user does not explicitly choose otherwise. Grammar: 'private' (owner-only), 'org' (everyone in this org), 'team:<uuid>' (specific team). Backend does NOT enforce — the badge state at thread-create time is authoritative for ``metadata.team_id``. d3 normalises invalid values to 'private' on read."},"cron_thread_ttl_minutes":{"anyOf":[{"type":"integer","maximum":43200.0,"minimum":60.0},{"type":"null"}],"title":"Cron Thread Ttl Minutes","description":"Minutes before cron-created threads are auto-deleted (60 min – 30 days)"},"command_deny_list":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Command Deny List","description":"Command patterns blocked from execution (full replacement). Each entry: {pattern: str, is_regex: bool, description: str, category: str}"},"compaction_trigger_tokens":{"anyOf":[{"type":"integer","maximum":900000.0,"minimum":50000.0},{"type":"null"}],"title":"Compaction Trigger Tokens","description":"Input token threshold for context compaction (50k–900k). None = inherit deployment policy (automatic model capacity by default)."},"playbook_failure_archive_rate":{"anyOf":[{"type":"number","maximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Playbook Failure Archive Rate","description":"Fraction of a learned playbook's recent uses that must be attributable failures before it is archived (with a global 2-failure floor). Range (0, 1]. None = use the platform default (0.5). Expert per-org risk-appetite knob."},"amem_superseded_ttl_days":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Amem Superseded Ttl Days","description":"Grace window (days) after which a superseded (stale) knowledge record is reaped by consolidation. None = use the platform default (AMEM_SUPERSEDED_TTL_DAYS, also None = keep forever). Requires the platform-global AMEM_SUPERSEDED_RECALL='hide' to take effect; under the default 'annotate' mode this window is inert and no records are reaped."}},"type":"object","title":"AgentSettingsUpdate","description":"Request schema for updating agent settings."},"AgentTestBody":{"properties":{"recordId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recordid"}},"type":"object","title":"AgentTestBody","description":"Body of ``POST /{id}/test`` for an agent rule: the record to test on."},"AggregateBody":{"properties":{"filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filter"},"aggregates":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Aggregates"},"includeDeleted":{"type":"boolean","title":"Includedeleted","default":false}},"type":"object","title":"AggregateBody","description":"Body of ``POST .../records/aggregate``."},"ApplyBody":{"properties":{"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/ApplyItemBody"},"type":"array"},{"type":"null"}],"title":"Items"},"useCurrent":{"items":{"type":"integer"},"type":"array","title":"Usecurrent"}},"type":"object","title":"ApplyBody","description":"Body of ``POST /{id}/apply``.\n\n``items`` omitted approves every waiting item as held; otherwise the\nwaiting items it leaves out are skipped. ``useCurrent`` keeps the current\nvalue of items whose record changed since."},"ApplyItemBody":{"properties":{"index":{"type":"integer","title":"Index"},"value":{"title":"Value"},"values":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Values"}},"type":"object","required":["index"],"title":"ApplyItemBody","description":"One approved item: ``value`` edits a one-field item, ``values`` any item."},"ArtifactCheck":{"properties":{"kind":{"type":"string","enum":["assert_contains","assert_not_contains","assert_regex"],"title":"Kind"},"pattern":{"type":"string","maxLength":500,"minLength":1,"title":"Pattern"}},"type":"object","required":["kind","pattern"],"title":"ArtifactCheck","description":"One deterministic text check against the drafted artifact."},"Assistant":{"properties":{"assistant_id":{"type":"string","title":"Assistant Id","description":"Unique identifier for the assistant."},"name":{"type":"string","title":"Name","description":"Human-readable name of the assistant."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description of the assistant's purpose."},"config":{"additionalProperties":true,"type":"object","title":"Config","description":"Configuration passed to the graph at runtime."},"context":{"additionalProperties":true,"type":"object","title":"Context","description":"Context variables available to the graph during execution."},"graph_id":{"type":"string","title":"Graph Id","description":"Identifier of the graph this assistant executes."},"user_id":{"type":"string","title":"User Id","description":"Identifier of the user who owns this assistant."},"version":{"type":"integer","title":"Version","description":"The version of the assistant."},"metadata_dict":{"additionalProperties":true,"type":"object","title":"Metadata Dict","description":"Arbitrary metadata for searching and filtering."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the assistant was created."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Timestamp when the assistant was last updated."}},"type":"object","required":["assistant_id","name","graph_id","user_id","version","created_at","updated_at"],"title":"Assistant","description":"Assistant entity model"},"AssistantCreate":{"properties":{"assistant_id":{"anyOf":[{"type":"string","maxLength":255,"minLength":1,"pattern":"\\S"},{"type":"null"}],"title":"Assistant Id","description":"Optional client-provided assistant ID. Omit or null to let the server generate a UUID. When set, 1-255 characters and not blank (must fit PostgreSQL btree keys uncompressed)."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Human-readable assistant name (auto-generated if not provided)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Assistant description"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Assistant configuration"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Assistant context"},"graph_id":{"type":"string","title":"Graph Id","description":"LangGraph graph ID from aegra.json"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Metadata to use for searching and filtering assistants."},"if_exists":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If Exists","description":"What to do if assistant exists: error or do_nothing","default":"error"}},"type":"object","required":["graph_id"],"title":"AssistantCreate","description":"Request model for creating assistants"},"AssistantList":{"properties":{"assistants":{"items":{"$ref":"#/components/schemas/Assistant"},"type":"array","title":"Assistants"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["assistants","total"],"title":"AssistantList","description":"Response model for listing assistants"},"AssistantSearchRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Filter by assistant name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Filter by assistant description"},"graph_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Graph Id","description":"Filter by graph ID"},"limit":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Limit","description":"Maximum results","default":20},"offset":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Offset","description":"Results offset","default":0},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Metadata to use for searching and filtering assistants."},"sort_by":{"anyOf":[{"type":"string","enum":["assistant_id","name","graph_id","created_at","updated_at"]},{"type":"null"}],"title":"Sort By","description":"Field to sort by (SDK-compatible)."},"sort_order":{"anyOf":[{"type":"string","enum":["asc","desc"]},{"type":"null"}],"title":"Sort Order","description":"Sort direction (SDK-compatible). Defaults to 'desc' when sort_by is set."}},"type":"object","title":"AssistantSearchRequest","description":"Request model for assistant search"},"AssistantUpdate":{"properties":{"name":{"type":"string","title":"Name","description":"The name of the assistant. Unchanged when omitted."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"The description of the assistant. Unchanged when omitted."},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Configuration to use for the graph. Unchanged when omitted."},"graph_id":{"type":"string","title":"Graph Id","description":"The ID of the graph. Unchanged when omitted."},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"The context to use for the graph. Useful when graph is configurable. Unchanged when omitted."},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Metadata to merge into the assistant's existing metadata."}},"type":"object","title":"AssistantUpdate","description":"Request model for partially updating assistants.\n\nEvery field is optional and defaults to ``None`` so that an omitted field\nis distinguishable from an explicit one via ``model_dump(exclude_unset=True)``:\nomitting ``config`` keeps the stored config, sending ``{\"config\": {}}`` clears it.\n\nA null clears ``description`` and reads as empty for the other dict fields.\n``name`` and ``graph_id`` back NOT NULL columns and refuse one."},"AssistantVersionsSearchRequest":{"properties":{"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Version metadata containment filter"},"limit":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Limit","description":"Maximum versions to return","default":10},"offset":{"type":"integer","minimum":0.0,"title":"Offset","description":"Number of matching versions to skip","default":0}},"type":"object","title":"AssistantVersionsSearchRequest","description":"Pagination and metadata filters for an assistant's version history."},"AttributeMap":{"properties":{"attribute":{"type":"string","title":"Attribute"},"predicate":{"type":"string","title":"Predicate"}},"additionalProperties":false,"type":"object","required":["attribute","predicate"],"title":"AttributeMap","description":"Map a source column, pointer or extracted attribute to a predicate."},"AuthorizationCallbackRequest":{"properties":{"code":{"type":"string","title":"Code"},"state":{"type":"string","title":"State"}},"type":"object","required":["code","state"],"title":"AuthorizationCallbackRequest","description":"Request for authorization callback."},"AuthorizationStartResponse":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url"},"state":{"type":"string","title":"State"}},"type":"object","required":["authorization_url","state"],"title":"AuthorizationStartResponse","description":"Response from starting authorization flow."},"AutonomyResponse":{"properties":{"autonomy_level":{"type":"integer","title":"Autonomy Level","description":"Persisted autonomy level (clamped to capability on write)"},"capability":{"type":"integer","title":"Capability","description":"Earned capability rung (0, 25, 50, 75, or 100)"},"effective_level":{"type":"integer","title":"Effective Level","description":"min(level, capability); 0 when Brain is disabled"},"brain_enabled":{"type":"boolean","title":"Brain Enabled","description":"Brain (memory) prerequisite; the UI dims the slider when False"},"n_runs":{"type":"integer","title":"N Runs","description":"Completed investigations counted"},"accepted_count":{"type":"integer","title":"Accepted Count","description":"Human-approved remediations"},"ignored_count":{"type":"integer","title":"Ignored Count","description":"Human Ignore rulings"},"remediation_success_count":{"type":"integer","title":"Remediation Success Count","description":"Approved remediations that completed successfully"},"next_rung":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Rung","description":"Next unlockable rung; None at 100"},"next_rung_requirements":{"additionalProperties":{"type":"number"},"type":"object","title":"Next Rung Requirements","description":"Remaining deltas toward next_rung (unmet only)"},"decision":{"anyOf":[{"$ref":"#/components/schemas/DecisionCapability"},{"type":"null"}],"description":"Decision-autonomy status (DR verdict gate): whether auto verdicts stand, plus the ruling counts behind it. None when the signal could not be read."},"capability_truncated":{"type":"boolean","title":"Capability Truncated","description":"Capability scan was truncated or failed; counts undercount"},"capability_degraded":{"type":"boolean","title":"Capability Degraded","description":"The capability scan FAILED (read error): the rung is a degraded 0 and nothing was counted. Distinct from capability_truncated alone, which means a long track record exceeded the scan ceiling and real counts undercount. The UI copy for the two must differ: 'could not read your track record' vs 'the earned rung may read lower than it is'.","default":false}},"type":"object","required":["autonomy_level","capability","effective_level","brain_enabled","n_runs","accepted_count","ignored_count","remediation_success_count","next_rung","next_rung_requirements","capability_truncated"],"title":"AutonomyResponse","description":"Response schema for autonomy settings.\n\nProgress fields mirror the entities-overview pattern so the UI can\nrender \"N more to unlock\" copy against ``next_rung_requirements``."},"AutonomyUpdate":{"properties":{"autonomy_level":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Autonomy Level","description":"Desired autonomy level (0-100)"}},"type":"object","required":["autonomy_level"],"title":"AutonomyUpdate","description":"Request schema for updating autonomy level."},"AvailableChannelResponse":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"blurb":{"type":"string","title":"Blurb"},"capabilities":{"additionalProperties":true,"type":"object","title":"Capabilities"},"configured":{"type":"boolean","title":"Configured","default":false}},"type":"object","required":["id","label","blurb","capabilities"],"title":"AvailableChannelResponse","description":"A channel plugin available for configuration."},"AvailableChannelsListResponse":{"properties":{"channels":{"items":{"$ref":"#/components/schemas/AvailableChannelResponse"},"type":"array","title":"Channels"}},"type":"object","required":["channels"],"title":"AvailableChannelsListResponse","description":"Response for listing available channel plugins."},"BindingCreate":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"conversation_id":{"type":"string","title":"Conversation Id"},"graph_id":{"type":"string","title":"Graph Id","default":"PlatformPilot"},"description":{"type":"string","title":"Description","default":""},"team_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Team Id","description":"Team whose memory shared-channel runs in this conversation recall and write. Omit to keep the stored pin; null clears it (org-wide)."}},"type":"object","required":["channel_id","conversation_id"],"title":"BindingCreate","description":"Request body for creating a binding."},"Body_analyze_import_organizations__organization_id__crm_imports_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"object":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object"},"visibleTo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Visibleto"}},"type":"object","required":["file"],"title":"Body_analyze_import_organizations__organization_id__crm_imports_post"},"Body_get_access_token_token_post":{"properties":{"client_id":{"type":"string","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret"}},"type":"object","required":["client_id","client_secret"],"title":"Body_get_access_token_token_post"},"Body_set_assistant_latest_assistants__assistant_id__latest_post":{"properties":{"version":{"type":"integer","title":"Version","description":"The version number to set as latest"}},"type":"object","required":["version"],"title":"Body_set_assistant_latest_assistants__assistant_id__latest_post"},"Body_upload_media_media_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_media_media_upload_post"},"BotConfigCreate":{"properties":{"webhook_url":{"type":"string","title":"Webhook Url"},"enabled":{"type":"boolean","title":"Enabled","default":true},"notification_strategy":{"type":"string","enum":["first","all"],"title":"Notification Strategy","default":"first"}},"type":"object","required":["webhook_url"],"title":"BotConfigCreate","description":"Request model for creating a bot configuration."},"BotConfigResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"enabled":{"type":"boolean","title":"Enabled"},"notification_strategy":{"type":"string","title":"Notification Strategy"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["provider","enabled","notification_strategy","created_by","created_at","updated_at"],"title":"BotConfigResponse","description":"Response model for a bot configuration."},"BotConfigUpdate":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"notification_strategy":{"anyOf":[{"type":"string","enum":["first","all"]},{"type":"null"}],"title":"Notification Strategy"}},"type":"object","title":"BotConfigUpdate","description":"Request model for updating a bot configuration."},"BotListResponse":{"properties":{"bots":{"additionalProperties":{"$ref":"#/components/schemas/BotConfigResponse"},"type":"object","title":"Bots"},"total":{"type":"integer","title":"Total"},"enabled_count":{"type":"integer","title":"Enabled Count"}},"type":"object","required":["bots","total","enabled_count"],"title":"BotListResponse","description":"Response model for listing bot configurations."},"BrainApplyRequest":{"properties":{"predicate":{"type":"string","maxLength":128,"minLength":1,"title":"Predicate"}},"type":"object","required":["predicate"],"title":"BrainApplyRequest","description":"Which field of the record takes the Brain's value."},"BrainDigestConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"channel_id":{"type":"string","title":"Channel Id","default":""},"account_id":{"type":"string","title":"Account Id","default":"default"},"to":{"type":"string","title":"To","default":""},"audience_attested":{"type":"boolean","title":"Audience Attested","default":false}},"type":"object","title":"BrainDigestConfig","description":"Per-org opt-in for the weekly Brain digest.\n\nThe digest aggregates memory-derived findings into a channel whose\nmembership can exceed the admin set, a leak class run-initiated\nsummaries do not have. That is why ``audience_attested`` is part of the\ncontract: the admin enabling it attests that everyone in the target\nchannel may see org-wide Brain content, and the sender re-checks the\nattestation at send time. Sends are weekly at most, ride dream\ncompletion (no scheduler), and skip entirely when there is no news."},"CallerBrainResponse":{"properties":{"claim_contract_version":{"type":"integer","title":"Claim Contract Version","default":0},"view_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"View Fingerprint"},"complete":{"type":"boolean","title":"Complete","default":true},"coverage_issues":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Coverage Issues"},"pending":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Pending"},"valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid Until"},"states":{"items":{"type":"string"},"type":"array","title":"States"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"canonical_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Name"},"recent_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recent Context"},"recent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recent At"},"suggestions":{"items":{"$ref":"#/components/schemas/StarterSuggestion"},"type":"array","title":"Suggestions"}},"type":"object","title":"CallerBrainResponse","description":"What the Brain holds about the authenticated caller.\n\nAll-null with an empty ``suggestions`` list is the normal empty state, not\nan error: the caller has no person entity yet, nothing is linked to them,\nor the layer is off. The UI reads it as \"no personalization available\" and\ngreets them plainly."},"CancelDowngradeResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether cancellation was successful"},"subscription_id":{"type":"string","title":"Subscription Id","description":"Stripe subscription ID"},"schedule_id":{"type":"string","title":"Schedule Id","description":"Cancelled schedule ID"},"message":{"type":"string","title":"Message","description":"Confirmation message"}},"type":"object","required":["success","subscription_id","schedule_id","message"],"title":"CancelDowngradeResponse","description":"Response schema for cancelling a scheduled downgrade."},"CancelIntentRequest":{"properties":{"organization_id":{"type":"string","maxLength":512,"minLength":1,"title":"Organization Id"},"intent_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Intent Id"},"failure":{"anyOf":[{"type":"string","enum":["admin_approval","declined"]},{"type":"null"}],"title":"Failure"}},"additionalProperties":false,"type":"object","required":["organization_id","intent_id"],"title":"CancelIntentRequest","description":"Record only the fixed provider failure classification, never its description."},"CancelResponse":{"properties":{"cancelled":{"type":"boolean","title":"Cancelled"},"checkpoint_path":{"type":"string","title":"Checkpoint Path"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["cancelled","checkpoint_path","detail"],"title":"CancelResponse","description":"Response from the cancel-run endpoint."},"CategoryConnection":{"properties":{"source":{"type":"string","title":"Source","description":"First category of the pair (alphabetical)"},"target":{"type":"string","title":"Target","description":"Second category of the pair"},"total":{"type":"integer","title":"Total","description":"Deduped memory-to-memory edges crossing the two categories"},"relations":{"additionalProperties":{"type":"integer"},"type":"object","title":"Relations","description":"Edge count per link relation; each deduped edge carries the most-specific relation of its two stored directions"}},"type":"object","required":["source","target","total"],"title":"CategoryConnection","description":"Aggregate edge weight between two categories (live rows only)."},"CategorySummaryResponse":{"properties":{"category":{"type":"integer","title":"Category"},"count":{"type":"integer","title":"Count"},"avg_bleu":{"type":"number","title":"Avg Bleu"},"avg_f1":{"type":"number","title":"Avg F1"},"avg_llm":{"type":"number","title":"Avg Llm"}},"type":"object","required":["category","count","avg_bleu","avg_f1","avg_llm"],"title":"CategorySummaryResponse","description":"Per-category aggregated metrics."},"ChannelAccountCreate":{"properties":{"account_id":{"type":"string","title":"Account Id","description":"Account identifier","default":"default"},"credentials":{"additionalProperties":true,"type":"object","title":"Credentials","description":"Channel-specific credentials (e.g. bot_token, signing_secret)"},"enabled":{"type":"boolean","title":"Enabled","default":true},"settings":{"additionalProperties":true,"type":"object","title":"Settings"},"notification_strategy":{"type":"string","enum":["first","all"],"title":"Notification Strategy","default":"all"}},"type":"object","required":["credentials"],"title":"ChannelAccountCreate","description":"Request body for creating a channel account."},"ChannelAccountResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"account_id":{"type":"string","title":"Account Id"},"enabled":{"type":"boolean","title":"Enabled"},"settings":{"additionalProperties":true,"type":"object","title":"Settings"},"notification_strategy":{"type":"string","title":"Notification Strategy"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["channel_id","account_id","enabled","settings","notification_strategy","created_by","created_at","updated_at"],"title":"ChannelAccountResponse","description":"Response model for a channel account (credentials excluded)."},"ChannelAccountUpdate":{"properties":{"credentials":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Credentials"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Settings"},"notification_strategy":{"anyOf":[{"type":"string","enum":["first","all"]},{"type":"null"}],"title":"Notification Strategy"}},"type":"object","title":"ChannelAccountUpdate","description":"Request body for updating a channel account."},"ChannelAuthorizeResponse":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url"},"state":{"type":"string","title":"State"}},"type":"object","required":["authorize_url","state"],"title":"ChannelAuthorizeResponse","description":"Response with OAuth authorize URL for channel installation."},"ChannelIdentityCreateRequest":{"properties":{"channel_id":{"type":"string","maxLength":64,"minLength":1,"title":"Channel Id"},"sender_id":{"type":"string","maxLength":255,"minLength":1,"title":"Sender Id"},"user_id":{"type":"string","maxLength":36,"minLength":1,"title":"User Id"},"display_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["channel_id","sender_id","user_id"],"title":"ChannelIdentityCreateRequest","description":"Request to link a channel sender to a PlatformPilot user."},"ChannelIdentityResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"sender_id":{"type":"string","title":"Sender Id"},"user_id":{"type":"string","title":"User Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"linked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked At"},"linked_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked By"}},"type":"object","required":["channel_id","sender_id","user_id"],"title":"ChannelIdentityResponse","description":"Response schema for a channel identity link."},"ChannelListResponse":{"properties":{"channels":{"items":{"$ref":"#/components/schemas/ChannelSummaryResponse"},"type":"array","title":"Channels"},"total_accounts":{"type":"integer","title":"Total Accounts"},"total_enabled":{"type":"integer","title":"Total Enabled"}},"type":"object","required":["channels","total_accounts","total_enabled"],"title":"ChannelListResponse","description":"Response for listing all configured channels."},"ChannelOAuthCallbackRequest":{"properties":{"code":{"type":"string","title":"Code"},"state":{"type":"string","title":"State"}},"type":"object","required":["code","state"],"title":"ChannelOAuthCallbackRequest","description":"Request body for channel OAuth callback."},"ChannelOAuthCallbackResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"workspace_id":{"type":"string","title":"Workspace Id","default":""},"workspace_name":{"type":"string","title":"Workspace Name","default":""},"message":{"type":"string","title":"Message","default":""}},"type":"object","required":["success"],"title":"ChannelOAuthCallbackResponse","description":"Response from channel OAuth callback."},"ChannelSummaryResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"label":{"type":"string","title":"Label"},"account_count":{"type":"integer","title":"Account Count"},"enabled_count":{"type":"integer","title":"Enabled Count"},"accounts":{"items":{"$ref":"#/components/schemas/ChannelAccountResponse"},"type":"array","title":"Accounts"},"capabilities":{"additionalProperties":true,"type":"object","title":"Capabilities"}},"type":"object","required":["channel_id","label","account_count","enabled_count","accounts"],"title":"ChannelSummaryResponse","description":"Summary of a channel's configured accounts."},"CheckoutSessionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Checkout session ID"},"stripe_session_id":{"type":"string","title":"Stripe Session Id","description":"Stripe checkout session ID"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (null if orphaned)"},"plan_id":{"type":"string","title":"Plan Id","description":"Plan being purchased"},"status":{"$ref":"#/components/schemas/CheckoutStatus","description":"Session status"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Session creation timestamp"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"Session completion timestamp"}},"type":"object","required":["id","stripe_session_id","plan_id","status","created_at"],"title":"CheckoutSessionResponse","description":"Response schema for checkout session details."},"CheckoutStatus":{"type":"string","enum":["pending","completed","expired"],"title":"CheckoutStatus","description":"Checkout session statuses."},"CheckpointConvProgress":{"properties":{"seeded":{"type":"boolean","title":"Seeded"},"turns_seeded":{"type":"integer","title":"Turns Seeded"},"qa_results_count":{"type":"integer","title":"Qa Results Count"},"completed":{"type":"boolean","title":"Completed"},"qa_results":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Qa Results"}},"type":"object","required":["seeded","turns_seeded","qa_results_count","completed"],"title":"CheckpointConvProgress","description":"Per-conversation checkpoint state."},"CheckpointExampleProgress":{"properties":{"seeded":{"type":"boolean","title":"Seeded"},"sessions_seeded":{"type":"integer","title":"Sessions Seeded"},"completed":{"type":"boolean","title":"Completed"},"rows":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Rows"}},"type":"object","required":["seeded","sessions_seeded","completed"],"title":"CheckpointExampleProgress","description":"Per-example checkpoint state."},"CheckpointRecordProgress":{"properties":{"seeded":{"type":"boolean","title":"Seeded"},"chunks_seeded":{"type":"integer","title":"Chunks Seeded"},"completed":{"type":"boolean","title":"Completed"},"rows":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Rows"}},"type":"object","required":["seeded","chunks_seeded","completed"],"title":"CheckpointRecordProgress","description":"Per-record checkpoint state."},"ClaimCandidateDecisionRequest":{"properties":{"expected_revision":{"type":"integer","minimum":1.0,"title":"Expected Revision"},"displayed_claim_token":{"type":"string","maxLength":128,"minLength":1,"title":"Displayed Claim Token"},"note":{"type":"string","maxLength":2000,"minLength":1,"title":"Note"},"independent_attestation":{"type":"boolean","title":"Independent Attestation","default":false}},"additionalProperties":false,"type":"object","required":["expected_revision","displayed_claim_token","note"],"title":"ClaimCandidateDecisionRequest","description":"Bind a decision to the proposal actually reviewed by the administrator."},"ClaimRequest":{"properties":{"token":{"type":"string","maxLength":64,"minLength":1,"title":"Token"}},"type":"object","required":["token"],"title":"ClaimRequest","description":"Request to claim an invite token."},"ClientRegistrationRequest":{"properties":{"redirect_uris":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Redirect Uris"},"grant_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Grant Types"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"}},"type":"object","title":"ClientRegistrationRequest","description":"Request for dynamic client registration."},"ClientRegistrationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"ClientRegistrationResponse","description":"Response from dynamic client registration."},"CloudProviderCreate":{"properties":{"provider":{"type":"string","pattern":"^(gcp|aws|azure)$","title":"Provider","description":"Cloud provider type","examples":["gcp","aws","azure"]},"config":{"additionalProperties":true,"type":"object","title":"Config","description":"Provider-specific configuration (GCP/AWS/Azure)","examples":[{"project_id":"my-gcp-project","service_account_email":"sa@project.iam.gserviceaccount.com"}]},"labels":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Labels","description":"Labels for agent reasoning","examples":[{"cloud":"gcp","env":"prod"}]},"provider_key":{"type":"string","title":"Provider Key","description":"Auto-derived unique provider key (GCP: project_id, AWS: account_id, Azure: subscription_id)","default":"","examples":["my-gcp-project-123","123456789012","12345678-1234-1234-1234-123456789012"]}},"type":"object","required":["provider","config"],"title":"CloudProviderCreate","description":"Request schema for creating cloud provider.\n\nNOTE: provider_key is auto-derived from cloud-native identifiers:\n- GCP: project_id\n- AWS: account_id\n- Azure: subscription_id"},"CloudProviderListResponse":{"properties":{"providers":{"items":{"$ref":"#/components/schemas/CloudProviderResponse"},"type":"array","title":"Providers"}},"type":"object","required":["providers"],"title":"CloudProviderListResponse","description":"Response schema for list of cloud providers."},"CloudProviderResponse":{"properties":{"provider_key":{"type":"string","title":"Provider Key"},"provider":{"type":"string","title":"Provider"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Labels"},"clusters":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Clusters"},"services":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Services"},"created_at":{"type":"string","title":"Created At"},"import_bucket_probe":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Import Bucket Probe"},"media_bucket_probe":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Media Bucket Probe"}},"type":"object","required":["provider_key","provider","config","labels","clusters","created_at"],"title":"CloudProviderResponse","description":"Response schema for cloud provider details (hierarchical with nested clusters)."},"CloudProviderUpdate":{"properties":{"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Updated provider configuration"},"labels":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Labels","description":"Updated labels"}},"type":"object","title":"CloudProviderUpdate","description":"Request schema for updating cloud provider."},"ClusterAccessInfo":{"properties":{"cluster_name":{"type":"string","title":"Cluster Name","description":"Cluster name","examples":["prod-cluster"]},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location","description":"Cluster location (zone or region), null if cluster not found","examples":["us-central1-a","us-central1"]},"access_level":{"type":"string","title":"Access Level","description":"Detected access level: container.clusterAdmin, container.clusterViewer, or unknown","examples":["container.clusterAdmin","container.clusterViewer","unknown"]},"has_label":{"type":"boolean","title":"Has Label","description":"Whether cluster has platformpilot-access=enabled label","examples":[true,false]},"can_access":{"type":"boolean","title":"Can Access","description":"Whether service account can get cluster details","examples":[true,false]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Explanation if access_level is not container.clusterAdmin","examples":["Missing platformpilot-access=enabled label on cluster","Insufficient permissions to get cluster details (conditional IAM binding may not be applied)"]}},"type":"object","required":["cluster_name","access_level","has_label","can_access"],"title":"ClusterAccessInfo","description":"Access verification result for a single cluster."},"ClusterAccessRequest":{"properties":{"cluster_names":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Cluster Names","description":"List of cluster names to verify access for","examples":[["prod-cluster","staging-cluster"]]}},"type":"object","required":["cluster_names"],"title":"ClusterAccessRequest","description":"Request to verify access level for specific clusters.\n\nUsed in Step 4 of the UI journey to validate that conditional IAM bindings\nand cluster labels have been properly applied."},"ClusterAccessResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether verification completed successfully","examples":[true]},"cluster_access":{"items":{"$ref":"#/components/schemas/ClusterAccessInfo"},"type":"array","title":"Cluster Access","description":"Access verification results per cluster"}},"type":"object","required":["success","cluster_access"],"title":"ClusterAccessResponse","description":"Response containing access verification results for multiple clusters."},"ClusterCreationResult":{"properties":{"cluster_name":{"type":"string","title":"Cluster Name"},"status":{"type":"string","title":"Status","description":"success, skipped, or failed"},"cluster":{"anyOf":[{"$ref":"#/components/schemas/KubernetesClusterResponse"},{"type":"null"}],"description":"Cluster details if created/skipped"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if failed"}},"type":"object","required":["cluster_name","status"],"title":"ClusterCreationResult","description":"Result for a single cluster creation within a batch."},"ClusterDiscoveryResult":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether discovery completed successfully","examples":[true,false]},"project_id":{"type":"string","title":"Project Id","description":"GCP project ID","examples":["my-gcp-project-123"]},"clusters":{"items":{"$ref":"#/components/schemas/DiscoveredClusterInfo"},"type":"array","title":"Clusters","description":"Discovered clusters (empty on failure)","default":[]},"total_count":{"type":"integer","title":"Total Count","description":"Total clusters discovered","examples":[3,0]},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","description":"Hard errors preventing discovery","default":[],"examples":[["Permission denied: Service account lacks 'container.clusters.list'"]]},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Soft warnings during discovery","default":[],"examples":[[]]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"Machine-readable error code","examples":["INSUFFICIENT_PERMISSIONS","PROJECT_NOT_FOUND"]},"error_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error Details","description":"Additional error context","examples":[{"missing_permission":"container.clusters.list","required_role":"roles/container.clusterViewer","service_account":"customer-sa@project.iam.gserviceaccount.com"}]},"suggested_actions":{"items":{"type":"string"},"type":"array","title":"Suggested Actions","description":"Actionable steps to resolve errors","default":[],"examples":[["Grant 'Kubernetes Engine Cluster Viewer' role to customer-sa@project.iam.gserviceaccount.com","gcloud projects add-iam-policy-binding my-project --member='serviceAccount:customer-sa@project.iam.gserviceaccount.com' --role='roles/container.clusterViewer'"]]}},"type":"object","required":["success","project_id","total_count"],"title":"ClusterDiscoveryResult","description":"Cluster discovery result with comprehensive error handling.\n\nFollows AgentEnvironmentValidationResult pattern for consistency.\nSupports both successful discovery and error scenarios with actionable guidance."},"ColumnChange":{"properties":{"index":{"type":"integer","minimum":0.0,"title":"Index"},"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"},"transform":{"anyOf":[{"type":"string","enum":["none","split_full_name","split_city_country","split_emails","parse_date","linkedin_profile"]},{"type":"null"}],"title":"Transform"}},"type":"object","required":["index"],"title":"ColumnChange","description":"One column's new target: a field path, ``ignore``, or null to clear it."},"CompensationSpec":{"properties":{"description":{"type":"string","maxLength":300,"minLength":1,"title":"Description"},"command":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Command"}},"type":"object","required":["description"],"title":"CompensationSpec","description":"Declarative \"what undoes this action\" metadata (A.6).\n\nRendered wherever a matched action is held for approval, so the\nreviewer sees the undo path next to the proposed action. The\n``command`` is display-only — nothing executes it automatically."},"CompleteIntentRequest":{"properties":{"organization_id":{"type":"string","maxLength":512,"minLength":1,"title":"Organization Id"},"intent_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Intent Id"},"mailbox":{"oneOf":[{"$ref":"#/components/schemas/MicrosoftMailbox-Input"},{"$ref":"#/components/schemas/GoogleMailbox"},{"$ref":"#/components/schemas/ImapMailbox"}],"title":"Mailbox"},"label":{"anyOf":[{"type":"string","maxLength":320,"minLength":3,"pattern":"^[^\\s<>]+@[^\\s<>]+$"},{"type":"null"}],"title":"Label"}},"additionalProperties":false,"type":"object","required":["organization_id","intent_id","mailbox"],"title":"CompleteIntentRequest","description":"Carry the delegated identity verified by the OAuth service."},"CompleteRequest":{"properties":{"alsoMarkCrmDone":{"type":"boolean","title":"Alsomarkcrmdone","description":"Also mark the linked CRM task Done when its audience differs from the delegation's (when they match it happens anyway)","default":false}},"type":"object","title":"CompleteRequest","description":"Optional body of ``POST .../complete``."},"ConnectionRequest":{"properties":{"organization_id":{"type":"string","maxLength":512,"minLength":1,"title":"Organization Id"},"connection_id":{"type":"string","maxLength":512,"minLength":1,"title":"Connection Id"}},"additionalProperties":false,"type":"object","required":["organization_id","connection_id"],"title":"ConnectionRequest","description":"Address a registered connection without supplying an owner."},"ConnectionStatus":{"properties":{"scope":{"$ref":"#/components/schemas/MailboxScope"},"health":{"type":"string","pattern":"^[a-z_]{1,40}$","title":"Health"},"attention":{"anyOf":[{"type":"string","enum":["reconnect_required","permission_denied","throttled","provider_unavailable"]},{"type":"null"}],"title":"Attention"},"since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"},"unreadable":{"type":"integer","minimum":0.0,"title":"Unreadable","default":0}},"additionalProperties":false,"type":"object","required":["scope","health","attention","since","last_synced_at"],"title":"ConnectionStatus","description":"Describe one current mailbox's provider health without exposing its mail."},"ContextWindowResponse":{"properties":{"used_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Used Tokens","description":"Estimated tokens in the saved conversation, using compatible provider usage anchors when available. Execution separately checks the complete request including current tools and system instructions."},"max_tokens":{"type":"integer","title":"Max Tokens","description":"Context-window capacity of the requested or admitted model: the thread's own role (an investigation reports its execute model), chat otherwise."},"percent":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Percent","description":"used_tokens / max_tokens. May exceed 1.0 briefly between the moment a turn pushes content over the model limit and the moment Anthropic compaction summarizes it."},"compaction_trigger_tokens":{"type":"integer","title":"Compaction Trigger Tokens","description":"Effective preparation threshold for the selected model, reserving output and safety headroom. Explicit deployment/org ceilings apply."},"from_anchor":{"type":"boolean","title":"From Anchor","description":"True when an AIMessage anchor was found and used (high accuracy). False when the estimate fell back to pure block-aware char/4 across the whole list (turn-1 case)."},"model_selection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Selection Id"},"model_identity":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Model Identity"},"model_selection_source":{"type":"string","enum":["admitted","requested","legacy"],"title":"Model Selection Source","default":"legacy"},"model_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Effort"},"context_revision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context Revision"},"measurement_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Measurement Id"},"measurement_status":{"type":"string","enum":["estimated","unavailable"],"title":"Measurement Status","default":"estimated"},"measurement_scope":{"type":"string","const":"saved_conversation","title":"Measurement Scope","default":"saved_conversation"},"requested_compaction_trigger_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Requested Compaction Trigger Tokens"},"output_reserve_tokens":{"type":"integer","title":"Output Reserve Tokens","default":20000},"compaction_status":{"type":"string","enum":["idle","preparing","failed"],"title":"Compaction Status","default":"idle"}},"type":"object","required":["used_tokens","max_tokens","percent","compaction_trigger_tokens","from_anchor"],"title":"ContextWindowResponse","description":"Indicator payload — minimal so the UI can render '70.2k / 200.0k (35%)'."},"ConvertTrialResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Subscription status after conversion ('active' on success)."},"plan_id":{"type":"string","title":"Plan Id","description":"Plan the subscription is on."},"subscription_id":{"type":"string","title":"Subscription Id","description":"Internal subscription record ID."},"already_active":{"type":"boolean","title":"Already Active","description":"True if the subscription was already active (idempotent no-op).","default":false}},"type":"object","required":["status","plan_id","subscription_id"],"title":"ConvertTrialResponse","description":"Response schema for converting a Brain trial to a paid subscription now."},"CreateCheckoutRequest":{"properties":{"plan_id":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Subscription plan to purchase (starter or professional)"},"success_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Success Url","description":"Custom success URL (overrides default)"},"cancel_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Cancel Url","description":"Custom cancel URL (overrides default)"},"user_uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Uid","description":"User UID from Landing Page (Auth0 User ID, e.g., 'auth0|1234567890abcdef'). If provided, checkout will be created for this user instead of the service account."},"region":{"anyOf":[{"type":"string","enum":["us","eu"]},{"type":"null"}],"title":"Region","description":"Billing region detected by Landing Page from Cloudflare geolocation. 'us' routes to DynG AI, Inc. (Delaware), 'eu' routes to PlatformPilot Limited (Ireland). If not provided, defaults to 'us'. Ignored for existing customers (uses stored region)."},"billing_period":{"type":"string","enum":["monthly","annual"],"title":"Billing Period","description":"Billing period for the subscription. 'monthly' for month-to-month, 'annual' for yearly billing (typically discounted). Defaults to 'monthly'.","default":"monthly"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Checkout source identifier. Set to 'landing_page_onboarding' by the Landing Page during initial onboarding to trigger server-side Auth0 flag setting."}},"type":"object","required":["plan_id"],"title":"CreateCheckoutRequest","description":"Request schema for creating a Stripe Checkout session."},"CreateCheckoutResponse":{"properties":{"checkout_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Checkout Url","description":"Stripe Checkout URL to redirect user to"},"session_id":{"type":"string","title":"Session Id","description":"Checkout session ID for tracking"}},"type":"object","required":["checkout_url","session_id"],"title":"CreateCheckoutResponse","description":"Response schema for created Stripe Checkout session."},"CreditAllocationResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Allocation ID"},"user_id":{"type":"string","title":"User Id","description":"User ID"},"subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Id","description":"Subscription ID (null if unlinked)"},"credits_granted":{"type":"integer","title":"Credits Granted","description":"Credits granted"},"credits_remaining":{"type":"integer","title":"Credits Remaining","description":"Credits remaining"},"credits_used":{"type":"integer","title":"Credits Used","description":"Credits used"},"usage_percentage":{"type":"number","title":"Usage Percentage","description":"Percentage used (0-100)"},"period_start":{"type":"string","format":"date-time","title":"Period Start","description":"Period start date"},"period_end":{"type":"string","format":"date-time","title":"Period End","description":"Period end date"},"stripe_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Invoice Id","description":"Stripe invoice ID"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Allocation creation timestamp"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether allocation is currently active"},"is_expired":{"type":"boolean","title":"Is Expired","description":"Whether allocation period has expired"}},"type":"object","required":["id","user_id","credits_granted","credits_remaining","credits_used","usage_percentage","period_start","period_end","created_at","is_active","is_expired"],"title":"CreditAllocationResponse","description":"Response schema for credit allocation details."},"CreditBalanceResponse":{"properties":{"user_id":{"type":"string","title":"User Id","description":"User ID"},"current_period":{"$ref":"#/components/schemas/CurrentPeriodCredits","description":"Credits for current billing period"},"total_lifetime_credits":{"type":"integer","title":"Total Lifetime Credits","description":"Total credits allocated over lifetime"},"total_lifetime_usage":{"type":"integer","title":"Total Lifetime Usage","description":"Total credits used over lifetime"}},"type":"object","required":["user_id","current_period","total_lifetime_credits","total_lifetime_usage"],"title":"CreditBalanceResponse","description":"Response schema for current credit balance."},"CreditPackBalanceResponse":{"properties":{"prepaid_credits_available":{"type":"integer","title":"Prepaid Credits Available","description":"Current prepaid credit balance"},"prepaid_balance_cents":{"type":"integer","title":"Prepaid Balance Cents","description":"Actual dollar balance in cents (use for display, avoids rounding)"},"price_per_credit_cents":{"type":"integer","title":"Price Per Credit Cents","description":"Current price per credit in cents"},"plan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Id","description":"User's subscription plan"},"purchase_history":{"items":{"$ref":"#/components/schemas/CreditPackPurchase"},"type":"array","title":"Purchase History","description":"Recent credit pack purchases"}},"type":"object","required":["prepaid_credits_available","prepaid_balance_cents","price_per_credit_cents"],"title":"CreditPackBalanceResponse","description":"Response schema for credit pack balance and history."},"CreditPackCheckoutRequest":{"properties":{"preset":{"anyOf":[{"$ref":"#/components/schemas/UsagePackPreset"},{"type":"null"}],"description":"Preset pack amount: '10' ($10), '25' ($25), or '50' ($50)"},"amount_cents":{"anyOf":[{"type":"integer","maximum":50000.0,"minimum":500.0},{"type":"null"}],"title":"Amount Cents","description":"Custom amount in cents (min $5, max $500). Used if preset is not set."},"return_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return Url","description":"URL to redirect after checkout (success or cancel). If provided, appends ?checkout=success or ?checkout=cancelled."}},"type":"object","title":"CreditPackCheckoutRequest","description":"Request schema for purchasing a credit pack.\n\nSupports two modes:\n1. Preset pack: Set `preset` to \"10\", \"25\", or \"50\" (recommended)\n2. Custom amount: Set `amount_cents` for any amount (fallback)\n\nIf both are provided, `preset` takes precedence."},"CreditPackCheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url","description":"Stripe Checkout URL"},"checkout_session_id":{"type":"string","title":"Checkout Session Id","description":"Stripe Checkout session ID"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Purchase amount in cents"},"credits_to_receive":{"type":"integer","title":"Credits To Receive","description":"Credits that will be added after successful payment"},"price_per_credit_cents":{"type":"integer","title":"Price Per Credit Cents","description":"Price per credit in cents"}},"type":"object","required":["checkout_url","checkout_session_id","amount_cents","credits_to_receive","price_per_credit_cents"],"title":"CreditPackCheckoutResponse","description":"Response schema for credit pack checkout session."},"CreditPackPurchase":{"properties":{"id":{"type":"string","title":"Id","description":"Transaction ID"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Amount paid in cents"},"credits_received":{"type":"integer","title":"Credits Received","description":"Credits added to balance"},"price_per_credit_cents":{"type":"integer","title":"Price Per Credit Cents","description":"Price per credit at purchase"},"purchased_at":{"type":"string","format":"date-time","title":"Purchased At","description":"Purchase timestamp"}},"type":"object","required":["id","amount_cents","credits_received","price_per_credit_cents","purchased_at"],"title":"CreditPackPurchase","description":"Schema for a credit pack purchase record."},"CreditTransactionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Transaction ID"},"user_id":{"type":"string","title":"User Id","description":"User ID"},"allocation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allocation Id","description":"Allocation ID (null if unlinked)"},"amount":{"type":"integer","title":"Amount","description":"Credit amount (positive = grant, negative = usage)"},"transaction_type":{"$ref":"#/components/schemas/TransactionType","description":"Transaction type"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Transaction reason"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id","description":"LangGraph thread ID (for usage tracking)"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional context"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Transaction timestamp"}},"type":"object","required":["id","user_id","amount","transaction_type","created_at"],"title":"CreditTransactionResponse","description":"Response schema for credit transaction details."},"CreditUsageRequest":{"properties":{"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Number of credits to use (must be positive)"},"reason":{"type":"string","maxLength":500,"minLength":1,"title":"Reason","description":"Reason for usage"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id","description":"LangGraph thread ID"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional context (e.g., model, tokens, agent type)","examples":[{"agent":"HDRAgent","model":"claude-sonnet-4","tokens":1500}]}},"type":"object","required":["amount","reason"],"title":"CreditUsageRequest","description":"Request schema for recording credit usage."},"CrmLink":{"properties":{"object":{"type":"string","maxLength":63,"minLength":1,"title":"Object"},"id":{"type":"string","maxLength":64,"minLength":1,"title":"Id"}},"type":"object","required":["object","id"],"title":"CrmLink","description":"A CRM record a delegation is about (object key and record id).\n\nOnly the reference is stored; names are resolved at read time through\nthe reader's CRM visibility, so a record they cannot see never shows."},"CrmPromotion":{"properties":{"record_id":{"type":"string","title":"Record Id"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"allowed_teams":{"items":{"type":"string"},"type":"array","title":"Allowed Teams"}},"type":"object","required":["record_id","payload","allowed_teams"],"title":"CrmPromotion","description":"Durable creation intent shared by every retry of a CRM promotion."},"CrmSharingUpdate":{"properties":{"reply_signals":{"type":"boolean","title":"Reply Signals"},"timeline":{"type":"string","enum":["off","who_and_when","with_subject"],"title":"Timeline"},"expected_revision":{"type":"integer","minimum":0.0,"title":"Expected Revision"}},"additionalProperties":false,"type":"object","required":["reply_signals","timeline","expected_revision"],"title":"CrmSharingUpdate","description":"Accept exactly the choices and the compare-and-swap revision."},"CrmSharingView":{"properties":{"connection_id":{"type":"string","maxLength":512,"minLength":1,"title":"Connection Id"},"revision":{"type":"integer","minimum":0.0,"title":"Revision"},"reply_signals":{"type":"boolean","title":"Reply Signals","default":false},"reply_signals_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reply Signals Since"},"timeline":{"type":"string","enum":["off","who_and_when","with_subject"],"title":"Timeline","default":"off"},"timeline_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Timeline Since"},"subject_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Subject Since"}},"additionalProperties":false,"type":"object","required":["connection_id","revision"],"title":"CrmSharingView","description":"Expose choices and cutoff times without internal consent epochs (C11)."},"CronCountRequest":{"properties":{"assistant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assistant Id"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","title":"CronCountRequest","description":"Request body for counting cron jobs."},"CronCreate":{"properties":{"assistant_id":{"type":"string","maxLength":256,"title":"Assistant Id"},"schedule":{"type":"string","maxLength":256,"title":"Schedule"},"input":{"additionalProperties":true,"type":"object","title":"Input"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"},"interrupt_before":{"anyOf":[{"type":"string","const":"*"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Interrupt Before"},"interrupt_after":{"anyOf":[{"type":"string","const":"*"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Interrupt After"},"webhook":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook"},"on_run_completed":{"anyOf":[{"type":"string","enum":["delete","keep"]},{"type":"null"}],"title":"On Run Completed"},"multitask_strategy":{"anyOf":[{"type":"string","enum":["reject","interrupt","rollback","enqueue"],"maxLength":256},{"type":"null"}],"title":"Multitask Strategy"},"end_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"stream_mode":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stream Mode"},"stream_subgraphs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream Subgraphs"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"},"durability":{"anyOf":[{"type":"string","enum":["sync","async","exit"]},{"type":"null"}],"title":"Durability"},"checkpoint_during":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Checkpoint During"}},"type":"object","required":["assistant_id","schedule","input"],"title":"CronCreate","description":"Request body for creating a cron job (stateless or thread-bound)."},"CronResponse":{"properties":{"cron_id":{"type":"string","title":"Cron Id"},"assistant_id":{"type":"string","title":"Assistant Id"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"on_run_completed":{"anyOf":[{"type":"string","enum":["delete","keep"]},{"type":"null"}],"title":"On Run Completed"},"end_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time"},"schedule":{"type":"string","title":"Schedule"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"next_run_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Run Date"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["cron_id","assistant_id","schedule","created_at","updated_at"],"title":"CronResponse","description":"Response model matching the SDK ``Cron`` TypedDict."},"CronSearchRequest":{"properties":{"assistant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assistant Id"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"limit":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Limit","default":10},"offset":{"type":"integer","minimum":0.0,"title":"Offset","default":0},"sort_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"},"sort_order":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort Order"}},"type":"object","title":"CronSearchRequest","description":"Request body for searching cron jobs."},"CronUpdate":{"properties":{"schedule":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Schedule"},"end_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time"},"input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"},"webhook":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook"},"interrupt_before":{"anyOf":[{"type":"string","const":"*"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Interrupt Before"},"interrupt_after":{"anyOf":[{"type":"string","const":"*"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Interrupt After"},"on_run_completed":{"anyOf":[{"type":"string","enum":["delete","keep"]},{"type":"null"}],"title":"On Run Completed"},"multitask_strategy":{"anyOf":[{"type":"string","enum":["reject","interrupt","rollback","enqueue"],"maxLength":256},{"type":"null"}],"title":"Multitask Strategy"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"stream_mode":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stream Mode"},"stream_subgraphs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream Subgraphs"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"},"durability":{"anyOf":[{"type":"string","enum":["sync","async","exit"]},{"type":"null"}],"title":"Durability"}},"type":"object","title":"CronUpdate","description":"Request body for updating an existing cron job."},"CurationQueueSummary":{"properties":{"version":{"type":"integer","const":1,"title":"Version","default":1},"scope":{"type":"string","const":"entity_curation","title":"Scope","default":"entity_curation"},"observed_at":{"type":"string","title":"Observed At"},"total":{"type":"integer","minimum":0.0,"title":"Total"},"automatic":{"type":"integer","minimum":0.0,"title":"Automatic"},"waiting_for_evidence":{"type":"integer","minimum":0.0,"title":"Waiting For Evidence"},"needs_decision":{"type":"integer","minimum":0.0,"title":"Needs Decision"},"blocked":{"type":"integer","minimum":0.0,"title":"Blocked"},"unclassified":{"type":"integer","minimum":0.0,"title":"Unclassified"}},"type":"object","required":["observed_at","total","automatic","waiting_for_evidence","needs_decision","blocked","unclassified"],"title":"CurationQueueSummary","description":"Count a complete entity-curation inventory at one recorded observation."},"CurationResearchProgress":{"properties":{"status":{"type":"string","enum":["not_started","in_progress","completed","exhausted","unavailable"],"title":"Status","default":"not_started"},"tool_calls":{"type":"integer","minimum":0.0,"title":"Tool Calls","default":0},"searches":{"type":"integer","minimum":0.0,"title":"Searches","default":0},"fetched_pages":{"type":"integer","minimum":0.0,"title":"Fetched Pages","default":0}},"type":"object","title":"CurationResearchProgress","description":"Describe research already attempted for the current evidence version."},"CurationReviewProgress":{"properties":{"version":{"type":"integer","const":2,"title":"Version","default":2},"phase":{"type":"string","enum":["local_review","research","verification","deferral_review","settled"],"title":"Phase"},"reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason Code"},"next_action":{"type":"string","enum":["automatic_review","wait_for_evidence","human_decision","technical_repair","none"],"title":"Next Action"},"missing_evidence":{"items":{"type":"string"},"type":"array","title":"Missing Evidence"},"research":{"$ref":"#/components/schemas/CurationResearchProgress"},"last_reviewed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Reviewed At"},"retry_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retry At"}},"type":"object","required":["phase","next_action"],"title":"CurationReviewProgress","description":"Expose what review is waiting for without inferring legacy state."},"CurrentOrganizationMembershipResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"organization_id":{"type":"string","title":"Organization Id"},"role":{"type":"string","title":"Role"}},"type":"object","required":["user_id","organization_id","role"],"title":"CurrentOrganizationMembershipResponse","description":"Caller-bound live membership used by peer services for authorization."},"CurrentPeriodCredits":{"properties":{"granted":{"type":"integer","title":"Granted","description":"Credits granted this period"},"remaining":{"type":"integer","title":"Remaining","description":"Credits remaining this period"},"used":{"type":"integer","title":"Used","description":"Credits used this period"},"usage_percentage":{"type":"number","title":"Usage Percentage","description":"Percentage of credits used (0-100)"},"period_start":{"type":"string","format":"date-time","title":"Period Start","description":"Period start date"},"period_end":{"type":"string","format":"date-time","title":"Period End","description":"Period end date"}},"type":"object","required":["granted","remaining","used","usage_percentage","period_start","period_end"],"title":"CurrentPeriodCredits","description":"Credit details for current billing period."},"DecisionCapability":{"properties":{"earned":{"type":"boolean","title":"Earned","description":"True once auto verdicts may stand unreviewed.","default":false},"agreements":{"type":"integer","title":"Agreements","description":"Human rulings that accepted a DR verdict.","default":0},"overrides":{"type":"integer","title":"Overrides","description":"Human rulings that overrode a DR verdict.","default":0},"override_pct":{"type":"number","title":"Override Pct","description":"Override share among all rulings.","default":0.0},"min_agreements":{"type":"integer","title":"Min Agreements","description":"Agreements required before auto can stand.","default":0},"max_override_pct":{"type":"number","title":"Max Override Pct","description":"Override-share ceiling for earning trust.","default":0.0},"truncated":{"type":"boolean","title":"Truncated","description":"Scan hit the page ceiling or failed; counts undercount.","default":false},"degraded":{"type":"boolean","title":"Degraded","description":"Scan FAILED outright (read error): counts absent, not undercounted. Same split as ``CapabilityResult.degraded``.","default":false}},"type":"object","title":"DecisionCapability","description":"Earned decision-autonomy status plus the counts behind it."},"DecisionDetail":{"properties":{"id":{"type":"string","title":"Id"},"key":{"type":"string","title":"Key"},"namespace":{"type":"string","title":"Namespace","default":"episodes"},"record_type":{"type":"string","title":"Record Type"},"label":{"type":"string","title":"Label"},"decided_at":{"type":"string","title":"Decided At","default":""},"premises":{"items":{"$ref":"#/components/schemas/PremiseStatus"},"type":"array","title":"Premises"},"premises_total":{"type":"integer","title":"Premises Total"},"premises_dirty":{"type":"integer","title":"Premises Dirty"}},"type":"object","required":["id","key","record_type","label","premises","premises_total","premises_dirty"],"title":"DecisionDetail","description":"One decision with its premises verified live."},"DecisionListItem":{"properties":{"id":{"type":"string","title":"Id","description":"Opaque decision-grounding id (dg_...)"},"key":{"type":"string","title":"Key","description":"Episode row key"},"namespace":{"type":"string","title":"Namespace","default":"episodes"},"record_type":{"type":"string","title":"Record Type","description":"hd_episode | dr_episode"},"label":{"type":"string","title":"Label","description":"Sanitized one-line decision label"},"decided_at":{"type":"string","title":"Decided At","description":"ISO timestamp","default":""},"premises_total":{"type":"integer","title":"Premises Total","default":0},"flagged":{"type":"boolean","title":"Flagged","description":"Whether the last grounding sweep found changed evidence","default":false},"premises_dirty":{"type":"integer","title":"Premises Dirty","default":0},"dirty":{"items":{"$ref":"#/components/schemas/DirtyPremise"},"type":"array","title":"Dirty"}},"type":"object","required":["id","key","record_type","label"],"title":"DecisionListItem","description":"One standing decision in the ledger."},"DecisionsResponse":{"properties":{"decisions":{"items":{"$ref":"#/components/schemas/DecisionListItem"},"type":"array","title":"Decisions"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts","description":"Uncapped totals from the last sweep (decisions/dirty/grounded)"},"last_checked":{"type":"string","title":"Last Checked","description":"When the grounding sweep last verified premises (ISO)","default":""},"scan_truncated":{"type":"boolean","title":"Scan Truncated","default":false}},"type":"object","required":["decisions"],"title":"DecisionsResponse","description":"The decision ledger, joined with the last grounding sweep."},"DefeatType":{"type":"string","enum":["rebut","undercut"],"title":"DefeatType","description":"Pollock's two defeat types.\n\nREBUT attacks the conclusion of a claim (\"not P\"). UNDERCUT attacks\nthe inference connecting premises to the conclusion (\"the source of P\nis unreliable\"). The NDE treats both uniformly when computing defeat\nstatus; the distinction is preserved for explanations."},"DeleteReportRequest":{"properties":{"kind":{"type":"string","const":"memory_delete","title":"Kind"},"namespace":{"type":"string","enum":["episodes","knowledge"],"title":"Namespace"},"key":{"type":"string","maxLength":256,"minLength":1,"title":"Key"}},"additionalProperties":false,"type":"object","required":["kind","namespace","key"],"title":"DeleteReportRequest","description":"State what one memory currently holds up before it is deleted."},"DeleteRule":{"properties":{"expected_revision":{"type":"integer","minimum":1.0,"title":"Expected Revision"}},"additionalProperties":false,"type":"object","required":["expected_revision"],"title":"DeleteRule","description":"Require the visible revision for a private rule deletion."},"DenyListEntrySchema":{"properties":{"pattern":{"type":"string","minLength":1,"title":"Pattern","description":"Regex pattern or literal prefix"},"is_regex":{"type":"boolean","title":"Is Regex","description":"Treat pattern as regex","default":false},"description":{"type":"string","title":"Description","description":"Human-readable reason","default":""},"category":{"type":"string","title":"Category","description":"Grouping: kubectl, gcloud, general","default":""}},"type":"object","required":["pattern"],"title":"DenyListEntrySchema","description":"Schema for a single deny list entry."},"DenyListResponse":{"properties":{"entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Entries","description":"Current deny list entries"},"count":{"type":"integer","title":"Count","description":"Number of entries"},"revision":{"type":"integer","title":"Revision","description":"Monotonic settings revision backing this deny list (also surfaced as the ETag; echo it back via If-Match on a write)","default":0},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last settings update timestamp"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By","description":"User who last updated settings"}},"type":"object","required":["entries","count"],"title":"DenyListResponse","description":"Response schema for deny list."},"DenyListUpdate":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/DenyListEntrySchema"},"type":"array","title":"Entries","description":"Full replacement deny list entries"}},"type":"object","required":["entries"],"title":"DenyListUpdate","description":"Request schema for replacing the deny list."},"DestinationAcknowledgement":{"properties":{"text":{"type":"string","title":"Text"},"required_on":{"items":{"type":"string"},"type":"array","title":"Required On"}},"additionalProperties":false,"type":"object","required":["text","required_on"],"title":"DestinationAcknowledgement","description":"Describe the exact transitions requiring the destination's request consent."},"DestinationCatalogEntry":{"properties":{"key":{"type":"string","maxLength":63,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Key"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"content":{"type":"string","enum":["metadata","subject","body"],"title":"Content"},"consumes_usage":{"type":"boolean","title":"Consumes Usage"},"senders":{"type":"string","enum":["allowlist","known_contacts","any"],"title":"Senders"},"folders":{"items":{"type":"string","enum":["inbox","sent","other"]},"type":"array","title":"Folders"},"platform_available":{"type":"boolean","title":"Platform Available"},"unavailable_reason":{"anyOf":[{"type":"string","const":"platform_unavailable"},{"type":"null"}],"title":"Unavailable Reason"},"features":{"items":{"type":"string"},"type":"array","title":"Features"},"outcomes":{"items":{"type":"string"},"type":"array","title":"Outcomes"},"schema":{"$ref":"#/components/schemas/FormSchema"},"acknowledgement":{"anyOf":[{"$ref":"#/components/schemas/DestinationAcknowledgement"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["key","title","description","content","consumes_usage","senders","folders","platform_available","unavailable_reason","features","outcomes","schema","acknowledgement"],"title":"DestinationCatalogEntry","description":"Publish only registered declarations so a client can render generic forms."},"DestinationConnect":{"properties":{"version":{"type":"integer","const":2,"title":"Version"},"source_enabled":{"type":"boolean","title":"Source Enabled","default":false},"team_acknowledged":{"type":"boolean","title":"Team Acknowledged","default":false},"team_id":{"type":"string","maxLength":512,"minLength":1,"title":"Team Id"},"minimum_strength":{"type":"string","enum":["asserted","verified"],"title":"Minimum Strength","default":"asserted"},"destinations":{"patternProperties":{"^[a-z][a-z0-9_]*$":{"$ref":"#/components/schemas/DestinationUpdate"}},"propertyNames":{"maxLength":63,"minLength":1},"type":"object","maxProperties":32,"title":"Destinations"},"intent_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Intent Id"},"provider":{"type":"string","enum":["outlook","gmail","imap"],"title":"Provider","default":"outlook"}},"additionalProperties":false,"type":"object","required":["version","team_id","intent_id"],"title":"DestinationConnect","description":"Create a disabled source before the ordinary provider handoff."},"DestinationHealthView":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"blocker":{"anyOf":[{"type":"string","enum":["platform_unavailable","sender_verification_unavailable","source_disabled","source_unavailable","routing_unavailable","reconnect_required","team_unavailable","destination_unavailable"]},{"type":"null"}],"title":"Blocker"},"health":{"type":"string","enum":["no_data","operational","degraded","partial_outage","major_outage"],"title":"Health"},"timeline":{"items":{"$ref":"#/components/schemas/DestinationTimeBucket"},"type":"array","maxItems":168,"minItems":168,"title":"Timeline"}},"additionalProperties":false,"type":"object","required":["enabled","blocker","health","timeline"],"title":"DestinationHealthView","description":"Keep member health free of owner settings, profile choices and pins."},"DestinationReplace":{"properties":{"version":{"type":"integer","const":2,"title":"Version"},"source_enabled":{"type":"boolean","title":"Source Enabled","default":false},"team_acknowledged":{"type":"boolean","title":"Team Acknowledged","default":false},"team_id":{"type":"string","maxLength":512,"minLength":1,"title":"Team Id"},"minimum_strength":{"type":"string","enum":["asserted","verified"],"title":"Minimum Strength","default":"asserted"},"destinations":{"patternProperties":{"^[a-z][a-z0-9_]*$":{"$ref":"#/components/schemas/DestinationUpdate"}},"propertyNames":{"maxLength":63,"minLength":1},"type":"object","maxProperties":32,"title":"Destinations"},"expected_revision":{"type":"integer","exclusiveMinimum":0.0,"title":"Expected Revision"}},"additionalProperties":false,"type":"object","required":["version","team_id","expected_revision"],"title":"DestinationReplace","description":"Use the global source revision only for the administrator CAS."},"DestinationTimeBucket":{"properties":{"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"status":{"type":"string","enum":["no_data","operational","degraded","partial_outage","major_outage"],"title":"Status"},"total":{"type":"integer","minimum":0.0,"title":"Total"},"errors":{"type":"integer","minimum":0.0,"title":"Errors"},"error_rate":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Error Rate"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"}},"additionalProperties":false,"type":"object","required":["timestamp","status","total","errors","error_rate","counts"],"title":"DestinationTimeBucket","description":"Expose only one module's declared hourly counters, never message rows."},"DestinationUpdate":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"settings":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"title":"Settings"},"acknowledged":{"type":"boolean","title":"Acknowledged","default":false}},"additionalProperties":false,"type":"object","required":["enabled"],"title":"DestinationUpdate","description":"Accept choices and consent without any server authority or feature epoch."},"DestinationView":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"revision":{"type":"integer","exclusiveMinimum":0.0,"title":"Revision"},"since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"},"settings":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Settings"},"blocker":{"anyOf":[{"type":"string","enum":["platform_unavailable","sender_verification_unavailable","source_disabled","source_unavailable","routing_unavailable","reconnect_required","team_unavailable","destination_unavailable"]},{"type":"null"}],"title":"Blocker"},"editable":{"type":"boolean","title":"Editable","default":true}},"additionalProperties":false,"type":"object","required":["enabled","revision","since","settings","blocker"],"title":"DestinationView","description":"Expose editable values without frozen profiles, membership pins or epochs."},"DeviceRegisterRequest":{"properties":{"token":{"type":"string","maxLength":200,"minLength":16,"title":"Token"},"platform":{"type":"string","maxLength":20,"title":"Platform","default":"ios"}},"type":"object","required":["token"],"title":"DeviceRegisterRequest","description":"Register (or refresh) one push target."},"DeviceToken":{"properties":{"type":{"type":"string","title":"Type","default":"device_token"},"token":{"type":"string","maxLength":200,"minLength":16,"title":"Token"},"platform":{"type":"string","title":"Platform","default":"ios"},"created_at":{"type":"string","title":"Created At","default":""},"last_seen_at":{"type":"string","title":"Last Seen At","default":""}},"type":"object","required":["token"],"title":"DeviceToken","description":"One registered push target."},"DirtyPremise":{"properties":{"ref":{"type":"string","title":"Ref","description":"'<namespace>:<key>' premise ref"},"state":{"type":"string","title":"State","description":"superseded | retracted | deleted"},"successor":{"type":"string","title":"Successor","description":"Replacing row key, if any","default":""},"label":{"type":"string","title":"Label","description":"Sanitized one-line premise label","default":""}},"type":"object","required":["ref","state"],"title":"DirtyPremise","description":"One premise whose state changed since the decision was made."},"DiscoveredClusterInfo":{"properties":{"name":{"type":"string","title":"Name","description":"Cluster name","examples":["prod-gke-us-central1"]},"location":{"type":"string","title":"Location","description":"Zone (e.g., us-central1-a) or region (e.g., us-central1)","examples":["us-central1-a","us-central1"]},"cluster_type":{"type":"string","title":"Cluster Type","description":"Cluster type: zonal, regional, or autopilot","examples":["zonal","regional","autopilot"]},"status":{"type":"string","title":"Status","description":"Cluster status (RUNNING, PROVISIONING, etc.)","examples":["RUNNING","PROVISIONING"]},"access_level":{"type":"string","title":"Access Level","description":"Access level for service account: viewer, editor, admin, or unknown","examples":["admin","viewer","editor","unknown"]},"suggested_labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Suggested Labels","description":"Auto-derived labels for agent reasoning","examples":[{"cloud":"gcp","env":"production","region":"us-central1"}]},"resource_labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Resource Labels","description":"GCP resource labels from cluster metadata (e.g., platformpilot-access=enabled)","examples":[{"platformpilot-access":"enabled","team":"platform"},{"cost-center":"engineering","environment":"prod"}]}},"type":"object","required":["name","location","cluster_type","status","access_level","suggested_labels"],"title":"DiscoveredClusterInfo","description":"Discovered GKE cluster information for UI selection."},"DiscoveredServiceInfo":{"properties":{"name":{"type":"string","title":"Name","description":"API name (e.g., sqladmin.googleapis.com)","examples":["sqladmin.googleapis.com"]},"display_name":{"type":"string","title":"Display Name","description":"Human-readable service name","examples":["Cloud SQL Admin API"]},"category":{"type":"string","title":"Category","description":"Service category (compute, database, monitoring, etc.)","examples":["database","compute","monitoring"]},"suggested_labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Suggested Labels","description":"Auto-derived labels"}},"type":"object","required":["name","display_name","category"],"title":"DiscoveredServiceInfo","description":"Discovered GCP service information for UI selection."},"Disqualifiers":{"properties":{"description":{"type":"string","title":"Description","default":""},"interest_seed_template":{"type":"string","minLength":1,"title":"Interest Seed Template","description":"Template for the initial epistemic interest. Variables in {braces} are substituted at runtime — only ``{candidate}`` and ``{candidate_id}`` are accepted (e.g., '{candidate} is qualified for outreach'). Any other placeholder is rejected at validation time so the DR run can't crash on a typo."},"patterns":{"items":{"$ref":"#/components/schemas/Pattern"},"type":"array","title":"Patterns","description":"Defeater rubric. Order and priority are informational: the engine adjudicates every fired defeater uniformly (see ``Pattern.priority``)"},"verification_protocol":{"type":"string","title":"Verification Protocol","description":"Free-form description of the source-verification workflow: which providers and fetchers to use, parallel/serial ordering, and source-authority hierarchy. Tool-agnostic — describe the workflow in terms of capabilities (enrichment, web-fetch, web-search) rather than naming specific vendor tools, so the rubric stays portable across configurations. Injected into the source-verification agent's instructions at run time; empty means defaults only.","default":""},"info_seeker_prompt":{"type":"string","title":"Info Seeker Prompt","description":"Guidance injected into the evidence-gathering agent when an interest cannot be resolved with current evidence: what to gather first and which capabilities to prefer. Empty means defaults only.","default":""},"version":{"type":"integer","title":"Version","description":"Schema version of this sub-pack","default":1}},"additionalProperties":false,"type":"object","required":["interest_seed_template"],"title":"Disqualifiers","description":"Phase-1 (disqualification) configuration for a Rubric.\n\nHolds the defeater patterns the engine evaluates against the\ncandidate plus the source-verification protocol the undercutter\nfollows. Was ``DefeasiblePack`` in earlier scaffolding."},"DomainCreateRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_-]*$","title":"Name"},"description":{"type":"string","title":"Description","default":""},"graph_id":{"type":"string","title":"Graph Id","description":"Orchestration graph that processes this domain","default":"HypotheticoDeductiveAgent"},"namespaces":{"items":{"$ref":"#/components/schemas/NamespaceRequest"},"type":"array","maxItems":3,"minItems":1,"title":"Namespaces"},"extraction_instructions":{"type":"string","minLength":1,"title":"Extraction Instructions"},"requires_cloud_resources":{"type":"boolean","title":"Requires Cloud Resources","description":"Whether profiles using this domain need K8s/cloud resource selection","default":true},"drops_updates":{"type":"boolean","title":"Drops Updates","description":"True = drop update events (ops default), False = process state transitions as primary events","default":true}},"type":"object","required":["name","namespaces","extraction_instructions"],"title":"DomainCreateRequest","description":"Request schema for creating a custom memory domain."},"DomainMetadataResponse":{"properties":{"orchestration_graphs":{"items":{"$ref":"#/components/schemas/GraphInfo"},"type":"array","title":"Orchestration Graphs"},"executors":{"items":{"$ref":"#/components/schemas/ExecutorInfo"},"type":"array","title":"Executors"}},"type":"object","required":["orchestration_graphs","executors"],"title":"DomainMetadataResponse","description":"Available orchestration graphs and executors for domain creation."},"DomainResponse":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"graph_id":{"type":"string","title":"Graph Id"},"namespaces":{"items":{"$ref":"#/components/schemas/NamespaceConfig"},"type":"array","title":"Namespaces"},"extraction_instructions":{"type":"string","title":"Extraction Instructions"},"requires_cloud_resources":{"type":"boolean","title":"Requires Cloud Resources","default":true},"drops_updates":{"type":"boolean","title":"Drops Updates","default":true},"is_builtin":{"type":"boolean","title":"Is Builtin"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["name","description","graph_id","namespaces","extraction_instructions","is_builtin"],"title":"DomainResponse","description":"Response schema for a memory domain."},"DomainUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"graph_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Graph Id"},"namespaces":{"anyOf":[{"items":{"$ref":"#/components/schemas/NamespaceRequest"},"type":"array"},{"type":"null"}],"title":"Namespaces"},"extraction_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Instructions"},"requires_cloud_resources":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Requires Cloud Resources"},"drops_updates":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Drops Updates"}},"type":"object","title":"DomainUpdateRequest","description":"Request schema for updating a custom memory domain (partial)."},"DowngradeRequest":{"properties":{"target_plan":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Target plan to downgrade to (e.g., 'starter')"}},"type":"object","required":["target_plan"],"title":"DowngradeRequest","description":"Request schema for downgrading subscription to a lower tier."},"DowngradeResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether downgrade was scheduled"},"subscription_id":{"type":"string","title":"Subscription Id","description":"Stripe subscription ID"},"schedule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Id","description":"Stripe subscription schedule ID (for scheduled downgrades)"},"previous_plan":{"type":"string","title":"Previous Plan","description":"Current plan name"},"new_plan":{"type":"string","title":"New Plan","description":"New plan name after downgrade"},"effective_date":{"type":"string","title":"Effective Date","description":"When the downgrade takes effect (ISO format)"}},"type":"object","required":["success","subscription_id","previous_plan","new_plan","effective_date"],"title":"DowngradeResponse","description":"Response schema for subscription downgrade."},"DreamGates":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Platform switch (DREAM_ENABLED)"},"allowlisted":{"type":"boolean","title":"Allowlisted","description":"Org admitted by the rollout allowlist"},"opted_in":{"type":"boolean","title":"Opted In","description":"The org's Dreaming toggle"},"paid_subscription":{"type":"boolean","title":"Paid Subscription","description":"Active non-trial subscription"},"balance_positive":{"type":"boolean","title":"Balance Positive","description":"Usage balance above zero"},"open":{"type":"boolean","title":"Open","description":"Every gate passes"},"blocked_by":{"items":{"type":"string"},"type":"array","title":"Blocked By","description":"Failing gates, in check order"}},"type":"object","required":["enabled","allowlisted","opted_in","paid_subscription","balance_positive","open","blocked_by"],"title":"DreamGates","description":"Why dreaming can or cannot run for this org right now."},"DreamHealthResumeRequest":{"properties":{"expected_generation":{"type":"string","maxLength":128,"minLength":1,"title":"Expected Generation"},"operation_id":{"type":"string","maxLength":96,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Operation Id"}},"type":"object","required":["expected_generation","operation_id"],"title":"DreamHealthResumeRequest","description":"Fence an explicit operator health resume against its observed generation."},"DreamHealthResumeResponse":{"properties":{"applied":{"type":"boolean","title":"Applied"},"already_applied":{"type":"boolean","title":"Already Applied"},"operation_id":{"type":"string","title":"Operation Id"},"health_generation":{"type":"string","title":"Health Generation"},"applied_at":{"type":"string","title":"Applied At"},"retry_index_cleanup_pending":{"type":"boolean","title":"Retry Index Cleanup Pending","default":false}},"type":"object","required":["applied","already_applied","operation_id","health_generation","applied_at"],"title":"DreamHealthResumeResponse","description":"Confirm the durable resume; retrying its operation ID cannot reset it again."},"DreamPressure":{"properties":{"pressure":{"type":"integer","title":"Pressure","description":"Write-side disorder observations"},"read_observations":{"type":"integer","title":"Read Observations","description":"Recall-side corroborations"},"effective_pressure":{"type":"integer","title":"Effective Pressure","description":"pressure + read_observations // divisor"},"pressure_threshold":{"type":"integer","title":"Pressure Threshold","description":"Backoff-scaled trigger threshold"},"percent_to_threshold":{"type":"integer","title":"Percent To Threshold","description":"effective_pressure as a percent of threshold, capped at 100"},"writes_since_sweep":{"type":"integer","title":"Writes Since Sweep","description":"Writes since the last full survey"},"sweep_threshold":{"type":"integer","title":"Sweep Threshold","description":"Backoff-scaled sweep threshold"},"barren_streak":{"type":"integer","title":"Barren Streak","description":"Consecutive runs that changed nothing"},"backoff":{"type":"integer","title":"Backoff","description":"Threshold multiplier from the barren streak"},"queue_debt":{"type":"boolean","title":"Queue Debt","description":"Planned work left undrained"},"stale":{"type":"boolean","title":"Stale","description":"Last run older than the staleness interval"},"signals":{"items":{"type":"string"},"type":"array","title":"Signals","description":"Work signals firing right now"}},"type":"object","required":["pressure","read_observations","effective_pressure","pressure_threshold","percent_to_threshold","writes_since_sweep","sweep_threshold","barren_streak","backoff","queue_debt","stale","signals"],"title":"DreamPressure","description":"The adenosine counter and the thresholds it is measured against."},"DreamQueueEntry":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","enum":["cluster","oversize"],"title":"Kind"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Seed category (clusters only)"},"preview":{"type":"string","title":"Preview","description":"The center/record label; empty when no row resolved"},"member_count":{"type":"integer","title":"Member Count","description":"Rows the tidy-up touches"},"chars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chars","description":"Record length (oversize only)"},"members":{"items":{"$ref":"#/components/schemas/DreamQueueMember"},"type":"array","title":"Members","description":"Resolved member rows; deleted or restricted rows omitted"}},"type":"object","required":["id","kind","preview","member_count","members"],"title":"DreamQueueEntry","description":"One live tidy-up: a near-duplicate cluster or an overlong record."},"DreamQueueMember":{"properties":{"key":{"type":"string","title":"Key"},"preview":{"type":"string","title":"Preview","description":"Sanitized one-line label (same discipline as Brain cards)"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Row-level updated_at snapshotted at enqueue time"},"is_center":{"type":"boolean","title":"Is Center","description":"The row the cluster would merge the others into","default":false}},"type":"object","required":["key","preview"],"title":"DreamQueueMember","description":"One memory row inside a queued tidy-up, trimmed to a card line."},"DreamQueueResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/DreamQueueEntry"},"type":"array","title":"Entries"},"total":{"type":"integer","title":"Total","description":"Live entries in the queue, before the limit"},"written_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Written At","description":"When the survey wrote the queue"}},"type":"object","required":["entries","total"],"title":"DreamQueueResponse","description":"The live queue behind the status counts, with member previews."},"DreamReportSummary":{"properties":{"key":{"type":"string","title":"Key"},"started_at":{"type":"string","title":"Started At","default":""},"finished_at":{"type":"string","title":"Finished At","default":""},"dry_run":{"type":"boolean","title":"Dry Run","default":false},"chain_count":{"type":"integer","title":"Chain Count","default":0},"pressure_snapshot":{"type":"integer","title":"Pressure Snapshot","default":0},"ops_planned":{"type":"integer","title":"Ops Planned","default":0},"ops_executed":{"type":"integer","title":"Ops Executed","default":0},"records_absorbed":{"type":"integer","title":"Records Absorbed","default":0},"memory_debt":{"type":"integer","title":"Memory Debt","default":0},"dead_letters":{"type":"integer","title":"Dead Letters","default":0},"categories_rewritten":{"type":"integer","title":"Categories Rewritten","default":0},"plan_errors":{"type":"integer","title":"Plan Errors","default":0},"execution_errors":{"type":"integer","title":"Execution Errors","default":0},"ops_deferred":{"type":"integer","title":"Ops Deferred","default":0},"entity_deferred":{"type":"integer","title":"Entity Deferred","default":0},"entity_work_pending":{"type":"integer","title":"Entity Work Pending","default":0},"plan_failures":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Plan Failures"},"llm_failure":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Llm Failure"},"fatal_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fatal Error"}},"type":"object","required":["key"],"title":"DreamReportSummary","description":"One past run, trimmed to what a status panel can show."},"DreamRunRequest":{"properties":{"force":{"type":"boolean","title":"Force","description":"Survey even with no accumulated pressure. Defaults to true: an admin asking for a run now means the run should happen, and every billing/lease gate still applies inside the graph.","default":true}},"type":"object","title":"DreamRunRequest","description":"Manual run options."},"DreamRunResponse":{"properties":{"started":{"type":"boolean","title":"Started"},"forced":{"type":"boolean","title":"Forced"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["started","forced","detail"],"title":"DreamRunResponse","description":"Outcome of a manual run request."},"DreamRunState":{"properties":{"in_flight":{"type":"boolean","title":"In Flight","description":"A run is leased or freshly queued"},"pending":{"type":"boolean","title":"Pending","description":"A run is queued but has not started"},"lease_held":{"type":"boolean","title":"Lease Held","description":"A run currently holds the org lease"},"runs_today":{"type":"integer","title":"Runs Today","description":"Completed non-chained runs today (UTC), including manual and retry runs"},"max_runs_per_day":{"type":"integer","title":"Max Runs Per Day","description":"Burst ceiling for automatic runs"},"total_runs_today":{"type":"integer","title":"Total Runs Today","description":"All runs today, chains included"},"total_runs_cap":{"type":"integer","title":"Total Runs Cap","description":"Hard daily bound enforced by the graph"},"total_runs_cap_is_custom":{"type":"boolean","title":"Total Runs Cap Is Custom","description":"The daily bound comes from an org override, not the default"},"total_runs_cap_ceiling":{"type":"integer","title":"Total Runs Cap Ceiling","description":"Highest daily bound this deployment will accept"},"daily_bound_reached":{"type":"boolean","title":"Daily Bound Reached","description":"No further runs will start today"},"last_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Run At","description":"Finish time of the last run"},"queued_clusters":{"type":"integer","title":"Queued Clusters","description":"Live near-duplicate clusters awaiting a merge decision"},"queued_oversize":{"type":"integer","title":"Queued Oversize","description":"Live overlong records awaiting a split decision"},"pending_entity_work":{"type":"integer","title":"Pending Entity Work","description":"Entity verification stages awaiting successful completion","default":0}},"type":"object","required":["in_flight","pending","lease_held","runs_today","max_runs_per_day","total_runs_today","total_runs_cap","total_runs_cap_is_custom","total_runs_cap_ceiling","daily_bound_reached","queued_clusters","queued_oversize"],"title":"DreamRunState","description":"In-flight state and the daily brakes."},"DreamingStatusResponse":{"properties":{"dry_run":{"type":"boolean","title":"Dry Run","description":"Runs plan and report without committing changes"},"would_trigger":{"type":"boolean","title":"Would Trigger","description":"A memory write right now would start a run"},"gates":{"$ref":"#/components/schemas/DreamGates"},"pressure":{"$ref":"#/components/schemas/DreamPressure"},"run":{"$ref":"#/components/schemas/DreamRunState"},"reports":{"items":{"$ref":"#/components/schemas/DreamReportSummary"},"type":"array","title":"Reports"},"llm_health":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Llm Health"},"llm_run_allowed":{"type":"boolean","title":"Llm Run Allowed","description":"The model-health gate permits a manual run now"}},"type":"object","required":["dry_run","would_trigger","gates","pressure","run","reports","llm_run_allowed"],"title":"DreamingStatusResponse","description":"Everything the Dreaming panel renders."},"EncryptionConfigCreate":{"properties":{"provider":{"$ref":"#/components/schemas/KmsKeyProvider","default":"gcp"},"key_resource":{"type":"string","title":"Key Resource","description":"Full GCP KMS resource name. See ``KmsKeyConfig.key_resource``."}},"type":"object","required":["key_resource"],"title":"EncryptionConfigCreate","description":"Request body for ``POST .../encryption`` and ``PUT .../encryption``.\n\nPOST creates a new config (or 409s if one already exists for this\ncloud_provider). PUT replaces the entire config (used for KEK\nrotation — customer minted a new key, points us at it). Both\naccept the same fields; the route handler enforces semantics."},"EncryptionConfigResponse":{"properties":{"provider":{"$ref":"#/components/schemas/KmsKeyProvider"},"key_resource":{"type":"string","title":"Key Resource"},"provisioning_state":{"$ref":"#/components/schemas/integration__schemas__encryption_config__ProvisioningState"},"last_test_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Test At"},"last_test_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Test Error"},"actor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Email"},"mutated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Mutated At"}},"type":"object","required":["provider","key_resource","provisioning_state","last_test_at","last_test_error","actor_email","mutated_at"],"title":"EncryptionConfigResponse","description":"``GET .../encryption`` response and the body of POST/PUT 200 OKs.\n\nThe key_resource is returned as-is to the admin caller (they\nalready know it — they sent it). Logs/audit trails redact it via\n``kms_client._redact_kek``."},"EncryptionGranteeResponse":{"properties":{"service_account_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Account Email","description":"The service account that makes our KMS calls. ``None`` when the deployment runs KMS on its ambient identity (``KMS_SA_KEY`` unset) and the address is not known to this process; the UI then falls back to naming no account rather than a wrong one."},"role":{"type":"string","title":"Role","description":"The IAM role to grant that account on the key.","default":"roles/cloudkms.cryptoKeyEncrypterDecrypter"}},"type":"object","required":["service_account_email"],"title":"EncryptionGranteeResponse","description":"``GET .../encryption/grantee``: who the customer grants, and what.\n\nReadable before any key is registered, so the admin UI can show the\naccount from its first state and the very first ``/test`` can pass."},"EncryptionSubscriptionRequiredProblemDetail":{"properties":{"type":{"type":"string","title":"Type","description":"URI identifying the problem type","default":"https://api.platformpilot.ai/errors/byok-encryption-subscription-required"},"title":{"type":"string","title":"Title","default":"Active subscription required"},"status":{"type":"integer","title":"Status","default":402},"detail":{"type":"string","title":"Detail","description":"Human-readable explanation of the gate"}},"type":"object","required":["detail"],"title":"EncryptionSubscriptionRequiredProblemDetail","description":"RFC 9457 problem details for the encryption-config subscription gate.\n\nThe 402 fires only when there's no active subscription at all, so a\n``current_plan`` field would always serialize as ``null`` and add no\ninformation for the SDK or UI — intentionally omitted. If a future\nplan-tier gate is reintroduced for this surface, add the field at\nthat point with a real value, not a perennial null."},"EntitiesOverviewResponse":{"properties":{"entities":{"items":{"$ref":"#/components/schemas/EntityListItem"},"type":"array","title":"Entities"},"pending_aliases":{"items":{"$ref":"#/components/schemas/PendingAlias"},"type":"array","title":"Pending Aliases"},"proposals":{"items":{"$ref":"#/components/schemas/MergeProposal"},"type":"array","title":"Proposals"},"unsupported_facts":{"items":{"$ref":"#/components/schemas/UnsupportedFact"},"type":"array","title":"Unsupported Facts"},"conflicts":{"items":{"$ref":"#/components/schemas/SlotConflict"},"type":"array","title":"Conflicts"},"record_cases":{"items":{"$ref":"#/components/schemas/RecordCase"},"type":"array","title":"Record Cases"},"total_entities":{"type":"integer","title":"Total Entities"},"truncated":{"type":"boolean","title":"Truncated","default":false},"curation_queue_summary":{"anyOf":[{"$ref":"#/components/schemas/CurationQueueSummary"},{"type":"null"}]},"precedent_count":{"type":"integer","title":"Precedent Count","default":0},"negative_precedent_count":{"type":"integer","title":"Negative Precedent Count","default":0},"adjudication_min_precedents":{"type":"integer","title":"Adjudication Min Precedents","default":0},"adjudication_active":{"type":"boolean","title":"Adjudication Active","default":false},"reconciliation_precedent_count":{"type":"integer","title":"Reconciliation Precedent Count","default":0},"reconciliation_negative_precedent_count":{"type":"integer","title":"Reconciliation Negative Precedent Count","default":0},"reconciliation_adjudication_active":{"type":"boolean","title":"Reconciliation Adjudication Active","default":false},"claim_contract_version":{"type":"integer","title":"Claim Contract Version","default":0},"view_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"View Fingerprint"},"complete":{"type":"boolean","title":"Complete","default":true},"coverage_issues":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Coverage Issues"},"pending":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Pending"},"valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid Until"},"checked_conflicts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Checked Conflicts"},"operational_coverage":{"additionalProperties":true,"type":"object","title":"Operational Coverage"}},"type":"object","required":["entities","pending_aliases","proposals","total_entities"],"title":"EntitiesOverviewResponse","description":"Registry list + curation queue from one bounded sweep."},"EntityDetailResponse":{"properties":{"claim_contract_version":{"type":"integer","title":"Claim Contract Version","default":0},"view_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"View Fingerprint"},"complete":{"type":"boolean","title":"Complete","default":true},"coverage_issues":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Coverage Issues"},"pending":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Pending"},"valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid Until"},"states":{"items":{"type":"string"},"type":"array","title":"States"},"key":{"type":"string","title":"Key"},"requested_key":{"type":"string","title":"Requested Key"},"redirected":{"type":"boolean","title":"Redirected","default":false},"canonical_name":{"type":"string","title":"Canonical Name","default":""},"entity_type":{"type":"string","title":"Entity Type","default":"unknown"},"entity_type_confirmed":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Entity Type Confirmed"},"expected_binding_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Binding Token"},"identity_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identity Status"},"status":{"type":"string","title":"Status","default":"active"},"created_at":{"type":"string","title":"Created At","default":""},"rho":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rho"},"facts_at":{"type":"string","title":"Facts At","default":""},"fact_count":{"type":"integer","title":"Fact Count","default":0},"facts":{"items":{"$ref":"#/components/schemas/EntityFactItem"},"type":"array","title":"Facts"},"relations":{"items":{"$ref":"#/components/schemas/EntityRelationOut"},"type":"array","title":"Relations"},"referenced_by":{"items":{"$ref":"#/components/schemas/EntityReferenceOut"},"type":"array","title":"Referenced By"},"member_sample":{"items":{"type":"string"},"type":"array","title":"Member Sample"},"member_preview":{"items":{"$ref":"#/components/schemas/MemberPreviewItem"},"type":"array","title":"Member Preview"},"member_count":{"type":"integer","title":"Member Count","default":0},"member_count_complete":{"type":"boolean","title":"Member Count Complete","default":true},"candidates":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Candidates"},"reported":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Reported"},"history":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"History"},"conflicts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Conflicts"}},"type":"object","required":["key","requested_key"],"title":"EntityDetailResponse","description":"One entity with its fact sheet, edges, and a membership sample.\n\nHistory IS included here: the current-values-by-default rule protects\nLLM prompts from version ambiguity; the curation UI wants the chain."},"EntityFactHistoryEntry":{"properties":{"value":{"type":"string","title":"Value","default":""},"observed_at":{"type":"string","title":"Observed At","default":""},"source_memory_key":{"type":"string","title":"Source Memory Key","default":""},"source_namespace":{"type":"string","title":"Source Namespace","default":""}},"type":"object","title":"EntityFactHistoryEntry","description":"One superseded value in a fact's bounded history chain."},"EntityFactItem":{"properties":{"audience":{"type":"string","enum":["org","team"],"title":"Audience","default":"org"},"team_ids":{"items":{"type":"string"},"type":"array","title":"Team Ids"},"team_names":{"items":{"type":"string"},"type":"array","title":"Team Names"},"all_teams":{"type":"boolean","title":"All Teams","default":false},"team_key":{"type":"string","title":"Team Key","default":""},"disputed":{"type":"boolean","title":"Disputed","default":false},"key":{"type":"string","title":"Key","default":""},"claim_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Id"},"claim_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Kind"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"subject_binding_revision":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Subject Binding Revision"},"object_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Id"},"object_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Role"},"object_binding_revision":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Object Binding Revision"},"identity_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identity Status"},"object_identity_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Identity Status"},"value_raw":{"title":"Value Raw"},"value_norm":{"title":"Value Norm"},"value_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Type"},"units":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Units"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"first_observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Observed At"},"claim_contract_version":{"type":"integer","title":"Claim Contract Version","default":0},"publication_state":{"type":"string","title":"Publication State","default":"accepted"},"qualification":{"additionalProperties":true,"type":"object","title":"Qualification"},"qualification_text":{"type":"string","title":"Qualification Text","default":""},"polarity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Polarity"},"frame":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frame"},"claimant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claimant"},"scope":{"title":"Scope"},"event_valid_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Valid From"},"event_valid_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Valid To"},"source_published_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Published At"},"source_observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Observed At"},"source_references":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Source References"},"publication_decision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publication Decision Id"},"decision_origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Origin"},"position_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position Id"},"displayed_decision_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Displayed Decision Token"},"valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid Until"},"predicate":{"type":"string","title":"Predicate","default":""},"value":{"type":"string","title":"Value","default":""},"observed_at":{"type":"string","title":"Observed At","default":""},"confidence":{"type":"number","title":"Confidence","default":0.0},"source_memory_key":{"type":"string","title":"Source Memory Key","default":""},"source_namespace":{"type":"string","title":"Source Namespace","default":""},"unsupported_at":{"type":"string","title":"Unsupported At","default":""},"kept":{"type":"boolean","title":"Kept","default":false},"evidence_support":{"type":"integer","title":"Evidence Support","default":0},"evidence_trials":{"type":"integer","title":"Evidence Trials","default":0},"last_negative_at":{"type":"string","title":"Last Negative At","default":""},"ineffective_at":{"type":"string","title":"Ineffective At","default":""},"history":{"items":{"$ref":"#/components/schemas/EntityFactHistoryEntry"},"type":"array","title":"History"},"resolution":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Resolution"}},"type":"object","title":"EntityFactItem","description":"One current-state attribute fact of an entity.\n\n``source_memory_key`` + ``source_namespace`` form the full provenance\naddress of the memory the value was distilled from (empty when the\ndistiller cited no excerpt, or on rows written before grounding)."},"EntityListItem":{"properties":{"key":{"type":"string","title":"Key"},"canonical_name":{"type":"string","title":"Canonical Name","default":""},"entity_type":{"type":"string","title":"Entity Type","default":"unknown"},"status":{"type":"string","title":"Status","default":"active"},"link_count":{"type":"integer","title":"Link Count","default":0},"merged_into":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merged Into"},"fact_count":{"type":"integer","title":"Fact Count","default":0},"edge_count":{"type":"integer","title":"Edge Count","default":0},"rho":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rho"},"created_at":{"type":"string","title":"Created At","default":""}},"type":"object","required":["key"],"title":"EntityListItem","description":"One registry row in the overview."},"EntityReferenceOut":{"properties":{"audience":{"type":"string","enum":["org","team"],"title":"Audience","default":"org"},"team_ids":{"items":{"type":"string"},"type":"array","title":"Team Ids"},"team_names":{"items":{"type":"string"},"type":"array","title":"Team Names"},"all_teams":{"type":"boolean","title":"All Teams","default":false},"team_key":{"type":"string","title":"Team Key","default":""},"disputed":{"type":"boolean","title":"Disputed","default":false},"key":{"type":"string","title":"Key","default":""},"claim_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Id"},"claim_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Kind"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"subject_binding_revision":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Subject Binding Revision"},"object_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Id"},"object_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Role"},"object_binding_revision":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Object Binding Revision"},"identity_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identity Status"},"object_identity_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Identity Status"},"value_raw":{"title":"Value Raw"},"value_norm":{"title":"Value Norm"},"value_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Type"},"units":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Units"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"first_observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Observed At"},"claim_contract_version":{"type":"integer","title":"Claim Contract Version","default":0},"publication_state":{"type":"string","title":"Publication State","default":"accepted"},"qualification":{"additionalProperties":true,"type":"object","title":"Qualification"},"qualification_text":{"type":"string","title":"Qualification Text","default":""},"polarity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Polarity"},"frame":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frame"},"claimant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claimant"},"scope":{"title":"Scope"},"event_valid_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Valid From"},"event_valid_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Valid To"},"source_published_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Published At"},"source_observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Observed At"},"source_references":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Source References"},"publication_decision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publication Decision Id"},"decision_origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Origin"},"position_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position Id"},"displayed_decision_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Displayed Decision Token"},"valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid Until"},"predicate":{"type":"string","title":"Predicate","default":""},"subject_key":{"type":"string","title":"Subject Key","default":""},"subject_name":{"type":"string","title":"Subject Name","default":""},"observed_at":{"type":"string","title":"Observed At","default":""},"valid_from":{"type":"string","title":"Valid From","default":""},"valid_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid To"},"closed_mechanism":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closed Mechanism"}},"type":"object","title":"EntityReferenceOut","description":"One object-side edge: another entity -> predicate -> this entity."},"EntityRelationOut":{"properties":{"audience":{"type":"string","enum":["org","team"],"title":"Audience","default":"org"},"team_ids":{"items":{"type":"string"},"type":"array","title":"Team Ids"},"team_names":{"items":{"type":"string"},"type":"array","title":"Team Names"},"all_teams":{"type":"boolean","title":"All Teams","default":false},"team_key":{"type":"string","title":"Team Key","default":""},"disputed":{"type":"boolean","title":"Disputed","default":false},"key":{"type":"string","title":"Key","default":""},"claim_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Id"},"claim_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Kind"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"subject_binding_revision":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Subject Binding Revision"},"object_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Id"},"object_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Role"},"object_binding_revision":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Object Binding Revision"},"identity_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identity Status"},"object_identity_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Identity Status"},"value_raw":{"title":"Value Raw"},"value_norm":{"title":"Value Norm"},"value_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Type"},"units":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Units"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"first_observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Observed At"},"claim_contract_version":{"type":"integer","title":"Claim Contract Version","default":0},"publication_state":{"type":"string","title":"Publication State","default":"accepted"},"qualification":{"additionalProperties":true,"type":"object","title":"Qualification"},"qualification_text":{"type":"string","title":"Qualification Text","default":""},"polarity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Polarity"},"frame":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frame"},"claimant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claimant"},"scope":{"title":"Scope"},"event_valid_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Valid From"},"event_valid_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Valid To"},"source_published_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Published At"},"source_observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Observed At"},"source_references":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Source References"},"publication_decision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publication Decision Id"},"decision_origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Origin"},"position_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position Id"},"displayed_decision_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Displayed Decision Token"},"valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid Until"},"predicate":{"type":"string","title":"Predicate","default":""},"object_key":{"type":"string","title":"Object Key","default":""},"object_name":{"type":"string","title":"Object Name","default":""},"observed_at":{"type":"string","title":"Observed At","default":""},"confidence":{"type":"number","title":"Confidence","default":0.0},"valid_from":{"type":"string","title":"Valid From","default":""},"valid_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid To"},"closed_mechanism":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closed Mechanism"},"superseded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Superseded By"},"evidence_support":{"type":"integer","title":"Evidence Support","default":0},"evidence_trials":{"type":"integer","title":"Evidence Trials","default":0},"last_negative_at":{"type":"string","title":"Last Negative At","default":""},"ineffective_at":{"type":"string","title":"Ineffective At","default":""}},"type":"object","title":"EntityRelationOut","description":"One subject-side edge: this entity -> predicate -> another entity."},"EntitySearchResponse":{"properties":{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"EntitySearchResponse","description":"Entities named like the query, best match first (``entity_search``)."},"ErasureReceipt":{"properties":{"scope":{"$ref":"#/components/schemas/MailboxScope"},"requested_generation":{"type":"integer","exclusiveMinimum":0.0,"title":"Requested Generation"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"brain_deleted":{"type":"integer","minimum":0.0,"title":"Brain Deleted","default":0},"brain_complete":{"type":"boolean","title":"Brain Complete","default":false},"source_fence":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Source Fence"},"source_deleted":{"type":"integer","minimum":0.0,"title":"Source Deleted","default":0},"source_complete":{"type":"boolean","title":"Source Complete","default":false},"retired_grant":{"anyOf":[{"$ref":"#/components/schemas/MailboxGrant"},{"type":"null"}]},"source_retired_fence":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Source Retired Fence"},"backup_status":{"type":"string","const":"unverified","title":"Backup Status","default":"unverified"},"provider_cleanup":{"anyOf":[{"$ref":"#/components/schemas/ProviderCleanup"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["scope","requested_generation","started_at"],"title":"ErasureReceipt","description":"Keep only authority and cleanup counters after active content is removed."},"EscalationEvent":{"properties":{"thread_id":{"type":"string","title":"Thread Id"},"from_profile":{"type":"string","title":"From Profile"},"to_profile":{"type":"string","title":"To Profile"},"reason":{"type":"string","title":"Reason"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"alert_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alert Title"},"success":{"type":"boolean","title":"Success","default":true},"timestamp":{"type":"string","title":"Timestamp"}},"type":"object","required":["thread_id","from_profile","to_profile","reason"],"title":"EscalationEvent","description":"Single cross-domain escalation event."},"EscalationEventsResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/EscalationEvent"},"type":"array","title":"Events"}},"type":"object","required":["events"],"title":"EscalationEventsResponse","description":"Wrapper for escalation event list."},"EscalationPairStats":{"properties":{"from_profile":{"type":"string","title":"From Profile"},"to_profile":{"type":"string","title":"To Profile"},"count":{"type":"integer","title":"Count"},"last_occurred":{"type":"string","title":"Last Occurred"},"providers":{"items":{"type":"string"},"type":"array","title":"Providers"}},"type":"object","required":["from_profile","to_profile","count","last_occurred","providers"],"title":"EscalationPairStats","description":"Aggregate stats for a (from_profile, to_profile) pair."},"EscalationRecommendationsResponse":{"properties":{"recommendations":{"items":{"$ref":"#/components/schemas/ProfilePinRecommendation"},"type":"array","title":"Recommendations"}},"type":"object","required":["recommendations"],"title":"EscalationRecommendationsResponse","description":"Wrapper for profile-pin recommendations."},"EscalationStatsResponse":{"properties":{"stats":{"items":{"$ref":"#/components/schemas/EscalationPairStats"},"type":"array","title":"Stats"}},"type":"object","required":["stats"],"title":"EscalationStatsResponse","description":"Wrapper for escalation pair stats."},"EventStreamRequest":{"properties":{"channels":{"items":{"type":"string"},"type":"array","title":"Channels","description":"Channels to subscribe to (e.g. messages, values, lifecycle)."},"namespaces":{"anyOf":[{"items":{"items":{"type":"string"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Namespaces","description":"Subgraph namespace prefixes to include."},"depth":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Depth","description":"Max subgraph nesting depth to include."},"since":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Since","description":"Last seq the client saw; events at or below it are skipped on resume."}},"type":"object","required":["channels"],"title":"EventStreamRequest","description":"Body for ``POST /threads/{thread_id}/stream/events``.\n\nThread-scoped, matching the LangGraph SDK: no run id — the stream\ncarries events for whatever run(s) execute on the thread."},"ExcludedServer":{"properties":{"name":{"type":"string","title":"Name"},"reason":{"type":"string","enum":["oauth_token_missing","unsupported_transport","missing_url","connection_timeout","connection_failed"],"title":"Reason"},"message":{"type":"string","title":"Message"},"needs_authorization":{"type":"boolean","title":"Needs Authorization","default":false}},"type":"object","required":["name","reason","message"],"title":"ExcludedServer","description":"Information about an excluded server."},"ExclusionsRequest":{"properties":{"entries":{"items":{"type":"string","maxLength":320,"minLength":3},"type":"array","maxItems":200,"title":"Entries"},"expected_revision":{"type":"integer","minimum":0.0,"title":"Expected Revision"},"forget_existing":{"type":"boolean","title":"Forget Existing","default":false}},"additionalProperties":false,"type":"object","required":["entries","expected_revision"],"title":"ExclusionsRequest","description":"Exclude future learning and optionally forget existing matching facts."},"ExecutorInfo":{"properties":{"id":{"type":"string","title":"Id"},"description":{"type":"string","title":"Description"}},"type":"object","required":["id","description"],"title":"ExecutorInfo","description":"Describes an available executor type."},"ExtraUsageSettingsResponse":{"properties":{"billing_model":{"type":"string","title":"Billing Model","description":"Billing model: 'prepaid' (Starter/Pro) or 'postpaid' (Enterprise)","default":"prepaid"},"plan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Id","description":"User's subscription plan"},"prepaid_credits_available":{"type":"integer","title":"Prepaid Credits Available","description":"Prepaid credits purchased (never expire)","default":0},"extra_usage_enabled":{"type":"boolean","title":"Extra Usage Enabled","description":"Whether postpaid overage billing is enabled (Enterprise only)"},"extra_usage_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Extra Usage Cap Cents","description":"Max monthly overage spend in cents (NULL = unlimited)"},"extra_usage_cap_dollars":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Extra Usage Cap Dollars","description":"Max monthly overage spend in dollars (for display)"},"overage_credits_used":{"type":"integer","title":"Overage Credits Used","description":"Overage credits used this billing period (postpaid)"},"overage_spend_cents":{"type":"integer","title":"Overage Spend Cents","description":"Current overage spend in cents (postpaid)"},"overage_spend_dollars":{"type":"number","title":"Overage Spend Dollars","description":"Current overage spend in dollars (postpaid)"},"remaining_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Remaining Cap Cents","description":"Remaining overage budget in cents (NULL if unlimited)"},"remaining_cap_dollars":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Cap Dollars","description":"Remaining overage budget in dollars (NULL if unlimited)"},"price_per_credit_cents":{"type":"integer","title":"Price Per Credit Cents","description":"Price per credit in cents"}},"type":"object","required":["extra_usage_enabled","overage_credits_used","overage_spend_cents","overage_spend_dollars","price_per_credit_cents"],"title":"ExtraUsageSettingsResponse","description":"Response schema for extra usage settings."},"ExtraUsageSettingsUpdateRequest":{"properties":{"extra_usage_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Extra Usage Enabled","description":"Enable/disable overage billing"},"extra_usage_cap_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Extra Usage Cap Cents","description":"Max monthly overage spend in cents (0 = no limit)"}},"type":"object","title":"ExtraUsageSettingsUpdateRequest","description":"Request schema for updating extra usage settings."},"ExtractionSpec":{"properties":{"accepted_mimes":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Accepted Mimes"},"attribute_descriptions":{"additionalProperties":{"type":"string"},"type":"object","minProperties":1,"title":"Attribute Descriptions"},"record_id_attribute":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Record Id Attribute"},"min_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min Confidence","default":0.9},"review":{"type":"string","enum":["uncertain","all"],"title":"Review","default":"uncertain"}},"additionalProperties":false,"type":"object","required":["accepted_mimes","attribute_descriptions"],"title":"ExtractionSpec","description":"Declare supported original material and extraction review policy."},"FactRulingRequest":{"properties":{"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Id"},"position_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position Id"},"note":{"type":"string","maxLength":2000,"title":"Note","default":""},"promote_rule":{"type":"boolean","title":"Promote Rule","default":false},"expected_fingerprint":{"type":"string","maxLength":128,"minLength":1,"title":"Expected Fingerprint"}},"additionalProperties":false,"type":"object","required":["expected_fingerprint"],"title":"FactRulingRequest","description":"A supported value choice carrying the displayed decision token."},"FactorPolarity":{"type":"string","enum":["support","attack"],"title":"FactorPolarity","description":"Sign of a ranking factor's contribution to QBAF aggregation."},"FieldChoice":{"properties":{"index":{"type":"integer","minimum":0.0,"title":"Index"},"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Label"}},"type":"object","required":["index"],"title":"FieldChoice","description":"One proposed field an admin wants made, with their own label if any."},"FieldOption":{"properties":{"value":{"type":"string","title":"Value"},"label":{"type":"string","title":"Label"},"help":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Help"}},"additionalProperties":false,"type":"object","required":["value","label"],"title":"FieldOption","description":"Keep selectable values explicit and labels plain."},"FieldRule":{"properties":{"predicate":{"type":"string","title":"Predicate"},"value_type":{"type":"string","enum":["string","number","money","date","enum","email","domain","phone","bool"],"title":"Value Type","default":"string"},"normalize":{"items":{"type":"string","enum":["trim","casefold","strip_punct","digits_only","domain","domain_of_email","iso_date","currency_minor"]},"type":"array","title":"Normalize"},"synonyms":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Synonyms"},"tolerance":{"anyOf":[{"$ref":"#/components/schemas/Tolerance"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"authority":{"items":{"type":"string"},"type":"array","title":"Authority"},"fallback":{"type":"string","enum":["authority_only","newest_observed","majority","adjudicate"],"title":"Fallback","default":"adjudicate"},"write_back":{"anyOf":[{"$ref":"#/components/schemas/WriteBackSpec"},{"type":"null"}]},"scope_dimensions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scope Dimensions","description":"Required applicability dimensions; [] explicitly permits unscoped derived claims."},"temporal_value_role":{"anyOf":[{"type":"string","const":"event"},{"type":"null"}],"title":"Temporal Value Role","description":"Explicitly declares that the entire predicate value is an event date; never inferred from its name."}},"additionalProperties":false,"type":"object","required":["predicate"],"title":"FieldRule","description":"Define one canonical attribute and its source resolution policy."},"FolderListing":{"properties":{"scope":{"$ref":"#/components/schemas/MailboxScope"},"folders":{"items":{"$ref":"#/components/schemas/ProviderFolder"},"type":"array","maxItems":10000,"title":"Folders","default":[]}},"additionalProperties":false,"type":"object","required":["scope"],"title":"FolderListing","description":"RO's last complete discovery for one connection; empty before the baseline."},"FolderSelection":{"properties":{"connection_id":{"type":"string","maxLength":512,"minLength":1,"title":"Connection Id"},"revision":{"type":"integer","minimum":0.0,"title":"Revision"},"custom_roots":{"items":{"type":"string","maxLength":512,"minLength":1},"type":"array","maxItems":50,"title":"Custom Roots","default":[]}},"additionalProperties":false,"type":"object","required":["connection_id","revision"],"title":"FolderSelection","description":"Version a connection's custom roots for compare-and-swap updates."},"FolderSelectionRequest":{"properties":{"custom_roots":{"items":{"type":"string","maxLength":512,"minLength":1},"type":"array","maxItems":50,"title":"Custom Roots"},"expected_revision":{"type":"integer","minimum":0.0,"title":"Expected Revision"}},"additionalProperties":false,"type":"object","required":["custom_roots","expected_revision"],"title":"FolderSelectionRequest","description":"Replace custom roots; Inbox and Sent are always included."},"FolderView":{"properties":{"selection":{"$ref":"#/components/schemas/FolderSelection"},"listing":{"$ref":"#/components/schemas/FolderListing"}},"type":"object","required":["selection","listing"],"title":"FolderView","description":"Pair the current selection with RO's discovered folders for the picker."},"FormField":{"properties":{"key":{"type":"string","maxLength":63,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Key"},"type":{"type":"string","enum":["boolean","select","sender_list","investigation_profile"],"title":"Type"},"label":{"type":"string","title":"Label"},"help":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Help"},"required":{"type":"boolean","title":"Required"},"feature":{"anyOf":[{"type":"string","maxLength":63,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$"},{"type":"null"}],"title":"Feature"},"default":{"$ref":"#/components/schemas/JsonValue"},"options":{"items":{"$ref":"#/components/schemas/FieldOption"},"type":"array","title":"Options","default":[]},"max_entries":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Entries"},"canonical_rule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Rule"}},"additionalProperties":false,"type":"object","required":["key","type","label","required"],"title":"FormField","description":"Describe only the closed set of inputs the client may edit."},"FormSchema":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/FormField"},"type":"array","title":"Fields"}},"additionalProperties":false,"type":"object","required":["fields"],"title":"FormSchema","description":"Keep schema order stable without embedding profiles or team choices."},"GCPServiceBatchCreate":{"properties":{"services":{"items":{"additionalProperties":true,"type":"object"},"type":"array","minItems":1,"title":"Services","description":"List of services to register (each with service_name, display_name, category)"}},"type":"object","required":["services"],"title":"GCPServiceBatchCreate","description":"Request schema for batch service registration."},"GCPServiceBatchResponse":{"properties":{"total":{"type":"integer","title":"Total"},"created":{"type":"integer","title":"Created"},"skipped":{"type":"integer","title":"Skipped"},"results":{"items":{"$ref":"#/components/schemas/ServiceCreationResult"},"type":"array","title":"Results"}},"type":"object","required":["total","created","skipped","results"],"title":"GCPServiceBatchResponse","description":"Response schema for bulk service registration."},"GCPServiceListResponse":{"properties":{"services":{"items":{"$ref":"#/components/schemas/GCPServiceResponse"},"type":"array","title":"Services"}},"type":"object","required":["services"],"title":"GCPServiceListResponse","description":"Response schema for list of GCP services."},"GCPServiceResponse":{"properties":{"service_name":{"type":"string","title":"Service Name"},"display_name":{"type":"string","title":"Display Name"},"category":{"type":"string","title":"Category"},"labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Labels"},"iam_roles":{"items":{"type":"string"},"type":"array","title":"Iam Roles"},"discovered_at":{"type":"string","title":"Discovered At","default":""}},"type":"object","required":["service_name","display_name","category"],"title":"GCPServiceResponse","description":"Response schema for a registered GCP service."},"GoogleMailbox":{"properties":{"provider":{"type":"string","const":"gmail","title":"Provider"},"sub":{"type":"string","maxLength":255,"minLength":1,"pattern":"^[A-Za-z0-9_-]{1,255}$","title":"Sub"}},"additionalProperties":false,"type":"object","required":["provider","sub"],"title":"GoogleMailbox","description":"Identify a verified Gmail account by its stable subject, never an address."},"GrantBrainPassRequest":{"properties":{"org_id":{"type":"string","title":"Org Id","description":"Organization to credit (the pay token 'sub')."},"jti":{"type":"string","title":"Jti","description":"Pay token id; the idempotency key for this purchase."},"sku":{"type":"string","title":"Sku","description":"Pass SKU (e.g. 'platformpilot-starter'); resolves price + duration."},"payment_intent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Intent Id","description":"Stripe PaymentIntent that settled the charge (audit)."},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By","description":"Optional Auth0 uid of the human who approved the spend."}},"type":"object","required":["org_id","jti","sku"],"title":"GrantBrainPassRequest","description":"Request to grant (or idempotently re-confirm) a Brain access pass.\n\nThe grant is keyed on ``jti`` (the pay token id), so a retry (or the\nwebhook backstop firing for the same payment) converges to one pass. The\npass horizon (``paid_through``) is computed server-side from the SKU's\n``duration_days``; the client does NOT supply it (the backend stays\nauthoritative on duration just as it is on price)."},"GrantBrainPassResponse":{"properties":{"granted":{"type":"boolean","title":"Granted","description":"True once the pass is recorded."},"tier":{"type":"string","title":"Tier","description":"Entitlement tier the pass confers.","default":"paid"},"jti":{"type":"string","title":"Jti","description":"The purchase id (echoed for correlation)."},"paid_through":{"type":"string","format":"date-time","title":"Paid Through","description":"UTC instant the pass entitlement lapses."}},"type":"object","required":["granted","jti","paid_through"],"title":"GrantBrainPassResponse","description":"Result of a Brain access pass grant."},"GraphInfo":{"properties":{"id":{"type":"string","title":"Id"},"description":{"type":"string","title":"Description"},"display_name":{"type":"string","title":"Display Name","default":""}},"type":"object","required":["id","description"],"title":"GraphInfo","description":"Describes an available orchestration graph."},"GroundingEntry":{"properties":{"canonical":{"type":"string","title":"Canonical","description":"Display spelling of the canonical category"},"folded":{"items":{"type":"string"},"type":"array","title":"Folded","description":"Raw emergent labels the dream reconcile mapped onto this canonical (non-identity ledger entries). The ledger keeps label names only, not per-label memory counts — folded rows were rewritten to the canonical, so their original counts no longer exist"}},"type":"object","required":["canonical"],"title":"GroundingEntry","description":"One canonical category and the raw labels reconcile folded into it."},"GroupByBody":{"properties":{"filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filter"},"aggregates":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Aggregates"},"includeDeleted":{"type":"boolean","title":"Includedeleted","default":false},"groupBy":{"items":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"}]},"type":"array","maxItems":2,"minItems":1,"title":"Groupby"},"limit":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Limit","default":50},"includeRecords":{"type":"integer","maximum":60.0,"minimum":0.0,"title":"Includerecords","default":0},"orderBy":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Orderby"},"depth":{"type":"integer","maximum":1.0,"minimum":0.0,"title":"Depth","description":"1 nests many-to-one targets in the records","default":0}},"type":"object","required":["groupBy"],"title":"GroupByBody","description":"Body of ``POST .../records/group-by`` (kanban columns, pipeline totals)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Overall health status: 'healthy' or 'unhealthy'."},"database":{"type":"string","title":"Database","description":"PostgreSQL connection status."},"langgraph_checkpointer":{"type":"string","title":"Langgraph Checkpointer","description":"Checkpoint backend connection status."},"langgraph_store":{"type":"string","title":"Langgraph Store","description":"Store backend connection status."}},"type":"object","required":["status","database","langgraph_checkpointer","langgraph_store"],"title":"HealthResponse","description":"Health check response model"},"HealthStatus":{"type":"string","enum":["ok","unreachable","auth_failed","schema_mismatch"],"title":"HealthStatus","description":"Most recent ``_ensure_byo_db_health`` probe outcome.\n\nPopulated by the eight-check probe at activation; pre-flight\nprobes at config write time only emit ``ok`` / ``unreachable``."},"IAMGrantRequest":{"properties":{"service_name":{"type":"string","title":"Service Name","description":"GCP API name"},"role":{"type":"string","title":"Role","description":"IAM role to grant"},"access_level":{"type":"string","pattern":"^(viewer|admin)$","title":"Access Level","description":"Access level: viewer or admin","default":"viewer"}},"type":"object","required":["service_name","role"],"title":"IAMGrantRequest","description":"Request to grant an IAM role."},"IAMGrantResult":{"properties":{"service_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Name"},"role":{"type":"string","title":"Role"},"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"fix_command":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fix Command"}},"type":"object","required":["role","success","message"],"title":"IAMGrantResult","description":"Result of IAM grant or revoke operation."},"IAMRecommendation":{"properties":{"service_name":{"type":"string","title":"Service Name"},"display_name":{"type":"string","title":"Display Name"},"recommended_role":{"type":"string","title":"Recommended Role"},"has_role":{"type":"boolean","title":"Has Role"},"access_level":{"type":"string","title":"Access Level","description":"viewer or admin"},"gcloud_command":{"type":"string","title":"Gcloud Command"}},"type":"object","required":["service_name","display_name","recommended_role","has_role","access_level","gcloud_command"],"title":"IAMRecommendation","description":"IAM role recommendation for a service."},"IAMRevokeRequest":{"properties":{"role":{"type":"string","title":"Role","description":"IAM role to revoke"}},"type":"object","required":["role"],"title":"IAMRevokeRequest","description":"Request to revoke an IAM role."},"IdentityPolicy":{"properties":{"compatible_types":{"items":{"items":{"type":"string"},"type":"array"},"type":"array","maxItems":20,"title":"Compatible Types"},"company_offering":{"type":"string","enum":["separate","same_named_offering"],"title":"Company Offering","default":"separate"}},"additionalProperties":false,"type":"object","title":"IdentityPolicy","description":"Eligibility classes and the customer's company/offering granularity."},"IdentityReviewRequest":{"properties":{"expected_binding_token":{"type":"string","maxLength":128,"minLength":1,"title":"Expected Binding Token"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"note":{"type":"string","maxLength":2000,"minLength":1,"title":"Note"},"decision_kind":{"type":"string","enum":["identity","type","alias"],"title":"Decision Kind","default":"identity"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"alias_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias Key"},"expected_alias_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Alias Token"},"scope":{"additionalProperties":true,"type":"object","title":"Scope"},"source_dependencies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":128,"title":"Source Dependencies"},"independent_attestation":{"type":"boolean","title":"Independent Attestation","default":false}},"additionalProperties":false,"type":"object","required":["expected_binding_token","note"],"title":"IdentityReviewRequest","description":"Bind an explicit identity decision to the displayed identity and evidence."},"ImapMailbox":{"properties":{"provider":{"type":"string","const":"imap","title":"Provider"},"account_id":{"type":"string","pattern":"^[0-9a-f]{32}$","title":"Account Id"}},"additionalProperties":false,"type":"object","required":["provider","account_id"],"title":"ImapMailbox","description":"Hold RO's keyed account identity without its host, username or password."},"ImapTrustUpdate":{"properties":{"expected_revision":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Expected Revision"},"enabled":{"type":"boolean","title":"Enabled"},"trusted_server_ids":{"items":{"type":"string"},"type":"array","maxItems":16,"title":"Trusted Server Ids"},"acknowledged":{"type":"boolean","title":"Acknowledged","default":false}},"additionalProperties":false,"type":"object","required":["expected_revision","enabled"],"title":"ImapTrustUpdate","description":"Require explicit consent for an owner-supplied header trust choice."},"ImapTrustView":{"properties":{"connection_id":{"type":"string","maxLength":512,"minLength":1,"title":"Connection Id"},"revision":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Revision","default":0},"enabled":{"type":"boolean","title":"Enabled","default":false},"trusted_server_ids":{"items":{"type":"string"},"type":"array","maxItems":16,"title":"Trusted Server Ids","default":[]},"available":{"type":"boolean","title":"Available"}},"additionalProperties":false,"type":"object","required":["connection_id","available"],"title":"ImapTrustView","description":"Expose availability without treating the global gate as owner consent."},"ImportChanges":{"properties":{"columns":{"items":{"$ref":"#/components/schemas/ColumnChange"},"type":"array","title":"Columns"},"sheet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sheet"},"object":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object"},"visibleTo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Visibleto"},"source":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Source"},"includeRejected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Includerejected"}},"type":"object","title":"ImportChanges","description":"Body of ``PATCH .../imports/{importId}``.\n\n``source`` is the member's own word on where the file comes from: a name\nsets it, null clears it (\"a file\"); leave the key out to keep it.\n``includeRejected`` puts the rows that the file's status column marks as\ndropped back in (true) or leaves them out again (false)."},"ImportFields":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/FieldChoice"},"type":"array","maxItems":20,"minItems":1,"title":"Fields"}},"type":"object","required":["fields"],"title":"ImportFields","description":"Body of ``POST .../imports/{importId}/fields``."},"ImportReportRequest":{"properties":{"kind":{"type":"string","const":"memory_import","title":"Kind"},"preview_id":{"type":"string","maxLength":64,"minLength":1,"title":"Preview Id"}},"additionalProperties":false,"type":"object","required":["kind","preview_id"],"title":"ImportReportRequest","description":"Check every proposal of a seed preview against existing memories."},"ImportStart":{"properties":{"columns":{"items":{"$ref":"#/components/schemas/ColumnChange"},"type":"array","title":"Columns"}},"type":"object","title":"ImportStart","description":"Body of ``POST .../imports/{importId}/start``: column edits only, never rows."},"InfoResponse":{"properties":{"name":{"type":"string","title":"Name","description":"Service name."},"version":{"type":"string","title":"Version","description":"Current server version."},"description":{"type":"string","title":"Description","description":"Service description."},"status":{"type":"string","title":"Status","description":"Current service status."},"flags":{"additionalProperties":true,"type":"object","title":"Flags","description":"Feature flags indicating available capabilities."}},"type":"object","required":["name","version","description","status","flags"],"title":"InfoResponse","description":"Info endpoint response model"},"IntentRequest":{"properties":{"organization_id":{"type":"string","maxLength":512,"minLength":1,"title":"Organization Id"},"intent_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Intent Id"}},"additionalProperties":false,"type":"object","required":["organization_id","intent_id"],"title":"IntentRequest","description":"Address an existing owner intent without supplying ownership authority."},"InviteCreateRequest":{"properties":{"channel_id":{"type":"string","maxLength":64,"minLength":1,"title":"Channel Id"},"sender_id":{"type":"string","maxLength":255,"minLength":1,"title":"Sender Id"},"target_user_id":{"type":"string","maxLength":36,"minLength":1,"title":"Target User Id"}},"type":"object","required":["channel_id","sender_id","target_user_id"],"title":"InviteCreateRequest","description":"Request to generate an invite link for channel identity linking."},"InviteDetailsResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"sender_id":{"type":"string","title":"Sender Id"},"sender_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Display Name"},"expires_at":{"type":"string","title":"Expires At"},"claimed":{"type":"boolean","title":"Claimed"},"for_you":{"type":"boolean","title":"For You"}},"type":"object","required":["channel_id","sender_id","expires_at","claimed","for_you"],"title":"InviteDetailsResponse","description":"What an invite links, read without claiming it."},"InviteResponse":{"properties":{"url":{"type":"string","title":"Url"},"token":{"type":"string","title":"Token"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["url","token","expires_at"],"title":"InviteResponse","description":"Response with the invite URL and token."},"InvoiceListResponse":{"properties":{"invoices":{"items":{"$ref":"#/components/schemas/InvoiceResponse"},"type":"array","title":"Invoices","description":"List of invoices"},"count":{"type":"integer","title":"Count","description":"Number of invoices returned in this response"},"has_more":{"type":"boolean","title":"Has More","description":"Whether more invoices exist beyond this page"}},"type":"object","required":["invoices","count","has_more"],"title":"InvoiceListResponse","description":"Response schema for paginated invoice list."},"InvoiceResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Stripe invoice ID"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Invoice number (e.g., INV-0001)"},"created":{"type":"string","format":"date-time","title":"Created","description":"Invoice creation date"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date","description":"Payment due date"},"amount_due":{"type":"integer","title":"Amount Due","description":"Amount due in cents"},"amount_paid":{"type":"integer","title":"Amount Paid","description":"Amount paid in cents"},"currency":{"type":"string","title":"Currency","description":"Three-letter ISO currency code"},"status":{"type":"string","title":"Status","description":"Invoice status (draft, open, paid, uncollectible, void)"},"hosted_invoice_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hosted Invoice Url","description":"URL to view/pay the invoice"},"invoice_pdf":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Pdf","description":"URL to download PDF"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Invoice description"},"subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Id","description":"Associated subscription ID"}},"type":"object","required":["id","created","amount_due","amount_paid","currency","status"],"title":"InvoiceResponse","description":"Response schema for a single invoice."},"JobCreateRequest":{"properties":{"schedule":{"type":"string","title":"Schedule","description":"UTC cron expression (5 fields: minute hour day month weekday). Examples: '0 */6 * * *' (every 6h), '30 9 * * 1-5' (weekdays 09:30 UTC)."},"task_description":{"type":"string","maxLength":4000,"minLength":1,"title":"Task Description"},"assistant_id":{"type":"string","title":"Assistant Id","default":"PlatformPilot"}},"type":"object","required":["schedule","task_description"],"title":"JobCreateRequest","description":"Request schema for creating a scheduled job."},"JobPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JobView"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items","next_cursor"],"title":"JobPage","description":"Page retained private execution status in stable logical-ID order."},"JobRequest":{"properties":{"organization_id":{"type":"string","maxLength":512,"minLength":1,"title":"Organization Id"},"connection_id":{"type":"string","maxLength":512,"minLength":1,"title":"Connection Id"},"operation_id":{"type":"string","maxLength":512,"minLength":1,"title":"Operation Id"}},"additionalProperties":false,"type":"object","required":["organization_id","connection_id","operation_id"],"title":"JobRequest","description":"Address one durable processing operation."},"JobResponse":{"properties":{"cron_id":{"type":"string","title":"Cron Id"},"schedule":{"type":"string","title":"Schedule"},"task_description":{"type":"string","title":"Task Description"},"assistant_id":{"type":"string","title":"Assistant Id"},"enabled":{"type":"boolean","title":"Enabled"},"next_run_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Run Date"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["cron_id","schedule","task_description","assistant_id","enabled"],"title":"JobResponse","description":"Response schema for a scheduled job."},"JobUpdateRequest":{"properties":{"schedule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule"},"task_description":{"anyOf":[{"type":"string","maxLength":4000,"minLength":1},{"type":"null"}],"title":"Task Description"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"JobUpdateRequest","description":"Request schema for updating a scheduled job (partial)."},"JobView":{"properties":{"id":{"type":"string","title":"Id"},"rule_id":{"type":"string","title":"Rule Id"},"rule_revision":{"type":"integer","title":"Rule Revision"},"status":{"type":"string","enum":["pending","admitted","running","completed","no_match","not_sure","waiting_usage","daily_limit","revoked","expired","failed"],"title":"Status"},"received_at":{"type":"string","format":"date-time","title":"Received At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"thread_path":{"type":"string","title":"Thread Path","default":"/inbox"}},"type":"object","required":["id","rule_id","rule_revision","status","received_at","expires_at","thread_id"],"title":"JobView","description":"Keep status public only to its owner, without source IDs or usage authority."},"JsonValue":{},"KmsKeyProvider":{"type":"string","enum":["gcp"],"title":"KmsKeyProvider","description":"Cloud provider hosting the customer's KMS key.\n\nPhase B = GCP only. AWS/Azure are documented in PLA-204 Phase D\nand live behind a separate ``kms_client_aws.py`` /\n``kms_client_azure.py`` not implemented here. The enum is\nforward-looking so a tenant who later upgrades doesn't break\nschema compatibility on stored records."},"KubernetesClusterBatchCreate":{"properties":{"clusters":{"items":{"additionalProperties":true,"type":"object"},"type":"array","minItems":1,"title":"Clusters","description":"List of clusters to create (each with cluster_name and optional labels)","examples":[[{"cluster_name":"prod-gke-us-central1","labels":{"region":"us-central1","stage":"production"}},{"cluster_name":"staging-gke-us-east1","labels":{"region":"us-east1","stage":"staging"}}]]}},"type":"object","required":["clusters"],"title":"KubernetesClusterBatchCreate","description":"Request schema for creating multiple Kubernetes clusters in a single request."},"KubernetesClusterBatchResponse":{"properties":{"total":{"type":"integer","title":"Total","description":"Total clusters in request"},"created":{"type":"integer","title":"Created","description":"Number of clusters created"},"skipped":{"type":"integer","title":"Skipped","description":"Number of clusters skipped (already exist)"},"failed":{"type":"integer","title":"Failed","description":"Number of clusters that failed"},"results":{"items":{"$ref":"#/components/schemas/ClusterCreationResult"},"type":"array","title":"Results","description":"Per-cluster results"}},"type":"object","required":["total","created","skipped","failed","results"],"title":"KubernetesClusterBatchResponse","description":"Response schema for bulk cluster creation."},"KubernetesClusterListResponse":{"properties":{"clusters":{"items":{"$ref":"#/components/schemas/KubernetesClusterResponse"},"type":"array","title":"Clusters"}},"type":"object","required":["clusters"],"title":"KubernetesClusterListResponse","description":"Response schema for list of Kubernetes clusters."},"KubernetesClusterResponse":{"properties":{"cluster_name":{"type":"string","title":"Cluster Name"},"provider_key":{"type":"string","title":"Provider Key"},"labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Labels"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["cluster_name","provider_key","labels","created_at"],"title":"KubernetesClusterResponse","description":"Response schema for Kubernetes cluster details (hierarchical)."},"KubernetesClusterUpdate":{"properties":{"labels":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Labels","description":"Updated labels"}},"type":"object","title":"KubernetesClusterUpdate","description":"Request schema for updating Kubernetes cluster."},"LifecycleRequest":{"properties":{"expected_authorization_generation":{"type":"integer","exclusiveMinimum":0.0,"title":"Expected Authorization Generation"}},"additionalProperties":false,"type":"object","required":["expected_authorization_generation"],"title":"LifecycleRequest","description":"Require a current lifecycle version without accepting an owner or scope."},"LinkRulingRequest":{"properties":{"a_key":{"type":"string","title":"A Key","description":"One endpoint's memory key"},"b_key":{"type":"string","title":"B Key","description":"The other endpoint's memory key"},"namespace":{"type":"string","enum":["episodes","knowledge"],"title":"Namespace","description":"Namespace both memories live in"},"ruling":{"type":"string","enum":["confirm","dispute"],"title":"Ruling","description":"'confirm' = this connection is right; 'dispute' = it is wrong. Disputing does not delete the connection: it marks it so recall stops leaning on it and the graph can show it as rejected."}},"type":"object","required":["a_key","b_key","namespace","ruling"],"title":"LinkRulingRequest","description":"A reviewer's verdict on one connection between two memories."},"LinkRulingResponse":{"properties":{"a_key":{"type":"string","title":"A Key"},"b_key":{"type":"string","title":"B Key"},"namespace":{"type":"string","title":"Namespace"},"provenance":{"type":"string","enum":["structural","inferred","confirmed","disputed"],"title":"Provenance","description":"The tier now recorded on both directions of the edge"},"directions_stamped":{"type":"integer","title":"Directions Stamped","description":"How many of the two stored directions were updated. Normally 2; 1 when only one side records the link (a half-written edge)."}},"type":"object","required":["a_key","b_key","namespace","provenance","directions_stamped"],"title":"LinkRulingResponse","description":"Result of a link ruling."},"LinkedEntityOut":{"properties":{"key":{"type":"string","title":"Key","default":""},"name":{"type":"string","title":"Name","default":""},"entity_type":{"type":"string","title":"Entity Type","default":"unknown"}},"type":"object","title":"LinkedEntityOut","description":"One entity linked to a memory, resolved to its terminal survivor.\n\n``key`` is the registry row key (``entity:{uuid}``), directly usable\nas the workbench deep-link target (``/brain/workbench?entity=<key>``);\nthe mention-to-key resolution already happened in the entity layer."},"LongMemEvalRunResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"total_questions":{"type":"integer","title":"Total Questions"},"total_sessions_seeded":{"type":"integer","title":"Total Sessions Seeded"},"total_duration_s":{"type":"number","title":"Total Duration S"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"Per-question rows: question, response, retrieved, recall, ..."},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["technique","total_questions","total_sessions_seeded","total_duration_s","rows"],"title":"LongMemEvalRunResponse","description":"Response from the run phase."},"LongMemEvalScoreResponse":{"properties":{"accuracy":{"additionalProperties":true,"type":"object","title":"Accuracy"},"recall":{"additionalProperties":true,"type":"object","title":"Recall"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"Scored rows (each with a `correct` flag) for failure inspection."}},"type":"object","required":["accuracy","recall"],"title":"LongMemEvalScoreResponse","description":"Response from the score phase: QA accuracy + retrieval recall@k."},"MABRunResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"total_records":{"type":"integer","title":"Total Records"},"total_chunks_seeded":{"type":"integer","title":"Total Chunks Seeded"},"total_duration_s":{"type":"number","title":"Total Duration S"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"Per-probe rows: question, response, correct, answer_in_context, ..."},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["technique","total_records","total_chunks_seeded","total_duration_s","rows"],"title":"MABRunResponse","description":"Response from the run phase (rows already scored — deterministic)."},"MABScoreResponse":{"properties":{"summary":{"additionalProperties":true,"type":"object","title":"Summary"}},"type":"object","required":["summary"],"title":"MABScoreResponse","description":"Aggregated accuracy (overall + per competency) + fact-grounding rate."},"MCPOAuthConfig":{"properties":{"type":{"type":"string","const":"oauth2","title":"Type","default":"oauth2"},"grant_type":{"type":"string","enum":["client_credentials","authorization_code"],"title":"Grant Type","default":"client_credentials"},"authorization_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization Endpoint"},"token_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Endpoint"},"registration_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registration Endpoint"},"revocation_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revocation Endpoint"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"},"dynamic_registration":{"type":"boolean","title":"Dynamic Registration","default":false},"initial_access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial Access Token"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","default":[]},"resource":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"},"token_secret_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Secret Ref"}},"type":"object","title":"MCPOAuthConfig","description":"OAuth 2.1 configuration for MCP server authentication.\n\nSupports both client_credentials (server-to-server) and authorization_code\n(user-delegated) grant types with PKCE. Dynamic client registration (RFC 7591)\nis supported for on-demand client provisioning."},"MCPProbeRequest":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"MCPProbeRequest","description":"A URL to probe before any server exists."},"MCPProbeResponse":{"properties":{"issuer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuer"},"authorization_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization Endpoint"},"token_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Endpoint"},"registration_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registration Endpoint"},"revocation_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revocation Endpoint"},"scopes_supported":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes Supported"},"grant_types_supported":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Grant Types Supported"},"persisted":{"type":"boolean","title":"Persisted","default":false},"discovery_status":{"type":"string","enum":["discovered","no_auth_required","no_oauth","unreachable"],"title":"Discovery Status","default":"no_oauth"},"discovery_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discovery Error"},"icon_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Domain"}},"type":"object","title":"MCPProbeResponse","description":"Discovery for a URL, plus the domain the dashboard shows a favicon for.\n\n``persisted`` is always False: there is no server to persist into."},"MCPServerConfig":{"properties":{"transport":{"type":"string","enum":["sse","http"],"title":"Transport","default":"sse"},"url":{"type":"string","title":"Url"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers"},"timeout":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timeout"},"sse_read_timeout":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sse Read Timeout"},"auth":{"anyOf":[{"$ref":"#/components/schemas/MCPOAuthConfig"},{"type":"null"}]},"session_kwargs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Session Kwargs"},"terminate_on_close":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Terminate On Close"},"enabled":{"type":"boolean","title":"Enabled","default":true},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"resolved_ips":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Resolved Ips"}},"type":"object","required":["url"],"title":"MCPServerConfig","description":"MCP server configuration schema for remote MCP servers.\n\nSupported transports:\n- sse: Server-Sent Events (recommended for most MCP servers like Linear)\n- http: HTTP streaming\n\nThe resolved_ips field stores IP addresses resolved at validation time\nfor DNS pinning - preventing DNS rebinding attacks where the hostname\nresolves to a different (internal) IP at connection time."},"MailboxEvidence":{"properties":{"scope":{"$ref":"#/components/schemas/MailboxScope"},"kind":{"type":"string","enum":["original","attachment","derived"],"title":"Kind"},"content":{"type":"string","minLength":1,"title":"Content"},"sources":{"items":{"$ref":"#/components/schemas/SourceVersion"},"type":"array","minItems":1,"title":"Sources"}},"additionalProperties":false,"type":"object","required":["scope","kind","content","sources"],"title":"MailboxEvidence","description":"Preserve the complete source basis for an original or a derived artifact."},"MailboxGrant":{"properties":{"scope":{"$ref":"#/components/schemas/MailboxScope"},"state":{"type":"string","enum":["active","disconnected","erasing","retired"],"title":"State"}},"additionalProperties":false,"type":"object","required":["scope","state"],"title":"MailboxGrant","description":"Represent an authoritative registry snapshot, not a bearer capability."},"MailboxOperation":{"properties":{"operation_id":{"type":"string","maxLength":512,"minLength":1,"title":"Operation Id"},"scope":{"$ref":"#/components/schemas/MailboxScope"},"source":{"$ref":"#/components/schemas/SourceVersion"},"kind":{"type":"string","enum":["upsert","tombstone"],"title":"Kind"},"object_digest":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}],"title":"Object Digest"}},"additionalProperties":false,"type":"object","required":["operation_id","scope","source","kind"],"title":"MailboxOperation","description":"Carry one immutable source state and its authenticated grant binding."},"MailboxScope":{"properties":{"organization_id":{"type":"string","maxLength":512,"minLength":1,"title":"Organization Id"},"connection_id":{"type":"string","maxLength":512,"minLength":1,"title":"Connection Id"},"mailbox_id":{"type":"string","maxLength":512,"minLength":1,"title":"Mailbox Id"},"owner_id":{"type":"string","maxLength":512,"minLength":1,"title":"Owner Id"},"authorization_generation":{"type":"integer","exclusiveMinimum":0.0,"title":"Authorization Generation"},"audience_revision":{"type":"integer","exclusiveMinimum":0.0,"title":"Audience Revision"}},"additionalProperties":false,"type":"object","required":["organization_id","connection_id","mailbox_id","owner_id","authorization_generation","audience_revision"],"title":"MailboxScope","description":"Bind evidence to one mailbox owner and one authorization generation."},"MatchKey":{"properties":{"attribute":{"type":"string","title":"Attribute"},"kind":{"type":"string","enum":["identifier","name"],"title":"Kind"},"normalize":{"items":{"type":"string","enum":["trim","casefold","strip_punct","digits_only","domain","domain_of_email","iso_date","currency_minor"]},"type":"array","title":"Normalize"}},"additionalProperties":false,"type":"object","required":["attribute","kind"],"title":"MatchKey","description":"Map a source attribute to an entity identity hint."},"MediaUploadResponse":{"properties":{"content_block":{"additionalProperties":true,"type":"object","title":"Content Block"},"retained_in_memory":{"type":"boolean","title":"Retained In Memory","default":true},"retention_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retention Reason"}},"type":"object","required":["content_block"],"title":"MediaUploadResponse","description":"Response from the media upload endpoint."},"MemberPreviewItem":{"properties":{"key":{"type":"string","title":"Key"},"namespace":{"type":"string","title":"Namespace"},"label":{"type":"string","title":"Label","default":""},"kind":{"type":"string","enum":["investigation","session","learning","other"],"title":"Kind","default":"other"},"happensAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Happensat"}},"type":"object","required":["key","namespace"],"title":"MemberPreviewItem","description":"One linked-memory sample enriched for display.\n\nBare keys tell the user nothing; ``key`` + ``namespace`` form the memory\naddress the UI's hover card dereferences, and ``label`` is the memory's\none-sentence ``context`` (truncated) — the same de-facto title the\ncitation chips use."},"MemoryDbConfigCreate":{"properties":{"instance_connection_name":{"type":"string","maxLength":200,"title":"Instance Connection Name","description":"Cloud SQL connection string of the form ``project:region:instance``."},"database":{"type":"string","maxLength":63,"title":"Database","description":"Postgres database name within the instance. Capped at the Postgres identifier length (63 chars) so the REST layer rejects oversized payloads before the inner ``MemoryDbConfig`` validators see them."},"iam_user":{"type":"string","maxLength":320,"title":"Iam User","description":"Service-account email used as the IAM DB user. Must end in ``.iam.gserviceaccount.com``."},"public_ip":{"anyOf":[{"type":"string","maxLength":45},{"type":"null"}],"title":"Public Ip","description":"Public IPv4 address of the Cloud SQL instance, or ``None`` if registered pre-IP-resolution. Capped at the longest legal IPv6 textual form (45 chars) so the payload layer rejects oversized strings before the inner ``MemoryDbConfig._check_public_ip`` runs."},"openai_api_key":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Openai Api Key","description":"Optional: the org's own OpenAI API key for embedding traffic (BYOK). Omit/null = keep any existing key; empty string = clear it. Never echoed in responses."}},"type":"object","required":["instance_connection_name","database","iam_user"],"title":"MemoryDbConfigCreate","description":"POST payload for memory-db config.\n\n``provisioning_state`` always starts at ``pending`` from the\nREST surface — the dispatcher is the only thing that should be\nable to flip it to ``active``, and that happens via\n``set_memory_db_active(...)`` after the health probe passes.\n\nLength-bounded regexes are hoisted from ``MemoryDbConfig`` to\nTHIS payload: the REST route fans out to the Cloud SQL Admin API\n(``fetch_cloud_sql_tls_metadata``) BEFORE constructing\n``MemoryDbConfig``, so without the bounds at the payload layer a\nmulti-MB ``iam_user`` / ``instance_connection_name`` would reach\nGoogle's API and get echoed into the ``TlsMetadataFetchError``\nlog line. ``provisioned_by`` is intentionally NOT a payload field:\ncaller-controlled mass-assign here would let a REST caller mark a\nconfig as ``agent``-provisioned when only the onboarding agent\nshould set that — the route always stamps ``MANUAL`` regardless\nof payload."},"MemoryDbConfigResponse":{"properties":{"instance_connection_name":{"type":"string","title":"Instance Connection Name"},"database":{"type":"string","title":"Database"},"iam_user":{"type":"string","title":"Iam User"},"public_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Ip"},"instance_dns_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Dns Name"},"server_ca_pinned":{"type":"boolean","title":"Server Ca Pinned","description":"Whether a per-instance server CA is pinned for this config. The raw PEM is intentionally not echoed over REST — it is a public certificate but bloats responses and operators retrieve it from gcloud when needed. ``False`` means BYO connects fail closed until activation re-fetches the CA."},"openai_key_configured":{"type":"boolean","title":"Openai Key Configured","description":"Whether the org supplied its own OpenAI embedding key (BYOK). The ciphertext and fingerprint are intentionally not echoed over REST (this bool mirrors the ``server_ca_pinned`` precedent) so the admin UI can show key status without ever handling the secret.","default":false},"provisioning_state":{"$ref":"#/components/schemas/integration__schemas__memory_db__ProvisioningState"},"pending_operation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pending Operation Id"},"provisioned_by":{"anyOf":[{"$ref":"#/components/schemas/ProvisionedBy"},{"type":"null"}]},"provisioned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Provisioned At"},"last_health_check":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Health Check"},"last_health_status":{"anyOf":[{"$ref":"#/components/schemas/HealthStatus"},{"type":"null"}]},"last_setup_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Setup At"},"actor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Email","description":"Email of the last actor that mutated this config. ``None`` for legacy configs that pre-date the audit trail."},"mutated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Mutated At","description":"UTC timestamp of the last mutation."}},"type":"object","required":["instance_connection_name","database","iam_user","public_ip","instance_dns_name","server_ca_pinned","provisioning_state","pending_operation_id","provisioned_by","provisioned_at","last_health_check","last_health_status","last_setup_at"],"title":"MemoryDbConfigResponse","description":"GET payload — same fields as the stored record.\n\nNo fields here are secret (the IAM auth pattern means we never\nstash a password), but we still keep this distinct from\n``MemoryDbConfig`` so future internal-only fields (e.g., a\npool-cache key) can be added without leaking via REST."},"MemoryGraphLink":{"properties":{"source":{"type":"string","title":"Source","description":"Source node ID (memory key)"},"target":{"type":"string","title":"Target","description":"Target node ID (memory key)"},"cross_namespace":{"type":"boolean","title":"Cross Namespace","description":"Whether link crosses namespace boundary","default":false},"strength":{"type":"number","title":"Strength","description":"Edge strength (0.0-1.0), min-max normalized per response from the stored link_strengths (tube diameter) with an evolution-event-count fallback","default":0.0},"link_type":{"type":"string","enum":["related","bridge","causes","precedes","updates","contradicts"],"title":"Link Type","description":"Edge relation type (most specific of the two stored directions). NEAR family (same-topic): 'related' (elaboration), 'precedes' (temporal order), 'updates' (newer info), 'contradicts' (conflict). BRIDGE family (cross-topic connector): 'bridge', 'causes' (causal). Absent/legacy edges → 'related'. Clients should render the bridge FAMILY (bridge OR causes) as cross-topic, not just the literal 'bridge'.","default":"related"},"provenance":{"type":"string","enum":["structural","inferred","confirmed","disputed"],"title":"Provenance","description":"Who asserted this edge, collapsed across its two stored directions to the tier that most demands attention (disputed > confirmed > inferred > structural). 'structural' = a deterministic writer created it; 'inferred' = proposed automatically, and the reading for every edge predating this field; 'confirmed'/'disputed' = a reviewer ruled on it. Clients should render 'disputed' distinctly (a reviewer said this connection is wrong) and may de-emphasize 'inferred'.","default":"inferred"}},"type":"object","required":["source","target"],"title":"MemoryGraphLink","description":"An edge in the memory knowledge graph."},"MemoryGraphNode":{"properties":{"id":{"type":"string","title":"Id","description":"Memory key (unique within namespace)"},"namespace":{"type":"string","title":"Namespace","description":"Source namespace: 'episodes' or 'knowledge'"},"category":{"type":"string","title":"Category","description":"LLM-classified category","default":"Uncategorized"},"retrieval_count":{"type":"integer","title":"Retrieval Count","description":"Times retrieved","default":0},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO creation timestamp"},"last_accessed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Accessed","description":"ISO last access timestamp"},"event_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Time","description":"Original event/alert timestamp"},"link_count":{"type":"integer","title":"Link Count","description":"Number of links to other memories","default":0},"content_preview":{"type":"string","title":"Content Preview","description":"Truncated content for tooltip (max 200 chars)","default":""},"superseded":{"type":"boolean","title":"Superseded","description":"Whether this record has been superseded (marked stale by a newer memory). Surfaced so the viz can flag stale records for the pre-reap spot-check the supersession design relies on.","default":false},"superseded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Superseded At","description":"Earliest invalid_at across the superseded_by log, if superseded"},"superseded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Superseded By","description":"Key of the current-truth record that replaced this one (the newest superseding entry by written_at). Surfaced so the pre-reap spot-check can see not just THAT a record is stale but BY WHAT — without it the operator can't judge whether the supersede was correct."},"absorbed":{"type":"boolean","title":"Absorbed","description":"Whether a dream consolidation absorbed this record into a canonical. Absorbed rows are hidden from recall in EVERY mode (their content lives on in the canonical), so without this marker the graph shows nodes the agent can never recall, indistinguishable from live ones.","default":false},"absorbed_into":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Absorbed Into","description":"Key of the dream canonical that absorbed this record (_amem.absorbed_into), so the viz can point at where the content lives on."},"label":{"type":"string","title":"Label","description":"Who may read this memory: 'org' (every member), 'admins' (org admins only), or a team id (that team's members). A row that several teams may read lists their ids joined with ','; ids joined with '&' name the members of all of those teams. Admins see every label; a member only ever receives rows they may read.","default":"org"}},"type":"object","required":["id","namespace"],"title":"MemoryGraphNode","description":"A lean node in the memory knowledge graph.\n\nIntentionally omits the heavy per-memory fields (``context``,\n``keywords``, ``tags``) — the graph render only needs id/namespace/\ncounts/preview, and those heavy fields are used solely by the detail\npanel for the ONE selected node. They are fetched on demand via\n``GET /{namespace}/{memory_key}`` (``MemoryNodeDetail``) so the whole-\ngraph payload stays small."},"MemoryGraphResponse":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/MemoryGraphNode"},"type":"array","title":"Nodes"},"links":{"items":{"$ref":"#/components/schemas/MemoryGraphLink"},"type":"array","title":"Links"},"total_memories":{"type":"integer","title":"Total Memories","description":"Total memory count across requested namespaces","default":0},"truncated":{"type":"boolean","title":"Truncated","description":"Whether the graph was truncated due to size limits","default":false},"max_nodes":{"type":"integer","title":"Max Nodes","description":"Max node limit applied","default":0}},"type":"object","title":"MemoryGraphResponse","description":"D3.js-compatible force graph data."},"MemoryLabelRequest":{"properties":{"label":{"type":"string","maxLength":400,"minLength":1,"title":"Label","description":"'org' (every member), 'admins' (org admins only), or team ids of this organization in the label wire form: ids joined with ',' (members of any of those teams), and ids joined with '&' (members of all of those teams), for example 'a,b&c'. At most 8 distinct teams."}},"type":"object","required":["label"],"title":"MemoryLabelRequest","description":"The label an admin gives one memory."},"MemoryLabelResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Key of the live memory that was relabeled"},"namespace":{"type":"string","title":"Namespace"},"label":{"type":"string","title":"Label","description":"Who may read this memory: 'org' (every member), 'admins' (org admins only), or a team id (that team's members). A row that several teams may read lists their ids joined with ','; ids joined with '&' name the members of all of those teams. Admins see every label; a member only ever receives rows they may read."},"resolved_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved From","description":"Requested key when it led to a different live memory"},"cascaded":{"items":{"type":"string"},"type":"array","title":"Cascaded","description":"Other rows that hold this memory's content and now carry the same label: its split hub and parts, and its stored archives (merged or absorbed rows, the pre-merge archive)."},"rows_relabeled":{"type":"integer","title":"Rows Relabeled","description":"Rows whose stored label changed in this call","default":0},"truncated":{"type":"boolean","title":"Truncated","description":"True when rows holding this memory's content still carry another label (one call changes at most 256); repeat the request to continue","default":false}},"type":"object","required":["id","namespace","label"],"title":"MemoryLabelResponse","description":"Result of a relabel."},"MemoryNodeDetail":{"properties":{"id":{"type":"string","title":"Id","description":"Memory key (unique within namespace)"},"namespace":{"type":"string","title":"Namespace","description":"Source namespace: 'episodes' or 'knowledge'"},"context":{"type":"string","title":"Context","description":"One-sentence context summary","default":""},"seed_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seed Source","description":"Origin label when this memory was imported by a seed batch (item 5 origin chip); None for agent-earned memories"},"seed_source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seed Source Id","description":"Stable source-registry id (Provenance v2); None for agent-earned or pre-registry memories"},"seed_source_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed Source Version","description":"Which import version of the source produced this memory"},"seed_superseded":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Seed Superseded","description":"Set when a newer import of the same source no longer contains this fact ({at, by_version, by_batch}); the row is kept, annotated, and resurrected if a later import re-confirms it"},"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords","description":"Key terms"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"Classification tags"},"linked_entities":{"items":{"$ref":"#/components/schemas/LinkedEntityOut"},"type":"array","title":"Linked Entities","description":"Active entities linked to this memory (bounded, name-sorted), for cross-navigation into the entity workbench. Empty when the entity layer is off for the org."},"media":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Media","description":"Media attachment pointers on this memory (kind, mime, description, described, origin, checksum...). Renders as the detail-panel chip; the description is the searchable text projection, and bucket/object keys are pointers the UI must never turn into URLs."},"resolved_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved From","description":"Original requested key when this node was reached by following a redirect (the memory was merged/superseded by consolidation or dreaming). None for a direct hit. Lets a citation chip show that it resolved to the surviving memory."},"label":{"type":"string","title":"Label","description":"Who may read this memory: 'org' (every member), 'admins' (org admins only), or a team id (that team's members). A row that several teams may read lists their ids joined with ','; ids joined with '&' name the members of all of those teams. Admins see every label; a member only ever receives rows they may read.","default":"org"}},"type":"object","required":["id","namespace"],"title":"MemoryNodeDetail","description":"Heavy per-memory fields, fetched lazily for the ONE selected node.\n\nCarries the fields trimmed from ``MemoryGraphNode`` so the detail panel\ncan render context/keywords/tags without those riding along in the\nwhole-graph payload. id/namespace are echoed back for the caller to\nconfirm it got the node it asked for."},"MergeBody":{"properties":{"ids":{"items":{"type":"string"},"type":"array","maxItems":9,"minItems":2,"title":"Ids"},"priorityIndex":{"type":"integer","title":"Priorityindex","default":0},"dryRun":{"type":"boolean","title":"Dryrun","default":false}},"type":"object","required":["ids"],"title":"MergeBody","description":"Body of ``POST .../records/merge``."},"MergeProposal":{"properties":{"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status"},"review_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Reason"},"review_evidence":{"items":{"type":"string"},"type":"array","title":"Review Evidence"},"review_progress":{"anyOf":[{"$ref":"#/components/schemas/CurationReviewProgress"},{"type":"null"}]},"key":{"type":"string","title":"Key"},"entity_a":{"type":"string","title":"Entity A"},"entity_b":{"type":"string","title":"Entity B"},"entity_a_name":{"type":"string","title":"Entity A Name","default":""},"entity_b_name":{"type":"string","title":"Entity B Name","default":""},"entity_a_type":{"type":"string","title":"Entity A Type","default":"unknown"},"entity_b_type":{"type":"string","title":"Entity B Type","default":"unknown"},"score":{"type":"number","title":"Score","default":0.0},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"alias_surface":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias Surface"},"blocked_writes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Blocked Writes"},"sparse_cosine":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sparse Cosine"},"shared_terms":{"items":{"type":"string"},"type":"array","title":"Shared Terms"},"divergent_terms_a":{"items":{"type":"string"},"type":"array","title":"Divergent Terms A"},"divergent_terms_b":{"items":{"type":"string"},"type":"array","title":"Divergent Terms B"},"llm_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Verdict"},"llm_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Llm Confidence"},"llm_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm At"},"pair_evidence":{"anyOf":[{"$ref":"#/components/schemas/PairEvidenceOut"},{"type":"null"}]}},"type":"object","required":["key","entity_a","entity_b"],"title":"MergeProposal","description":"A dream-sweep merge proposal awaiting curation.\n\nThe ``sparse_*``/``*_terms`` fields carry pooled learned-sparse term\nevidence (what each side's linked memories actually talk about) when\nthe sparse channel was live at proposal time; empty otherwise.\n``pair_evidence`` is what the memories say AGAINST the merge; a\n``strong`` level is why an automatic merge did not happen."},"MicrosoftMailbox-Input":{"properties":{"provider":{"type":"string","const":"outlook","title":"Provider","default":"outlook"},"tenant_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Tenant Id"},"user_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"User Id"}},"additionalProperties":false,"type":"object","required":["tenant_id","user_id"],"title":"MicrosoftMailbox","description":"Keep verified account IDs; a separate connection profile holds its display address."},"MicrosoftMailbox-Output":{"properties":{"tenant_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Tenant Id"},"user_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"User Id"}},"additionalProperties":false,"type":"object","required":["tenant_id","user_id"],"title":"MicrosoftMailbox","description":"Keep verified account IDs; a separate connection profile holds its display address."},"ModeBody":{"properties":{"mode":{"type":"string","enum":["automatic","ask_owner_first"],"title":"Mode"}},"type":"object","required":["mode"],"title":"ModeBody","description":"Body of ``POST /{id}/mode``."},"NamespaceConfig":{"properties":{"name":{"type":"string","title":"Name","description":"Namespace name, e.g. 'security_incidents'"},"display_title":{"type":"string","title":"Display Title","description":"Human-readable heading, e.g. 'Security Incidents'"},"fields":{"items":{"$ref":"#/components/schemas/NamespaceFieldConfig"},"type":"array","maxItems":20,"minItems":1,"title":"Fields","description":"1-20 field definitions"},"search_limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Search Limit","default":3},"consolidation_threshold":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Consolidation Threshold"},"supports_supersession":{"type":"boolean","title":"Supports Supersession","description":"Whether the supersede verdict may stale records here. Leave False for append-only/historical namespaces (e.g. episodes); set True only for revisable knowledge-style namespaces. Gated additionally by the global AMEM_SUPERSESSION_ENABLED.","default":false},"empty_message":{"type":"string","title":"Empty Message","default":"No relevant items found."},"search_tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Tool Name"},"search_tool_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Tool Instructions"},"manage_tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manage Tool Name"},"manage_tool_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manage Tool Instructions"}},"type":"object","required":["name","display_title","fields"],"title":"NamespaceConfig","description":"Configuration for a single memory namespace within a domain."},"NamespaceFieldConfig":{"properties":{"name":{"type":"string","title":"Name","description":"snake_case field name"},"field_type":{"type":"string","enum":["str","list[str]","float","int"],"title":"Field Type","description":"Python type for the field","default":"str"},"description":{"type":"string","title":"Description","description":"Field description for create_model()"},"required":{"type":"boolean","title":"Required","default":true},"display_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Label","description":"Label for formatter (auto-derived from name if None)"},"is_primary":{"type":"boolean","title":"Is Primary","description":"Primary fields shown in header line","default":false},"variants":{"anyOf":[{"items":{"$ref":"#/components/schemas/NamespaceFieldVariant"},"type":"array"},{"type":"null"}],"title":"Variants","description":"Per-schema breakdown when the same field exists in multiple schemas of a unified namespace. None for single-schema fields (the canonical case)."}},"type":"object","required":["name","description"],"title":"NamespaceFieldConfig","description":"Configuration for a single field within a namespace schema."},"NamespaceFieldRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"},"field_type":{"type":"string","title":"Field Type","default":"str"},"description":{"type":"string","minLength":1,"title":"Description"},"required":{"type":"boolean","title":"Required","default":true},"display_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Label"},"is_primary":{"type":"boolean","title":"Is Primary","default":false}},"type":"object","required":["name","description"],"title":"NamespaceFieldRequest","description":"Request schema for a namespace field definition."},"NamespaceFieldVariant":{"properties":{"schema_class":{"type":"string","title":"Schema Class","description":"Pydantic class name where this variant lives"},"field_type":{"type":"string","enum":["str","list[str]","float","int"],"title":"Field Type"},"description":{"type":"string","title":"Description"}},"type":"object","required":["schema_class","field_type","description"],"title":"NamespaceFieldVariant","description":"Per-schema description of a field that's declared in multiple schemas.\n\nUsed by built-in unified-namespace responses (e.g., ``knowledge``\nholds ``KnowledgePattern`` + ``DRPattern`` + ``Rubric``)\nwhere the same field name has different descriptions or types\ndepending on which discriminated-union variant the record is.\nCustom domains never populate this — their schemas are 1:1 with\nnamespaces."},"NamespaceRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"},"display_title":{"type":"string","maxLength":128,"minLength":1,"title":"Display Title"},"fields":{"items":{"$ref":"#/components/schemas/NamespaceFieldRequest"},"type":"array","maxItems":20,"minItems":1,"title":"Fields"},"search_limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Search Limit","default":3},"consolidation_threshold":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Consolidation Threshold"},"empty_message":{"type":"string","title":"Empty Message","default":"No relevant items found."},"search_tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Tool Name"},"search_tool_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Tool Instructions"},"manage_tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manage Tool Name"},"manage_tool_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manage Tool Instructions"}},"type":"object","required":["name","display_title","fields"],"title":"NamespaceRequest","description":"Request schema for a namespace definition."},"NoticePage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/NoticeView"},"type":"array","title":"Items"},"unread_count":{"type":"integer","minimum":0.0,"title":"Unread Count"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"additionalProperties":false,"type":"object","required":["items","unread_count","next_cursor"],"title":"NoticePage","description":"Return a bounded page and the exact current unread count for this owner."},"NoticeView":{"properties":{"text":{"type":"string","maxLength":4000,"minLength":1,"title":"Text"},"id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Id"},"job_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Job Id"},"thread_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Thread Id"},"kind":{"type":"string","const":"notification","title":"Kind","default":"notification"},"status":{"type":"string","const":"completed","title":"Status","default":"completed"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read At"},"thread_path":{"type":"string","const":"/inbox","title":"Thread Path","default":"/inbox"}},"additionalProperties":false,"type":"object","required":["text","id","job_id","thread_id","created_at","expires_at"],"title":"NoticeView","description":"Construct the navigation destination on the server, separate from text."},"OAuthAuthorizeResponse":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url"}},"type":"object","required":["authorize_url"],"title":"OAuthAuthorizeResponse","description":"Response with the OAuth authorize URL."},"OAuthCallbackRequest":{"properties":{"code":{"type":"string","minLength":1,"title":"Code"},"state":{"type":"string","minLength":1,"title":"State"}},"type":"object","required":["code","state"],"title":"OAuthCallbackRequest","description":"Request to exchange an OAuth code for profile linking."},"OAuthDiscoveryResponse":{"properties":{"issuer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuer"},"authorization_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization Endpoint"},"token_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Endpoint"},"registration_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registration Endpoint"},"revocation_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revocation Endpoint"},"scopes_supported":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes Supported"},"grant_types_supported":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Grant Types Supported"},"persisted":{"type":"boolean","title":"Persisted","default":false},"discovery_status":{"type":"string","enum":["discovered","no_auth_required","no_oauth","unreachable"],"title":"Discovery Status","default":"no_oauth"},"discovery_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discovery Error"}},"type":"object","title":"OAuthDiscoveryResponse","description":"OAuth metadata discovery response.\n\nThe discovery_status field indicates the outcome of the discovery process:\n- \"discovered\": OAuth endpoints were found\n- \"no_auth_required\": Server completed the exchange without credentials\n  (public access). The endpoint fields may still be set: the server works\n  anonymously and offers OAuth as an option (it sent WWW-Authenticate on a\n  2xx). Clients must read this status before the endpoints.\n- \"no_oauth\": Server requires auth but no OAuth endpoints found\n- \"unreachable\": Server did not respond (timeout, DNS failure, connection refused)"},"OAuthSetupResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"authorization_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization Endpoint"},"token_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Endpoint"},"registration_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registration Endpoint"},"scopes_supported":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes Supported"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_registered":{"type":"boolean","title":"Client Registered","default":false},"dcr_attempted":{"type":"boolean","title":"Dcr Attempted","default":false},"dcr_succeeded":{"type":"boolean","title":"Dcr Succeeded","default":false},"dcr_error":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dcr Error"},"alternatives":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Alternatives"},"authorization_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization Url"},"token_acquired":{"type":"boolean","title":"Token Acquired","default":false}},"type":"object","required":["success","message"],"title":"OAuthSetupResponse","description":"Response from one-click OAuth setup."},"ObservationSpec":{"properties":{"observed_at_attribute":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observed At Attribute"},"refresh_unchanged":{"type":"boolean","title":"Refresh Unchanged","default":true},"revision_attribute":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision Attribute"},"revision_order":{"type":"string","enum":["monotonic_integer","observation_time"],"title":"Revision Order","default":"observation_time"}},"additionalProperties":false,"type":"object","title":"ObservationSpec","description":"Separate source evidence time from ingestion order."},"OnAcceptAction":{"properties":{"action":{"type":"string","enum":["mint_task","channel_message","mcp_tool"],"title":"Action"},"note":{"type":"string","maxLength":300,"title":"Note","description":"Author note explaining the intent (audit display only). Action-policy matching: mcp_tool executions are intercepted under the real MCP tool name; mint_task and channel_message are intercepted as the builtin tool names 'dr_on_accept_mint_task' and 'dr_on_accept_channel_message', so policies can target them by tool_name.","default":""},"task_title":{"anyOf":[{"type":"string","maxLength":150},{"type":"null"}],"title":"Task Title","description":"Static title prefix for the minted follow-up task; the engine appends the candidate signature. Defaults to 'Follow up'."},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id","description":"Connected channel plugin id (e.g. 'slack')."},"to":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"To","description":"Channel-native destination address for the message."},"message":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Message","description":"Static prose prepended to the engine-rendered acceptance line. Pure text; no template substitution."},"tool_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Tool Name","description":"Name of a connected MCP tool to invoke."},"tool_args":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Args","description":"Arguments for the MCP tool. Values exactly equal to $candidate_signature, $final_status, $rank_score, $confidence_delta, $rubric_id or $interest_query are replaced with the run's values; everything else is passed verbatim."},"version":{"type":"integer","title":"Version","default":1}},"additionalProperties":false,"type":"object","required":["action"],"title":"OnAcceptAction","description":"Customer-authored consequence of an auto-filed verdict.\n\nExecuted only when a run's ``auto`` gate verdict STANDS (decision\nautonomy earned, see ``agent/autonomy.py``), never for suggest or\nreview verdicts, and never while autonomy is unearned. One\nallowlisted action per rubric; every execution is routed through the\norg's action policies first, so a matching forbid / require_approval\n/ shadow policy suppresses it.\n\nWe deliberately do not interpret what an accepted candidate means:\nthe customer authors the consequence, the engine runs it."},"OnboardingIntent":{"additionalProperties":true,"type":"object"},"OnboardingRequest":{"properties":{"intent_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Intent Id"},"connection_id":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Connection Id"},"expected_authorization_generation":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Expected Authorization Generation"},"provider":{"anyOf":[{"type":"string","enum":["outlook","gmail","imap"]},{"type":"null"}],"title":"Provider"}},"additionalProperties":false,"type":"object","required":["intent_id"],"title":"OnboardingRequest","description":"Choose a new connection or reconnect without choosing its owner/account."},"OntologyCategory":{"properties":{"label":{"type":"string","title":"Label","description":"Display spelling of the category"},"curated":{"type":"boolean","title":"Curated","description":"True when the label comes from the org's curated reference vocabulary; False for an emergent category the LLM minted outside it"},"adoption_count":{"type":"integer","title":"Adoption Count","description":"Live memories (superseded/absorbed excluded) whose _amem.category matches this label case-insensitively"}},"type":"object","required":["label","curated","adoption_count"],"title":"OntologyCategory","description":"One category in the vocabulary-adoption projection."},"OntologyOverviewResponse":{"properties":{"categories":{"items":{"$ref":"#/components/schemas/OntologyCategory"},"type":"array","title":"Categories"},"vocabulary_size":{"type":"integer","title":"Vocabulary Size","description":"Curated reference-vocabulary term count (0 = unseeded org)","default":0},"total_categorized":{"type":"integer","title":"Total Categorized","description":"Live memories carrying any non-empty category","default":0},"grounding":{"items":{"$ref":"#/components/schemas/GroundingEntry"},"type":"array","title":"Grounding","description":"Canonicals with the raw labels folded into them (ledger)"},"converged":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Converged","description":"True = a reconcile ledger exists and maps every label to itself (nothing is being folded — the grounding success state); False = the ledger folds labels; None = no reconcile has run yet"},"ledger_updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Updated At","description":"ISO timestamp of the last reconcile ledger write, if any"},"trend":{"items":{"$ref":"#/components/schemas/TrendPoint"},"type":"array","title":"Trend","description":"Monthly per-category live-memory counts (sorted month, label)"},"connections":{"items":{"$ref":"#/components/schemas/CategoryConnection"},"type":"array","title":"Connections","description":"Cross-category edge aggregates (sorted by total desc)"},"link_provenance":{"additionalProperties":{"type":"integer"},"type":"object","title":"Link Provenance","description":"Audit at a glance: how many connections came from where, counted over deduped edges across ALL category pairs (not just cross-category ones). Keys are the provenance tiers (structural / inferred / confirmed / disputed); tiers with no edges are omitted. Answers 'how much of this graph has anyone actually checked'."},"truncated":{"type":"boolean","title":"Truncated","description":"True when the live-row sweep hit its page ceiling; every block (adoption counts included) is then computed from the same truncated population — consistently capped, never divergent across panels","default":false}},"type":"object","title":"OntologyOverviewResponse","description":"Vocabulary-adoption projection for the /brain/ontology panel.\n\nEmergent categories are the base layer — every org with memories has\nthem, so the panel is meaningful before a reference vocabulary is\nseeded. Curated terms overlay them, INCLUDING zero-adoption terms:\na curated term no memory carries is the \"dead vocabulary\" curation\nsignal and must stay visible.\n\n``grounding``/``converged`` project the dream reconcile ledger,\n``trend`` buckets live rows by creation month, and ``connections``\naggregates cross-category memory edges — every block folds labels with\nthe same rule as ``categories`` so the knowledge map, learning trend,\nand domain chord all agree on display names."},"Organization":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Organization name"},"slug":{"type":"string","maxLength":100,"minLength":1,"title":"Slug","description":"Organization slug (URL-friendly identifier)"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Organization description"},"max_members":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Members","description":"Maximum number of members allowed"},"id":{"type":"string","title":"Id","description":"Organization ID"},"created_by":{"type":"string","title":"Created By","description":"User ID of organization creator (UUID)"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether organization is active"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["name","slug","id","created_by","is_active","created_at","updated_at"],"title":"Organization","description":"Complete organization schema with all fields."},"OrganizationCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Organization name"},"slug":{"type":"string","maxLength":100,"minLength":1,"title":"Slug","description":"Organization slug (URL-friendly identifier)"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Organization description"},"max_members":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Members","description":"Maximum number of members allowed"}},"type":"object","required":["name","slug"],"title":"OrganizationCreate","description":"Schema for creating a new organization."},"OrganizationCreateRequest":{"properties":{"external_id":{"type":"string","title":"External Id","description":"External user ID (Auth0)"},"owner_email":{"type":"string","title":"Owner Email","description":"Owner's email address"},"owner_name":{"type":"string","title":"Owner Name","description":"Owner's full name"}},"type":"object","required":["external_id","owner_email","owner_name"],"title":"OrganizationCreateRequest","description":"Request schema for Landing Page organization creation."},"OrganizationCreateResponse":{"properties":{"organization_id":{"type":"string","title":"Organization Id","description":"Generated UUID"},"organization_name":{"type":"string","title":"Organization Name","description":"Organization name"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"}},"type":"object","required":["organization_id","organization_name","created_at"],"title":"OrganizationCreateResponse","description":"Response for Landing Page organization creation."},"OrganizationMemberAdd":{"properties":{"role":{"type":"string","title":"Role","description":"Member role: owner, admin, or member","default":"member"},"user_id":{"type":"string","title":"User Id","description":"User ID to add to organization (UUID)"}},"type":"object","required":["user_id"],"title":"OrganizationMemberAdd","description":"Schema for adding a member to an organization."},"OrganizationMemberResponse":{"properties":{"user_id":{"type":"string","title":"User Id","description":"User ID (UUID)"},"organization_id":{"type":"string","title":"Organization Id","description":"Organization ID"},"role":{"type":"string","title":"Role","description":"Member role"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Name from the identity provider"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Name to show: never an email or identity-provider id; null when no name is known"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id","description":"The member's person entity in the Brain, once bound"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Membership creation timestamp"}},"type":"object","required":["user_id","organization_id","role","created_at"],"title":"OrganizationMemberResponse","description":"Response schema for organization member operations."},"OrganizationUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name","description":"Updated organization name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Updated organization description"},"max_members":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Members","description":"Updated maximum member limit"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Organization active status"}},"type":"object","title":"OrganizationUpdate","description":"Schema for updating organization details."},"OriginalTransactionSummary":{"properties":{"id":{"type":"string","title":"Id"},"amount":{"type":"integer","title":"Amount"},"reason":{"type":"string","title":"Reason"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"refunded_at":{"type":"string","format":"date-time","title":"Refunded At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","amount","reason","thread_id","run_id","refunded_at","created_at"],"title":"OriginalTransactionSummary","description":"Summary of the original transaction that was refunded."},"Output":{"properties":{"description":{"type":"string","title":"Description","default":""},"preamble":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preamble","description":"Optional decorative markdown rendered above the canonical verdict block.  Pure markdown — no template substitution. If you need a candidate-context field surfaced, configure ``candidate_context_labels`` below; the engine renders the canonical fields list."},"epilogue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Epilogue","description":"Optional decorative markdown rendered below the canonical verdict block (e.g., outreach guidance, analyst notes). Pure markdown — no template substitution."},"candidate_context_labels":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Candidate Context Labels","description":"Pretty-print labels for keys in candidate_context.  The engine renders a '## Candidate Context' markdown list containing ONLY the keys declared here, with these labels: undeclared keys never surface, and a declared key absent from candidate_context is silently omitted (no auto-formatting fallback in this section).  Labels are also reused to name missing ``evidence_requirements`` keys in the ``incomplete`` diagnostic, where an unlabeled key falls back to Title Case.  Set to ``null`` or leave empty (the default) to suppress the candidate-context section entirely."},"evidence_requirements":{"items":{"type":"string"},"type":"array","title":"Evidence Requirements","description":"Snake_case keys that MUST be present in the caller-provided ``candidate_context`` dict before drafting (e.g. ['verified_quote_url']). These are CALLER-PROVIDED INPUT KEYS, not engine outputs: the engine does not synthesize them, so listing a key the caller never supplies makes every run terminate ``incomplete``, with the missing keys named in the diagnostic. NOTE: this differs from ``Pattern.evidence_requirements``, which uses plain prose describing evidence concepts; here keys are matched literally against ``candidate_context``."},"max_length_tokens":{"type":"integer","title":"Max Length Tokens","description":"Soft length budget for the rendered artifact","default":500},"on_accept":{"anyOf":[{"$ref":"#/components/schemas/OnAcceptAction"},{"type":"null"}],"description":"Optional consequence executed when a run's auto gate verdict stands (decision autonomy earned). See ``OnAcceptAction``; routed through the org's action policies before executing."},"version":{"type":"integer","title":"Version","default":2}},"additionalProperties":false,"type":"object","title":"Output","description":"Phase-3 (drafting) configuration for a Rubric.\n\nThe verdict artifact is rendered by the engine from a fixed\ncanonical structure populated by engine state and candidate_context.\nRubric authors no longer control the artifact's literal markup —\nonly its labels and optional decorative prose.  This eliminates\nthe class of bugs where author template-syntax errors bled through\nto customer-visible verdicts (e.g., the production\n``{(buyer_tier)}`` placeholder leak from 2026-05-04).\n\nSchema break vs. v1: ``template: str`` is removed and replaced by\n``preamble`` / ``epilogue`` (raw markdown, no substitution) plus\n``candidate_context_labels`` (label dict driving the engine's\ncanonical fields list).  The route layer rejects bodies carrying\nthe legacy ``template`` field with a 422 + migration message."},"OverageUsageResponse":{"properties":{"billing_model":{"type":"string","title":"Billing Model","description":"Billing model: 'prepaid' (Starter/Pro) or 'postpaid' (Enterprise)","default":"prepaid"},"period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period Start","description":"Current billing period start"},"period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period End","description":"Current billing period end"},"included_credits_granted":{"type":"integer","title":"Included Credits Granted","description":"Included credits for this period"},"included_credits_remaining":{"type":"integer","title":"Included Credits Remaining","description":"Remaining included credits"},"included_credits_used":{"type":"integer","title":"Included Credits Used","description":"Included credits consumed"},"prepaid_credits_available":{"type":"integer","title":"Prepaid Credits Available","description":"Prepaid credits purchased (never expire)","default":0},"overage_credits_used":{"type":"integer","title":"Overage Credits Used","description":"Overage credits consumed (postpaid)"},"overage_spend_cents":{"type":"integer","title":"Overage Spend Cents","description":"Overage spend in cents (postpaid)"},"overage_spend_dollars":{"type":"number","title":"Overage Spend Dollars","description":"Overage spend in dollars (postpaid)"},"extra_usage_enabled":{"type":"boolean","title":"Extra Usage Enabled","description":"Whether postpaid overage is enabled (Enterprise only)"},"extra_usage_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Extra Usage Cap Cents","description":"Overage cap in cents (postpaid)"},"at_cap":{"type":"boolean","title":"At Cap","description":"Whether user has hit their overage cap (postpaid)"},"price_per_credit_cents":{"type":"integer","title":"Price Per Credit Cents","description":"Price per credit in cents"}},"type":"object","required":["included_credits_granted","included_credits_remaining","included_credits_used","overage_credits_used","overage_spend_cents","overage_spend_dollars","extra_usage_enabled","at_cap","price_per_credit_cents"],"title":"OverageUsageResponse","description":"Response schema for usage summary (includes both prepaid and postpaid)."},"PaginationSpec":{"properties":{"mode":{"type":"string","enum":["none","cursor","page"],"title":"Mode","default":"none"},"request_arg":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Arg"},"start":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Start"},"next_cursor_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor Path"},"complete_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Complete Path"}},"additionalProperties":false,"type":"object","title":"PaginationSpec","description":"Declare verifiable terminal evidence for a pull."},"PairEvidenceOut":{"properties":{"level":{"type":"string","title":"Level","default":"none"},"signals":{"items":{"$ref":"#/components/schemas/PairEvidenceSignal"},"type":"array","title":"Signals"},"computed_at":{"type":"string","title":"Computed At","default":""}},"type":"object","title":"PairEvidenceOut","description":"What the pair's own memories say against the merge (``entity_store``).\n\n``level`` is ``strong`` (automation refused; a human merge needs\n``acknowledge_evidence``), ``weak`` (shown, not blocking) or ``none``."},"PairEvidenceSignal":{"properties":{"kind":{"type":"string","title":"Kind"},"strength":{"type":"string","title":"Strength","default":"weak"},"memory_key":{"type":"string","title":"Memory Key","default":""},"source":{"type":"string","title":"Source","default":""},"quote":{"type":"string","title":"Quote","default":""},"cue":{"type":"string","title":"Cue","default":""},"names":{"items":{"type":"string"},"type":"array","title":"Names"},"predicate":{"type":"string","title":"Predicate","default":""},"subject":{"type":"string","title":"Subject","default":""},"value_a":{"type":"string","title":"Value A","default":""},"value_b":{"type":"string","title":"Value B","default":""},"restricted":{"type":"boolean","title":"Restricted","default":false}},"type":"object","required":["kind"],"title":"PairEvidenceSignal","description":"One statement the Brain holds AGAINST merging a pair.\n\n``kind`` selects which fields are meaningful: ``caution`` and\n``co_listing`` quote a memory (``memory_key``/``source``/``quote``,\nplus ``cue`` and the sides ``names`` for a caution); ``edge`` names the\n``predicate`` and which ``subject`` side holds it; ``identifier_conflict``\ncarries the ``predicate`` and both values. ``restricted`` marks a signal\nfrom memories the viewer may not read: it still counts against the\nmerge, but only its ``kind`` and ``strength`` are shown."},"PairRequest":{"properties":{"expected_binding_tokens":{"additionalProperties":{"type":"string"},"type":"object","title":"Expected Binding Tokens"},"scope":{"additionalProperties":true,"type":"object","title":"Scope"},"source_dependencies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":128,"title":"Source Dependencies"},"independent_attestation":{"type":"boolean","title":"Independent Attestation","default":false},"other_id":{"type":"string","minLength":1,"title":"Other Id"},"acknowledge_evidence":{"type":"boolean","title":"Acknowledge Evidence","default":false},"expected_pair_evidence_token":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Expected Pair Evidence Token"},"note":{"type":"string","maxLength":2000,"title":"Note","default":""}},"type":"object","required":["other_id"],"title":"PairRequest","description":"Body for merge/split: the other entity of the pair.\n\n``acknowledge_evidence`` (merge only): the caller has seen the pair\nevidence the Brain holds against the merge and overrides it. Without\nit, a merge over ``strong`` evidence answers 409 with the evidence."},"PasswordUpdate":{"properties":{"old_password":{"type":"string","title":"Old Password","description":"Current password"},"new_password":{"type":"string","minLength":8,"title":"New Password","description":"New password (minimum 8 characters)"}},"type":"object","required":["old_password","new_password"],"title":"PasswordUpdate","description":"Schema for changing user password."},"Pattern":{"properties":{"name":{"type":"string","title":"Name","description":"Stable identifier (e.g. 'wrong_buyer_power')"},"description":{"type":"string","title":"Description","description":"One-sentence summary suitable for explanations"},"defeat_type":{"$ref":"#/components/schemas/DefeatType","description":"REBUT (attacks conclusion) or UNDERCUT (attacks inference)"},"detection_prompt":{"type":"string","title":"Detection Prompt","description":"LLM prompt template. Receives the candidate context as input; must return a structured judgement of whether the pattern fires and the supporting evidence."},"evidence_requirements":{"items":{"type":"string"},"type":"array","title":"Evidence Requirements","description":"Plain-prose descriptions of the evidence CONCEPTS this pattern needs to fire (e.g. [\"the candidate's company headcount\"]). Tool-agnostic — describe what the rule needs in the customer's vocabulary, not vendor field paths. NOTE: this differs from ``Output.evidence_requirements``, which uses snake_case keys matched literally against the caller-provided ``candidate_context``."},"priority":{"type":"integer","title":"Priority","description":"Authoring/precedence HINT only. The NDE evaluates every fired defeater uniformly (no priority sort / no short-circuit), so this does NOT control adjudication order or outcome; it documents intended cheap-fail ordering and is used by rubric-induction to clamp induced patterns below the curated floor.","default":100}},"additionalProperties":false,"type":"object","required":["name","description","defeat_type","detection_prompt"],"title":"Pattern","description":"One defeater pattern in a Disqualifiers sub-pack.\n\nA pattern says: \"given a candidate, here is a question to ask; if the\nanswer is yes, this candidate is defeated by this pattern.\""},"PendingAlias":{"properties":{"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status"},"review_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Reason"},"review_evidence":{"items":{"type":"string"},"type":"array","title":"Review Evidence"},"review_progress":{"anyOf":[{"$ref":"#/components/schemas/CurationReviewProgress"},{"type":"null"}]},"key":{"type":"string","title":"Key"},"surface_form":{"type":"string","title":"Surface Form","default":""},"candidates":{"items":{"type":"string"},"type":"array","title":"Candidates"},"candidate_names":{"items":{"type":"string"},"type":"array","title":"Candidate Names"},"provenance_count":{"type":"integer","title":"Provenance Count","default":0}},"type":"object","required":["key"],"title":"PendingAlias","description":"A graylisted alias awaiting confirmation."},"PendingIdentityResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"sender_id":{"type":"string","title":"Sender Id"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"sender_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Email"},"first_seen":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Seen"},"last_seen":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Seen"},"message_count":{"type":"integer","title":"Message Count","default":0}},"type":"object","required":["channel_id","sender_id"],"title":"PendingIdentityResponse","description":"Response schema for an unlinked channel sender."},"PendingLinkRequest":{"properties":{"user_id":{"type":"string","maxLength":36,"minLength":1,"title":"User Id"}},"type":"object","required":["user_id"],"title":"PendingLinkRequest","description":"Request to link a pending sender to a user."},"PersonalActivity":{"properties":{"processed_messages":{"type":"integer","minimum":0.0,"title":"Processed Messages"},"skipped":{"$ref":"#/components/schemas/SkipCounts"},"failed_messages":{"type":"integer","minimum":0.0,"title":"Failed Messages"},"stored_facts":{"type":"integer","minimum":0.0,"title":"Stored Facts"},"last_processed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Processed At"}},"additionalProperties":false,"type":"object","required":["processed_messages","skipped","failed_messages","stored_facts","last_processed_at"],"title":"PersonalActivity","description":"Return counts and time only, never a mailbox or message identifier."},"PlanResponse":{"properties":{"id":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Plan identifier"},"name":{"type":"string","title":"Name","description":"Plan display name"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price","description":"Monthly price in USD (null for Enterprise)"},"currency":{"type":"string","title":"Currency","description":"Currency code","default":"usd"},"interval":{"type":"string","title":"Interval","description":"Billing interval","default":"month"},"credits_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Per Month","description":"Monthly credit allocation (null for Enterprise)"},"features":{"items":{"type":"string"},"type":"array","title":"Features","description":"List of plan features"},"description":{"type":"string","title":"Description","description":"Plan description"},"available_for_checkout":{"type":"boolean","title":"Available For Checkout","description":"Whether plan can be purchased via Stripe Checkout"}},"type":"object","required":["id","name","description","available_for_checkout"],"title":"PlanResponse","description":"Plan details response schema."},"PolicyMatch":{"properties":{"kind":{"anyOf":[{"type":"string","enum":["shell","mcp","builtin"]},{"type":"null"}],"title":"Kind"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"command_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Command Class"},"risk_tier":{"anyOf":[{"type":"string","enum":["read_only","reversible","disruptive"]},{"type":"null"}],"title":"Risk Tier"},"command_regex":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Command Regex"},"namespace":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Namespace"},"project":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Project"}},"type":"object","title":"PolicyMatch","description":"Conjunctive matcher; unset fields match everything.\n\n``namespace`` / ``project`` are RESOURCE SCOPE matchers (glob\nsyntax, e.g. ``prod-*``): they match against coordinates the\nclassifier derives from the command itself (kubectl ``-n``,\ngcloud ``--project``) — policy authors write globs, never parse\ncommands. A scoped policy does NOT match an action whose\ncoordinate could not be derived (same fail-closed rule as\n``command_regex`` against a command-less action). MCP tools carry\nno resource scope by design (no uniform argument convention);\ncluster scope is deferred until the executor plumbs the kubeconfig\ncontext through the seam."},"PortalSessionRequest":{"properties":{"return_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Return Url","description":"URL to redirect user after portal session"}},"type":"object","required":["return_url"],"title":"PortalSessionRequest","description":"Request schema for creating a billing portal session."},"PortalSessionResponse":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url","description":"Stripe Billing Portal URL"}},"type":"object","required":["url"],"title":"PortalSessionResponse","description":"Response schema for billing portal session."},"PredicateAliasIn":{"properties":{"variant":{"type":"string","maxLength":200,"minLength":1,"title":"Variant"},"canonical":{"type":"string","maxLength":200,"minLength":1,"title":"Canonical"},"expected_alias_token":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Expected Alias Token"},"expected_inventory_token":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Expected Inventory Token"},"note":{"type":"string","maxLength":2000,"title":"Note","default":""},"independent_attestation":{"type":"boolean","title":"Independent Attestation","default":false},"scope":{"additionalProperties":true,"type":"object","title":"Scope"},"source_dependencies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":128,"title":"Source Dependencies"}},"type":"object","required":["variant","canonical"],"title":"PredicateAliasIn","description":"Admin request to map a variant predicate to a canonical one."},"PredicateProposalRef":{"properties":{"predicate_a":{"type":"string","maxLength":200,"minLength":1,"title":"Predicate A"},"predicate_b":{"type":"string","maxLength":200,"minLength":1,"title":"Predicate B"}},"type":"object","required":["predicate_a","predicate_b"],"title":"PredicateProposalRef","description":"Reference to one reconcile proposal (the pair, order-insensitive)."},"PremiseStatus":{"properties":{"ref":{"type":"string","title":"Ref"},"namespace":{"type":"string","title":"Namespace"},"key":{"type":"string","title":"Key"},"state":{"type":"string","title":"State","description":"grounded | superseded | retracted | deleted | restricted"},"successor":{"type":"string","title":"Successor","default":""},"label":{"type":"string","title":"Label","default":""}},"type":"object","required":["ref","namespace","key","state"],"title":"PremiseStatus","description":"Live-verified state of one premise."},"PreviewBody":{"properties":{"object":{"type":"string","title":"Object"},"start":{"type":"string","enum":["created","starts_matching"],"title":"Start"},"filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filter"},"audience":{"type":"string","title":"Audience"},"target":{"type":"string","enum":["webhook","agent","rubric","investigation"],"title":"Target"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"}},"type":"object","required":["object","start","audience","target"],"title":"PreviewBody","description":"Body of ``POST /preview``: a draft rule (``config`` names a rubric's id)."},"PrivateConnectionView":{"properties":{"grant":{"$ref":"#/components/schemas/MailboxGrant"},"provider":{"anyOf":[{"type":"string","enum":["outlook","gmail","imap"]},{"type":"null"}],"title":"Provider"},"connected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Connected At"},"label":{"anyOf":[{"type":"string","maxLength":320,"minLength":3,"pattern":"^[^\\s<>]+@[^\\s<>]+$"},{"type":"null"}],"title":"Label"},"crm_sharing":{"type":"boolean","title":"Crm Sharing","default":false}},"additionalProperties":false,"type":"object","required":["grant","provider"],"title":"PrivateConnectionView","description":"Offer CRM controls per connection without changing owner consent."},"ProcessingJob":{"properties":{"receipt":{"$ref":"#/components/schemas/AcceptanceReceipt"},"state":{"type":"string","enum":["pending","running","succeeded","obsolete","quarantined"],"title":"State","default":"pending"},"attempts":{"type":"integer","minimum":0.0,"title":"Attempts","default":0},"fence":{"type":"integer","minimum":0.0,"title":"Fence","default":0},"worker_id":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Worker Id"},"lease_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Lease Expires At"},"retry_at":{"type":"string","format":"date-time","title":"Retry At"},"error_code":{"anyOf":[{"type":"string","enum":["source_unavailable","source_digest_mismatch","unsupported_material","processing_failed"]},{"type":"null"}],"title":"Error Code"},"result_digest":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}],"title":"Result Digest"},"evidence_ids":{"items":{"type":"string"},"type":"array","title":"Evidence Ids","default":[]},"usage":{"anyOf":[{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object"},{"type":"null"}],"title":"Usage"},"billing":{"type":"string","enum":["none","pending","settled","disabled"],"title":"Billing","default":"none"}},"additionalProperties":false,"type":"object","required":["receipt","retry_at"],"title":"ProcessingJob","description":"Persist a recoverable lease, monotonically increasing fence and result stamp."},"ProfileCreateRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_-]*$","title":"Name"},"description":{"type":"string","title":"Description","default":""},"base_domain":{"type":"string","title":"Base Domain","default":"HD"},"executor_type":{"type":"string","title":"Executor Type","default":"reflective_shell"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"memory_section_titles":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Memory Section Titles"},"resolved_examples":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Examples"},"resolved_evidence_keywords":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Evidence Keywords"},"event_context_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Context Template"},"omit_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Criteria"},"omit_event_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Description"},"omit_event_reason_example":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Reason Example"},"executor_system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor System Prompt"},"executor_identity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Identity"},"executor_cloud_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Cloud Context"},"executor_web_search_guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Web Search Guidance"},"executor_workflows":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Workflows"},"executor_session_mode_header_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Investigation"},"executor_session_mode_header_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Remediation"},"executor_session_constraints":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Constraints"},"executor_report_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Report Format"},"executor_task_completion_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Investigation"},"executor_task_completion_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Remediation"},"executor_base_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Executor Base Tools"},"extraction_schemas":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extraction Schemas"},"extraction_instructions":{"anyOf":[{"type":"string","maxLength":8000,"minLength":1},{"type":"null"}],"title":"Extraction Instructions"},"chat_extraction_instructions":{"anyOf":[{"type":"string","maxLength":8000,"minLength":1},{"type":"null"}],"title":"Chat Extraction Instructions"},"empty_message_overrides":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Empty Message Overrides"}},"type":"object","required":["name"],"title":"ProfileCreateRequest","description":"Request schema for creating a custom investigation profile.\n\nAll prompt fields default to ``None`` = \"inherit the built-in default at\nruntime\".  This ensures that if the platform-level defaults evolve later,\nexisting profiles automatically pick up the new values instead of carrying\nstale frozen copies in the database.\n\nThe frontend can pre-fill creation forms by reading the current defaults\nfrom ``GET /profiles/defaults`` or from the built-in SRE profile response."},"ProfileDefaultsResponse":{"properties":{"system_prompt":{"type":"string","title":"System Prompt"},"resolved_examples":{"type":"string","title":"Resolved Examples"},"resolved_evidence_keywords":{"type":"string","title":"Resolved Evidence Keywords"},"event_context_template":{"type":"string","title":"Event Context Template"},"omit_criteria":{"type":"string","title":"Omit Criteria"},"omit_event_description":{"type":"string","title":"Omit Event Description"},"omit_event_reason_example":{"type":"string","title":"Omit Event Reason Example"}},"type":"object","required":["system_prompt","resolved_examples","resolved_evidence_keywords","event_context_template","omit_criteria","omit_event_description","omit_event_reason_example"],"title":"ProfileDefaultsResponse","description":"Current platform defaults for orchestrator and executor prompt fields.\n\nThe frontend uses this to pre-fill the profile creation form.  Values are\nresolved at request time so they always reflect the latest platform defaults."},"ProfileMetricRecord":{"properties":{"thread_id":{"type":"string","title":"Thread Id","description":"Thread ID (inv_ prefix for HD, dr_ prefix for DR — both stripped)"},"profile_name":{"type":"string","title":"Profile Name"},"graph_id":{"type":"string","title":"Graph Id","description":"Methodology discriminator. ``HDRAgent`` = Hypothetico-Deductive (HD) investigation, ``DefeasibleReasoningAgent`` = Defeasible Reasoning (DR) candidate evaluation. Defaults to HDRAgent for legacy records that predate the field.","default":"HDRAgent"},"timestamp":{"type":"string","title":"Timestamp","description":"ISO datetime"},"outcome":{"type":"string","title":"Outcome","description":"Cross-methodology aggregation key. HD: ``resolved | proposed | omitted | failed | skipped``. DR: ``resolved`` (warranted) | ``rejected`` (defeated) | ``skipped``. ``rejected`` is DR-specific and intentionally distinct from HD's ``omitted`` (which means 'alert was a false positive worth filtering' — opposite operational meaning from DR's 'candidate disqualified by a defeater')."},"iterations":{"type":"integer","title":"Iterations"},"alert_type":{"type":"string","title":"Alert Type","description":"HD: event title; DR: candidate_signature"},"provider":{"type":"string","title":"Provider","description":"HD: source name (datadog/gcp/...); DR: 'dr'"},"confidence":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Confidence","description":"HD only — LLM judge's self-rated confidence (0-100). None on DR."},"evidence_quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Quality","description":"HD only — DEFINITIVE | STRONG | PARTIAL | WEAK. None on DR."},"escalated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Escalated","description":"HD only — whether the run was escalated. None on DR."},"human_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Human Verdict","description":"HD only — accepted | edited | ignored | auto_accepted. None until the notify gate resolves (or on DR/legacy records)."},"verdict_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verdict At","description":"ISO datetime the verdict was recorded. None until resolved."},"auto_approved":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Approved","description":"True when the autonomy gate auto-accepted without a human. Auto-approved records never count toward earned capability."},"autonomy_effective_level":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Autonomy Effective Level","description":"Effective autonomy level (0-100) at auto-approval time."},"remediation_outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remediation Outcome","description":"completed | failed — final remediation attempt status."},"diagnosis":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Diagnosis","description":"True for platform-internal diagnosis runs. These bypass the HITL gate, so they are excluded from capability volume counts."},"final_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Status","description":"warranted | defeated | skipped (DR only)"},"rank_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rank Score","description":"QBAF strength in [0, 1] — None for disqualified or HD records"},"confidence_delta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence Delta","description":"Dual-BAG |t_base − t_estimated| disagreement signal (DR only)"},"defeaters_fired_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Defeaters Fired Count","description":"Count of defeater patterns that fired with valid provenance"},"defeaters_rejected_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Defeaters Rejected Count","description":"Count of defeater proposals dropped by the provenance gate"},"verifications_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Verifications Count","description":"Count of source URLs verified during the DR run"},"verification_degraded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Verification Degraded","description":"True when UNDERCUT verification could not run (no MCP tools)"},"candidate_signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Candidate Signature","description":"Compact identity summary (DR only)"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id","description":"Rubric used for the DR run"}},"type":"object","required":["thread_id","profile_name","timestamp","outcome","iterations","alert_type","provider"],"title":"ProfileMetricRecord","description":"A single per-run metric record (HD or DR).\n\nThe schema is **discriminated by ``graph_id``**. HD records leave\nthe DR-specific fields ``None``; DR records populate them and also\nmap their verdict into the HD-shaped legacy fields (``outcome``,\n``confidence``, ``iterations``, etc.) so dashboards that aggregate\nover the legacy fields still render mixed-methodology results.\n\nLegacy records persisted before the discriminator landed default\n``graph_id`` to ``\"HDRAgent\"`` — they predate DR entirely."},"ProfileMetricsResponse":{"properties":{"records":{"items":{"$ref":"#/components/schemas/ProfileMetricRecord"},"type":"array","title":"Records"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["records","total"],"title":"ProfileMetricsResponse","description":"Response for profile metrics endpoint."},"ProfilePinRecommendation":{"properties":{"provider":{"type":"string","title":"Provider"},"current_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Profile"},"recommended_profile":{"type":"string","title":"Recommended Profile"},"escalation_count":{"type":"integer","title":"Escalation Count"},"confidence":{"type":"string","title":"Confidence"}},"type":"object","required":["provider","current_profile","recommended_profile","escalation_count","confidence"],"title":"ProfilePinRecommendation","description":"Advisory recommendation to pin a webhook source to a profile."},"ProfileResponse":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"base_domain":{"type":"string","title":"Base Domain"},"executor_type":{"type":"string","title":"Executor Type"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"executor_system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor System Prompt"},"memory_section_titles":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Memory Section Titles"},"resolved_examples":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Examples"},"executor_identity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Identity"},"executor_cloud_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Cloud Context"},"executor_web_search_guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Web Search Guidance"},"executor_workflows":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Workflows"},"executor_session_mode_header_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Investigation"},"executor_session_mode_header_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Remediation"},"executor_session_constraints":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Constraints"},"executor_report_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Report Format"},"executor_task_completion_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Investigation"},"executor_task_completion_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Remediation"},"executor_base_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Executor Base Tools"},"resolved_evidence_keywords":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Evidence Keywords"},"event_context_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Context Template"},"omit_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Criteria"},"omit_event_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Description"},"omit_event_reason_example":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Reason Example"},"extraction_schemas":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extraction Schemas"},"extraction_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Instructions"},"chat_extraction_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Extraction Instructions"},"empty_message_overrides":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Empty Message Overrides"},"effective_extraction_schemas":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Effective Extraction Schemas"},"effective_extraction_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Extraction Instructions"},"effective_chat_extraction_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Chat Extraction Instructions"},"is_builtin":{"type":"boolean","title":"Is Builtin"},"field_conflicts":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Field Conflicts"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["name","description","base_domain","executor_type","system_prompt","executor_system_prompt","memory_section_titles","resolved_examples","resolved_evidence_keywords","is_builtin"],"title":"ProfileResponse","description":"Response schema for an investigation profile."},"ProfileUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"base_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Domain"},"executor_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Type"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"executor_system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor System Prompt"},"memory_section_titles":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Memory Section Titles"},"resolved_examples":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Examples"},"executor_identity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Identity"},"executor_cloud_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Cloud Context"},"executor_web_search_guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Web Search Guidance"},"executor_workflows":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Workflows"},"executor_session_mode_header_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Investigation"},"executor_session_mode_header_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Remediation"},"executor_session_constraints":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Constraints"},"executor_report_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Report Format"},"executor_task_completion_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Investigation"},"executor_task_completion_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Remediation"},"executor_base_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Executor Base Tools"},"resolved_evidence_keywords":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Evidence Keywords"},"event_context_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Context Template"},"omit_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Criteria"},"omit_event_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Description"},"omit_event_reason_example":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Reason Example"},"extraction_schemas":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extraction Schemas"},"extraction_instructions":{"anyOf":[{"type":"string","maxLength":8000,"minLength":1},{"type":"null"}],"title":"Extraction Instructions"},"chat_extraction_instructions":{"anyOf":[{"type":"string","maxLength":8000,"minLength":1},{"type":"null"}],"title":"Chat Extraction Instructions"},"empty_message_overrides":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Empty Message Overrides"}},"type":"object","title":"ProfileUpdateRequest","description":"Request schema for updating a custom investigation profile (partial)."},"PromoteRequest":{"properties":{"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dueat"},"allowedTeams":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allowedteams","description":"Who may read the CRM task (the Brain's label wire form); default org"}},"type":"object","title":"PromoteRequest","description":"Body of ``POST .../promote``."},"ProviderCleanup":{"properties":{"state":{"type":"string","enum":["not_required","expiry_pending","expiry_elapsed","unverified"],"title":"State"},"reason":{"type":"string","enum":["no_subscription","attempted","token_unavailable","provider_unavailable","binding_invalid","history_unavailable","expiry_reached"],"title":"Reason"},"checked_at":{"type":"string","format":"date-time","title":"Checked At"},"expires_by":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires By"},"deleted_subscriptions":{"type":"integer","minimum":0.0,"title":"Deleted Subscriptions","default":0}},"additionalProperties":false,"type":"object","required":["state","reason","checked_at"],"title":"ProviderCleanup","description":"Report provider cancellation attempts separately from local content deletion."},"ProviderFolder":{"properties":{"folder_id":{"type":"string","maxLength":512,"minLength":1,"title":"Folder Id"},"parent_id":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Parent Id"},"display_name":{"type":"string","maxLength":1024,"title":"Display Name"},"included":{"type":"boolean","title":"Included"},"required":{"type":"boolean","title":"Required","default":false},"selectable":{"type":"boolean","title":"Selectable","default":true}},"additionalProperties":false,"type":"object","required":["folder_id","display_name","included"],"title":"ProviderFolder","description":"One discovered physical folder, as the owner's picker shows it."},"ProvisionedBy":{"type":"string","enum":["agent","manual"],"title":"ProvisionedBy","description":"Who created the BYO setup.\n\n``agent`` records that the ``MemoryDbOnboarding`` profile drove\nthe instance creation; ``manual`` records that an admin pointed\nus at an existing instance via the UI / REST. The distinction\nmatters for migration tooling — ``agent``-provisioned instances\nare guaranteed to have the schema set up by us, so migration\ncan skip the schema-check and head straight to the row copy."},"PublishedClaimVetoRequest":{"properties":{"claim_key":{"type":"string","maxLength":1024,"minLength":1,"pattern":"^(fact|reported|rel):","title":"Claim Key"},"expected_publication_decision_id":{"type":"string","maxLength":128,"minLength":1,"title":"Expected Publication Decision Id"},"note":{"type":"string","maxLength":2000,"minLength":1,"title":"Note"}},"additionalProperties":false,"type":"object","required":["claim_key","expected_publication_decision_id","note"],"title":"PublishedClaimVetoRequest","description":"Veto one exact qualified projection shown to the reviewer."},"PublishedEvidence":{"properties":{"evidence_id":{"type":"string","maxLength":512,"minLength":1,"title":"Evidence Id"},"publication_revision":{"type":"integer","exclusiveMinimum":0.0,"title":"Publication Revision"},"evidence":{"$ref":"#/components/schemas/MailboxEvidence"}},"additionalProperties":false,"type":"object","required":["evidence_id","publication_revision","evidence"],"title":"PublishedEvidence","description":"Version a private projection for compare-and-swap and cache revalidation."},"PullSpec":{"properties":{"server":{"type":"string","title":"Server"},"tool":{"type":"string","title":"Tool"},"args":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Args"},"result_path":{"type":"string","title":"Result Path"},"pagination":{"$ref":"#/components/schemas/PaginationSpec"},"read_only_verified":{"type":"boolean","title":"Read Only Verified","default":false},"max_records":{"type":"integer","maximum":20000.0,"minimum":1.0,"title":"Max Records","default":2000},"full_state":{"type":"boolean","title":"Full State","default":false}},"additionalProperties":false,"type":"object","required":["server","tool","result_path"],"title":"PullSpec","description":"Configure a read-only connector pull and its completion evidence."},"RankingFactor":{"properties":{"name":{"type":"string","title":"Name","description":"Stable identifier (e.g. 'public_engagement')"},"description":{"type":"string","title":"Description","description":"What this factor measures"},"weight":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Weight","description":"Contribution weight for this factor's edge in the QBAF aggregation. Rollout-staged: every ranked run records the edge-weighted rank on its audit trail (``rank_score_weighted``); the live ``rank_score`` switches to it when the rollout completes."},"polarity":{"$ref":"#/components/schemas/FactorPolarity","description":"SUPPORT raises the candidate's strength; ATTACK lowers it"},"base_score_prompt":{"type":"string","title":"Base Score Prompt","description":"LLM prompt template. Receives the candidate context; must return a numeric base score in [0, 1]."}},"additionalProperties":false,"type":"object","required":["name","description","weight","polarity","base_score_prompt"],"title":"RankingFactor","description":"One factor contributing to a candidate's QBAF strength."},"RecordBatch":{"properties":{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":200,"minItems":1,"title":"Items"},"allowedTeams":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allowedteams","description":"Who may read the new records (the Brain's label wire form); default org"},"confirmPromotion":{"type":"boolean","title":"Confirmpromotion","description":"Resend with true after a 409 PROMOTION_CONFIRM_REQUIRED: the member confirmed promoting these prospects (it shares them with the Brain)","default":false}},"type":"object","required":["items"],"title":"RecordBatch","description":"Body of ``POST .../records/batch``."},"RecordCase":{"properties":{"claim_contract_version":{"type":"integer","title":"Claim Contract Version","default":0},"case_key":{"type":"string","title":"Case Key"},"kind":{"type":"string","enum":["binding","extraction"],"title":"Kind"},"source_id":{"type":"string","title":"Source Id"},"source_label":{"type":"string","title":"Source Label","default":""},"record_type":{"type":"string","title":"Record Type"},"record_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Record Key"},"record_key_row":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Record Key Row"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"extraction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Id"},"candidate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Candidate Id"},"expected_binding_revision":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Binding Revision"},"expected_record_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Record Token"},"expected_candidate_revision":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Candidate Revision"},"expected_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Fingerprint"},"reason":{"type":"string","title":"Reason","default":""},"review_status":{"type":"string","title":"Review Status","default":"pending"},"candidates":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Candidates"},"fields":{"additionalProperties":true,"type":"object","title":"Fields"},"evidence":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Evidence"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"issues":{"items":{"type":"string"},"type":"array","title":"Issues"},"coverage":{"additionalProperties":true,"type":"object","title":"Coverage"}},"type":"object","required":["case_key","kind","source_id","record_type"],"title":"RecordCase","description":"One binding or extraction decision in the shared curation queue."},"RecordCaseRequest":{"properties":{"expected_binding_tokens":{"additionalProperties":{"type":"string"},"type":"object","title":"Expected Binding Tokens"},"scope":{"additionalProperties":true,"type":"object","title":"Scope"},"source_dependencies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":128,"title":"Source Dependencies"},"independent_attestation":{"type":"boolean","title":"Independent Attestation","default":false},"action":{"type":"string","enum":["bind","create","dismiss","approve_extraction","correct_extraction","dismiss_extraction"],"title":"Action"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"entity_name":{"anyOf":[{"type":"string","maxLength":256,"minLength":1},{"type":"null"}],"title":"Entity Name"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"expected_binding_revision":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Binding Revision"},"expected_record_token":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Expected Record Token"},"expected_candidate_revision":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Candidate Revision"},"corrections":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Corrections"},"note":{"type":"string","maxLength":2000,"title":"Note","default":""},"previous_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Entity Id"},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Id"},"record_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Record Type"},"record_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Record Key"}},"additionalProperties":false,"type":"object","required":["action"],"title":"RecordCaseRequest","description":"An explicit revision-checked binding or extraction decision."},"RecordMoves":{"properties":{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":200,"minItems":1,"title":"Items"},"confirmPromotion":{"type":"boolean","title":"Confirmpromotion","description":"Resend with true after a 409 PROMOTION_CONFIRM_REQUIRED: the member confirmed promoting these prospects (it shares them with the Brain)","default":false}},"type":"object","required":["items"],"title":"RecordMoves","description":"Body of ``POST .../records/positions``."},"RecordQuery":{"properties":{"filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filter"},"orderBy":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Orderby"},"limit":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Limit","default":60},"after":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"},"before":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"},"depth":{"type":"integer","maximum":1.0,"minimum":0.0,"title":"Depth","default":0},"withCount":{"type":"boolean","title":"Withcount","default":false},"includeDeleted":{"type":"boolean","title":"Includedeleted","default":false},"withBrain":{"type":"boolean","title":"Withbrain","default":false}},"type":"object","title":"RecordQuery","description":"Body of ``POST .../records/query`` (for filters too long for a URL)."},"RecordType":{"properties":{"name":{"type":"string","title":"Name"},"entity_type":{"type":"string","title":"Entity Type"},"fields":{"additionalProperties":{"$ref":"#/components/schemas/FieldRule"},"type":"object","title":"Fields"}},"additionalProperties":false,"type":"object","required":["name","entity_type"],"title":"RecordType","description":"Declare a logical entity record and its canonical fields."},"RecordsByEntities":{"properties":{"entityIds":{"items":{"type":"string"},"type":"array","maxItems":200,"title":"Entityids"}},"type":"object","required":["entityIds"],"title":"RecordsByEntities","description":"Body of ``POST .../records/by-entities``."},"RefundCreateRequest":{"properties":{"run_id":{"type":"string","title":"Run Id","description":"LangGraph run ID to refund"},"reason":{"type":"string","maxLength":500,"minLength":1,"title":"Reason","description":"Reason for refund"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional context"}},"type":"object","required":["run_id","reason"],"title":"RefundCreateRequest","description":"Request to create a refund for a run."},"RefundCreateResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"refunds_created":{"type":"integer","title":"Refunds Created"},"total_credits_refunded":{"type":"integer","title":"Total Credits Refunded"},"refund_pairs":{"items":{"$ref":"#/components/schemas/RefundPairResponse"},"type":"array","title":"Refund Pairs"}},"type":"object","required":["run_id","refunds_created","total_credits_refunded","refund_pairs"],"title":"RefundCreateResponse","description":"Response after creating refunds."},"RefundListResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"refunds":{"items":{"$ref":"#/components/schemas/RefundTransactionResponse"},"type":"array","title":"Refunds"},"total_refunded":{"type":"integer","title":"Total Refunded"}},"type":"object","required":["run_id","refunds","total_refunded"],"title":"RefundListResponse","description":"List of refunds for a run."},"RefundPairResponse":{"properties":{"original_transaction":{"$ref":"#/components/schemas/OriginalTransactionSummary"},"refund_transaction":{"$ref":"#/components/schemas/RefundTransactionResponse"},"credits_refunded":{"type":"integer","title":"Credits Refunded"}},"type":"object","required":["original_transaction","refund_transaction","credits_refunded"],"title":"RefundPairResponse","description":"Response showing original transaction and its refund."},"RefundTransactionResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"allocation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allocation Id"},"amount":{"type":"integer","title":"Amount"},"reason":{"type":"string","title":"Reason"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"related_transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Related Transaction Id"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_id","allocation_id","amount","reason","run_id","related_transaction_id","metadata","created_at"],"title":"RefundTransactionResponse","description":"Individual refund transaction details."},"RejectRequest":{"properties":{"expected_binding_tokens":{"additionalProperties":{"type":"string"},"type":"object","title":"Expected Binding Tokens"},"scope":{"additionalProperties":true,"type":"object","title":"Scope"},"source_dependencies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":128,"title":"Source Dependencies"},"independent_attestation":{"type":"boolean","title":"Independent Attestation","default":false},"candidate_id":{"type":"string","minLength":1,"title":"Candidate Id"},"expected_binding_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Binding Token"},"expected_alias_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Alias Token"},"note":{"type":"string","maxLength":2000,"title":"Note","default":""}},"type":"object","required":["candidate_id"],"title":"RejectRequest","description":"Body for alias rejection: which candidate the name does NOT mean."},"ResubscribeRequest":{"properties":{"plan_id":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Plan to subscribe to (defaults to starter)","default":"starter"}},"type":"object","title":"ResubscribeRequest","description":"Request schema for resubscribing after a cancelled/expired subscription."},"ResubscribeResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url","description":"Stripe Checkout URL to redirect to"}},"type":"object","required":["checkout_url"],"title":"ResubscribeResponse","description":"Response schema for resubscription — returns checkout URL for redirect."},"ResumeBody":{"properties":{"queued":{"anyOf":[{"type":"string","enum":["deliver","discard"]},{"type":"null"}],"title":"Queued"}},"type":"object","title":"ResumeBody","description":"Body of ``POST /{id}/resume``: what to do with runs held while paused."},"RolloutGateStatus":{"properties":{"idle":{"type":"boolean","title":"Idle"},"runs_running":{"type":"integer","title":"Runs Running"},"dreams_running":{"type":"integer","title":"Dreams Running"}},"type":"object","required":["idle","runs_running","dreams_running"],"title":"RolloutGateStatus","description":"Whether the worker can be replaced without cutting a run."},"Rubric":{"properties":{"type":{"type":"string","const":"rubric","title":"Type","description":"Decorative type tag (kept for back-compat; the namespace is the canonical discriminator). Marks the record as a config-shaped rubric distinct from memory patterns.","default":"rubric"},"rubric_id":{"type":"string","title":"Rubric Id","description":"Stable identifier (e.g. 'prospect')"},"description":{"type":"string","title":"Description","default":""},"disqualifiers":{"$ref":"#/components/schemas/Disqualifiers"},"scoring":{"$ref":"#/components/schemas/Scoring"},"output":{"$ref":"#/components/schemas/Output"},"version":{"type":"integer","title":"Version","default":1}},"additionalProperties":false,"type":"object","required":["rubric_id","disqualifiers","scoring","output"],"title":"Rubric","description":"Wraps the three sub-packs (Disqualifiers, Scoring, Output) for one DR profile.\n\nLives in the dedicated ``(\"config\", \"rubrics\", org_id)`` config\nnamespace keyed by plain ``rubric_id``. Profile builders pre-seed\na starter rubric on first activation; orgs are then free to fork\nand edit through the rubric REST API. Was ``DRPackBundle`` in\nearlier scaffolding.\n\n``extra=\"forbid\"`` — see ``_STRICT_MODEL_CONFIG`` at the top of\nthis module. The on-disk row carries audit fields\n(``created_at`` / ``updated_at`` / ``updated_by``) that ARE\nextras to this model; ``RubricStore.PersistedRubric.from_store_value``\npops them BEFORE validating so this model stays strict for\nuser-authored bodies without breaking storage round-trips.\n\nThe ``type: \"rubric\"`` discriminator is now decorative — the\nnamespace alone identifies the record class. Kept for back-compat\nwith rows written before the namespace move; can be removed in a\nfuture cleanup pass."},"RubricEditReportRequest":{"properties":{"kind":{"type":"string","const":"rubric_edit","title":"Kind"},"rubric_id":{"type":"string","maxLength":128,"minLength":1,"title":"Rubric Id"},"rubric":{"$ref":"#/components/schemas/Rubric"},"sample_size":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Sample Size","default":3}},"additionalProperties":false,"type":"object","required":["kind","rubric_id","rubric"],"title":"RubricEditReportRequest","description":"Replay captured cases under a proposed (unsaved) rubric body."},"RubricScenario":{"properties":{"id":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_.-]+$","title":"Id"},"description":{"type":"string","title":"Description","default":""},"candidate_context":{"additionalProperties":true,"type":"object","title":"Candidate Context","description":"The candidate fields the rubric evaluates, exactly as the DR graph's candidate_context input."},"expect_final_status":{"anyOf":[{"type":"string","enum":["warranted","defeated","skipped","incomplete"]},{"type":"null"}],"title":"Expect Final Status"},"expect_gate_verdict":{"anyOf":[{"type":"string","enum":["auto","suggest","review"]},{"type":"null"}],"title":"Expect Gate Verdict"},"expect_defeaters_fired":{"items":{"type":"string"},"type":"array","title":"Expect Defeaters Fired"},"expect_defeaters_not_fired":{"items":{"type":"string"},"type":"array","title":"Expect Defeaters Not Fired"},"artifact_checks":{"items":{"$ref":"#/components/schemas/ArtifactCheck"},"type":"array","title":"Artifact Checks"}},"type":"object","required":["id","candidate_context"],"title":"RubricScenario","description":"One candidate to run through the rubric, plus its expectations."},"RuleBody":{"properties":{"object":{"type":"string","title":"Object"},"start":{"type":"string","enum":["created","starts_matching"],"title":"Start"},"filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filter"},"audience":{"type":"string","title":"Audience"},"target":{"type":"string","enum":["webhook","agent","rubric","investigation"],"title":"Target"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"turnOn":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Turnon"},"cooldownMinutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cooldownminutes"},"canStartOthers":{"type":"boolean","title":"Canstartothers","default":false},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"}},"type":"object","required":["object","start","audience","target"],"title":"RuleBody","description":"Body of ``POST \"\"`` (field names in the filter)."},"RuleConditions":{"properties":{"folder_roles":{"items":{"type":"string","enum":["inbox","sent","other"]},"type":"array","maxItems":3,"minItems":1,"title":"Folder Roles","default":["inbox","other"]},"include_sent":{"type":"boolean","title":"Include Sent","default":false},"senders":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Senders","default":[]},"recipients":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Recipients","default":[]},"received_after":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Received After"},"received_before":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Received Before"}},"additionalProperties":false,"type":"object","title":"RuleConditions","description":"Match envelope metadata deterministically before any model work."},"RuleList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StoredRule"},"type":"array","title":"Items"},"limit":{"type":"integer","title":"Limit","default":100},"available":{"type":"boolean","title":"Available"},"remaining_daily_runs":{"type":"integer","maximum":20.0,"minimum":0.0,"title":"Remaining Daily Runs"},"active_run":{"type":"boolean","title":"Active Run"}},"type":"object","required":["items","available","remaining_daily_runs","active_run"],"title":"RuleList","description":"Return owner configuration and availability without granting execution."},"RuleUpdate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"instructions":{"type":"string","maxLength":4000,"minLength":1,"title":"Instructions"},"conditions":{"$ref":"#/components/schemas/RuleConditions"},"question":{"anyOf":[{"type":"string","maxLength":1000,"minLength":1},{"type":"null"}],"title":"Question"},"output_kind":{"type":"string","enum":["notification","crm_proposal"],"title":"Output Kind","default":"notification"},"enabled":{"type":"boolean","title":"Enabled","default":false},"expected_revision":{"type":"integer","minimum":0.0,"title":"Expected Revision"}},"additionalProperties":false,"type":"object","required":["name","instructions","expected_revision"],"title":"RuleUpdate","description":"Require an explicit CAS revision on every owner change."},"RulingMintResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"},"status":{"type":"string","const":"minted","title":"Status"}},"type":"object","required":["task_id","status"],"title":"RulingMintResponse","description":"Receipt for a grounding review task."},"RulingRequest":{"properties":{"action":{"type":"string","enum":["accept","dismiss"],"title":"Action"},"expected":{"type":"string","pattern":"^[a-f0-9]{64}$","title":"Expected"}},"additionalProperties":false,"type":"object","required":["action","expected"],"title":"RulingRequest","description":"Accept or Dismiss a learned proposal exactly as the reader saw it (Plan C 6a)."},"Run":{"properties":{"run_id":{"type":"string","title":"Run Id","description":"Unique identifier for the run."},"thread_id":{"type":"string","title":"Thread Id","description":"Thread this run belongs to."},"assistant_id":{"type":"string","title":"Assistant Id","description":"Assistant that is executing this run."},"status":{"type":"string","title":"Status","description":"Current run status: pending, running, error, success, timeout, or interrupted.","default":"pending"},"input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input","description":"Input data provided to the run. None for checkpoint-only resume."},"output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output","description":"Final output produced by the run, or null if not yet complete."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error message if the run failed."},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Configuration passed to the graph at runtime."},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Context variables available during execution."},"user_id":{"type":"string","title":"User Id","description":"Identifier of the user who owns this run."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the run was created."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Timestamp when the run was last updated."}},"type":"object","required":["run_id","thread_id","assistant_id","user_id","created_at","updated_at"],"title":"Run","description":"Run entity model\n\nStatus values: pending, running, error, success, timeout, interrupted"},"RunCreate":{"properties":{"assistant_id":{"type":"string","title":"Assistant Id","description":"Assistant to execute"},"input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input","description":"Input data for the run. Optional when resuming from a checkpoint."},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Execution config"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Execution context"},"checkpoint":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Checkpoint","description":"Checkpoint configuration (e.g., {'checkpoint_id': '...', 'checkpoint_ns': ''})"},"checkpoint_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Checkpoint Id","description":"Checkpoint to run from. Short form of checkpoint={'checkpoint_id': ...}; 'checkpoint' wins if both set."},"durability":{"anyOf":[{"type":"string","enum":["sync","async","exit"]},{"type":"null"}],"title":"Durability","description":"When checkpoints are persisted: 'sync' before each next step starts, 'async' in the background while the next step runs (LangGraph default), 'exit' only once, when the run ends. Overrides the server default (checkpointer.durability)."},"checkpoint_during":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Checkpoint During","description":"Deprecated alias for durability: true means 'async', false means 'exit'. 'durability' wins if both are set."},"stream":{"type":"boolean","title":"Stream","description":"Enable streaming response","default":false},"stream_mode":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stream Mode","description":"Requested stream mode(s)"},"on_disconnect":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"On Disconnect","description":"Behavior on client disconnect: 'cancel' (default) or 'continue'."},"on_completion":{"anyOf":[{"type":"string","enum":["delete","keep"]},{"type":"null"}],"title":"On Completion","description":"Behavior after stateless run completes: 'delete' (default) removes the ephemeral thread, 'keep' preserves it."},"webhook":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook","description":"Completion callback URL"},"multitask_strategy":{"anyOf":[{"type":"string","enum":["reject","interrupt","rollback","enqueue"]},{"type":"null"}],"title":"Multitask Strategy","description":"Strategy for handling concurrent runs on same thread: 'reject', 'interrupt', 'rollback', or 'enqueue'."},"command":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Command","description":"Command for resuming interrupted runs with state updates or navigation"},"interrupt_before":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Interrupt Before","description":"Nodes to interrupt immediately before they get executed. Use '*' for all nodes."},"interrupt_after":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Interrupt After","description":"Nodes to interrupt immediately after they get executed. Use '*' for all nodes."},"stream_subgraphs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream Subgraphs","description":"Whether to include subgraph events in streaming. When True, includes events from all subgraphs. When False (default when None), excludes subgraph events. Defaults to False for backwards compatibility.","default":false},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Request metadata propagated to OTEL trace attributes (``langfuse.trace.metadata.<key>``).  Keys must match ``[A-Za-z0-9_-]{1,64}``.  Values must be primitive (``str``, ``int``, ``float``, ``bool``); string values are capped at 512 characters.  Maximum 32 keys.  Use this for filterable attributes (tenant, feature flag, environment, sub-agent type) rather than payload data."}},"type":"object","required":["assistant_id"],"title":"RunCreate","description":"Request model for creating runs"},"RunOnceBody":{"properties":{"source":{"type":"string","enum":["matching_now","bulk_skip"],"title":"Source","default":"matching_now"},"activityId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activityid"}},"type":"object","title":"RunOnceBody","description":"Body of ``POST /{id}/run-once``."},"RunResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"total_questions":{"type":"integer","title":"Total Questions"},"total_turns_seeded":{"type":"integer","title":"Total Turns Seeded"},"total_duration_s":{"type":"number","title":"Total Duration S"},"results":{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object","title":"Results","description":"Mem0-compatible results: {conv_index: [qa_dicts]}"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["technique","total_questions","total_turns_seeded","total_duration_s","results","errors"],"title":"RunResponse","description":"Response from the run phase."},"RunStatus":{"properties":{"run_id":{"type":"string","title":"Run Id","description":"Unique identifier for the run."},"status":{"type":"string","title":"Status","description":"Current run status value."},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Optional human-readable status message."}},"type":"object","required":["run_id","status"],"title":"RunStatus","description":"Simple run status response"},"RunsCancel":{"properties":{"status":{"anyOf":[{"type":"string","enum":["pending","running","all"]},{"type":"null"}],"title":"Status","description":"Cancel every active run of the caller in this status. 'all' means pending and running."},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id","description":"Thread that owns the runs listed in run_ids."},"run_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Run Ids","description":"Runs to cancel; requires thread_id."}},"type":"object","title":"RunsCancel","description":"Selector for ``POST /runs/cancel``: a status filter, or thread_id plus run_ids."},"ScoreResponse":{"properties":{"overall_bleu":{"type":"number","title":"Overall Bleu"},"overall_f1":{"type":"number","title":"Overall F1"},"overall_llm":{"type":"number","title":"Overall Llm"},"total_questions":{"type":"integer","title":"Total Questions"},"category_summaries":{"items":{"$ref":"#/components/schemas/CategorySummaryResponse"},"type":"array","title":"Category Summaries"},"scored":{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object","title":"Scored","description":"Scored results: {conv_index: [{...bleu_score, f1_score, llm_score}]}"}},"type":"object","required":["overall_bleu","overall_f1","overall_llm","total_questions","category_summaries","scored"],"title":"ScoreResponse","description":"Response from the score phase."},"Scoring":{"properties":{"description":{"type":"string","title":"Description","default":""},"factors":{"items":{"$ref":"#/components/schemas/RankingFactor"},"type":"array","title":"Factors","description":"QBAF factors; weights need not sum to 1"},"semantics":{"type":"string","enum":["dfquad","qe","eb"],"title":"Semantics","description":"Gradual semantics for QBAF aggregation. dfquad = Sum/Product+Linear; qe = Sum+QuadraticMaximum; eb = Sum+EulerBased.","default":"dfquad"},"aggregator":{"type":"string","enum":["sum","product"],"title":"Aggregator","description":"Aggregation function; product is DfQUaD-equivalent","default":"product"},"use_dual_bag":{"type":"boolean","title":"Use Dual Bag","description":"If True, compute strength under both root prior 0.5 and LLM-estimated prior. Delta is a confidence signal — large deltas indicate cases that need human review.","default":true},"version":{"type":"integer","title":"Version","default":1}},"additionalProperties":false,"type":"object","title":"Scoring","description":"Phase-2 (ranking) configuration for a Rubric.\n\nWas ``RankingPack`` in earlier scaffolding."},"SecretCreate":{"properties":{"value":{"type":"string","title":"Value"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["value"],"title":"SecretCreate","description":"Request body for creating/updating a secret."},"SecretListResponse":{"properties":{"secrets":{"items":{"$ref":"#/components/schemas/SecretResponse"},"type":"array","title":"Secrets"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["secrets","total"],"title":"SecretListResponse","description":"Response for listing secrets."},"SecretResponse":{"properties":{"key":{"type":"string","title":"Key"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["key","description","created_at","updated_at"],"title":"SecretResponse","description":"Response for a single secret (value hidden)."},"SeedProposalEdit":{"properties":{"index":{"type":"integer","minimum":0.0,"title":"Index"},"kind":{"anyOf":[{"type":"string","enum":["episodes","knowledge"]},{"type":"null"}],"title":"Kind"},"event_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Time"},"clear_event_time":{"type":"boolean","title":"Clear Event Time","default":false}},"type":"object","required":["index"],"title":"SeedProposalEdit","description":"One constrained edit to a proposed row at commit time.\n\nOnly kind flips and date corrections are allowed — content is\nimmutable between preview and commit by design."},"SeedRow":{"properties":{"content":{"type":"string","maxLength":20000,"minLength":1,"title":"Content"},"namespace":{"type":"string","enum":["episodes","knowledge"],"title":"Namespace","default":"knowledge"},"event_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Time","description":"ISO-8601 time the underlying event occurred (not now)."},"idempotency_key":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Idempotency Key"},"source_ref":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"object"},{"type":"null"}],"title":"Source Ref","description":"The exact source record this row cites. A row with one is deleted with that record and never merges with other rows."}},"type":"object","required":["content"],"title":"SeedRow","description":"One row to import."},"SelfLinkRequest":{"properties":{"channel_id":{"type":"string","maxLength":64,"minLength":1,"title":"Channel Id"},"sender_id":{"type":"string","maxLength":255,"minLength":1,"title":"Sender Id"}},"type":"object","required":["channel_id","sender_id"],"title":"SelfLinkRequest","description":"Request for a user to link their own channel identity."},"SendBackRequest":{"properties":{"comment":{"type":"string","maxLength":2000,"minLength":1,"title":"Comment"}},"type":"object","required":["comment"],"title":"SendBackRequest","description":"Body of ``POST .../send-back``."},"SenderExclusions":{"properties":{"connection_id":{"type":"string","maxLength":512,"minLength":1,"title":"Connection Id"},"revision":{"type":"integer","minimum":0.0,"title":"Revision"},"entries":{"items":{"type":"string","maxLength":320,"minLength":3},"type":"array","maxItems":200,"title":"Entries","default":[]},"forget_pending":{"type":"boolean","title":"Forget Pending","default":false},"forget_failed":{"type":"integer","minimum":0.0,"title":"Forget Failed","default":0}},"additionalProperties":false,"type":"object","required":["connection_id","revision"],"title":"SenderExclusions","description":"Version the owner's exclusion list and durable forget request."},"ServerListResponse":{"properties":{"mcpServers":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Mcpservers"},"display":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Display","default":{}},"total":{"type":"integer","title":"Total"},"enabled_count":{"type":"integer","title":"Enabled Count"},"disabled_count":{"type":"integer","title":"Disabled Count"}},"type":"object","required":["mcpServers","total","enabled_count","disabled_count"],"title":"ServerListResponse","description":"Response for server list endpoint."},"ServiceCreationResult":{"properties":{"service_name":{"type":"string","title":"Service Name"},"status":{"type":"string","title":"Status","description":"success or skipped"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["service_name","status"],"title":"ServiceCreationResult","description":"Result for a single service creation within a batch."},"ServiceDiscoveryResult":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether discovery completed successfully"},"project_id":{"type":"string","title":"Project Id","description":"GCP project ID"},"services":{"items":{"$ref":"#/components/schemas/DiscoveredServiceInfo"},"type":"array","title":"Services","description":"Discovered services (empty on failure)","default":[]},"total_count":{"type":"integer","title":"Total Count","description":"Total services discovered"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","description":"Hard errors","default":[]},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Soft warnings","default":[]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"Machine-readable error code"},"error_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error Details","description":"Additional error context"},"suggested_actions":{"items":{"type":"string"},"type":"array","title":"Suggested Actions","description":"Actionable steps to resolve errors","default":[]},"auto_enabled_apis":{"items":{"type":"string"},"type":"array","title":"Auto Enabled Apis","description":"Prerequisite control-plane APIs PlatformPilot auto-enabled on the project during discovery (enabled or still propagating). Surfaced so the UI can confirm what was done on the customer's behalf.","default":[]},"platform_sa_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform Sa Email","description":"Platform service account identity PlatformPilot authenticates as. Surfaced so the UI templates the real principal into IAM grant commands instead of a hardcoded constant."}},"type":"object","required":["success","project_id","total_count"],"title":"ServiceDiscoveryResult","description":"Service discovery result with error handling."},"ServiceEnableResult":{"properties":{"service_name":{"type":"string","title":"Service Name"},"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"operation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operation Id"}},"type":"object","required":["service_name","success","message"],"title":"ServiceEnableResult","description":"Result of enabling or disabling a GCP API."},"ServiceIAMCheckResponse":{"properties":{"service_account_email":{"type":"string","title":"Service Account Email"},"platform_sa_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform Sa Email"},"current_roles":{"items":{"type":"string"},"type":"array","title":"Current Roles"},"recommendations":{"items":{"$ref":"#/components/schemas/IAMRecommendation"},"type":"array","title":"Recommendations"}},"type":"object","required":["service_account_email","current_roles","recommendations"],"title":"ServiceIAMCheckResponse","description":"Response for IAM check endpoint."},"SkipCounts":{"properties":{"sender_auth_failed":{"type":"integer","minimum":0.0,"title":"Sender Auth Failed","default":0},"sender_excluded":{"type":"integer","minimum":0.0,"title":"Sender Excluded","default":0}},"additionalProperties":false,"type":"object","title":"SkipCounts","description":"Expose only reasons that stop a personal message before extraction."},"SlotAlternative":{"properties":{"source_id":{"type":"string","title":"Source Id"},"source_label":{"type":"string","title":"Source Label","default":""},"record_key":{"type":"string","title":"Record Key","default":""},"value":{"type":"string","title":"Value","default":""},"observed_at":{"type":"string","title":"Observed At","default":""},"evidence":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Evidence"},"record_count":{"type":"integer","title":"Record Count","default":0},"contributor_evidence":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Contributor Evidence"},"position_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position Id"},"qualification":{"additionalProperties":true,"type":"object","title":"Qualification"},"polarity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Polarity"},"frame":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frame"},"claimant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claimant"},"scope":{"title":"Scope"}},"type":"object","required":["source_id"],"title":"SlotAlternative","description":"One source's supported value and original evidence reference."},"SlotConflict":{"properties":{"displayed_decision_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Displayed Decision Token"},"publication_state":{"type":"string","title":"Publication State","default":"conflict"},"key":{"type":"string","title":"Key"},"entity_id":{"type":"string","title":"Entity Id"},"entity_name":{"type":"string","title":"Entity Name","default":""},"predicate":{"type":"string","title":"Predicate"},"record_type":{"type":"string","title":"Record Type","default":""},"alternatives":{"items":{"$ref":"#/components/schemas/SlotAlternative"},"type":"array","title":"Alternatives"},"rule_fallback":{"type":"string","title":"Rule Fallback","default":"adjudicate"},"intra_source":{"title":"Intra Source","default":false},"ruling_conflict":{"type":"boolean","title":"Ruling Conflict","default":false},"schema_conflict":{"title":"Schema Conflict"},"pending_sources":{"items":{"type":"string"},"type":"array","title":"Pending Sources"},"llm_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Verdict"},"llm_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Llm Confidence"},"llm_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm At"},"opened_at":{"type":"string","title":"Opened At","default":""},"expected_fingerprint":{"type":"string","title":"Expected Fingerprint"}},"type":"object","required":["key","entity_id","predicate","expected_fingerprint"],"title":"SlotConflict","description":"One unresolved attribute decision in the shared queue."},"SourceConnect":{"properties":{"profile_name":{"type":"string","maxLength":512,"minLength":1,"title":"Profile Name"},"team_id":{"type":"string","maxLength":512,"minLength":1,"title":"Team Id"},"allowlist":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Allowlist"},"minimum_strength":{"type":"string","enum":["asserted","verified"],"title":"Minimum Strength","default":"asserted"},"intent_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Intent Id"},"provider":{"type":"string","enum":["outlook","gmail","imap"],"title":"Provider","default":"outlook"}},"additionalProperties":false,"type":"object","required":["profile_name","team_id","allowlist","intent_id"],"title":"SourceConnect","description":"Pin an explicit source configuration before the ordinary provider handoff."},"SourceConnection":{"properties":{"connection_id":{"type":"string","maxLength":512,"minLength":1,"title":"Connection Id"},"provider":{"anyOf":[{"type":"string","enum":["outlook","gmail","imap"]},{"type":"null"}],"title":"Provider"},"label":{"anyOf":[{"type":"string","maxLength":320,"minLength":3,"pattern":"^[^\\s<>]+@[^\\s<>]+$"},{"type":"null"}],"title":"Label"},"state":{"type":"string","enum":["active","disconnected","erasing","retired"],"title":"State"},"authorization_generation":{"type":"integer","exclusiveMinimum":0.0,"title":"Authorization Generation"}},"additionalProperties":false,"type":"object","required":["connection_id","provider","label","state","authorization_generation"],"title":"SourceConnection","description":"Expose owner lifecycle controls without administrator configuration."},"SourceErasureProgress":{"properties":{"scope":{"$ref":"#/components/schemas/MailboxScope"},"fence":{"type":"integer","exclusiveMinimum":0.0,"title":"Fence"},"deleted":{"type":"integer","minimum":0.0,"title":"Deleted"},"complete":{"type":"boolean","title":"Complete"},"provider_cleanup":{"anyOf":[{"$ref":"#/components/schemas/ProviderCleanup"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["scope","fence","deleted","complete"],"title":"SourceErasureProgress","description":"A cumulative report from authenticated RO for the exact erased grant."},"SourceEventPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SourceEventView"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"additionalProperties":false,"type":"object","required":["items","next_cursor"],"title":"SourceEventPage","description":"Permit an empty filtered page with a cursor that still makes progress."},"SourceEventView":{"properties":{"event_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Event Id"},"provider":{"type":"string","enum":["outlook","gmail","imap"],"title":"Provider"},"received_at":{"type":"string","format":"date-time","title":"Received At"},"thread_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Thread Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},"additionalProperties":false,"type":"object","required":["event_id","provider","received_at","thread_id","title"],"title":"SourceEventView","description":"Add only the current investigation's curated title to its receipt."},"SourceHealthView":{"properties":{"connection_id":{"type":"string","maxLength":512,"minLength":1,"title":"Connection Id"},"provider":{"anyOf":[{"type":"string","enum":["outlook","gmail","imap"]},{"type":"null"}],"title":"Provider"},"team_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Name"},"enabled":{"type":"boolean","title":"Enabled"},"source_enabled":{"type":"boolean","title":"Source Enabled","default":false},"destinations":{"additionalProperties":{"$ref":"#/components/schemas/DestinationHealthView"},"type":"object","title":"Destinations"},"blocker":{"anyOf":[{"type":"string","enum":["platform_unavailable","sender_verification_unavailable","source_disabled","source_unavailable","routing_unavailable","reconnect_required"]},{"type":"null"}],"title":"Blocker"},"attention":{"anyOf":[{"type":"string","enum":["reconnect_required","permission_denied","throttled","provider_unavailable"]},{"type":"null"}],"title":"Attention"},"health":{"type":"string","enum":["no_data","operational","degraded","partial_outage","major_outage"],"title":"Health"},"timeline":{"items":{"$ref":"#/components/schemas/TimeBucket"},"type":"array","maxItems":168,"minItems":168,"title":"Timeline"}},"additionalProperties":false,"type":"object","required":["connection_id","provider","team_name","enabled","blocker","attention","health","timeline"],"title":"SourceHealthView","description":"Expose no owner, account label, configuration details or message content."},"SourceReconnect":{"properties":{"intent_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Intent Id"},"expected_authorization_generation":{"type":"integer","exclusiveMinimum":0.0,"title":"Expected Authorization Generation"}},"additionalProperties":false,"type":"object","required":["intent_id","expected_authorization_generation"],"title":"SourceReconnect","description":"Reconnect the same owner and provider without changing purpose."},"SourceRecordType":{"properties":{"input_mode":{"type":"string","enum":["structured","extracted"],"title":"Input Mode","default":"structured"},"extraction":{"anyOf":[{"$ref":"#/components/schemas/ExtractionSpec"},{"type":"null"}]},"observation":{"$ref":"#/components/schemas/ObservationSpec"},"record_key":{"type":"string","title":"Record Key"},"match_keys":{"items":{"$ref":"#/components/schemas/MatchKey"},"type":"array","minItems":1,"title":"Match Keys"},"attributes":{"items":{"$ref":"#/components/schemas/AttributeMap"},"type":"array","minItems":1,"title":"Attributes"},"aggregate":{"additionalProperties":{"type":"string","enum":["agree","sum","max","min","newest"]},"type":"object","title":"Aggregate"},"pull":{"anyOf":[{"$ref":"#/components/schemas/PullSpec"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["record_key","match_keys","attributes"],"title":"SourceRecordType","description":"Configure record identity, mapping and optional material extraction."},"SourceReplace":{"properties":{"profile_name":{"type":"string","maxLength":512,"minLength":1,"title":"Profile Name"},"team_id":{"type":"string","maxLength":512,"minLength":1,"title":"Team Id"},"allowlist":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Allowlist"},"minimum_strength":{"type":"string","enum":["asserted","verified"],"title":"Minimum Strength","default":"asserted"},"expected_revision":{"type":"integer","minimum":1.0,"title":"Expected Revision"},"enabled":{"type":"boolean","title":"Enabled","default":false},"sharing_acknowledged":{"type":"boolean","title":"Sharing Acknowledged","default":false}},"additionalProperties":false,"type":"object","required":["profile_name","team_id","allowlist","expected_revision"],"title":"SourceReplace","description":"Require a revision and explicit sharing consent for enabled source settings."},"SourceRequest":{"properties":{"scope":{"$ref":"#/components/schemas/MailboxScope"},"source":{"$ref":"#/components/schemas/SourceVersion"}},"additionalProperties":false,"type":"object","required":["scope","source"],"title":"SourceRequest","description":"Request current authorization for an exact source version."},"SourceSpec":{"properties":{"label":{"type":"string","title":"Label"},"publish_org_wide":{"type":"boolean","title":"Publish Org Wide","default":false},"record_types":{"additionalProperties":{"$ref":"#/components/schemas/SourceRecordType"},"type":"object","title":"Record Types"}},"additionalProperties":false,"type":"object","required":["label"],"title":"SourceSpec","description":"Register one source and its organization-wide publication decision."},"SourceStats":{"properties":{"last_eligible_received_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Eligible Received At"},"delivered":{"type":"integer","minimum":0.0,"title":"Delivered","default":0}},"additionalProperties":false,"type":"object","title":"SourceStats","description":"Keep bounded source progress without addresses, subjects or message content."},"SourceVersion":{"properties":{"connection_id":{"type":"string","maxLength":512,"minLength":1,"title":"Connection Id"},"source_id":{"type":"string","maxLength":512,"minLength":1,"title":"Source Id"},"source_revision":{"type":"integer","exclusiveMinimum":0.0,"title":"Source Revision"},"content_digest":{"type":"string","pattern":"^[0-9a-f]{64}$","title":"Content Digest"}},"additionalProperties":false,"type":"object","required":["connection_id","source_id","source_revision","content_digest"],"title":"SourceVersion","description":"Identify a reconciled source revision within its mailbox connection.\n\n``source_id`` preserves the case-sensitive provider immutable ID. A MIME\ndigest alone never establishes source identity or permission."},"SourceView":{"properties":{"grant":{"$ref":"#/components/schemas/MailboxGrant"},"provider":{"anyOf":[{"type":"string","enum":["outlook","gmail","imap"]},{"type":"null"}],"title":"Provider"},"connected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Connected At"},"label":{"anyOf":[{"type":"string","maxLength":320,"minLength":3,"pattern":"^[^\\s<>]+@[^\\s<>]+$"},{"type":"null"}],"title":"Label"},"connection_id":{"type":"string","title":"Connection Id"},"purpose":{"type":"string","const":"source","title":"Purpose","default":"source"},"revision":{"type":"integer","title":"Revision"},"enabled":{"type":"boolean","title":"Enabled"},"editable":{"type":"boolean","title":"Editable","default":true},"source_enabled":{"type":"boolean","title":"Source Enabled","default":false},"destinations":{"additionalProperties":{"$ref":"#/components/schemas/DestinationView"},"type":"object","title":"Destinations"},"profile_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Name"},"team_id":{"type":"string","title":"Team Id"},"allowlist":{"items":{"type":"string"},"type":"array","title":"Allowlist"},"minimum_strength":{"type":"string","enum":["asserted","verified"],"title":"Minimum Strength"},"sender_verification_available":{"type":"boolean","title":"Sender Verification Available"},"platform_available":{"type":"boolean","title":"Platform Available"},"progress":{"$ref":"#/components/schemas/SourceStats"},"skipped":{"type":"integer","minimum":0.0,"title":"Skipped"},"blocker":{"anyOf":[{"type":"string","enum":["platform_unavailable","sender_verification_unavailable","source_disabled","source_unavailable","routing_unavailable","reconnect_required"]},{"type":"null"}],"title":"Blocker"}},"additionalProperties":false,"type":"object","required":["grant","provider","connection_id","revision","enabled","profile_name","team_id","allowlist","minimum_strength","sender_verification_available","platform_available","progress","skipped","blocker"],"title":"SourceView","description":"Expose source choices and fixed availability reasons without the profile body."},"StartTrialRequest":{"properties":{"plan_id":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Plan the trial anchors on (starter or professional). The anchor must be a non-zero price so the subscription auto-charges at trial end (card on file) unless canceled. Enterprise/unknown plans are rejected."},"success_url":{"type":"string","title":"Success Url","description":"URL Stripe Checkout redirects to after the card is collected. Mirrors checkout (the trial flow now goes through Stripe Checkout)."},"cancel_url":{"type":"string","title":"Cancel Url","description":"URL Stripe Checkout redirects to if the user abandons the card collection step."},"user_uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Uid","description":"Auth0 User ID from the Landing Page onboarding flow. If provided, the trial is started for this user instead of the authenticated service account — mirrors the checkout flow."},"region":{"anyOf":[{"type":"string","enum":["us","eu"]},{"type":"null"}],"title":"Region","description":"Billing region from Landing Page geolocation. Ignored for existing customers (stored region wins). Defaults to 'us'."},"billing_period":{"type":"string","enum":["monthly","annual"],"title":"Billing Period","description":"Billing period the trial's anchor price uses; the user converts to this cadence if they upgrade. Defaults to 'monthly'.","default":"monthly"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata","description":"Optional passthrough metadata (e.g. onboarding context). The trial now flows through Stripe Checkout, which stamps the server-owned trial metadata (user_id, plan_id, region, trial_type, auth0_user_id, source) onto the subscription itself; client keys cannot override it."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Origin identifier, e.g. 'landing_page_onboarding'."}},"type":"object","required":["plan_id","success_url","cancel_url"],"title":"StartTrialRequest","description":"Request to start a card-on-file Brain evaluation trial."},"StartTrialResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Subscription status, 'trialing' on success."},"plan_id":{"type":"string","title":"Plan Id","description":"Plan the trial anchors on."},"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url","description":"Stripe Checkout URL the Landing Page redirects to so the card is collected. None when an existing trial was returned idempotently (no new card to collect; the Landing Page treats 'ok + no checkout_url' as 'go to success')."},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Internal checkout session record ID for the new Checkout session. None on an idempotent existing-trial return."},"already_trialing":{"type":"boolean","title":"Already Trialing","description":"True when an existing trial was returned idempotently (re-click of 'Try Brain').","default":false}},"type":"object","required":["status","plan_id"],"title":"StartTrialResponse","description":"Result of starting (or idempotently re-fetching) a Brain trial."},"StarterSuggestion":{"properties":{"kind":{"type":"string","title":"Kind"},"title":{"type":"string","title":"Title"},"label":{"type":"string","title":"Label","default":""},"prompt":{"type":"string","title":"Prompt","default":""},"href":{"type":"string","title":"Href","default":""}},"type":"object","required":["kind","title"],"title":"StarterSuggestion","description":"One welcome-screen conversation opener the Brain can actually answer.\n\n``kind`` selects the frontend icon/hue (``resume`` / ``self`` / ``entity``\n/ ``task`` / ``contradiction`` / ``retraction`` / ``queue``; an unknown\nvalue renders with a default icon). ``prompt`` is sent verbatim through\nthe normal composer, so the answer rides the same memory recall and\ncitation seams a typed message would. ``href`` cards navigate instead of\nprompting (the queue card): the path is composed server-side from a\nconstant relative prefix plus validated ids only, and the frontend\nrenderer rejects non-relative schemes. A card carries a prompt OR an\nhref, never neither (the route filter enforces it)."},"SteerQueueItem":{"properties":{"steer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Steer Id"},"text":{"type":"string","title":"Text"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"}},"type":"object","required":["text"],"title":"SteerQueueItem","description":"One queued-but-not-yet-drained steer."},"SteerQueueResponse":{"properties":{"steers":{"items":{"$ref":"#/components/schemas/SteerQueueItem"},"type":"array","title":"Steers"}},"type":"object","required":["steers"],"title":"SteerQueueResponse","description":"Pending steers for a thread, oldest first."},"SteerRequest":{"properties":{"text":{"type":"string","maxLength":8000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"SteerRequest","description":"A user message aimed at the thread's live run."},"SteerResponse":{"properties":{"steered":{"type":"boolean","title":"Steered"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"steer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Steer Id"}},"type":"object","required":["steered"],"title":"SteerResponse","description":"Outcome of the steer attempt."},"StoreDeleteRequest":{"properties":{"namespace":{"items":{"type":"string"},"type":"array","title":"Namespace","description":"Namespace path of the item to delete."},"key":{"type":"string","title":"Key","description":"Key of the item to delete."}},"type":"object","required":["namespace","key"],"title":"StoreDeleteRequest","description":"Request body for deleting store items (SDK-compatible)."},"StoreGetResponse":{"properties":{"key":{"type":"string","title":"Key","description":"The item's key within its namespace."},"value":{"title":"Value","description":"The stored value."},"namespace":{"items":{"type":"string"},"type":"array","title":"Namespace","description":"The namespace path where this item is stored."}},"type":"object","required":["key","value","namespace"],"title":"StoreGetResponse","description":"Response model for getting items"},"StoreItem":{"properties":{"key":{"type":"string","title":"Key","description":"The item's key within its namespace."},"value":{"title":"Value","description":"The stored value."},"namespace":{"items":{"type":"string"},"type":"array","title":"Namespace","description":"The namespace path where this item is stored."}},"type":"object","required":["key","value","namespace"],"title":"StoreItem","description":"Store item model"},"StoreListNamespacesRequest":{"properties":{"prefix":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Prefix","description":"Filter by namespace prefix"},"suffix":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Suffix","description":"Filter by namespace suffix"},"max_depth":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Max Depth","description":"Maximum namespace depth to return"},"limit":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Limit","description":"Maximum results","default":100},"offset":{"type":"integer","minimum":0.0,"title":"Offset","description":"Results offset","default":0}},"type":"object","title":"StoreListNamespacesRequest","description":"Request model for listing store namespaces"},"StoreListNamespacesResponse":{"properties":{"namespaces":{"items":{"items":{"type":"string"},"type":"array"},"type":"array","title":"Namespaces"}},"type":"object","required":["namespaces"],"title":"StoreListNamespacesResponse","description":"Response model for listing store namespaces"},"StorePutRequest":{"properties":{"namespace":{"items":{"type":"string"},"type":"array","title":"Namespace","description":"Storage namespace"},"key":{"type":"string","title":"Key","description":"Item key"},"value":{"additionalProperties":true,"type":"object","title":"Value","description":"Item value (must be a JSON object)"}},"type":"object","required":["namespace","key","value"],"title":"StorePutRequest","description":"Request model for storing items"},"StoreSearchRequest":{"properties":{"namespace_prefix":{"items":{"type":"string"},"type":"array","title":"Namespace Prefix","description":"Namespace prefix to search"},"filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filter","description":"Optional dictionary of key-value pairs to filter results."},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query","description":"Search query"},"limit":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Limit","description":"Maximum results","default":20},"offset":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Offset","description":"Results offset","default":0}},"type":"object","required":["namespace_prefix"],"title":"StoreSearchRequest","description":"Request model for searching store items"},"StoreSearchResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StoreItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"StoreSearchResponse","description":"Response model for store search"},"StoredRule":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"instructions":{"type":"string","maxLength":4000,"minLength":1,"title":"Instructions"},"conditions":{"$ref":"#/components/schemas/RuleConditions"},"question":{"anyOf":[{"type":"string","maxLength":1000,"minLength":1},{"type":"null"}],"title":"Question"},"output_kind":{"type":"string","enum":["notification","crm_proposal"],"title":"Output Kind","default":"notification"},"enabled":{"type":"boolean","title":"Enabled","default":false},"id":{"type":"string","title":"Id"},"revision":{"type":"integer","minimum":1.0,"title":"Revision"},"enabled_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Enabled Since"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted":{"type":"boolean","title":"Deleted","default":false}},"additionalProperties":false,"type":"object","required":["name","instructions","id","revision","enabled_since","created_at","updated_at"],"title":"StoredRule","description":"Keep the authoritative revision and database-clock cutoff in private storage."},"SubscriptionCancelRequest":{"properties":{"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","description":"Cancel at end of billing period (true) or immediately (false)","default":true}},"type":"object","title":"SubscriptionCancelRequest","description":"Request schema for canceling subscription."},"SubscriptionPlan":{"type":"string","enum":["starter","professional","enterprise"],"title":"SubscriptionPlan","description":"Available subscription plans."},"SubscriptionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Subscription ID"},"user_id":{"type":"string","title":"User Id","description":"User ID"},"stripe_subscription_id":{"type":"string","title":"Stripe Subscription Id","description":"Stripe subscription ID"},"stripe_customer_id":{"type":"string","title":"Stripe Customer Id","description":"Stripe customer ID"},"plan_id":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Subscription plan"},"status":{"$ref":"#/components/schemas/SubscriptionStatus","description":"Subscription status"},"current_period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period Start","description":"Current billing period start"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End","description":"Current billing period end"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","description":"Whether subscription will cancel at period end"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Subscription creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Subscription last update timestamp"}},"type":"object","required":["id","user_id","stripe_subscription_id","stripe_customer_id","plan_id","status","cancel_at_period_end","created_at","updated_at"],"title":"SubscriptionResponse","description":"Response schema for subscription details."},"SubscriptionStatus":{"type":"string","enum":["active","canceled","incomplete","incomplete_expired","past_due","trialing","unpaid"],"title":"SubscriptionStatus","description":"Stripe subscription statuses."},"SummaryResponse":{"properties":{"status":{"type":"string","enum":["pending","completed"],"title":"Status"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"key_points":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Key Points"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"}},"type":"object","required":["status"],"title":"SummaryResponse","description":"Response model for thread summary."},"TaskCreateRequest":{"properties":{"crm_links":{"anyOf":[{"items":{"$ref":"#/components/schemas/CrmLink"},"type":"array","maxItems":20},{"type":"null"}],"title":"Crm Links","description":"CRM records this task is about ({object, id}); each must be visible to you"},"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"detail":{"type":"string","maxLength":4000,"title":"Detail","default":""},"assignee":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"org_wide":{"type":"boolean","title":"Org Wide","default":false}},"type":"object","required":["title"],"title":"TaskCreateRequest","description":"Create payload; scope defaults to creator-private."},"TaskListResponse":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/TaskOut"},"type":"array","title":"Tasks"},"truncated":{"type":"boolean","title":"Truncated"}},"type":"object","required":["tasks","truncated"],"title":"TaskListResponse","description":"List page + the honest incompleteness signal."},"TaskOut":{"properties":{"type":{"type":"string","const":"task","title":"Type","default":"task"},"task_id":{"type":"string","title":"Task Id"},"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"detail":{"type":"string","maxLength":4000,"title":"Detail","default":""},"status":{"type":"string","enum":["open","working","needs_review","done","dropped"],"title":"Status","default":"open"},"assignee_entity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee Entity"},"assignee_surface":{"type":"string","title":"Assignee Surface","default":""},"assignee_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee User Id"},"requester":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requester"},"memory_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Key"},"source":{"$ref":"#/components/schemas/TaskSource"},"working_thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Working Thread Id"},"review_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Review Note"},"crm_task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crm Task Id"},"crm_links":{"items":{"$ref":"#/components/schemas/CrmLink"},"type":"array","maxItems":20,"title":"Crm Links"},"approvals":{"items":{"type":"string"},"type":"array","title":"Approvals"},"send_back_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Send Back Note"},"dedupe_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dedupe Key"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"allowed_teams":{"items":{"type":"string"},"type":"array","title":"Allowed Teams"},"created_at":{"type":"string","title":"Created At","default":""},"updated_at":{"type":"string","title":"Updated At","default":""},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Changed At"},"creator_user_id":{"type":"string","title":"Creator User Id","default":""},"created_by":{"type":"string","title":"Created By","default":""},"updated_by":{"type":"string","title":"Updated By","default":""},"crm_records":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Crm Records"},"status_label":{"type":"string","title":"Status Label","description":"Return the shared display label of this row's status.","readOnly":true},"closed":{"type":"boolean","title":"Closed","description":"Return whether the row is closed (done or dropped).","readOnly":true}},"type":"object","required":["task_id","title","status_label","closed"],"title":"TaskOut","description":"A ledger row as the API returns it, with the shared status vocabulary.\n\nRead-only additions (never stored): the display label and the closed\nflag every task surface uses (``config.task_vocabulary``)."},"TaskPatchRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Title"},"detail":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Detail"},"assignee":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"org_wide":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Org Wide"},"working_thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Working Thread Id"},"review_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Review Note"},"crm_links":{"anyOf":[{"items":{"$ref":"#/components/schemas/CrmLink"},"type":"array","maxItems":20},{"type":"null"}],"title":"Crm Links"},"status":{"anyOf":[{"type":"string","enum":["open","working","needs_review","done","dropped"]},{"type":"null"}],"title":"Status"}},"type":"object","title":"TaskPatchRequest","description":"Partial update; only provided fields change (read-modify-write)."},"TaskSource":{"properties":{"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","title":"TaskSource","description":"Provenance of a task (all optional)."},"Team":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Team name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Team description"},"id":{"type":"string","title":"Id","description":"Team ID (UUID)"},"organization_id":{"type":"string","title":"Organization Id","description":"Organization ID"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["name","id","organization_id","created_at","updated_at"],"title":"Team","description":"Complete team schema with all fields."},"TeamCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Team name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Team description"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Organization ID (defaults to user's organization)"}},"type":"object","required":["name"],"title":"TeamCreate","description":"Schema for creating a new team.\n\nNote: organization_id is optional. If not provided, it will default to the\nauthenticated user's primary_organization_id."},"TeamDeleteResponse":{"properties":{"relabeled_memories":{"type":"integer","title":"Relabeled Memories","description":"Memory rows whose label named the deleted team and were relabeled (0 when move_memories_to was not given).","default":0},"truncated":{"type":"boolean","title":"Truncated","description":"True when the memory scan stopped at its row ceiling","default":false}},"type":"object","title":"TeamDeleteResponse","description":"Result of a team deletion."},"TeamDisputeOut":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"predicate":{"type":"string","title":"Predicate"},"org_value":{"type":"string","title":"Org Value"},"team_value":{"type":"string","title":"Team Value"},"team_key":{"type":"string","title":"Team Key"},"team_ids":{"items":{"type":"string"},"type":"array","title":"Team Ids"},"all_teams":{"type":"boolean","title":"All Teams","default":false},"admins_only":{"type":"boolean","title":"Admins Only","default":false},"observed_at":{"type":"string","title":"Observed At","default":""}},"type":"object","required":["entity_id","predicate","org_value","team_value","team_key"],"title":"TeamDisputeOut","description":"An org value and a team value that disagree on one predicate.\n\n``team_ids`` is the dispute's label, the meet of its two rows' labels:\nfor an org-wide org value, the team's label. ``all_teams`` is True when\nonly members of every listed team read it (two team rows' meet)."},"TeamMemberAdd":{"properties":{"role":{"type":"string","title":"Role","description":"Member role: owner, admin, or member","default":"member"},"user_id":{"type":"string","title":"User Id","description":"User ID to add to team (UUID)"}},"type":"object","required":["user_id"],"title":"TeamMemberAdd","description":"Schema for adding a member to a team."},"TeamMemberResponse":{"properties":{"user_id":{"type":"string","title":"User Id","description":"User ID (UUID)"},"team_id":{"type":"string","title":"Team Id","description":"Team ID (UUID)"},"role":{"type":"string","title":"Role","description":"Member role"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Membership creation timestamp"}},"type":"object","required":["user_id","team_id","role","created_at"],"title":"TeamMemberResponse","description":"Response schema for team member operations."},"TeamRowRuling":{"properties":{"key":{"type":"string","minLength":1,"title":"Key"},"valid_to":{"type":"string","title":"Valid To","default":""}},"type":"object","required":["key"],"title":"TeamRowRuling","description":"One admin ruling on a team row, addressed by the ``team_key`` shown."},"TeamUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name","description":"Updated team name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Updated team description"}},"type":"object","title":"TeamUpdate","description":"Schema for updating team details."},"TestProbeResult":{"properties":{"ok":{"type":"boolean","title":"Ok"},"provisioning_state":{"$ref":"#/components/schemas/integration__schemas__encryption_config__ProvisioningState"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Redacted KmsCallError message when ``ok=False``. Customer project_id is never present in this string."},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail","description":"Human-readable next-step guidance, e.g. \"grant roles/cloudkms.cryptoKeyEncrypterDecrypter to <platform SA email>\"."}},"type":"object","required":["ok","provisioning_state"],"title":"TestProbeResult","description":"``POST .../encryption/test`` response.\n\nThe probe attempts a real KMS ``encrypt`` call against the\ncustomer's KEK. Success flips ``provisioning_state`` to\n``active``; failure records the error and leaves the state\nunchanged (or flips to ``failed`` if it was previously active —\nthat's a meaningful regression worth surfacing)."},"Thread":{"properties":{"thread_id":{"type":"string","title":"Thread Id","description":"Unique identifier for the thread."},"status":{"type":"string","title":"Status","description":"Current thread status: idle, busy, interrupted, or error.","default":"idle"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Arbitrary metadata attached to the thread."},"user_id":{"type":"string","title":"User Id","description":"Identifier of the user who owns this thread."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the thread was created."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Timestamp when the thread was last updated."}},"type":"object","required":["thread_id","user_id","created_at","updated_at"],"title":"Thread","description":"Thread entity model\n\nStatus values: idle, busy, interrupted, error"},"ThreadCheckpoint":{"properties":{"checkpoint_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Id"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"checkpoint_ns":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Ns","default":""}},"type":"object","title":"ThreadCheckpoint","description":"Checkpoint identifier for thread history"},"ThreadCheckpointPostRequest":{"properties":{"checkpoint":{"$ref":"#/components/schemas/ThreadCheckpoint","description":"Checkpoint to fetch"},"subgraphs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Subgraphs","description":"Include subgraph states","default":false}},"type":"object","required":["checkpoint"],"title":"ThreadCheckpointPostRequest","description":"Request model for fetching thread checkpoint"},"ThreadCommand":{"properties":{"id":{"type":"integer","title":"Id","description":"Client-assigned command id, echoed in the response."},"method":{"type":"string","title":"Method","description":"Command method, e.g. run.start or input.respond."},"params":{"additionalProperties":true,"type":"object","title":"Params","description":"Method parameters."}},"type":"object","required":["id","method"],"title":"ThreadCommand","description":"Body for ``POST /threads/{thread_id}/commands`` (JSON-RPC style)."},"ThreadCreate":{"properties":{"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Thread metadata"},"initial_state":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Initial State","description":"LangGraph initial state"},"threadId":{"anyOf":[{"type":"string","maxLength":255,"minLength":1,"pattern":"\\S"},{"type":"null"}],"title":"Threadid","description":"Optional client-provided thread ID for idempotent creation. Omit or null to let the server generate a UUID. When set, 1–255 characters and not blank (must fit PostgreSQL btree keys uncompressed)."},"ifExists":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ifexists","description":"Behavior when thread exists: 'raise' (default) or 'do_nothing'","default":"raise"},"ttl":{"anyOf":[{"$ref":"#/components/schemas/ThreadTTLSpec"},{"type":"null"}],"description":"Per-thread TTL override; requires TTL to be configured server-side or default_ttl set"}},"type":"object","title":"ThreadCreate","description":"Request model for creating threads"},"ThreadHistoryRequest":{"properties":{"limit":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Limit","description":"Number of states to return","default":10},"before":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"},{"type":"null"}],"title":"Before","description":"Return states before this checkpoint (checkpoint ID string, raw checkpoint dict, or RunnableConfig with 'configurable' key)"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Filter by metadata"},"checkpoint":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Checkpoint","description":"Checkpoint for subgraph filtering"},"subgraphs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Subgraphs","description":"Include states from subgraphs","default":false},"checkpoint_ns":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Ns","description":"Checkpoint namespace"}},"type":"object","title":"ThreadHistoryRequest","description":"Request model for thread history endpoint"},"ThreadList":{"properties":{"threads":{"items":{"$ref":"#/components/schemas/Thread"},"type":"array","title":"Threads"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["threads","total"],"title":"ThreadList","description":"Response model for listing threads"},"ThreadPruneResponse":{"properties":{"deleted":{"type":"integer","title":"Deleted","description":"Expired threads fully deleted (strategy 'delete')","default":0},"pruned":{"type":"integer","title":"Pruned","description":"Expired threads whose history was pruned (strategy 'keep_latest')","default":0}},"type":"object","title":"ThreadPruneResponse","description":"Response model for POST /threads/prune"},"ThreadSearchRequest":{"properties":{"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Metadata filters"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Thread status filter (idle, busy, interrupted, error)"},"limit":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Limit","description":"Maximum results","default":20},"offset":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Offset","description":"Results offset","default":0},"order_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order By","description":"DEPRECATED: use sort_by + sort_order. Legacy single-field form, e.g. 'updated_at ASC'.","default":"created_at DESC","deprecated":true},"sort_by":{"anyOf":[{"type":"string","enum":["thread_id","status","created_at","updated_at"]},{"type":"null"}],"title":"Sort By","description":"Field to sort by (SDK-compatible). Takes precedence over order_by."},"sort_order":{"anyOf":[{"type":"string","enum":["asc","desc"]},{"type":"null"}],"title":"Sort Order","description":"Sort direction (SDK-compatible). Defaults to 'desc' when sort_by is set."}},"type":"object","title":"ThreadSearchRequest","description":"Request model for thread search"},"ThreadState":{"properties":{"values":{"additionalProperties":true,"type":"object","title":"Values","description":"Channel values (messages, etc.)"},"next":{"items":{"type":"string"},"type":"array","title":"Next","description":"Next nodes to execute"},"tasks":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tasks","description":"Tasks to execute"},"interrupts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Interrupts","description":"Interrupt data"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Checkpoint metadata"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp of state creation"},"checkpoint":{"$ref":"#/components/schemas/ThreadCheckpoint","description":"Current checkpoint"},"parent_checkpoint":{"anyOf":[{"$ref":"#/components/schemas/ThreadCheckpoint"},{"type":"null"}],"description":"Parent checkpoint"},"checkpoint_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Id","description":"Checkpoint ID (for backward compatibility)"},"parent_checkpoint_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Checkpoint Id","description":"Parent checkpoint ID (for backward compatibility)"}},"type":"object","required":["values","checkpoint"],"title":"ThreadState","description":"Thread state model for history endpoint"},"ThreadStateUpdate":{"properties":{"values":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Values","description":"The values to update the state with"},"checkpoint":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Checkpoint","description":"The checkpoint to update the state of"},"checkpoint_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Id","description":"Optional checkpoint ID to update from"},"as_node":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"As Node","description":"Update the state as if this node had just executed"},"subgraphs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Subgraphs","description":"Include states from subgraphs","default":false},"checkpoint_ns":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Ns","description":"Checkpoint namespace"}},"type":"object","title":"ThreadStateUpdate","description":"Request model for updating thread state"},"ThreadStateUpdateResponse":{"properties":{"checkpoint":{"additionalProperties":true,"type":"object","title":"Checkpoint","description":"The checkpoint that was created/updated"}},"type":"object","required":["checkpoint"],"title":"ThreadStateUpdateResponse","description":"Response model for thread state update"},"ThreadTTLSpec":{"properties":{"default_ttl":{"anyOf":[{"type":"number","maximum":1000000000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Default Ttl","description":"Thread TTL in minutes; also accepted under the key \"ttl\" (LangGraph SDK compatibility). Falls back to the server default when omitted"},"strategy":{"anyOf":[{"type":"string","enum":["delete","keep_latest"]},{"type":"null"}],"title":"Strategy","description":"Expiry strategy: 'delete' removes the thread, 'keep_latest' prunes history"}},"type":"object","title":"ThreadTTLSpec","description":"Per-thread TTL override supplied on thread creation.\n\nThe langgraph SDK sends the minutes value as \"ttl\" while issue #288 names\nit \"default_ttl\" — AliasChoices accepts both spellings."},"ThreadUpdate":{"properties":{"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Thread metadata to update"}},"type":"object","title":"ThreadUpdate","description":"Request model for updating threads"},"TimeBucket":{"properties":{"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"status":{"type":"string","enum":["no_data","operational","degraded","partial_outage","major_outage"],"title":"Status"},"total":{"type":"integer","minimum":0.0,"title":"Total"},"errors":{"type":"integer","minimum":0.0,"title":"Errors"},"error_rate":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Error Rate"},"investigated":{"type":"integer","minimum":0.0,"title":"Investigated"},"skipped":{"type":"integer","minimum":0.0,"title":"Skipped"},"destinations":{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object","title":"Destinations"}},"additionalProperties":false,"type":"object","required":["timestamp","status","total","errors","error_rate","investigated","skipped"],"title":"TimeBucket","description":"Match webhook health thresholds while distinguishing source outcomes."},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["access_token","token_type","expires_in"],"title":"Token","description":"Token response model"},"TokenResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}},"type":"object","required":["success","message"],"title":"TokenResponse","description":"OAuth token response."},"TokenStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"has_token":{"type":"boolean","title":"Has Token"},"has_refresh_token":{"type":"boolean","title":"Has Refresh Token"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}},"type":"object","required":["status","has_token","has_refresh_token"],"title":"TokenStatusResponse","description":"Token status response."},"Tolerance":{"properties":{"abs":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Abs"},"rel":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rel"},"days":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Days"}},"additionalProperties":false,"type":"object","title":"Tolerance","description":"Declare comparison tolerances in field units."},"TransactionType":{"type":"string","enum":["allocation","usage","refund","adjustment","overage_usage","prepaid_purchase","prepaid_usage"],"title":"TransactionType","description":"Credit transaction types."},"TrendPoint":{"properties":{"month":{"type":"string","title":"Month","description":"Calendar month the memories were created, YYYY-MM"},"label":{"type":"string","title":"Label","description":"Category display label (same case-insensitive folding and curated-spelling precedence as ``categories``)"},"count":{"type":"integer","title":"Count","description":"Live memories created that month in this category"}},"type":"object","required":["month","label","count"],"title":"TrendPoint","description":"Live-memory count for one category in one calendar month."},"TruncateRequest":{"properties":{"namespaces":{"items":{"items":{"type":"string"},"type":"array"},"type":"array","minItems":1,"title":"Namespaces","description":"Namespace prefixes to truncate (e.g. ``[['episodes'], ['knowledge']]``). The org_id is appended by the helper. For a re-onboard wipe also include ``['_amem_meta']`` + ``['_amem_redirects']`` + any custom-domain heads, or stale rows will mismatch the next forward migration's reconciliation."},"dry_run":{"type":"boolean","title":"Dry Run","description":"When True (the default) returns counts without deleting. Set False to actually wipe rows.","default":true}},"type":"object","required":["namespaces"],"title":"TruncateRequest","description":"POST body for ``/memory-db/truncate``.\n\n``namespaces`` is a list of namespace tuples (e.g.\n``[[\"episodes\"], [\"knowledge\"]]``) — the tuple shape lets a caller\ntarget sub-namespaces if needed. ``dry_run`` defaults to ``True``\nso an accidental click counts rather than deletes.\n\nReminder for operators running a wipe-and-re-onboard sequence\n(DELETE → re-register → migrate): the OPERATIONAL heads\n``_amem_meta`` (evolution counters) and ``_amem_redirects`` (A-mem\nredirect chains) persist on the BYO instance independent of\n``episodes`` / ``knowledge`` / ``profile_metrics`` / ``playbooks``.\nA truncate that omits them leaves stale counter + redirect rows\nthat mismatch the next forward migration's reconciliation phase\n(``report.ok=False``) → the operator sees \"migration broken\" when\nthey actually have residue from the prior cycle. To wipe the\nBYO instance comprehensively, include ALL of:\n    [[\"episodes\"], [\"knowledge\"], [\"profile_metrics\"],\n     [\"playbooks\"], [\"_amem_meta\"], [\"_amem_redirects\"]]\nplus any custom-domain heads the org has registered."},"UnsupportedFact":{"properties":{"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status"},"review_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Reason"},"review_evidence":{"items":{"type":"string"},"type":"array","title":"Review Evidence"},"review_progress":{"anyOf":[{"$ref":"#/components/schemas/CurationReviewProgress"},{"type":"null"}]},"entity_id":{"type":"string","title":"Entity Id"},"entity_name":{"type":"string","title":"Entity Name","default":""},"predicate":{"type":"string","title":"Predicate"},"value":{"type":"string","title":"Value"},"unsupported_at":{"type":"string","title":"Unsupported At"}},"type":"object","required":["entity_id","predicate","value","unsupported_at"],"title":"UnsupportedFact","description":"A fact whose value the grounding ladder could not support anywhere.\n\nQueue item for the curation rail: the dream pass established that no\nmemory in the Brain states this value (stamped ``unsupported_at``),\nwhich makes it a stale-fact/contradiction candidate awaiting a human\nruling: remove (DELETE the fact, writes a value veto) or keep."},"UpdateTeamMemberRole":{"properties":{"role":{"type":"string","title":"Role","description":"New role: owner, admin, or member"}},"type":"object","required":["role"],"title":"UpdateTeamMemberRole","description":"Schema for updating a team member's role."},"UpgradeRequest":{"properties":{"target_plan":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Target plan to upgrade to (e.g., 'professional')"}},"type":"object","required":["target_plan"],"title":"UpgradeRequest","description":"Request schema for upgrading subscription to a higher tier."},"UpgradeResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether upgrade was successful"},"subscription_id":{"type":"string","title":"Subscription Id","description":"Stripe subscription ID"},"previous_plan":{"type":"string","title":"Previous Plan","description":"Previous plan name"},"new_plan":{"type":"string","title":"New Plan","description":"New plan name after upgrade"},"credits_added":{"type":"integer","title":"Credits Added","description":"Additional credits added for the upgrade"}},"type":"object","required":["success","subscription_id","previous_plan","new_plan","credits_added"],"title":"UpgradeResponse","description":"Response schema for subscription upgrade."},"UpsertBody":{"properties":{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":2000,"minItems":1,"title":"Items"},"asImport":{"type":"boolean","title":"Asimport","description":"An import: createdBy.source IMPORT; a known record only gets empty fields filled, a trashed one is skipped (crm/upsert.py)","default":false},"confirmPromotion":{"type":"boolean","title":"Confirmpromotion","description":"Resend with true after a 409 PROMOTION_CONFIRM_REQUIRED: the member confirmed promoting these prospects (it shares them with the Brain)","default":false}},"type":"object","required":["items"],"title":"UpsertBody","description":"Body of ``POST .../records/upsert`` (rows in record API shape)."},"UsagePackPreset":{"type":"string","enum":["10","25","50"],"title":"UsagePackPreset","description":"Available preset usage pack amounts."},"UserCreate":{"properties":{"username":{"type":"string","maxLength":50,"minLength":3,"title":"Username","description":"Username (3-50 characters)"},"password":{"type":"string","minLength":8,"title":"Password","description":"Password (minimum 8 characters)"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Email address"},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name","description":"Full name"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Organization ID (slug)"},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether user has superuser privileges","default":false}},"type":"object","required":["username","password"],"title":"UserCreate","description":"Schema for creating a new internal user."},"UserListResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/UserResponse"},"type":"array","title":"Users","description":"List of users"},"total":{"type":"integer","title":"Total","description":"Total number of users"}},"type":"object","required":["users","total"],"title":"UserListResponse","description":"Response schema for listing users."},"UserResponse":{"properties":{"id":{"type":"string","title":"Id","description":"User ID (UUID)"},"username":{"type":"string","title":"Username","description":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Email address"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Full name"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Organization ID"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether user is active"},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether user is superuser"},"auth_source":{"type":"string","title":"Auth Source","description":"Authentication source (internal/external)"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"User creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","username","is_active","is_superuser","auth_source","created_at","updated_at"],"title":"UserResponse","description":"Public user response schema (no password)."},"UserSyncData":{"properties":{"external_id":{"type":"string","title":"External Id","description":"User ID from Landing/Auth app"},"username":{"type":"string","title":"Username","description":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email address"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Full name"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Organization ID"},"roles":{"items":{"type":"string"},"type":"array","title":"Roles","description":"User roles","default":["user"]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether user is active","default":true},"stripe_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Region","description":"Stripe region: 'us' or 'eu' (from geolocation)"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Verified phone number from Auth0 (E.164 format)"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["external_id","username","updated_at"],"title":"UserSyncData","description":"User data from Landing/Auth app for synchronization."},"UserSyncPayload":{"properties":{"action":{"type":"string","title":"Action","description":"Action: created, updated, deleted"},"user_id":{"type":"string","title":"User Id","description":"External user ID"},"user_data":{"anyOf":[{"$ref":"#/components/schemas/UserSyncData"},{"type":"null"}],"description":"User data (for create/update)"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp","description":"Event timestamp"}},"type":"object","required":["action","user_id"],"title":"UserSyncPayload","description":"Complete payload for user synchronization webhook."},"UserSyncResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Sync status: success, failed"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Optional message"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"Local user ID if created/updated"}},"type":"object","required":["status"],"title":"UserSyncResponse","description":"Response from user sync webhook."},"UserUpdate":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Updated email address"},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name","description":"Updated full name"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Updated organization ID"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Whether user is active"},"roles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Roles","description":"Updated user roles"}},"type":"object","title":"UserUpdate","description":"Schema for updating user details."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifySpec":{"properties":{"server":{"type":"string","title":"Server"},"tool":{"type":"string","title":"Tool"},"args_template":{"additionalProperties":{"type":"string"},"type":"object","title":"Args Template"},"result_path":{"type":"string","title":"Result Path"},"version_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Path"},"observed_at_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observed At Path"},"read_only_verified":{"type":"boolean","title":"Read Only Verified","default":false}},"additionalProperties":false,"type":"object","required":["server","tool","result_path"],"title":"VerifySpec","description":"Configure a read that supplies remote write evidence."},"WebhookSourceCreateRequest":{"properties":{"provider":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_-]*$","title":"Provider"},"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"default_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Profile"},"team_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Team Id","description":"Team whose memory alert runs from this source recall and write. Omit to keep the stored pin; null clears it (org-wide)."}},"type":"object","required":["provider","name"],"title":"WebhookSourceCreateRequest","description":"Request schema for creating/updating a webhook source."},"WebhookSourceResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"default_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Profile"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["provider","name","description","default_profile"],"title":"WebhookSourceResponse","description":"Response schema for a webhook source."},"WebhookSourceUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Description"},"default_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Profile"},"team_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Team Id","description":"Team whose memory alert runs from this source recall and write. Omit to keep the stored pin; null clears it (org-wide)."}},"type":"object","title":"WebhookSourceUpdateRequest","description":"Request schema for updating a webhook source (partial)."},"WorkThreadRequest":{"properties":{"threadId":{"type":"string","maxLength":128,"minLength":1,"title":"Threadid"}},"type":"object","required":["threadId"],"title":"WorkThreadRequest","description":"Body of ``POST .../work-thread``."},"WriteBackPolicy":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"max_writes_per_run":{"type":"integer","maximum":2000.0,"minimum":1.0,"title":"Max Writes Per Run","default":100}},"additionalProperties":false,"type":"object","title":"WriteBackPolicy","description":"Bound explicitly enabled source write-back runs."},"WriteBackSpec":{"properties":{"source":{"type":"string","title":"Source"},"executor":{"type":"string","enum":["mcp","native"],"title":"Executor","default":"mcp"},"server":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Server"},"tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"},"args_template":{"additionalProperties":{"type":"string"},"type":"object","title":"Args Template"},"max_staleness_hours":{"type":"integer","maximum":8760.0,"minimum":1.0,"title":"Max Staleness Hours","default":72},"verify":{"anyOf":[{"$ref":"#/components/schemas/VerifySpec"},{"type":"null"}]},"expected_version_arg":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Version Arg"},"idempotency_arg":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Arg"}},"additionalProperties":false,"type":"object","required":["source"],"title":"WriteBackSpec","description":"Configure an explicitly verified source update.\n\n``executor=\"mcp\"`` (default) writes through the source's MCP server:\nserver, tool, arguments and a verification read are required.\n``executor=\"native\"`` writes the platform's own CRM (source ``crm``)\ndirectly, verified against the live row in the same transaction\n(``crm.native_writeback``); it takes no MCP settings."},"_Attachment":{"properties":{"kind":{"type":"string","enum":["reference","template","script"],"title":"Kind"},"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"},"content":{"type":"string","maxLength":100000,"minLength":1,"title":"Content"}},"type":"object","required":["kind","name","content"],"title":"_Attachment"},"_ConfigRequest":{"properties":{"version":{"type":"integer","const":1,"title":"Version","default":1},"record_types":{"additionalProperties":{"$ref":"#/components/schemas/RecordType"},"type":"object","title":"Record Types"},"sources":{"additionalProperties":{"$ref":"#/components/schemas/SourceSpec"},"type":"object","title":"Sources"},"adjudicator":{"$ref":"#/components/schemas/AdjudicatorSpec"},"write_back":{"$ref":"#/components/schemas/WriteBackPolicy"},"expected_revision":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Revision"}},"additionalProperties":false,"type":"object","title":"_ConfigRequest","description":"Accept a complete semantic configuration with its edit precondition."},"_ConfigResponse":{"properties":{"version":{"type":"integer","const":1,"title":"Version","default":1},"record_types":{"additionalProperties":{"$ref":"#/components/schemas/RecordType"},"type":"object","title":"Record Types"},"sources":{"additionalProperties":{"$ref":"#/components/schemas/SourceSpec"},"type":"object","title":"Sources"},"adjudicator":{"$ref":"#/components/schemas/AdjudicatorSpec"},"write_back":{"$ref":"#/components/schemas/WriteBackPolicy"},"revision":{"type":"integer","minimum":1.0,"title":"Revision"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"updated_by":{"type":"string","title":"Updated By"},"accepted":{"type":"boolean","title":"Accepted","default":true},"queued":{"type":"boolean","title":"Queued","default":false},"pending_invalidations":{"type":"integer","title":"Pending Invalidations","default":0}},"additionalProperties":false,"type":"object","required":["revision","created_at","updated_at","updated_by"],"title":"_ConfigResponse","description":"Expose configuration and distinguish saved state from invalidation debt."},"_CreatePlaybook":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"},"trigger_description":{"type":"string","maxLength":4000,"minLength":1,"title":"Trigger Description"},"body":{"type":"string","maxLength":8000,"minLength":1,"title":"Body"},"target":{"type":"string","enum":["reasoning","execution"],"title":"Target"}},"type":"object","required":["name","trigger_description","body","target"],"title":"_CreatePlaybook"},"_DenyListEntry":{"properties":{"pattern":{"type":"string","minLength":1,"title":"Pattern","description":"Regex pattern or literal prefix"},"is_regex":{"type":"boolean","title":"Is Regex","description":"Treat pattern as regex","default":false},"description":{"type":"string","title":"Description","description":"Human-readable reason","default":""},"category":{"type":"string","title":"Category","description":"Grouping: kubectl, gcloud, general","default":""}},"type":"object","required":["pattern"],"title":"_DenyListEntry","description":"Schema for a single deny list entry."},"_DenyListResponse":{"properties":{"entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Entries","description":"Current deny list entries"},"count":{"type":"integer","title":"Count","description":"Number of entries"},"level":{"type":"string","title":"Level","description":"Deny list level: provider or cluster"},"resource_key":{"type":"string","title":"Resource Key","description":"Provider key or cluster name"}},"type":"object","required":["entries","count","level","resource_key"],"title":"_DenyListResponse","description":"Response schema for a deny list."},"_DenyListUpdate":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/_DenyListEntry"},"type":"array","title":"Entries","description":"Full replacement deny list entries"}},"type":"object","required":["entries"],"title":"_DenyListUpdate","description":"Request schema for replacing a deny list."},"_DiscoveryCommitRequest":{"properties":{"label":{"type":"string","maxLength":64,"title":"Label","default":""},"record_type":{"type":"string","maxLength":128,"title":"Record Type","default":""},"entity_type":{"type":"string","maxLength":40,"title":"Entity Type","default":"unknown"},"selected":{"items":{"type":"integer"},"type":"array","title":"Selected"},"edits":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Edits"},"publish_org_wide":{"type":"boolean","title":"Publish Org Wide","default":false},"expected_revision":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Revision"}},"additionalProperties":false,"type":"object","title":"_DiscoveryCommitRequest","description":"Commit reviewed fields from one probe into the reconciliation config."},"_DismissBody":{"properties":{"watermark_ts":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Watermark Ts","description":"The generation shown on the card. Required in practice: without it a stale card can suppress a window nobody reviewed."}},"type":"object","title":"_DismissBody","description":"Which readiness generation the caller believes it is dismissing."},"_DisqualifiersMetadataPatch":{"properties":{"interest_seed_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Interest Seed Template"},"verification_protocol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Protocol"},"info_seeker_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Info Seeker Prompt"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"additionalProperties":false,"type":"object","title":"_DisqualifiersMetadataPatch","description":"Patch the top-level ``Disqualifiers`` metadata (NOT patterns).\n\nAll fields default to ``None`` = \"leave alone\". Use the patterns\nsub-resource to edit individual rules.\n\nM-4: ``extra=\"forbid\"`` so a typo like ``verifcation_protocol``\nreturns 422 instead of silently accepting the body and updating\nnothing — the kind of bug that makes a customer think the API is\nbroken.\n\nAdversarial-pass-2 H-A: a non-``None`` ``interest_seed_template``\nis run through ``_validate_interest_seed_template`` here. The\nfield-validator on ``Disqualifiers`` doesn't fire when the store\nconstructs the new sub-pack via ``model_copy(update=...)``, so\nenforcing it at the route boundary is the only path that catches\nbad templates introduced via PATCH. Defense in depth at the\nstore layer is in ``RubricStore.replace_disqualifiers_metadata``.\n\nSub-pack ``version`` is intentionally NOT patchable from this\nsurface; it's engine-managed. Bump via full-rubric PUT if needed."},"_DraftApplyRequest":{"properties":{"pattern_names":{"items":{"type":"string"},"type":"array","title":"Pattern Names"},"factor_names":{"items":{"type":"string"},"type":"array","title":"Factor Names"}},"additionalProperties":false,"type":"object","title":"_DraftApplyRequest","description":"Selected names from the staged draft (content immutable)."},"_DraftApplyResponse":{"properties":{"rubric_id":{"type":"string","title":"Rubric Id"},"applied_patterns":{"items":{"type":"string"},"type":"array","title":"Applied Patterns"},"applied_factors":{"items":{"type":"string"},"type":"array","title":"Applied Factors"}},"type":"object","required":["rubric_id","applied_patterns","applied_factors"],"title":"_DraftApplyResponse","description":"What apply promoted into the active rubric."},"_DraftDetail":{"properties":{"key":{"type":"string","title":"Key"},"rubric_id":{"type":"string","title":"Rubric Id"},"profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile"},"created_at":{"type":"string","title":"Created At"},"staged_by":{"type":"string","title":"Staged By"},"status":{"type":"string","title":"Status"},"new_patterns":{"type":"integer","title":"New Patterns"},"kept_weights":{"type":"integer","title":"Kept Weights"},"decision_count":{"type":"integer","title":"Decision Count"},"patch":{"additionalProperties":true,"type":"object","title":"Patch"}},"type":"object","required":["key","rubric_id","created_at","staged_by","status","new_patterns","kept_weights","decision_count","patch"],"title":"_DraftDetail","description":"A staged draft with its full induction patch."},"_DraftDigest":{"properties":{"key":{"type":"string","title":"Key"},"rubric_id":{"type":"string","title":"Rubric Id"},"profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile"},"created_at":{"type":"string","title":"Created At"},"staged_by":{"type":"string","title":"Staged By"},"status":{"type":"string","title":"Status"},"new_patterns":{"type":"integer","title":"New Patterns"},"kept_weights":{"type":"integer","title":"Kept Weights"},"decision_count":{"type":"integer","title":"Decision Count"}},"type":"object","required":["key","rubric_id","created_at","staged_by","status","new_patterns","kept_weights","decision_count"],"title":"_DraftDigest","description":"One staged-draft summary row."},"_DraftInduceRequest":{"properties":{"profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile","description":"Scope harvesting to one profile."}},"additionalProperties":false,"type":"object","title":"_DraftInduceRequest","description":"Body for POST /{rubric_id}/drafts/induce."},"_DraftInduceResponse":{"properties":{"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"decisions":{"type":"integer","title":"Decisions"},"new_patterns":{"type":"integer","title":"New Patterns"},"kept_weights":{"type":"integer","title":"Kept Weights"}},"type":"object","required":["key","decisions","new_patterns","kept_weights"],"title":"_DraftInduceResponse","description":"Induction outcome; ``key`` is None when nothing was proposed."},"_DraftListResponse":{"properties":{"drafts":{"items":{"$ref":"#/components/schemas/_DraftDigest"},"type":"array","title":"Drafts"}},"type":"object","required":["drafts"],"title":"_DraftListResponse","description":"Staged drafts, newest first."},"_FieldRuleRequest":{"properties":{"predicate":{"type":"string","title":"Predicate"},"value_type":{"type":"string","enum":["string","number","money","date","enum","email","domain","phone","bool"],"title":"Value Type","default":"string"},"normalize":{"items":{"type":"string","enum":["trim","casefold","strip_punct","digits_only","domain","domain_of_email","iso_date","currency_minor"]},"type":"array","title":"Normalize"},"synonyms":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Synonyms"},"tolerance":{"anyOf":[{"$ref":"#/components/schemas/Tolerance"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"authority":{"items":{"type":"string"},"type":"array","title":"Authority"},"fallback":{"type":"string","enum":["authority_only","newest_observed","majority","adjudicate"],"title":"Fallback","default":"adjudicate"},"write_back":{"anyOf":[{"$ref":"#/components/schemas/WriteBackSpec"},{"type":"null"}]},"scope_dimensions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scope Dimensions","description":"Required applicability dimensions; [] explicitly permits unscoped derived claims."},"temporal_value_role":{"anyOf":[{"type":"string","const":"event"},{"type":"null"}],"title":"Temporal Value Role","description":"Explicitly declares that the entire predicate value is an event date; never inferred from its name."},"expected_revision":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Revision"}},"additionalProperties":false,"type":"object","required":["predicate"],"title":"_FieldRuleRequest","description":"Accept one field rule and an edit precondition."},"_GateDecisionSummary":{"properties":{"total":{"type":"integer","title":"Total"},"needs_review":{"type":"integer","title":"Needs Review"},"by_gate_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Gate Status"},"by_lifecycle_state":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Lifecycle State"}},"type":"object","required":["total","needs_review","by_gate_status","by_lifecycle_state"],"title":"_GateDecisionSummary"},"_MaterialAnchor":{"properties":{"object":{"type":"string","enum":["company","person"],"title":"Object"},"recordId":{"type":"string","maxLength":64,"minLength":1,"title":"Recordid"}},"type":"object","required":["object","recordId"],"title":"_MaterialAnchor","description":"The CRM record a material belongs to (a company's or person's Files tab)."},"_MaterialRetryRequest":{"properties":{"new_revision":{"type":"boolean","title":"New Revision","default":false}},"additionalProperties":false,"type":"object","title":"_MaterialRetryRequest","description":"Choose between durable replay and an explicit new extraction revision."},"_MediaStorageSetupRequest":{"properties":{"provider_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Provider Key"},"bucket":{"anyOf":[{"type":"string","maxLength":222,"minLength":3,"pattern":"^[a-z0-9][a-z0-9._-]+$"},{"type":"null"}],"title":"Bucket"}},"type":"object","title":"_MediaStorageSetupRequest","description":"One-call media-storage setup (durable chat/channel attachments)."},"_OrgPlaybookListResponse":{"properties":{"summary":{"$ref":"#/components/schemas/_GateDecisionSummary"},"playbooks":{"items":{"$ref":"#/components/schemas/_PlaybookResponse"},"type":"array","title":"Playbooks"}},"type":"object","required":["summary","playbooks"],"title":"_OrgPlaybookListResponse"},"_PlaybookListResponse":{"properties":{"playbooks":{"items":{"$ref":"#/components/schemas/_PlaybookResponse"},"type":"array","title":"Playbooks"}},"type":"object","required":["playbooks"],"title":"_PlaybookListResponse"},"_PlaybookResponse":{"properties":{"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"trigger_description":{"type":"string","title":"Trigger Description"},"body":{"type":"string","title":"Body"},"target":{"type":"string","enum":["reasoning","execution"],"title":"Target"},"profile_name":{"type":"string","title":"Profile Name"},"created_by":{"type":"string","title":"Created By"},"lifecycle_state":{"type":"string","title":"Lifecycle State"},"pinned":{"type":"boolean","title":"Pinned"},"event_time":{"type":"string","title":"Event Time","default":""},"attachments":{"items":{"$ref":"#/components/schemas/_Attachment"},"type":"array","title":"Attachments","default":[]},"gate_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gate Status"},"gate_rank_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gate Rank Score"},"gate_confidence_delta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gate Confidence Delta"},"gate_fired_defeaters":{"items":{"type":"string"},"type":"array","title":"Gate Fired Defeaters","default":[]},"gate_shadow_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gate Shadow Verdict"},"gate_shadow_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gate Shadow Score"},"gate_decided_at":{"type":"string","title":"Gate Decided At","default":""}},"type":"object","required":["key","name","trigger_description","body","target","profile_name","created_by","lifecycle_state","pinned"],"title":"_PlaybookResponse"},"_PolicyBody":{"properties":{"match":{"$ref":"#/components/schemas/PolicyMatch"},"effect":{"type":"string","enum":["forbid","require_approval","shadow","allow"],"title":"Effect"},"enforce":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enforce","description":"Omit to follow the rollout rule (non-enforcing on create and on every edit); pass true to promote explicitly."},"note":{"type":"string","maxLength":500,"title":"Note","default":""},"compensation":{"anyOf":[{"$ref":"#/components/schemas/CompensationSpec"},{"type":"null"}],"description":"Declarative undo metadata ({description, command?}) rendered wherever a matched action is held for approval."},"capture_prior":{"type":"boolean","title":"Capture Prior","description":"Attach a derived prior-state read (mutating kubectl only) to log rows and held-action messages.","default":false}},"type":"object","required":["effect"],"title":"_PolicyBody","description":"Policy body for PUT (policy_id comes from the path)."},"_PolicyListResponse":{"properties":{"policies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Policies"}},"type":"object","required":["policies"],"title":"_PolicyListResponse"},"_PreviewRequest":{"properties":{"source":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_.\\- ]+$","title":"Source"},"text":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Text"},"material_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Material Id"}},"type":"object","required":["source"],"title":"_PreviewRequest","description":"Raw source material to distill into proposed memories.\n\nExactly one of ``text`` (small inline paste) or ``material_id`` (a\nregistered bulk material in the org's own bucket)."},"_PreviewResponse":{"properties":{"preview_id":{"type":"string","title":"Preview Id"},"proposals":{"items":{"$ref":"#/components/schemas/SeedRow"},"type":"array","title":"Proposals"},"proposed_count":{"type":"integer","title":"Proposed Count"},"note":{"type":"string","title":"Note"},"unchanged_since_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unchanged Since Version","description":"Set when the material's checksum matches the source's last imported version: nothing changed, nothing was analyzed, and there is nothing to commit"},"media_entry":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Media Entry","description":"For image materials: the attachment pointer (original object in the customer's bucket) that will ride every committed row. Renders as the chip on the review card; descriptions are not editable (the commit contract keeps content immutable)."},"ci_report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ci Report Id","description":"Memory-CI import report started for this preview (poll it at GET /organizations/{org}/memory-ci/reports/{id}): each proposal checked against the memories it would contradict. None when nothing was proposed or the report could not be started."}},"type":"object","required":["preview_id","proposals","proposed_count","note"],"title":"_PreviewResponse","description":"Persisted proposal set for the admin to review before committing."},"_ProbeRequest":{"properties":{"server":{"type":"string","maxLength":128,"minLength":1,"title":"Server"},"tool":{"type":"string","maxLength":200,"minLength":1,"title":"Tool"},"args":{"additionalProperties":true,"type":"object","title":"Args"},"record_type":{"type":"string","maxLength":128,"title":"Record Type","default":""},"publish_org_wide":{"type":"boolean","title":"Publish Org Wide","default":false},"attest_read_only":{"type":"boolean","title":"Attest Read Only","default":false}},"additionalProperties":false,"type":"object","required":["server","tool"],"title":"_ProbeRequest","description":"Read one connector tool once so its records can be described."},"_PullRequest":{"properties":{"source":{"type":"string","maxLength":64,"minLength":1,"title":"Source"},"record_type":{"type":"string","maxLength":128,"minLength":1,"title":"Record Type"}},"additionalProperties":false,"type":"object","required":["source","record_type"],"title":"_PullRequest","description":"Select a configured pull without accepting a caller-supplied identity."},"_PullScheduleRequest":{"properties":{"source":{"type":"string","maxLength":64,"minLength":1,"title":"Source"},"record_type":{"type":"string","maxLength":128,"minLength":1,"title":"Record Type"},"schedule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"additionalProperties":false,"type":"object","required":["source","record_type"],"title":"_PullScheduleRequest","description":"Set or disable one source/type schedule."},"_RecordTypeRequest":{"properties":{"name":{"type":"string","title":"Name"},"entity_type":{"type":"string","title":"Entity Type"},"fields":{"additionalProperties":{"$ref":"#/components/schemas/FieldRule"},"type":"object","title":"Fields"},"expected_revision":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Revision"}},"additionalProperties":false,"type":"object","required":["name","entity_type"],"title":"_RecordTypeRequest","description":"Accept one record-type definition and an edit precondition."},"_RecordsRequest":{"properties":{"source":{"type":"string","maxLength":64,"minLength":1,"title":"Source"},"record_type":{"type":"string","maxLength":128,"minLength":1,"title":"Record Type"},"request_key":{"anyOf":[{"type":"string","maxLength":256,"minLength":1},{"type":"null"}],"title":"Request Key"},"record_mode":{"type":"string","enum":["full_record","patch"],"title":"Record Mode","default":"full_record"},"full_state":{"type":"boolean","title":"Full State","default":false},"format":{"type":"string","enum":["csv","json"],"title":"Format","default":"json"},"material_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Material Id"},"records":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Records"}},"type":"object","required":["source","record_type"],"title":"_RecordsRequest","description":"Accept one registered structured source without implicit retirement."},"_RecoveryRequest":{"properties":{"limit":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Limit","default":100},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},"additionalProperties":false,"type":"object","title":"_RecoveryRequest","description":"Page persisted local application debt."},"_ReflectNowResponse":{"properties":{"status":{"type":"string","title":"Status"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["status","detail"],"title":"_ReflectNowResponse"},"_ReflectionAudit":{"properties":{"run_id":{"type":"string","title":"Run Id"},"profile_name":{"type":"string","title":"Profile Name"},"mode":{"type":"string","title":"Mode"},"reason":{"items":{"type":"string"},"type":"array","title":"Reason","default":[]},"touched":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Touched","default":[]},"cited_run_ids":{"items":{"type":"string"},"type":"array","title":"Cited Run Ids","default":[]},"reverted":{"type":"boolean","title":"Reverted","default":false},"created_at":{"type":"string","title":"Created At","default":""},"reverted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reverted At"}},"type":"object","required":["run_id","profile_name","mode"],"title":"_ReflectionAudit"},"_ReflectionAuditList":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/_ReflectionAudit"},"type":"array","title":"Runs"}},"type":"object","required":["runs"],"title":"_ReflectionAuditList"},"_ReplayRequest":{"properties":{"sample_size":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Sample Size","default":3}},"type":"object","title":"_ReplayRequest","description":"Replay batch parameters (item 4b)."},"_RevertResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"archived":{"items":{"type":"string"},"type":"array","title":"Archived"},"skipped":{"items":{"type":"string"},"type":"array","title":"Skipped"}},"type":"object","required":["run_id","archived","skipped"],"title":"_RevertResponse"},"_RubricListResponse":{"properties":{"rubrics":{"items":{"$ref":"#/components/schemas/_RubricResponse"},"type":"array","title":"Rubrics"}},"type":"object","required":["rubrics"],"title":"_RubricListResponse","description":"List view for ``GET /rubrics``."},"_RubricResponse":{"properties":{"type":{"type":"string","const":"rubric","title":"Type","description":"Decorative type tag (kept for back-compat; the namespace is the canonical discriminator). Marks the record as a config-shaped rubric distinct from memory patterns.","default":"rubric"},"rubric_id":{"type":"string","title":"Rubric Id","description":"Stable identifier (e.g. 'prospect')"},"description":{"type":"string","title":"Description","default":""},"disqualifiers":{"$ref":"#/components/schemas/Disqualifiers"},"scoring":{"$ref":"#/components/schemas/Scoring"},"output":{"$ref":"#/components/schemas/Output"},"version":{"type":"integer","title":"Version","default":1},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"additionalProperties":false,"type":"object","required":["rubric_id","disqualifiers","scoring","output"],"title":"_RubricResponse","description":"Rubric body + storage-layer audit fields.\n\nInherits the full Rubric shape so the response is the canonical\nPydantic model — no field drift between the DR engine's\n``_load_rubric`` view and the admin REST view. Audit fields default\nto ``None`` so older rows that pre-date the metadata still\nserialize cleanly.\n\nAdversarial-pass-3 M-2: this subclass inherits the parent's\n``extra=\"forbid\"`` (M-A) — the audit fields are DECLARED here so\nthey aren't \"extras\" and pass strict validation. A prior version\noverrode with ``extra=\"ignore\"`` to be permissive on future drift,\nbut that contradicts the M-A intent of catching mismatches early.\nBetter to surface a clear ValidationError if ``Rubric`` ever gains\na field this response forgets to mirror."},"_RubricTestRequest":{"properties":{"scenarios":{"items":{"$ref":"#/components/schemas/RubricScenario"},"type":"array","minItems":1,"title":"Scenarios"}},"type":"object","required":["scenarios"],"title":"_RubricTestRequest","description":"Scenario batch to run through the rubric."},"_RubricTestStartResponse":{"properties":{"test_id":{"type":"string","title":"Test Id"},"status":{"type":"string","title":"Status"},"scenario_count":{"type":"integer","title":"Scenario Count"},"note":{"type":"string","title":"Note"}},"type":"object","required":["test_id","status","scenario_count","note"],"title":"_RubricTestStartResponse","description":"202 response for a started test run."},"_ScoringMetadataPatch":{"properties":{"semantics":{"anyOf":[{"type":"string","enum":["dfquad","qe","eb"]},{"type":"null"}],"title":"Semantics"},"aggregator":{"anyOf":[{"type":"string","enum":["sum","product"]},{"type":"null"}],"title":"Aggregator"},"use_dual_bag":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Dual Bag"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"additionalProperties":false,"type":"object","title":"_ScoringMetadataPatch","description":"Patch the top-level ``Scoring`` metadata (NOT factors).\n\nSame ``extra=\"forbid\"`` rationale as ``_DisqualifiersMetadataPatch``.\nSub-pack ``version`` is intentionally NOT patchable."},"_SeedRequest":{"properties":{"source":{"anyOf":[{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_.\\- ]+$"},{"type":"null"}],"title":"Source","description":"Label for where these rows came from (e.g. 'hubspot-export'). Required in rows mode; preview mode carries the preview's own source label."},"rows":{"anyOf":[{"items":{"$ref":"#/components/schemas/SeedRow"},"type":"array","minItems":1},{"type":"null"}],"title":"Rows"},"preview_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Preview Id"},"selected":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Selected"},"edits":{"anyOf":[{"items":{"$ref":"#/components/schemas/SeedProposalEdit"},"type":"array"},{"type":"null"}],"title":"Edits"},"team_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Team Id","description":"Import for one team of this organization (only with team isolation on). Omit for an org-wide import. A source keeps the audience of its first import."}},"type":"object","title":"_SeedRequest","description":"Batch commit: inline rows OR an approved preview subset.\n\nTwo modes, exactly one:\n- ``rows`` (+ required ``source``): the original programmatic path.\n- ``preview_id`` + ``selected`` (+ optional constrained ``edits``):\n  the reviewed-import path — commit can only produce rows that\n  exist verbatim in the persisted preview."},"_SeedStartResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"status":{"type":"string","title":"Status"},"row_count":{"type":"integer","title":"Row Count"},"note":{"type":"string","title":"Note"}},"type":"object","required":["batch_id","status","row_count","note"],"title":"_SeedStartResponse","description":"202 response for a started batch."},"_SettlementRequest":{"properties":{"outcome":{"type":"string","pattern":"^(done|failed)$","title":"Outcome"},"rationale":{"type":"string","maxLength":2000,"minLength":1,"title":"Rationale"},"evidence":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Evidence"}},"additionalProperties":false,"type":"object","required":["outcome","rationale"],"title":"_SettlementRequest","description":"Accept an explicit local settlement of an uncertain remote effect."},"_SourceRequest":{"properties":{"label":{"type":"string","title":"Label"},"publish_org_wide":{"type":"boolean","title":"Publish Org Wide","default":false},"record_types":{"additionalProperties":{"$ref":"#/components/schemas/SourceRecordType"},"type":"object","title":"Record Types"},"expected_revision":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Revision"}},"additionalProperties":false,"type":"object","required":["label"],"title":"_SourceRequest","description":"Accept one source definition and an edit precondition."},"_StorageSetupRequest":{"properties":{"provider_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Provider Key"},"bucket":{"anyOf":[{"type":"string","maxLength":222,"minLength":3,"pattern":"^[a-z0-9][a-z0-9._-]+$"},{"type":"null"}],"title":"Bucket"},"origin":{"anyOf":[{"type":"string","maxLength":200,"pattern":"^https?://[^\\s/]+$"},{"type":"null"}],"title":"Origin","description":"Browser origin to allow for direct uploads (CORS)."}},"type":"object","title":"_StorageSetupRequest","description":"One-call storage connect: the platform does every step it can."},"_WriteBackPlanRequest":{"properties":{"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"predicate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicate"},"limit":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Limit","default":100}},"additionalProperties":false,"type":"object","title":"_WriteBackPlanRequest","description":"Optionally limit the plan to an entity and field before applying its cap."},"_WriteBackRunRequest":{"properties":{"op_ids":{"items":{"type":"string"},"type":"array","maxItems":2000,"minItems":1,"title":"Op Ids"}},"additionalProperties":false,"type":"object","required":["op_ids"],"title":"_WriteBackRunRequest","description":"Select existing operation ids without accepting executable arguments."},"integration__schemas__encryption_config__ProvisioningState":{"type":"string","enum":["pending","active","failed"],"title":"ProvisioningState","description":"Lifecycle state of the per-org encryption configuration.\n\n- ``pending``  — admin started onboarding; we haven't yet\n                 verified our SA can call ``encrypt`` on the\n                 resource. ``derive_context`` ignores pending\n                 configs (falls back to platform default) so\n                 a half-configured BYOK doesn't break writes.\n- ``active``   — ``/test`` probe passed; ``derive_context``\n                 routes the org's encrypts through this KEK.\n- ``failed``   — terminal. Admin must fix IAM and rerun\n                 ``/test``. Pending state would be acceptable\n                 here too; ``failed`` exists so the UI can show\n                 an actionable error instead of a stuck spinner."},"integration__schemas__memory_db__ProvisioningState":{"type":"string","enum":["pending","active","failed"],"title":"ProvisioningState","description":"Lifecycle state of the BYO memory DB.\n\n- ``pending``  — admin started the onboarding flow; instance may\n                 not exist yet, schema not run, IAM user not\n                 created. Dispatcher raises ``BYODBNotReadyError``\n                 to surface 503 rather than silently spilling\n                 data to the platform DB.\n- ``active``   — health probe passed end-to-end; dispatcher\n                 routes memory ops to this instance. Set only\n                 via ``AgentEnvironmentStore.set_memory_db_active``\n                 (the deterministic ``/memory-db/test`` probe\n                 pass path).\n- ``failed``   — terminal \"gave up\" state. Set via\n                 ``AgentEnvironmentStore.set_memory_db_failed``\n                 (admin tooling / future onboarding-agent\n                 \"give up\" flow). Dispatcher raises\n                 ``BYODBNotReadyError`` identically to\n                 ``pending``; the distinction is purely an\n                 operator-UX signal so polling clients can tell\n                 \"still onboarding\" from \"stuck, please\n                 intervene\". The PENDING→FAILED transition is\n                 ENFORCED in the setter (an ACTIVE cfg must be\n                 torn down via DELETE, not flag-flipped)."},"routes__eval__CheckpointResponse":{"properties":{"exists":{"type":"boolean","title":"Exists"},"technique":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Technique"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"run_tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Tag"},"conversations":{"additionalProperties":{"$ref":"#/components/schemas/CheckpointConvProgress"},"type":"object","title":"Conversations","default":{}}},"type":"object","required":["exists"],"title":"CheckpointResponse","description":"Server-side checkpoint snapshot."},"routes__eval__CleanupResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"cleaned_conversations":{"items":{"type":"integer"},"type":"array","title":"Cleaned Conversations"},"checkpoint_deleted":{"type":"boolean","title":"Checkpoint Deleted","default":false}},"type":"object","required":["technique","cleaned_conversations"],"title":"CleanupResponse","description":"Response from the cleanup phase."},"routes__eval_longmemeval__CheckpointResponse":{"properties":{"exists":{"type":"boolean","title":"Exists"},"technique":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Technique"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"in_progress":{"type":"boolean","title":"In Progress","default":false},"total_sessions_seeded":{"type":"integer","title":"Total Sessions Seeded","default":0},"examples":{"additionalProperties":{"$ref":"#/components/schemas/CheckpointExampleProgress"},"type":"object","title":"Examples","default":{}}},"type":"object","required":["exists"],"title":"CheckpointResponse","description":"Server-side checkpoint snapshot."},"routes__eval_longmemeval__CleanupResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"cleaned_questions":{"type":"integer","title":"Cleaned Questions"},"checkpoint_deleted":{"type":"boolean","title":"Checkpoint Deleted","default":false},"example_rows_deleted":{"type":"integer","title":"Example Rows Deleted","default":0},"orphan_rows_swept":{"type":"integer","title":"Orphan Rows Swept","default":0}},"type":"object","required":["technique","cleaned_questions"],"title":"CleanupResponse","description":"Response from the cleanup phase."},"routes__eval_memoryagentbench__CheckpointResponse":{"properties":{"exists":{"type":"boolean","title":"Exists"},"technique":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Technique"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"records":{"additionalProperties":{"$ref":"#/components/schemas/CheckpointRecordProgress"},"type":"object","title":"Records","default":{}}},"type":"object","required":["exists"],"title":"CheckpointResponse","description":"Server-side checkpoint snapshot."},"routes__eval_memoryagentbench__CleanupResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"cleaned_records":{"type":"integer","title":"Cleaned Records"},"checkpoint_deleted":{"type":"boolean","title":"Checkpoint Deleted","default":false}},"type":"object","required":["technique","cleaned_records"],"title":"CleanupResponse","description":"Response from the cleanup phase."},"routes__resources__entity_identity_policy__PreviewRequest":{"properties":{"policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"$ref":"#/components/schemas/IdentityPolicy"}],"title":"Policy"}},"additionalProperties":false,"type":"object","required":["policy"],"title":"PreviewRequest","description":"Explicit candidate policy; the current value is never changed by preview."},"routes__resources__entity_identity_policy__SaveRequest":{"properties":{"policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"$ref":"#/components/schemas/IdentityPolicy"}],"title":"Policy"},"expected_revision":{"type":"integer","minimum":0.0,"title":"Expected Revision"},"preview_token":{"type":"string","pattern":"^[a-f0-9]{64}$","title":"Preview Token"}},"additionalProperties":false,"type":"object","required":["policy","expected_revision","preview_token"],"title":"SaveRequest","description":"Require the exact reviewed inventory and policy revision."},"routes__resources__entity_types__PreviewRequest":{"properties":{"change":{"additionalProperties":true,"type":"object","title":"Change"}},"additionalProperties":false,"type":"object","required":["change"],"title":"PreviewRequest","description":"One change; validated per action in :func:`_change`."},"routes__resources__entity_types__SaveRequest":{"properties":{"change":{"additionalProperties":true,"type":"object","title":"Change"},"preview_token":{"type":"string","pattern":"^[a-f0-9]{64}$","title":"Preview Token"}},"additionalProperties":false,"type":"object","required":["change","preview_token"],"title":"SaveRequest","description":"The previewed change and the token its preview returned."},"routes__resources__memory_seed___MaterialRequest":{"properties":{"filename":{"type":"string","maxLength":200,"minLength":1,"title":"Filename"},"size_bytes":{"type":"integer","minimum":1.0,"title":"Size Bytes"},"content_type":{"type":"string","maxLength":100,"minLength":3,"title":"Content Type","default":"text/plain"},"anchor":{"anyOf":[{"$ref":"#/components/schemas/_MaterialAnchor"},{"type":"null"}],"description":"Anchor the material to a CRM company or person: it lists on the record's Files tab, and every memory its import commits is linked to the record's Brain entity."}},"type":"object","required":["filename","size_bytes"],"title":"_MaterialRequest","description":"Upload intent for one file of raw import material."},"routes__resources__reconciliation___MaterialRequest":{"properties":{"source":{"type":"string","maxLength":64,"minLength":1,"title":"Source"},"record_type":{"type":"string","maxLength":128,"minLength":1,"title":"Record Type"},"request_key":{"type":"string","maxLength":256,"minLength":1,"title":"Request Key"},"material_id":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Material Id"},"memory_ref":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Memory Ref"}},"additionalProperties":false,"type":"object","required":["source","record_type","request_key"],"title":"_MaterialRequest","description":"Admit exactly one authorized original for a declared extracted source."}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}}},"tags":[{"name":"Assistants","description":"A configured instance of a graph."},{"name":"Threads","description":"Accumulated state and outputs from a group of runs."},{"name":"Thread Runs","description":"Invoke a graph on a thread, updating its persistent state."},{"name":"Stateless Runs","description":"Invoke a graph without state or memory persistence."},{"name":"Crons","description":"Scheduled recurring runs on a cron schedule."},{"name":"Store","description":"Persistent key-value and semantic storage available from any thread."},{"name":"Event Streaming","description":"Agent Protocol v2 thread event streaming and commands."},{"name":"Health","description":"Server health checks and service information."}]}