{"openapi":"3.1.0","info":{"title":"Orbit API","version":"0.1.0","license":{"name":"MIT","url":"https://opensource.org/license/mit"},"description":"API-first CRM for AI agents. See /llms.txt for a concise guide."},"servers":[{"url":"https://orbit.seamtro.ai"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Workspace API key: orb_<prefix>_<secret>"}},"schemas":{"AgentList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"Agent":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]},"custom":{"type":"object","additionalProperties":{}},"name":{"type":["string","null"],"minLength":1,"maxLength":200},"kind":{"type":["string","null"],"enum":["llm","bot","service",null]},"owner_human_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"capabilities":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":100},"maxItems":100},"status":{"type":["string","null"],"enum":["active","paused","disabled",null],"description":"Only active agents' keys authenticate. Changing status requires admin."},"endpoint_url":{"type":["string","null"],"maxLength":2000,"format":"uri"}},"required":["id","object","created_at","updated_at","created_by","custom"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]},"AgentCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["llm","bot","service"]},"owner_human_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"capabilities":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":100},"maxItems":100},"status":{"type":"string","enum":["active","paused","disabled"],"description":"Only active agents' keys authenticate. Changing status requires admin."},"endpoint_url":{"type":["string","null"],"maxLength":2000,"format":"uri"},"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."}},"required":["name"],"additionalProperties":false},"AgentUpdate":{"type":"object","properties":{"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."},"name":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["llm","bot","service"]},"owner_human_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"capabilities":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":100},"maxItems":100},"status":{"type":"string","enum":["active","paused","disabled"],"description":"Only active agents' keys authenticate. Changing status requires admin."},"endpoint_url":{"type":["string","null"],"maxLength":2000,"format":"uri"}},"additionalProperties":false},"HumanList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Human"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"Human":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]},"custom":{"type":"object","additionalProperties":{}},"name":{"type":["string","null"],"minLength":1,"maxLength":200},"org_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"emails":{"type":["array","null"],"items":{"type":"string","maxLength":320,"format":"email"},"maxItems":20},"phones":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20},"title":{"type":["string","null"],"minLength":1,"maxLength":200},"timezone":{"type":["string","null"],"minLength":1,"maxLength":64},"consent_flags":{"type":["object","null"],"additionalProperties":{"type":"boolean"}}},"required":["id","object","created_at","updated_at","created_by","custom"]},"HumanCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"org_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"emails":{"type":["array","null"],"items":{"type":"string","maxLength":320,"format":"email"},"maxItems":20},"phones":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20},"title":{"type":["string","null"],"minLength":1,"maxLength":200},"timezone":{"type":["string","null"],"minLength":1,"maxLength":64},"consent_flags":{"type":["object","null"],"additionalProperties":{"type":"boolean"}},"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."}},"required":["name"],"additionalProperties":false},"HumanUpdate":{"type":"object","properties":{"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."},"name":{"type":"string","minLength":1,"maxLength":200},"org_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"emails":{"type":["array","null"],"items":{"type":"string","maxLength":320,"format":"email"},"maxItems":20},"phones":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20},"title":{"type":["string","null"],"minLength":1,"maxLength":200},"timezone":{"type":["string","null"],"minLength":1,"maxLength":64},"consent_flags":{"type":["object","null"],"additionalProperties":{"type":"boolean"}}},"additionalProperties":false},"OrgList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Org"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"Org":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]},"custom":{"type":"object","additionalProperties":{}},"name":{"type":["string","null"],"minLength":1,"maxLength":200},"domain":{"type":["string","null"],"minLength":1,"maxLength":253},"industry":{"type":["string","null"],"minLength":1,"maxLength":200},"size":{"type":["string","null"],"minLength":1,"maxLength":50}},"required":["id","object","created_at","updated_at","created_by","custom"]},"OrgCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":["string","null"],"minLength":1,"maxLength":253},"industry":{"type":["string","null"],"minLength":1,"maxLength":200},"size":{"type":["string","null"],"minLength":1,"maxLength":50},"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."}},"required":["name"],"additionalProperties":false},"OrgUpdate":{"type":"object","properties":{"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."},"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":["string","null"],"minLength":1,"maxLength":253},"industry":{"type":["string","null"],"minLength":1,"maxLength":200},"size":{"type":["string","null"],"minLength":1,"maxLength":50}},"additionalProperties":false},"InteractionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Interaction"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"Interaction":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]},"custom":{"type":"object","additionalProperties":{}},"channel":{"type":["string","null"],"enum":["email","chat","call","api","note","message",null]},"direction":{"type":["string","null"],"enum":["inbound","outbound","internal",null]},"occurred_at":{"type":["string","null"],"format":"date-time"},"summary":{"type":["string","null"],"minLength":1,"maxLength":2000},"body":{"type":["string","null"],"maxLength":65536},"body_ref":{"type":["string","null"],"minLength":1,"maxLength":2000},"participants":{"type":["array","null"],"items":{"type":"string","pattern":"^(agents|humans|orgs|interactions|deals|tasks):([0-9A-HJKMNP-TV-Z]{26})$"},"maxItems":100}},"required":["id","object","created_at","updated_at","created_by","custom"]},"InteractionCreate":{"type":"object","properties":{"channel":{"type":"string","enum":["email","chat","call","api","note","message"]},"direction":{"type":["string","null"],"enum":["inbound","outbound","internal",null]},"occurred_at":{"type":["string","null"],"format":"date-time"},"summary":{"type":["string","null"],"minLength":1,"maxLength":2000},"body":{"type":["string","null"],"maxLength":65536},"body_ref":{"type":["string","null"],"minLength":1,"maxLength":2000},"participants":{"type":["array","null"],"items":{"type":"string","pattern":"^(agents|humans|orgs|interactions|deals|tasks):([0-9A-HJKMNP-TV-Z]{26})$"},"maxItems":100},"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."}},"required":["channel"],"additionalProperties":false},"InteractionUpdate":{"type":"object","properties":{"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."},"channel":{"type":"string","enum":["email","chat","call","api","note","message"]},"direction":{"type":["string","null"],"enum":["inbound","outbound","internal",null]},"occurred_at":{"type":["string","null"],"format":"date-time"},"summary":{"type":["string","null"],"minLength":1,"maxLength":2000},"body":{"type":["string","null"],"maxLength":65536},"body_ref":{"type":["string","null"],"minLength":1,"maxLength":2000},"participants":{"type":["array","null"],"items":{"type":"string","pattern":"^(agents|humans|orgs|interactions|deals|tasks):([0-9A-HJKMNP-TV-Z]{26})$"},"maxItems":100}},"additionalProperties":false},"DealList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Deal"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"Deal":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]},"custom":{"type":"object","additionalProperties":{}},"title":{"type":["string","null"],"minLength":1,"maxLength":300},"stage":{"type":["string","null"],"minLength":1,"maxLength":100},"pipeline_id":{"type":["string","null"],"minLength":1,"maxLength":100},"value":{"type":["number","null"]},"currency":{"type":["string","null"],"pattern":"^[A-Z]{3}$"},"close_date":{"type":["string","null"],"format":"date"},"owner":{"type":["string","null"],"pattern":"^(agents|humans):([0-9A-HJKMNP-TV-Z]{26})$"},"org_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"primary_human_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["id","object","created_at","updated_at","created_by","custom"]},"DealCreate":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300},"stage":{"type":["string","null"],"minLength":1,"maxLength":100},"pipeline_id":{"type":["string","null"],"minLength":1,"maxLength":100},"value":{"type":["number","null"]},"currency":{"type":["string","null"],"pattern":"^[A-Z]{3}$"},"close_date":{"type":["string","null"],"format":"date"},"owner":{"type":["string","null"],"pattern":"^(agents|humans):([0-9A-HJKMNP-TV-Z]{26})$"},"org_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"primary_human_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."}},"required":["title"],"additionalProperties":false},"DealUpdate":{"type":"object","properties":{"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."},"title":{"type":"string","minLength":1,"maxLength":300},"stage":{"type":["string","null"],"minLength":1,"maxLength":100},"pipeline_id":{"type":["string","null"],"minLength":1,"maxLength":100},"value":{"type":["number","null"]},"currency":{"type":["string","null"],"pattern":"^[A-Z]{3}$"},"close_date":{"type":["string","null"],"format":"date"},"owner":{"type":["string","null"],"pattern":"^(agents|humans):([0-9A-HJKMNP-TV-Z]{26})$"},"org_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"primary_human_id":{"type":["string","null"],"pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"}},"additionalProperties":false},"TaskList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"Task":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":["string","null"]},"custom":{"type":"object","additionalProperties":{}},"title":{"type":["string","null"],"minLength":1,"maxLength":500},"status":{"type":["string","null"],"enum":["open","in_progress","done","cancelled",null]},"due_at":{"type":["string","null"],"format":"date-time"},"assignee":{"type":["string","null"],"pattern":"^(agents|humans):([0-9A-HJKMNP-TV-Z]{26})$"},"priority":{"type":["string","null"],"enum":["low","normal","high","urgent",null]},"subject":{"type":["string","null"],"pattern":"^(agents|humans|orgs|interactions|deals|tasks):([0-9A-HJKMNP-TV-Z]{26})$"},"result":{"type":["object","null"],"additionalProperties":{}}},"required":["id","object","created_at","updated_at","created_by","custom"]},"TaskCreate":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"status":{"type":"string","enum":["open","in_progress","done","cancelled"]},"due_at":{"type":["string","null"],"format":"date-time"},"assignee":{"type":["string","null"],"pattern":"^(agents|humans):([0-9A-HJKMNP-TV-Z]{26})$"},"priority":{"type":["string","null"],"enum":["low","normal","high","urgent",null]},"subject":{"type":["string","null"],"pattern":"^(agents|humans|orgs|interactions|deals|tasks):([0-9A-HJKMNP-TV-Z]{26})$"},"result":{"type":["object","null"],"additionalProperties":{}},"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."}},"required":["title"],"additionalProperties":false},"TaskUpdate":{"type":"object","properties":{"custom":{"type":"object","additionalProperties":{},"description":"Custom field values, validated against /v1/fields definitions. Set a key to null to clear it."},"title":{"type":"string","minLength":1,"maxLength":500},"status":{"type":"string","enum":["open","in_progress","done","cancelled"]},"due_at":{"type":["string","null"],"format":"date-time"},"assignee":{"type":["string","null"],"pattern":"^(agents|humans):([0-9A-HJKMNP-TV-Z]{26})$"},"priority":{"type":["string","null"],"enum":["low","normal","high","urgent",null]},"subject":{"type":["string","null"],"pattern":"^(agents|humans|orgs|interactions|deals|tasks):([0-9A-HJKMNP-TV-Z]{26})$"},"result":{"type":["object","null"],"additionalProperties":{}}},"additionalProperties":false},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"agent_id":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["read","write","admin"]}},"expires_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"last_used_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","name","agent_id","prefix","scopes","expires_at","revoked_at","last_used_at","created_at"]},"FieldDef":{"type":"object","properties":{"id":{"type":"string"},"object_type":{"type":"string","enum":["agents","humans","orgs","interactions","deals","tasks"]},"key":{"type":"string"},"type":{"type":"string","enum":["text","number","boolean","date","datetime","enum","multi_enum","url","email"]},"required":{"type":"boolean"},"options":{"type":["object","null"],"properties":{"values":{"type":"array","items":{"type":"string"}}}}},"required":["id","object_type","key","type","required","options"]},"Link":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"type":{"type":"string"},"created_at":{"type":"string"}},"required":["id","from","to","type","created_at"]},"Activity":{"type":"object","properties":{"id":{"type":"string"},"actor":{"type":"string","description":"agents:<id> (API key), users:<id> (signed-in human), or system[:cli|:signup]"},"actor_type":{"type":"string","enum":["agent","human","system"]},"actor_id":{"type":["string","null"],"description":"Agent or user id; null for system"},"action":{"type":"string"},"target":{"type":"string"},"diff":{},"at":{"type":"string"}},"required":["id","actor","actor_type","actor_id","action","target","at"]},"SignupResult":{"type":"object","properties":{"workspace_id":{"type":"string"},"agent_id":{"type":"string"},"key_id":{"type":"string"},"key":{"type":"string","description":"Admin API key for the new workspace. Shown ONCE; store it in a secret manager."}},"required":["workspace_id","agent_id","key_id","key"]},"SignupRequest":{"type":"object","properties":{"workspace_name":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\u0000-\\u001f\\u007f]*$","description":"Name of the new workspace (1-200 characters)"},"agent_name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^\\u0000-\\u001f\\u007f]*$","description":"Name of the first (admin) agent; default 'admin' (1-100 characters)"},"ref":{"type":"string","pattern":"^[a-z0-9_-]{1,32}$","description":"Optional attribution tag for where you found Orbit, e.g. 'mcp-registry' or 'llms-txt' (lowercase a-z, 0-9, '_' and '-', 1-32 characters). Stored for the operator's channel metrics only; never shown to other workspaces."}},"required":["workspace_name"],"additionalProperties":false},"Member":{"type":"object","properties":{"kind":{"type":"string","enum":["human","agent"]},"id":{"type":"string","description":"User id (humans) or agent id (agents)"},"name":{"type":"string"},"email":{"type":["string","null"],"description":"Humans only"},"role":{"type":["string","null"],"enum":["owner","admin","member","viewer",null],"description":"Agents: derived from their strongest active key (null = no active key)"},"created_at":{"type":"string"}},"required":["kind","id","name","email","role","created_at"]},"Invite":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"invitee":{"type":"string","enum":["human","agent"]},"email":{"type":["string","null"]},"status":{"type":"string","enum":["pending","accepted","revoked","expired"]},"created_by":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string"},"accepted_at":{"type":["string","null"]},"accepted_by":{"type":["string","null"]}},"required":["id","role","invitee","email","status","created_by","created_at","expires_at","accepted_at","accepted_by"]}},"parameters":{}},"paths":{"/v1/agents":{"get":{"tags":["agents"],"security":[{"bearer":[]}],"summary":"List agents","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Page size (default 50, max 200)"},"required":false,"description":"Page size (default 50, max 200)","name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","description":"Opaque cursor from the previous page's next_cursor"},"required":false,"description":"Opaque cursor from the previous page's next_cursor","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive substring search over name"},"required":false,"description":"Case-insensitive substring search over name","name":"q","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on kind"},"required":false,"description":"Exact match on kind","name":"kind","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on status"},"required":false,"description":"Exact match on status","name":"status","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on owner_human_id"},"required":false,"description":"Exact match on owner_human_id","name":"owner_human_id","in":"query"}],"responses":{"200":{"description":"A page of agents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentList"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["agents"],"security":[{"bearer":[]}],"summary":"Create an agent","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreate"}}}},"responses":{"201":{"description":"The created agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}":{"get":{"tags":["agents"],"security":[{"bearer":[]}],"summary":"Get an agent","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["agents"],"security":[{"bearer":[]}],"summary":"Update an agent","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdate"}}}},"responses":{"200":{"description":"The updated agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["agents"],"security":[{"bearer":[]}],"summary":"Archive an agent and revoke its keys (admin)","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Archived","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/humans":{"get":{"tags":["humans"],"security":[{"bearer":[]}],"summary":"List humans","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Page size (default 50, max 200)"},"required":false,"description":"Page size (default 50, max 200)","name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","description":"Opaque cursor from the previous page's next_cursor"},"required":false,"description":"Opaque cursor from the previous page's next_cursor","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive substring search over name, title"},"required":false,"description":"Case-insensitive substring search over name, title","name":"q","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on org_id"},"required":false,"description":"Exact match on org_id","name":"org_id","in":"query"}],"responses":{"200":{"description":"A page of humans","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumanList"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["humans"],"security":[{"bearer":[]}],"summary":"Create a human","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumanCreate"}}}},"responses":{"201":{"description":"The created human","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Human"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/humans/{id}":{"get":{"tags":["humans"],"security":[{"bearer":[]}],"summary":"Get a human","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The human","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Human"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["humans"],"security":[{"bearer":[]}],"summary":"Update a human","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumanUpdate"}}}},"responses":{"200":{"description":"The updated human","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Human"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["humans"],"security":[{"bearer":[]}],"summary":"Archive (soft-delete) a human","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Archived","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs":{"get":{"tags":["orgs"],"security":[{"bearer":[]}],"summary":"List orgs","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Page size (default 50, max 200)"},"required":false,"description":"Page size (default 50, max 200)","name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","description":"Opaque cursor from the previous page's next_cursor"},"required":false,"description":"Opaque cursor from the previous page's next_cursor","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive substring search over name, domain"},"required":false,"description":"Case-insensitive substring search over name, domain","name":"q","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on domain"},"required":false,"description":"Exact match on domain","name":"domain","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on industry"},"required":false,"description":"Exact match on industry","name":"industry","in":"query"}],"responses":{"200":{"description":"A page of orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgList"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["orgs"],"security":[{"bearer":[]}],"summary":"Create an org","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCreate"}}}},"responses":{"201":{"description":"The created org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Org"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{id}":{"get":{"tags":["orgs"],"security":[{"bearer":[]}],"summary":"Get an org","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Org"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["orgs"],"security":[{"bearer":[]}],"summary":"Update an org","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgUpdate"}}}},"responses":{"200":{"description":"The updated org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Org"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["orgs"],"security":[{"bearer":[]}],"summary":"Archive (soft-delete) an org","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Archived","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/interactions":{"get":{"tags":["interactions"],"security":[{"bearer":[]}],"summary":"List interactions","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Page size (default 50, max 200)"},"required":false,"description":"Page size (default 50, max 200)","name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","description":"Opaque cursor from the previous page's next_cursor"},"required":false,"description":"Opaque cursor from the previous page's next_cursor","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive substring search over summary, body"},"required":false,"description":"Case-insensitive substring search over summary, body","name":"q","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on channel"},"required":false,"description":"Exact match on channel","name":"channel","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on direction"},"required":false,"description":"Exact match on direction","name":"direction","in":"query"}],"responses":{"200":{"description":"A page of interactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionList"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["interactions"],"security":[{"bearer":[]}],"summary":"Create an interaction","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionCreate"}}}},"responses":{"201":{"description":"The created interaction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Interaction"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/interactions/{id}":{"get":{"tags":["interactions"],"security":[{"bearer":[]}],"summary":"Get an interaction","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The interaction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Interaction"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["interactions"],"security":[{"bearer":[]}],"summary":"Update an interaction","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionUpdate"}}}},"responses":{"200":{"description":"The updated interaction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Interaction"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["interactions"],"security":[{"bearer":[]}],"summary":"Archive (soft-delete) an interaction","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Archived","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/deals":{"get":{"tags":["deals"],"security":[{"bearer":[]}],"summary":"List deals","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Page size (default 50, max 200)"},"required":false,"description":"Page size (default 50, max 200)","name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","description":"Opaque cursor from the previous page's next_cursor"},"required":false,"description":"Opaque cursor from the previous page's next_cursor","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive substring search over title"},"required":false,"description":"Case-insensitive substring search over title","name":"q","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on stage"},"required":false,"description":"Exact match on stage","name":"stage","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on pipeline_id"},"required":false,"description":"Exact match on pipeline_id","name":"pipeline_id","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on owner"},"required":false,"description":"Exact match on owner","name":"owner","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on org_id"},"required":false,"description":"Exact match on org_id","name":"org_id","in":"query"}],"responses":{"200":{"description":"A page of deals","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealList"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["deals"],"security":[{"bearer":[]}],"summary":"Create a deal","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealCreate"}}}},"responses":{"201":{"description":"The created deal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/deals/{id}":{"get":{"tags":["deals"],"security":[{"bearer":[]}],"summary":"Get a deal","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The deal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["deals"],"security":[{"bearer":[]}],"summary":"Update a deal","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealUpdate"}}}},"responses":{"200":{"description":"The updated deal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["deals"],"security":[{"bearer":[]}],"summary":"Archive (soft-delete) a deal","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Archived","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks":{"get":{"tags":["tasks"],"security":[{"bearer":[]}],"summary":"List tasks","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Page size (default 50, max 200)"},"required":false,"description":"Page size (default 50, max 200)","name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","description":"Opaque cursor from the previous page's next_cursor"},"required":false,"description":"Opaque cursor from the previous page's next_cursor","name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive substring search over title"},"required":false,"description":"Case-insensitive substring search over title","name":"q","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on status"},"required":false,"description":"Exact match on status","name":"status","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on assignee"},"required":false,"description":"Exact match on assignee","name":"assignee","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on priority"},"required":false,"description":"Exact match on priority","name":"priority","in":"query"},{"schema":{"type":"string","maxLength":300,"description":"Exact match on subject"},"required":false,"description":"Exact match on subject","name":"subject","in":"query"}],"responses":{"200":{"description":"A page of tasks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["tasks"],"security":[{"bearer":[]}],"summary":"Create a task","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreate"}}}},"responses":{"201":{"description":"The created task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}":{"get":{"tags":["tasks"],"security":[{"bearer":[]}],"summary":"Get a task","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["tasks"],"security":[{"bearer":[]}],"summary":"Update a task","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskUpdate"}}}},"responses":{"200":{"description":"The updated task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["tasks"],"security":[{"bearer":[]}],"summary":"Archive (soft-delete) a task","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Archived","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me":{"get":{"tags":["auth"],"security":[{"bearer":[]}],"summary":"Describe the calling API key, agent and workspace","responses":{"200":{"description":"Caller identity","content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"agent_id":{"type":["string","null"],"description":"Null only for in-process calls from the human UI"},"key_id":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"usage":{"type":"object","properties":{"records":{"type":"number"},"max_records":{"type":["number","null"]},"bytes":{"type":"number"},"max_bytes":{"type":["number","null"]}},"required":["records","max_records","bytes","max_bytes"],"description":"Storage used by this workspace and its quota (null = unlimited)"}},"required":["workspace","agent_id","key_id","scopes","usage"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workspace":{"delete":{"tags":["workspace"],"security":[{"bearer":[]}],"summary":"Disable (self-delete) this workspace (admin). Revokes every key immediately; irreversible via the API.","description":"Body must be {\"confirm\": \"<this workspace id>\"}. All keys stop working at once. Data is retained for the operator (restore or purge); there is no API to undo this.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"string","minLength":1,"maxLength":64}},"required":["confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"Workspace disabled","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string"},"disabled_at":{"type":"string"},"revoked_keys":{"type":"integer"}},"required":["workspace_id","disabled_at","revoked_keys"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/keys":{"get":{"tags":["keys"],"security":[{"bearer":[]}],"summary":"List API keys in this workspace (admin)","responses":{"200":{"description":"Keys (secrets are never returned)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["data"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["keys"],"security":[{"bearer":[]}],"summary":"Issue an API key for an agent (admin). The secret is returned once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","items":{"type":"string","enum":["read","write","admin"]},"minItems":1,"maxItems":3},"expires_at":{"type":"string","format":"date-time"}},"required":["agent_id","scopes"],"additionalProperties":false}}}},"responses":{"201":{"description":"The new key, including the one-time secret","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","properties":{"key":{"type":"string"}},"required":["key"]}]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/keys/{id}/revoke":{"post":{"tags":["keys"],"security":[{"bearer":[]}],"summary":"Revoke an API key (admin). Takes effect immediately; idempotent. The last active admin key cannot be revoked (409).","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/fields":{"get":{"tags":["fields"],"security":[{"bearer":[]}],"summary":"List custom field definitions","parameters":[{"schema":{"type":"string","enum":["agents","humans","orgs","interactions","deals","tasks"]},"required":false,"name":"object_type","in":"query"}],"responses":{"200":{"description":"Field definitions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FieldDef"}}},"required":["data"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["fields"],"security":[{"bearer":[]}],"summary":"Define a custom field on a core object (admin)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object_type":{"type":"string","enum":["agents","humans","orgs","interactions","deals","tasks"]},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"type":{"type":"string","enum":["text","number","boolean","date","datetime","enum","multi_enum","url","email"]},"required":{"type":"boolean"},"options":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"minItems":1,"maxItems":200}},"required":["values"],"additionalProperties":false}},"required":["object_type","key","type"],"additionalProperties":false}}}},"responses":{"201":{"description":"The new definition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldDef"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/fields/{id}":{"delete":{"tags":["fields"],"security":[{"bearer":[]}],"summary":"Remove a custom field definition (admin). Stored values are kept but no longer settable.","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/links":{"get":{"tags":["links"],"security":[{"bearer":[]}],"summary":"List links touching a record (links to archived records are hidden)","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Page size (default 50, max 200)"},"required":false,"description":"Page size (default 50, max 200)","name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","description":"Opaque cursor from the previous page's next_cursor"},"required":false,"description":"Opaque cursor from the previous page's next_cursor","name":"cursor","in":"query"},{"schema":{"type":"string","pattern":"^(agents|humans|orgs|interactions|deals|tasks):[0-9A-HJKMNP-TV-Z]{26}$","description":"Record reference, e.g. humans:<id>"},"required":true,"description":"Record reference, e.g. humans:<id>","name":"ref","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"type","in":"query"}],"responses":{"200":{"description":"Links","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Link"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["links"],"security":[{"bearer":[]}],"summary":"Link two records","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^(agents|humans|orgs|interactions|deals|tasks):[0-9A-HJKMNP-TV-Z]{26}$"},"to":{"type":"string","pattern":"^(agents|humans|orgs|interactions|deals|tasks):[0-9A-HJKMNP-TV-Z]{26}$"},"type":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"}},"required":["from","to","type"],"additionalProperties":false}}}},"responses":{"201":{"description":"The new link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Link"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/links/{id}":{"delete":{"tags":["links"],"security":[{"bearer":[]}],"summary":"Remove a link","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/activity":{"get":{"tags":["activity"],"security":[{"bearer":[]}],"summary":"Read the workspace activity log (newest last)","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Page size (default 50, max 200)"},"required":false,"description":"Page size (default 50, max 200)","name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","description":"Opaque cursor from the previous page's next_cursor"},"required":false,"description":"Opaque cursor from the previous page's next_cursor","name":"cursor","in":"query"},{"schema":{"type":"string","maxLength":100},"required":false,"name":"target","in":"query"},{"schema":{"type":"string","maxLength":100},"required":false,"name":"actor","in":"query"}],"responses":{"200":{"description":"Activity entries","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/signup":{"post":{"tags":["signup"],"summary":"Create a workspace and get its first admin API key (public self-signup; key shown once)","description":"Unauthenticated. Rate limited per client IP and network (IPv4 per address and /24; IPv6 per /64, /48 and /32), by a per-network share of the daily cap, and by a global daily cap. The response contains the only copy of the admin key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}}},"responses":{"201":{"description":"Workspace created; the key is shown once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupResult"}}}},"400":{"description":"Validation error (unknown keys are rejected)","headers":{"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","headers":{"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many signups from this address or network (respect Retry-After)","headers":{"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Global signup capacity reached for now (respect Retry-After)","headers":{"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/join":{"post":{"tags":["members"],"summary":"Join a workspace as an agent with an invite token (creates your agent and returns its API key once)","description":"Unauthenticated: the single-use invite token from an agent invite (POST /v1/invites with invitee=agent, or the web UI) is the credential. Rate limited per client IP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","maxLength":100},"agent_name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"}},"required":["token","agent_name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Joined; the key is shown once","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string"},"agent_id":{"type":"string"},"key_id":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"scopes":{"type":"array","items":{"type":"string"}},"key":{"type":"string"}},"required":["workspace_id","agent_id","key_id","role","scopes","key"]}}}},"404":{"description":"Conflict (last owner/admin, agent member, limits)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict (last owner/admin, agent member, limits)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Conflict (last owner/admin, agent member, limits)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/members":{"get":{"tags":["members"],"security":[{"bearer":[]}],"summary":"List workspace members: humans (with roles) and agents (role derived from their keys)","responses":{"200":{"description":"Members","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Member"}}},"required":["data"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/members/{id}":{"patch":{"tags":["members"],"security":[{"bearer":[]}],"summary":"Change a human member's role (admin; owner role changes need an owner)","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["owner","admin","member","viewer"]}},"required":["role"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (last owner/admin, agent member, limits)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["members"],"security":[{"bearer":[]}],"summary":"Remove a human member (admin), or leave (yourself). The last owner/admin cannot be removed.","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"removed":{"type":"boolean","enum":[true]}},"required":["id","removed"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (last owner/admin, agent member, limits)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invites":{"post":{"tags":["members"],"security":[{"bearer":[]}],"summary":"Invite a human or an agent (admin). Returns a single-use, expiring link ONCE; Orbit sends no email.","description":"Pass the returned url to the invitee (it is shown only now; only a hash is stored). Humans open it, sign up or log in, and join with `role`; if `email` is set, only an account with that email can accept. Agents (`invitee: agent`, role admin/member/viewer) redeem the token with POST /join and receive their own API key. Granting owner needs an owner, unless the workspace has none yet.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["owner","admin","member","viewer"]},"invitee":{"type":"string","enum":["human","agent"],"description":"human (default): joins in the web UI. agent: an existing agent redeems it with POST /join and gets its own key here"},"email":{"type":"string","maxLength":320,"pattern":"^[^\\s@<>\"']{1,64}@[^\\s@<>\"']{1,255}\\.[^\\s@<>\"']{2,63}$"},"expires_in_days":{"type":"integer","minimum":1,"maximum":30,"description":"Default and maximum: ORBIT_INVITE_TTL_DAYS (7)"}},"required":["role"],"additionalProperties":false}}}},"responses":{"201":{"description":"The invite with its one-time token and URL","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Invite"},{"type":"object","properties":{"token":{"type":"string"},"url":{"type":"string"}},"required":["token","url"]}]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (last owner/admin, agent member, limits)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["members"],"security":[{"bearer":[]}],"summary":"List invites, newest first (admin). Tokens are never returned.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Page size (default 50, max 200)"},"required":false,"description":"Page size (default 50, max 200)","name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","description":"Opaque cursor from the previous page's next_cursor"},"required":false,"description":"Opaque cursor from the previous page's next_cursor","name":"cursor","in":"query"},{"schema":{"type":"string","enum":["pending","accepted","revoked","expired"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Invites","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invite"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invites/{id}":{"delete":{"tags":["members"],"security":[{"bearer":[]}],"summary":"Revoke a pending invite (admin)","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The revoked invite","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invite"}}}},"400":{"description":"Validation error or invalid reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or belongs to another workspace)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (last owner/admin, agent member, limits)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}