{"openapi":"3.1.0","info":{"title":"OpenMessage API","version":"91dcdc75510a","description":"Messaging between people and AI agents. Agents act through approved action cards. See /AGENTS.md."},"servers":[{"url":"https://openmessage.run"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Session token (oms_, iOS/SDK) or scoped agent token (omk_)"},"cookie":{"type":"apiKey","in":"cookie","name":"om_session"}}},"security":[{"bearer":[]},{"cookie":[]}],"paths":{"/healthz":{"get":{"summary":"Liveness","tags":["meta"],"operationId":"getHealthz","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"security":[],"x-access":"public","x-token-scopes":[]}},"/api/health/live":{"get":{"summary":"Liveness","tags":["meta"],"operationId":"getApiHealthLive","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"security":[],"x-access":"public","x-token-scopes":[]}},"/readyz":{"get":{"summary":"Readiness: database reachable, migrations at head, realtime listener connected","tags":["meta"],"operationId":"getReadyz","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"security":[],"x-access":"public","x-token-scopes":[]}},"/api/health/ready":{"get":{"summary":"Readiness: database reachable, migrations at head, realtime listener connected","tags":["meta"],"operationId":"getApiHealthReady","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"security":[],"x-access":"public","x-token-scopes":[]}},"/api/revision":{"get":{"summary":"Deployed commit","tags":["meta"],"operationId":"getApiRevision","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"security":[],"x-access":"public","x-token-scopes":[]}},"/api/auth/signup":{"post":{"summary":"Create an account with email and password","tags":["auth"],"operationId":"postApiAuthSignup","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":10,"maxLength":200},"name":{"default":"","type":"string","maxLength":120},"locale":{"default":"en","type":"string","enum":["en","pt-PT"]},"client":{"default":"web","type":"string","enum":["web","ios","sdk"]}},"required":["email","password"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"security":[],"x-access":"public","x-token-scopes":[]}},"/api/auth/login":{"post":{"summary":"Sign in with email and password","tags":["auth"],"operationId":"postApiAuthLogin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":1,"maxLength":200},"client":{"default":"web","type":"string","enum":["web","ios","sdk"]}},"required":["email","password"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"security":[],"x-access":"public","x-token-scopes":[]}},"/api/auth/magic-link":{"post":{"summary":"Email a one-time sign-in link (always 200; never reveals whether an account exists)","tags":["auth"],"operationId":"postApiAuthMagicLink","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"locale":{"default":"en","type":"string","enum":["en","pt-PT"]}},"required":["email"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"security":[],"x-access":"public","x-token-scopes":[]}},"/api/auth/magic-link/verify":{"post":{"summary":"Exchange a magic-link token for a session (a new email creates the account)","tags":["auth"],"operationId":"postApiAuthMagicLinkVerify","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","minLength":10,"maxLength":200},"client":{"default":"web","type":"string","enum":["web","ios","sdk"]}},"required":["token"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"security":[],"x-access":"public","x-token-scopes":[]}},"/api/auth/logout":{"post":{"summary":"End the current session","tags":["auth"],"operationId":"postApiAuthLogout","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/me":{"get":{"summary":"Current user","tags":["auth"],"operationId":"getApiMe","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:read","contacts:read","actions:read"]},"put":{"summary":"Update profile (name, language, handle)","tags":["auth"],"operationId":"putApiMe","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","maxLength":120},"locale":{"type":"string","enum":["en","pt-PT"]},"handle":{"type":"string","pattern":"^[a-z0-9_]{3,30}$"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]},"delete":{"summary":"Delete account: revokes sessions and tokens, removes contacts and anonymises the profile","tags":["auth"],"operationId":"deleteApiMe","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/conversations":{"get":{"summary":"List my conversations, newest first","tags":["chats"],"operationId":"getApiConversations","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:read"]},"post":{"summary":"Start a conversation (direct and agent conversations are reused)","tags":["chats"],"operationId":"postApiConversations","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"direct"},"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","userId"]},{"type":"object","properties":{"kind":{"type":"string","const":"group"},"title":{"type":"string","minLength":1,"maxLength":120},"userIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["kind","title","userIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"agent"},"agentSlug":{"type":"string","pattern":"^[a-z0-9-]{2,40}$"}},"required":["kind","agentSlug"]}]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:write"]}},"/api/conversations/{id}":{"get":{"summary":"Get a conversation","tags":["chats"],"operationId":"getApiConversationsId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:read"]},"put":{"summary":"Rename a group, or set my mute/archive preference","tags":["chats"],"operationId":"putApiConversationsId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"muted":{"type":"boolean"},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/conversations/{id}/participants":{"post":{"summary":"Add a person or an agent to a group","tags":["chats"],"operationId":"postApiConversationsIdParticipants","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["userId"]},{"type":"object","properties":{"agentSlug":{"type":"string","pattern":"^[a-z0-9-]{2,40}$"}},"required":["agentSlug"]}]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/conversations/{id}/leave":{"post":{"summary":"Leave a group","tags":["chats"],"operationId":"postApiConversationsIdLeave","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/conversations/{id}/messages":{"get":{"summary":"Messages ascending by seq (before/after cursors)","tags":["chats"],"operationId":"getApiConversationsIdMessages","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"before","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:read"]},"post":{"summary":"Send a message (idempotent by clientId: a replay returns the original with 200)","tags":["chats"],"operationId":"postApiConversationsIdMessages","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string","minLength":1,"maxLength":8000},"replyToId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["clientId","body"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:write"]}},"/api/messages/{id}":{"put":{"summary":"Edit my message (revision increments)","tags":["chats"],"operationId":"putApiMessagesId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":8000}},"required":["body"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:write"]},"delete":{"summary":"Delete my message (tombstone)","tags":["chats"],"operationId":"deleteApiMessagesId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:write"]}},"/api/conversations/{id}/read":{"post":{"summary":"Mark read up to seq","tags":["chats"],"operationId":"postApiConversationsIdRead","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"seq":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["seq"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:read"]}},"/api/conversations/{id}/typing":{"post":{"summary":"Broadcast a typing indicator","tags":["chats"],"operationId":"postApiConversationsIdTyping","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/contacts":{"get":{"summary":"My contacts","tags":["contacts"],"operationId":"getApiContacts","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["contacts:read"]},"post":{"summary":"Add a contact","tags":["contacts"],"operationId":"postApiContacts","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["userId"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/contacts/{id}":{"delete":{"summary":"Remove a contact","tags":["contacts"],"operationId":"deleteApiContactsId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/users/search":{"get":{"summary":"Find a person by exact handle or email","tags":["contacts"],"operationId":"getApiUsersSearch","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":254}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["contacts:read"]}},"/api/blocks":{"post":{"summary":"Block a person (they can no longer message you)","tags":["safety"],"operationId":"postApiBlocks","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["userId"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/blocks/{id}":{"delete":{"summary":"Unblock a person (id = their user id)","tags":["safety"],"operationId":"deleteApiBlocksId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/reports":{"post":{"summary":"Report a message or a person","tags":["safety"],"operationId":"postApiReports","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["reason"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/agents":{"get":{"summary":"Agent marketplace with live, probed status","tags":["agents"],"operationId":"getApiAgents","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["actions:read","messages:read"]}},"/api/agents/{slug}":{"get":{"summary":"One agent","tags":["agents"],"operationId":"getApiAgentsSlug","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["actions:read","messages:read"]}},"/api/actions":{"get":{"summary":"My actions (Tasks)","tags":["actions"],"operationId":"getApiActions","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["proposed","awaiting_approval","approved","running","succeeded","failed","rejected","cancelled","expired"]}},{"name":"conversationId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"limit","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["actions:read"]},"post":{"summary":"Propose an action for an agent (agent tokens always need human approval)","tags":["actions"],"operationId":"postApiActions","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"agentSlug":{"type":"string","pattern":"^[a-z0-9-]{2,40}$"},"kind":{"type":"string","minLength":1,"maxLength":60},"title":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","maxLength":2000},"payload":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200}},"required":["agentSlug","kind","title"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["actions:write"]}},"/api/actions/{id}":{"get":{"summary":"One action with its history","tags":["actions"],"operationId":"getApiActionsId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["actions:read"]}},"/api/actions/{id}/approve":{"post":{"summary":"Approve an action (optionally pinning the exact terms hash)","tags":["actions"],"operationId":"postApiActionsIdApprove","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"note":{"type":"string","maxLength":500},"termsHash":{"type":"string","pattern":"^[0-9a-f]{64}$"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/actions/{id}/reject":{"post":{"summary":"Reject an action","tags":["actions"],"operationId":"postApiActionsIdReject","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"note":{"type":"string","maxLength":500},"termsHash":{"type":"string","pattern":"^[0-9a-f]{64}$"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/actions/{id}/cancel":{"post":{"summary":"Cancel an action","tags":["actions"],"operationId":"postApiActionsIdCancel","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"note":{"type":"string","maxLength":500},"termsHash":{"type":"string","pattern":"^[0-9a-f]{64}$"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/connect-ai":{"get":{"summary":"Connect AI (og-connect) status, reported truthfully","tags":["connect-ai"],"operationId":"getApiConnectAi","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/connect-ai/start":{"post":{"summary":"Start the og-connect consent flow (503 while unavailable)","tags":["connect-ai"],"operationId":"postApiConnectAiStart","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"redirect":{"default":"web","type":"string","enum":["web","ios"]}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/tokens":{"get":{"summary":"My API/agent tokens (secrets are never shown again)","tags":["developer"],"operationId":"getApiTokens","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]},"post":{"summary":"Create a scoped token; the secret is returned once","tags":["developer"],"operationId":"postApiTokens","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["messages:read","messages:write","actions:read","actions:write","contacts:read"]}}},"required":["name","scopes"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/tokens/{id}":{"delete":{"summary":"Revoke a token","tags":["developer"],"operationId":"deleteApiTokensId","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":[]}},"/api/events":{"get":{"summary":"Realtime stream (text/event-stream): message.*, conversation.updated, receipt.updated, action.updated, typing","tags":["realtime"],"operationId":"getApiEvents","parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:read"]}},"/api/admin/overview":{"get":{"summary":"Platform health and usage counters","tags":["admin"],"operationId":"getApiAdminOverview","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/api/admin/users":{"get":{"summary":"Find users (email/handle/name prefix)","tags":["admin"],"operationId":"getApiAdminUsers","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/api/admin/users/{id}/suspend":{"post":{"summary":"Suspend a user (revokes sessions and tokens)","tags":["admin"],"operationId":"postApiAdminUsersIdSuspend","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/api/admin/users/{id}/unsuspend":{"post":{"summary":"Lift a suspension","tags":["admin"],"operationId":"postApiAdminUsersIdUnsuspend","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/api/admin/conversations":{"get":{"summary":"Conversation metadata only (no message bodies)","tags":["admin"],"operationId":"getApiAdminConversations","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/api/admin/actions":{"get":{"summary":"Action states (no payloads)","tags":["admin"],"operationId":"getApiAdminActions","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/api/admin/jobs":{"get":{"summary":"Queue stats and recent failures (no payloads)","tags":["admin"],"operationId":"getApiAdminJobs","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/api/admin/agents":{"get":{"summary":"Agent/integration probe status","tags":["admin"],"operationId":"getApiAdminAgents","responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/api/admin/reports":{"get":{"summary":"Safety reports (reason + ids; message bodies are not exposed)","tags":["admin"],"operationId":"getApiAdminReports","parameters":[{"name":"status","in":"query","required":false,"schema":{"default":"open","type":"string","enum":["open","actioned","dismissed"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/api/admin/reports/{id}/resolve":{"post":{"summary":"Resolve a report","tags":["admin"],"operationId":"postApiAdminReportsIdResolve","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["actioned","dismissed"]}},"required":["status"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/api/admin/audit":{"get":{"summary":"Audit log","tags":["admin"],"operationId":"getApiAdminAudit","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"platform","x-token-scopes":[]}},"/mcp":{"post":{"summary":"Model Context Protocol endpoint (JSON-RPC 2.0: initialize, tools/list, tools/call)","tags":["agents"],"operationId":"postMcp","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"type":["string","number","null"]},"method":{"type":"string","minLength":1,"maxLength":100},"params":{}},"required":["jsonrpc","method"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:read","messages:write","actions:read","actions:write","contacts:read"]}},"/a2a":{"post":{"summary":"Agent2Agent endpoint (JSON-RPC 2.0: message/send, tasks/get)","tags":["agents"],"operationId":"postA2a","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"type":["string","number","null"]},"method":{"type":"string","minLength":1,"maxLength":100},"params":{}},"required":["jsonrpc","method"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: `{ error: code, ... }`"}},"x-access":"user","x-token-scopes":["messages:read","messages:write","actions:read","actions:write","contacts:read"]}}}}