{"openapi":"3.1.0","info":{"title":"hiza API","version":"1","description":"Authentication: the session cookie (hiza's own web client; writes check the Origin); hiza's own apps (M13): `Authorization: Bearer hiza_dat_…` from /api/v1/auth/token; or — for the platform's endpoints (M11) — `Authorization: Bearer` with an OAuth access token (`hiza_at_…`, from /oauth/token) or an API key (`hiza_live_…`). Scopes: profile, conversations.read, conversations.write, messages.read, messages.write. Webhooks follow Standard Webhooks (webhook-id, webhook-timestamp, webhook-signature)."},"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"hiza_session"},"bearer":{"type":"http","scheme":"bearer","description":"hiza's apps' access token, an OAuth access token or an API key"},"oauth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"/oauth/authorize","tokenUrl":"/oauth/token","refreshUrl":"/oauth/token","scopes":{"profile":"See your name, username and email address","conversations.read":"See the organization's conversations that the app started or linked, and who is in them","conversations.write":"Start conversations for the organization, add people to them and link them to its records","messages.read":"Read messages in those conversations (and receive their text in webhooks)","messages.write":"Send messages in those conversations"}}}}}},"paths":{"/api/v1/auth/token":{"post":{"summary":"hiza's apps: tokens for a sign-in code (with the PKCE verifier) or for a refresh token","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"grantType":{"type":"string","const":"authorization_code"},"code":{"type":"string","minLength":16,"maxLength":128,"description":"From the app link /app/callback?code=…"},"codeVerifier":{"type":"string","minLength":43,"maxLength":128,"description":"The PKCE verifier of the code_challenge sent to /api/auth/app"},"deviceName":{"description":"Shown in the device list, e.g. the phone's name","type":"string","maxLength":100}},"required":["grantType","code","codeVerifier"]},{"type":"object","properties":{"grantType":{"type":"string","const":"refresh_token"},"refreshToken":{"type":"string","minLength":1,"maxLength":200}},"required":["grantType","refreshToken"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accessToken":{"type":"string","description":"hiza_dat_…, 15 minutes"},"refreshToken":{"type":"string","description":"hiza_drt_…; replaced at every refresh, keep only the newest"},"tokenType":{"type":"string","const":"Bearer"},"expiresIn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deviceId":{"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)$"},"user":{"type":"object","properties":{"id":{"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)$"},"setUp":{"type":"boolean","description":"Finished: the app can open the chats"},"needsName":{"type":"boolean","description":"Coredo Account has no name for them: ask for one here"},"hasUsername":{"type":"boolean","description":"False: they must sign in again (Coredo Account asks for a username)"}},"required":["id","setUp","needsName","hasUsername"],"additionalProperties":false}},"required":["accessToken","refreshToken","tokenType","expiresIn","deviceId","user"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/auth/sign-out":{"post":{"summary":"hiza's apps: sign this device out","responses":{"204":{"description":"204"}}}},"/api/v1/me/welcome":{"get":{"summary":"What is left of the first-run setup","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"setUp":{"type":"boolean","description":"Finished: the app can open the chats"},"needsName":{"type":"boolean","description":"Coredo Account has no name for them: ask for one here"},"hasUsername":{"type":"boolean","description":"False: they must sign in again (Coredo Account asks for a username)"}},"required":["setUp","needsName","hasUsername"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Finish the first-run setup (a name, only when Coredo Account has none)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":64}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"setUp":{"type":"boolean","description":"Finished: the app can open the chats"},"needsName":{"type":"boolean","description":"Coredo Account has no name for them: ask for one here"},"hasUsername":{"type":"boolean","description":"False: they must sign in again (Coredo Account asks for a username)"}},"required":["setUp","needsName","hasUsername"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/unread":{"get":{"summary":"The viewer's unread count (the app badge's number)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unread messages that notify, as the app badge counts them"}},"required":["count"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/notifications/app-subscription":{"put":{"summary":"hiza's apps: this device's APNs or FCM token and its RFC 8291 keys","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channel":{"type":"string","enum":["apns","fcm"]},"token":{"type":"string","minLength":8,"maxLength":4096,"description":"The device token from APNs or FCM"},"environment":{"description":"APNs only: sandbox for development builds (default production)","type":"string","enum":["production","sandbox"]},"keys":{"type":"object","properties":{"p256dh":{"type":"string","minLength":1,"maxLength":200},"auth":{"type":"string","minLength":1,"maxLength":100}},"required":["p256dh","auth"],"description":"The app's key pair for RFC 8291, as a browser's: the payload is encrypted to it"},"others":{"description":"The device ids of this app's other accounts on this phone: they keep the token (M14)","maxItems":2,"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":["channel","token","keys"],"additionalProperties":false}}}},"responses":{"204":{"description":"204"}}}},"/api/v1/me":{"get":{"summary":"The signed-in user","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"email":{"type":"string"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]}},"required":["id","email","username","displayName","avatarUrl"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/privacy":{"get":{"summary":"Privacy settings","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"whoCanMessage":{"type":"string","enum":["everyone_requests","contacts","nobody"]},"findableByUsername":{"type":"boolean"},"lastSeen":{"type":"string","enum":["everyone","contacts","nobody"]},"avatarVisibility":{"type":"string","enum":["everyone","contacts","nobody"]},"readReceipts":{"type":"boolean"},"forwardLink":{"type":"boolean"},"groupInvites":{"type":"string","enum":["everyone","contacts"]}},"required":["whoCanMessage","findableByUsername","lastSeen","avatarVisibility","readReceipts","forwardLink","groupInvites"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"patch":{"summary":"Change privacy settings","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"whoCanMessage":{"type":"string","enum":["everyone_requests","contacts","nobody"]},"findableByUsername":{"type":"boolean"},"lastSeen":{"type":"string","enum":["everyone","contacts","nobody"]},"avatarVisibility":{"type":"string","enum":["everyone","contacts","nobody"]},"readReceipts":{"type":"boolean"},"forwardLink":{"type":"boolean"},"groupInvites":{"type":"string","enum":["everyone","contacts"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"whoCanMessage":{"type":"string","enum":["everyone_requests","contacts","nobody"]},"findableByUsername":{"type":"boolean"},"lastSeen":{"type":"string","enum":["everyone","contacts","nobody"]},"avatarVisibility":{"type":"string","enum":["everyone","contacts","nobody"]},"readReceipts":{"type":"boolean"},"forwardLink":{"type":"boolean"},"groupInvites":{"type":"string","enum":["everyone","contacts"]}},"required":["whoCanMessage","findableByUsername","lastSeen","avatarVisibility","readReceipts","forwardLink","groupInvites"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/devices":{"get":{"summary":"Signed-in devices","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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":{"type":"string"},"platform":{"type":"string","enum":["web","pwa","ios","android"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastSeenAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"isCurrent":{"type":"boolean"}},"required":["id","name","platform","createdAt","lastSeenAt","isCurrent"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/devices/{id}":{"delete":{"summary":"Sign a device out","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/me/devices/revoke-others":{"post":{"summary":"Sign out every other device","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"revoked":{"type":"number"}},"required":["revoked"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/blocks":{"get":{"summary":"Blocked people","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"blockedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","username","displayName","blockedAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/blocks/{userId}":{"put":{"summary":"Block someone","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}},"delete":{"summary":"Unblock someone","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/me/contacts":{"get":{"summary":"Contacts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isSelf":{"type":"boolean"},"isContact":{"type":"boolean"},"contactName":{"type":["string","null"]},"isBlocked":{"type":"boolean"}},"required":["id","username","displayName","avatarUrl","isSelf","isContact","contactName","isBlocked"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/contacts/{userId}":{"put":{"summary":"Add or rename a contact","parameters":[{"name":"userId","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":{"customName":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"204":{"description":"204"}}},"delete":{"summary":"Remove a contact","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/me/export":{"get":{"summary":"Download my data (needs a fresh sign-in)","responses":{"200":{"description":"application/json attachment"}}}},"/api/v1/me/export/archive":{"get":{"summary":"Download everything as a ZIP: the JSON export and the photos, videos and files you sent (fresh sign-in)","responses":{"200":{"description":"application/zip attachment"}}}},"/api/v1/reports":{"post":{"summary":"Report a message, a person or a group (M8): { kind, messageId | userId | conversationId, reason, details? }","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"message"},"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)$"},"reason":{"type":"string","enum":["spam","harassment","violence","sexual","illegal","other"]},"details":{"type":"string","maxLength":1000}},"required":["kind","messageId","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"user"},"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","enum":["spam","harassment","violence","sexual","illegal","other"]},"details":{"type":"string","maxLength":1000}},"required":["kind","userId","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"group"},"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)$"},"reason":{"type":"string","enum":["spam","harassment","violence","sexual","illegal","other"]},"details":{"type":"string","maxLength":1000}},"required":["kind","conversationId","reason"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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":["id"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/reports":{"get":{"summary":"The reports you made and how they ended","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"kind":{"type":"string","enum":["message","user","group","notice","appeal"]},"reason":{"type":"string","enum":["spam","harassment","violence","sexual","illegal","other"]},"status":{"type":"string","enum":["open","actioned","dismissed"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","kind","reason","status","createdAt","decidedAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/notices":{"get":{"summary":"Statements of reasons for moderation decisions about you","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"action":{"type":"string","enum":["remove_message","suspend_account","lift_suspension"]},"ground":{"type":"string","enum":["terms","law"]},"groundDetail":{"type":"string","description":"The clause of the terms or the provision of law"},"statement":{"type":"string","description":"The facts and reasons, in words for the person"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"seen":{"type":"boolean"},"appeal":{"type":"string","enum":["none","open","decided"]}},"required":["id","action","ground","groundDetail","statement","createdAt","seen","appeal"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/notices/{id}/appeal":{"post":{"summary":"Ask for a review of a decision about you: { explanation }","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":{"explanation":{"type":"string","minLength":1,"maxLength":2000}},"required":["explanation"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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":["id"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/delete":{"post":{"summary":"Delete my account (needs a fresh sign-in)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"confirm":{"type":"string","const":"delete my account"}},"required":["confirm"],"additionalProperties":false}}}},"responses":{"204":{"description":"204"}}}},"/api/v1/users/search":{"get":{"summary":"Find people by username (exact from 3 characters, prefix from 4)","parameters":[{"name":"username","in":"query","required":true,"description":"the username or its beginning","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isSelf":{"type":"boolean"},"isContact":{"type":"boolean"},"contactName":{"type":["string","null"]},"isBlocked":{"type":"boolean"}},"required":["id","username","displayName","avatarUrl","isSelf","isContact","contactName","isBlocked"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/users/{id}":{"get":{"summary":"A user, as the viewer may see them","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isSelf":{"type":"boolean"},"isContact":{"type":"boolean"},"contactName":{"type":["string","null"]},"isBlocked":{"type":"boolean"}},"required":["id","username","displayName","avatarUrl","isSelf","isContact","contactName","isBlocked"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/users/{id}/avatar":{"get":{"summary":"A user's photo, if the viewer may see it","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"image"}}}},"/api/v1/realtime/tickets":{"post":{"summary":"A single-use ticket for the realtime socket","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ticket":{"type":"string"},"url":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["ticket","url","expiresAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/conversations":{"get":{"summary":"The chat list (?folder=main|archived|requests)","parameters":[{"name":"folder","in":"query","required":true,"description":"main | archived | requests","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Open a direct chat or Saved messages, or make a group (meta.notAdded)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"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"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"saved"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"group"},"title":{"type":"string","maxLength":200},"memberIds":{"default":[],"maxItems":199,"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"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/conversations/{id}":{"get":{"summary":"One chat","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"patch":{"summary":"Change a group's name, description, member permissions or history visibility","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","maxLength":200},"about":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}]},"permissions":{"type":"integer","minimum":0,"maximum":31},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":1048576,"maximum":2147483648},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/conversations/{id}/settings":{"put":{"summary":"Pin, archive or mute (your own view)","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":{"pinned":{"type":"boolean"},"archived":{"type":"boolean"},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"description":"While muted, mentions still notify (M5)","type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/conversations/{id}/draft":{"put":{"summary":"Save the draft (synced to your devices)","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":{"text":{"type":"string","maxLength":4096},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"]}}},"required":["text"],"additionalProperties":false}}}},"responses":{"204":{"description":"204"}}}},"/api/v1/conversations/{id}/read":{"post":{"summary":"Move the read cursor","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"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["lastReadSeq"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/conversations/{id}/messages":{"get":{"summary":"A page of messages (?before|after&limit), oldest first","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"before","in":"query","required":true,"description":"seq","schema":{"type":"string"}},{"name":"after","in":"query","required":true,"description":"seq","schema":{"type":"string"}},{"name":"limit","in":"query","required":true,"description":"1–100","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":false},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"fromVisitor":{"type":"boolean","description":"M10: the website visitor wrote it"},"appName":{"description":"M11: an app wrote it through its API key: the app's name","type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"body":{"type":["string","null"]},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"encrypted":{"type":"boolean","description":"M12: a private chat's message (ciphertext only; the device decrypts it)"},"action":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}},{"type":"null"}],"description":"A service message's action, with user ids (docs/API.md → Service messages)"},"mentioned":{"type":"boolean"},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"preview":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","seq","senderId","preview","deleted"],"additionalProperties":false},{"type":"null"}]},"forward":{"anyOf":[{"type":"object","properties":{"userId":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":["string","null"]},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["userId","name","date"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deleted":{"type":"boolean"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mine":{"type":"boolean"}},"required":["emoji","count","mine"],"additionalProperties":false}},"media":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"kind":{"type":"string","enum":["photo","video","file"]},"quality":{"type":"string","enum":["compressed","original"]},"status":{"type":"string","enum":["uploading","processing","ready","failed","expired","deleted"]},"failure":{"description":"Why it failed: unsupported, too_long, location_kept, processing_failed","type":["string","null"]},"filename":{"type":"string"},"mime":{"type":"string","description":"From the file's content; what a download of the original is"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"temporary":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"hasLocation":{"type":"boolean","description":"An original that still says where it was made"},"variants":{"type":"array","items":{"type":"string","enum":["original","preview","thumb","playback","poster"]},"description":"What GET /api/v1/media/urls can give addresses for"}},"required":["id","kind","quality","status","failure","filename","mime","size","width","height","durationMs","temporary","expiresAt","hasLocation","variants"],"additionalProperties":false}},"clientMessageId":{"anyOf":[{"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)$"},{"type":"null"}]}},"required":["id","conversationId","seq","hidden","senderId","fromVisitor","appName","kind","body","entities","encrypted","action","mentioned","replyTo","forward","createdAt","editedAt","deleted","reactions","media","clientMessageId"],"additionalProperties":false},{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":true}},"required":["id","conversationId","seq","hidden"],"additionalProperties":false}]}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Send a message (idempotent by clientMessageId)","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":{"clientMessageId":{"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","maxLength":4096},"entities":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"]}},"replyToId":{"anyOf":[{"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)$"},{"type":"null"}]},"attachmentIds":{"description":"Uploaded attachments, in order; the body is then an optional caption","maxItems":10,"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":["clientMessageId","body"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":false},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"fromVisitor":{"type":"boolean","description":"M10: the website visitor wrote it"},"appName":{"description":"M11: an app wrote it through its API key: the app's name","type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"body":{"type":["string","null"]},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"encrypted":{"type":"boolean","description":"M12: a private chat's message (ciphertext only; the device decrypts it)"},"action":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}},{"type":"null"}],"description":"A service message's action, with user ids (docs/API.md → Service messages)"},"mentioned":{"type":"boolean"},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"preview":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","seq","senderId","preview","deleted"],"additionalProperties":false},{"type":"null"}]},"forward":{"anyOf":[{"type":"object","properties":{"userId":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":["string","null"]},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["userId","name","date"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deleted":{"type":"boolean"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mine":{"type":"boolean"}},"required":["emoji","count","mine"],"additionalProperties":false}},"media":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"kind":{"type":"string","enum":["photo","video","file"]},"quality":{"type":"string","enum":["compressed","original"]},"status":{"type":"string","enum":["uploading","processing","ready","failed","expired","deleted"]},"failure":{"description":"Why it failed: unsupported, too_long, location_kept, processing_failed","type":["string","null"]},"filename":{"type":"string"},"mime":{"type":"string","description":"From the file's content; what a download of the original is"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"temporary":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"hasLocation":{"type":"boolean","description":"An original that still says where it was made"},"variants":{"type":"array","items":{"type":"string","enum":["original","preview","thumb","playback","poster"]},"description":"What GET /api/v1/media/urls can give addresses for"}},"required":["id","kind","quality","status","failure","filename","mime","size","width","height","durationMs","temporary","expiresAt","hasLocation","variants"],"additionalProperties":false}},"clientMessageId":{"anyOf":[{"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)$"},{"type":"null"}]}},"required":["id","conversationId","seq","hidden","senderId","fromVisitor","appName","kind","body","entities","encrypted","action","mentioned","replyTo","forward","createdAt","editedAt","deleted","reactions","media","clientMessageId"],"additionalProperties":false},{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":true}},"required":["id","conversationId","seq","hidden"],"additionalProperties":false}]},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/messages/{id}":{"patch":{"summary":"Edit your message (48 hours)","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","maxLength":4096},"entities":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"]}}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":false},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"fromVisitor":{"type":"boolean","description":"M10: the website visitor wrote it"},"appName":{"description":"M11: an app wrote it through its API key: the app's name","type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"body":{"type":["string","null"]},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"encrypted":{"type":"boolean","description":"M12: a private chat's message (ciphertext only; the device decrypts it)"},"action":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}},{"type":"null"}],"description":"A service message's action, with user ids (docs/API.md → Service messages)"},"mentioned":{"type":"boolean"},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"preview":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","seq","senderId","preview","deleted"],"additionalProperties":false},{"type":"null"}]},"forward":{"anyOf":[{"type":"object","properties":{"userId":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":["string","null"]},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["userId","name","date"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deleted":{"type":"boolean"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mine":{"type":"boolean"}},"required":["emoji","count","mine"],"additionalProperties":false}},"media":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"kind":{"type":"string","enum":["photo","video","file"]},"quality":{"type":"string","enum":["compressed","original"]},"status":{"type":"string","enum":["uploading","processing","ready","failed","expired","deleted"]},"failure":{"description":"Why it failed: unsupported, too_long, location_kept, processing_failed","type":["string","null"]},"filename":{"type":"string"},"mime":{"type":"string","description":"From the file's content; what a download of the original is"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"temporary":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"hasLocation":{"type":"boolean","description":"An original that still says where it was made"},"variants":{"type":"array","items":{"type":"string","enum":["original","preview","thumb","playback","poster"]},"description":"What GET /api/v1/media/urls can give addresses for"}},"required":["id","kind","quality","status","failure","filename","mime","size","width","height","durationMs","temporary","expiresAt","hasLocation","variants"],"additionalProperties":false}},"clientMessageId":{"anyOf":[{"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)$"},{"type":"null"}]}},"required":["id","conversationId","seq","hidden","senderId","fromVisitor","appName","kind","body","entities","encrypted","action","mentioned","replyTo","forward","createdAt","editedAt","deleted","reactions","media","clientMessageId"],"additionalProperties":false},{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":true}},"required":["id","conversationId","seq","hidden"],"additionalProperties":false}]},"meta":{},"error":{"type":"null"}}}}}}}},"delete":{"summary":"Delete for me or everyone (?for=me|everyone)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"for","in":"query","required":true,"description":"me | everyone","schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/messages/{id}/reactions/{emoji}":{"put":{"summary":"React","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"emoji","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}},"delete":{"summary":"Remove a reaction","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"emoji","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/messages/forward":{"post":{"summary":"Forward messages to chats","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageIds":{"minItems":1,"maxItems":100,"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)$"}},"toConversationIds":{"minItems":1,"maxItems":10,"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":["messageIds","toConversationIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":false},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"fromVisitor":{"type":"boolean","description":"M10: the website visitor wrote it"},"appName":{"description":"M11: an app wrote it through its API key: the app's name","type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"body":{"type":["string","null"]},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"encrypted":{"type":"boolean","description":"M12: a private chat's message (ciphertext only; the device decrypts it)"},"action":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}},{"type":"null"}],"description":"A service message's action, with user ids (docs/API.md → Service messages)"},"mentioned":{"type":"boolean"},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"preview":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","seq","senderId","preview","deleted"],"additionalProperties":false},{"type":"null"}]},"forward":{"anyOf":[{"type":"object","properties":{"userId":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":["string","null"]},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["userId","name","date"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deleted":{"type":"boolean"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mine":{"type":"boolean"}},"required":["emoji","count","mine"],"additionalProperties":false}},"media":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"kind":{"type":"string","enum":["photo","video","file"]},"quality":{"type":"string","enum":["compressed","original"]},"status":{"type":"string","enum":["uploading","processing","ready","failed","expired","deleted"]},"failure":{"description":"Why it failed: unsupported, too_long, location_kept, processing_failed","type":["string","null"]},"filename":{"type":"string"},"mime":{"type":"string","description":"From the file's content; what a download of the original is"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"temporary":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"hasLocation":{"type":"boolean","description":"An original that still says where it was made"},"variants":{"type":"array","items":{"type":"string","enum":["original","preview","thumb","playback","poster"]},"description":"What GET /api/v1/media/urls can give addresses for"}},"required":["id","kind","quality","status","failure","filename","mime","size","width","height","durationMs","temporary","expiresAt","hasLocation","variants"],"additionalProperties":false}},"clientMessageId":{"anyOf":[{"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)$"},{"type":"null"}]}},"required":["id","conversationId","seq","hidden","senderId","fromVisitor","appName","kind","body","entities","encrypted","action","mentioned","replyTo","forward","createdAt","editedAt","deleted","reactions","media","clientMessageId"],"additionalProperties":false},{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":true}},"required":["id","conversationId","seq","hidden"],"additionalProperties":false}]}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/requests":{"get":{"summary":"Message requests","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/requests/{id}/accept":{"post":{"summary":"Accept a message request","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/requests/{id}/decline":{"post":{"summary":"Decline a message request","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/sync/state":{"get":{"summary":"Your position in the update log","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["seq"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/sync/difference":{"get":{"summary":"Updates since a position (?since&limit)","parameters":[{"name":"since","in":"query","required":true,"description":"seq","schema":{"type":"string"}},{"name":"limit","in":"query","required":true,"description":"1–500","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"tooLong":{"type":"boolean","const":false},"updates":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string"},"conversationId":{"anyOf":[{"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)$"},{"type":"null"}]},"conversation":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false},{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":false}},"required":["id","visible"],"additionalProperties":false}]},"message":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":false},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"fromVisitor":{"type":"boolean","description":"M10: the website visitor wrote it"},"appName":{"description":"M11: an app wrote it through its API key: the app's name","type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"body":{"type":["string","null"]},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"encrypted":{"type":"boolean","description":"M12: a private chat's message (ciphertext only; the device decrypts it)"},"action":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}},{"type":"null"}],"description":"A service message's action, with user ids (docs/API.md → Service messages)"},"mentioned":{"type":"boolean"},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"preview":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","seq","senderId","preview","deleted"],"additionalProperties":false},{"type":"null"}]},"forward":{"anyOf":[{"type":"object","properties":{"userId":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":["string","null"]},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["userId","name","date"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deleted":{"type":"boolean"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mine":{"type":"boolean"}},"required":["emoji","count","mine"],"additionalProperties":false}},"media":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"kind":{"type":"string","enum":["photo","video","file"]},"quality":{"type":"string","enum":["compressed","original"]},"status":{"type":"string","enum":["uploading","processing","ready","failed","expired","deleted"]},"failure":{"description":"Why it failed: unsupported, too_long, location_kept, processing_failed","type":["string","null"]},"filename":{"type":"string"},"mime":{"type":"string","description":"From the file's content; what a download of the original is"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"temporary":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"hasLocation":{"type":"boolean","description":"An original that still says where it was made"},"variants":{"type":"array","items":{"type":"string","enum":["original","preview","thumb","playback","poster"]},"description":"What GET /api/v1/media/urls can give addresses for"}},"required":["id","kind","quality","status","failure","filename","mime","size","width","height","durationMs","temporary","expiresAt","hasLocation","variants"],"additionalProperties":false}},"clientMessageId":{"anyOf":[{"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)$"},{"type":"null"}]}},"required":["id","conversationId","seq","hidden","senderId","fromVisitor","appName","kind","body","entities","encrypted","action","mentioned","replyTo","forward","createdAt","editedAt","deleted","reactions","media","clientMessageId"],"additionalProperties":false},{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":true}},"required":["id","conversationId","seq","hidden"],"additionalProperties":false}]},"read":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["userId","seq"],"additionalProperties":false}},"required":["seq","kind","conversationId"],"additionalProperties":false}},"toSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"more":{"type":"boolean"}},"required":["tooLong","updates","toSeq","more"],"additionalProperties":false},{"type":"object","properties":{"tooLong":{"type":"boolean","const":true},"toSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["tooLong","toSeq"],"additionalProperties":false}]},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/conversations/{id}/photo":{"get":{"summary":"The group's photo (members)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"image"}}},"put":{"summary":"Set the group's photo (image body)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}},"delete":{"summary":"Remove the group's photo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/conversations/{id}/members":{"get":{"summary":"The people in the chat (?ids=a,b also returns people who left)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"joinedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"active":{"type":"boolean"},"actions":{"type":"array","items":{"type":"string","enum":["remove","restrict","promote","editRights","demote"]}}},"required":["user","role","permissions","joinedAt","active","actions"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Add people to a group","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":{"userIds":{"minItems":1,"maxItems":199,"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":["userIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"added":{"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)$"}},"notAdded":{"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":["added","notAdded"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/conversations/{id}/members/{userId}":{"patch":{"summary":"Make an admin, change rights, restrict, or make an ordinary member","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","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":{"role":{"type":"string","const":"admin"},"rights":{"type":"integer","minimum":0,"maximum":63,"description":"change info 1, delete messages 2, ban 4, invite 8, pin 16, admins 32"}},"required":["role","rights"],"additionalProperties":false},{"type":"object","properties":{"role":{"type":"string","const":"restricted"},"permissions":{"type":"integer","minimum":0,"maximum":31}},"required":["role","permissions"],"additionalProperties":false},{"type":"object","properties":{"role":{"type":"string","const":"member"}},"required":["role"],"additionalProperties":false}]}}}},"responses":{"204":{"description":"204"}}},"delete":{"summary":"Remove someone (?ban=true keeps them from rejoining by link)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"ban","in":"query","required":true,"description":"true | false","schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/conversations/{id}/leave":{"post":{"summary":"Leave a group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/conversations/{id}/invites":{"get":{"summary":"The group's invite links","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"code":{"type":"string"},"url":{"type":"string","description":"Relative: /+<code>"},"createdById":{"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)$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"maxUses":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"uses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requiresApproval":{"type":"boolean"},"state":{"type":"string","enum":["active","expired","used_up","revoked"]}},"required":["id","code","url","createdById","createdAt","expiresAt","maxUses","uses","requiresApproval","state"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Make an invite link","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":{"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"maxUses":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"requiresApproval":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"code":{"type":"string"},"url":{"type":"string","description":"Relative: /+<code>"},"createdById":{"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)$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"maxUses":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"uses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requiresApproval":{"type":"boolean"},"state":{"type":"string","enum":["active","expired","used_up","revoked"]}},"required":["id","code","url","createdById","createdAt","expiresAt","maxUses","uses","requiresApproval","state"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/conversations/{id}/invites/{inviteId}":{"delete":{"summary":"Revoke an invite link","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"inviteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/conversations/{id}/join-requests":{"get":{"summary":"People asking to join","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["user","createdAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/conversations/{id}/join-requests/{userId}/approve":{"post":{"summary":"Let someone in","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/conversations/{id}/join-requests/{userId}/decline":{"post":{"summary":"Decline a join request (they are not told)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/conversations/{id}/pins":{"get":{"summary":"Pinned messages, newest first","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":false},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"fromVisitor":{"type":"boolean","description":"M10: the website visitor wrote it"},"appName":{"description":"M11: an app wrote it through its API key: the app's name","type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"body":{"type":["string","null"]},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"encrypted":{"type":"boolean","description":"M12: a private chat's message (ciphertext only; the device decrypts it)"},"action":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}},{"type":"null"}],"description":"A service message's action, with user ids (docs/API.md → Service messages)"},"mentioned":{"type":"boolean"},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"preview":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","seq","senderId","preview","deleted"],"additionalProperties":false},{"type":"null"}]},"forward":{"anyOf":[{"type":"object","properties":{"userId":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":["string","null"]},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["userId","name","date"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deleted":{"type":"boolean"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mine":{"type":"boolean"}},"required":["emoji","count","mine"],"additionalProperties":false}},"media":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"kind":{"type":"string","enum":["photo","video","file"]},"quality":{"type":"string","enum":["compressed","original"]},"status":{"type":"string","enum":["uploading","processing","ready","failed","expired","deleted"]},"failure":{"description":"Why it failed: unsupported, too_long, location_kept, processing_failed","type":["string","null"]},"filename":{"type":"string"},"mime":{"type":"string","description":"From the file's content; what a download of the original is"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"temporary":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"hasLocation":{"type":"boolean","description":"An original that still says where it was made"},"variants":{"type":"array","items":{"type":"string","enum":["original","preview","thumb","playback","poster"]},"description":"What GET /api/v1/media/urls can give addresses for"}},"required":["id","kind","quality","status","failure","filename","mime","size","width","height","durationMs","temporary","expiresAt","hasLocation","variants"],"additionalProperties":false}},"clientMessageId":{"anyOf":[{"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)$"},{"type":"null"}]}},"required":["id","conversationId","seq","hidden","senderId","fromVisitor","appName","kind","body","entities","encrypted","action","mentioned","replyTo","forward","createdAt","editedAt","deleted","reactions","media","clientMessageId"],"additionalProperties":false},{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":true}},"required":["id","conversationId","seq","hidden"],"additionalProperties":false}]}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/messages/{id}/pin":{"put":{"summary":"Pin a message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}},"delete":{"summary":"Unpin a message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/messages/{id}/read-by":{"get":{"summary":"Who read your message (groups of up to 50, 7 days)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/invites/{code}":{"get":{"summary":"What an invite link leads to","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string"},"about":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requiresApproval":{"type":"boolean"},"conversationId":{"anyOf":[{"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)$"},{"type":"null"}]},"requested":{"type":"boolean"}},"required":["title","about","memberCount","requiresApproval","conversationId","requested"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/invites/{code}/join":{"post":{"summary":"Join (or ask to join) by link","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["joined","requested"]},"conversationId":{"anyOf":[{"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)$"},{"type":"null"}]}},"required":["status","conversationId"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/uploads":{"post":{"summary":"Start a resumable upload (tus 1.0 creation: Upload-Length, Upload-Metadata with conversationId, filename, type, as, quality, removeLocation, temporary)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"attachmentId":{"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":["id","attachmentId"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/uploads/{id}":{"patch":{"summary":"Append bytes at Upload-Offset (application/offset+octet-stream); HEAD gives the offset to resume from","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}},"delete":{"summary":"Cancel an unfinished upload","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/media/urls":{"get":{"summary":"Signed media-origin addresses for attachments the viewer may see","parameters":[{"name":"ids","in":"query","required":true,"description":"Attachment ids, comma-separated (up to 100)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"urls":{"type":"object","propertyNames":{"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)$"},"additionalProperties":{"type":"object","properties":{"original":{"type":"string"},"preview":{"type":"string"},"thumb":{"type":"string"},"playback":{"type":"string"},"poster":{"type":"string"}},"additionalProperties":false}},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["urls","expiresAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/search/messages":{"get":{"summary":"Search messages you can read, newest first (meta.next: the next page's cursor; meta.people: senders)","parameters":[{"name":"q","in":"query","required":true,"description":"Words to find, each from the start of a word (scripts without spaces: anywhere)","schema":{"type":"string"}},{"name":"conversationId","in":"query","required":true,"description":"Only this chat","schema":{"type":"string"}},{"name":"senderId","in":"query","required":true,"description":"Only messages this person sent","schema":{"type":"string"}},{"name":"from","in":"query","required":true,"description":"Sent at or after (ISO 8601)","schema":{"type":"string"}},{"name":"before","in":"query","required":true,"description":"Sent before (ISO 8601)","schema":{"type":"string"}},{"name":"type","in":"query","required":true,"description":"photo | video | file | link","schema":{"type":"string"}},{"name":"cursor","in":"query","required":true,"description":"meta.next of the previous page","schema":{"type":"string"}},{"name":"limit","in":"query","required":true,"description":"1–50 (20)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":false},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"fromVisitor":{"type":"boolean","description":"M10: the website visitor wrote it"},"appName":{"description":"M11: an app wrote it through its API key: the app's name","type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"body":{"type":["string","null"]},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"encrypted":{"type":"boolean","description":"M12: a private chat's message (ciphertext only; the device decrypts it)"},"action":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}},{"type":"null"}],"description":"A service message's action, with user ids (docs/API.md → Service messages)"},"mentioned":{"type":"boolean"},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"preview":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","seq","senderId","preview","deleted"],"additionalProperties":false},{"type":"null"}]},"forward":{"anyOf":[{"type":"object","properties":{"userId":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":["string","null"]},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["userId","name","date"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deleted":{"type":"boolean"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mine":{"type":"boolean"}},"required":["emoji","count","mine"],"additionalProperties":false}},"media":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"kind":{"type":"string","enum":["photo","video","file"]},"quality":{"type":"string","enum":["compressed","original"]},"status":{"type":"string","enum":["uploading","processing","ready","failed","expired","deleted"]},"failure":{"description":"Why it failed: unsupported, too_long, location_kept, processing_failed","type":["string","null"]},"filename":{"type":"string"},"mime":{"type":"string","description":"From the file's content; what a download of the original is"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"temporary":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"hasLocation":{"type":"boolean","description":"An original that still says where it was made"},"variants":{"type":"array","items":{"type":"string","enum":["original","preview","thumb","playback","poster"]},"description":"What GET /api/v1/media/urls can give addresses for"}},"required":["id","kind","quality","status","failure","filename","mime","size","width","height","durationMs","temporary","expiresAt","hasLocation","variants"],"additionalProperties":false}},"clientMessageId":{"anyOf":[{"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)$"},{"type":"null"}]}},"required":["id","conversationId","seq","hidden","senderId","fromVisitor","appName","kind","body","entities","encrypted","action","mentioned","replyTo","forward","createdAt","editedAt","deleted","reactions","media","clientMessageId"],"additionalProperties":false},{"type":"object","properties":{"id":{"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)$"},"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hidden":{"type":"boolean","const":true}},"required":["id","conversationId","seq","hidden"],"additionalProperties":false}]}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/search/conversations":{"get":{"summary":"Your chats whose name contains q (groups, people, Saved messages)","parameters":[{"name":"q","in":"query","required":true,"description":"Part of a name or username","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/conversations/{id}/media":{"get":{"summary":"The chat's photos and videos, files, or links, newest first (meta.nextBefore pages back)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"tab","in":"query","required":true,"description":"media | files | links","schema":{"type":"string"}},{"name":"before","in":"query","required":true,"description":"Older than this seq","schema":{"type":"string"}},{"name":"limit","in":"query","required":true,"description":"1–100 (60)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"attachment":{"type":"object","properties":{"id":{"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)$"},"kind":{"type":"string","enum":["photo","video","file"]},"quality":{"type":"string","enum":["compressed","original"]},"status":{"type":"string","enum":["uploading","processing","ready","failed","expired","deleted"]},"failure":{"description":"Why it failed: unsupported, too_long, location_kept, processing_failed","type":["string","null"]},"filename":{"type":"string"},"mime":{"type":"string","description":"From the file's content; what a download of the original is"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"temporary":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"hasLocation":{"type":"boolean","description":"An original that still says where it was made"},"variants":{"type":"array","items":{"type":"string","enum":["original","preview","thumb","playback","poster"]},"description":"What GET /api/v1/media/urls can give addresses for"}},"required":["id","kind","quality","status","failure","filename","mime","size","width","height","durationMs","temporary","expiresAt","hasLocation","variants"],"additionalProperties":false}},"required":["messageId","seq","senderId","createdAt","attachment"],"additionalProperties":false},{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"link":{"type":"object","properties":{"url":{"type":"string"},"text":{"type":"string"}},"required":["url","text"],"additionalProperties":false}},"required":["messageId","seq","senderId","createdAt","link"],"additionalProperties":false}]}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/storage":{"get":{"summary":"Storage for originals: allowance and use","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean","description":"Whether originals and files can be sent (a storage ledger is on)"},"available":{"type":"boolean","description":"False when Crate can't be asked right now: the figures are zeros then"},"allowance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The free allowance plus bought storage, bytes"},"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Originals and files in hiza's chats"},"library":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The Crate library while it counts (managed storage)"},"libraryMode":{"anyOf":[{"type":"string","enum":["managed","own","none"]},{"type":"null"}],"description":"null: hiza keeps the ledger itself"},"others":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","bytes"],"additionalProperties":false},"description":"Other apps using the same storage"},"largest":{"type":"array","items":{"type":"object","properties":{"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)$"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["conversationId","bytes"],"additionalProperties":false}},"upgradeUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Crate's page for more storage"},"hasLibrary":{"description":"Whether the person has a Crate library yet","type":["boolean","null"]},"crateSaves":{"type":"boolean","description":"Whether photos and videos can be saved to Crate here"}},"required":["enabled","available","allowance","used","left","chats","library","libraryMode","others","largest","upgradeUrl","hasLibrary","crateSaves"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/attachments/{id}/save-to-crate":{"get":{"summary":"Where the viewer's save of this photo or video to Crate stands (null: never asked)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"attachmentId":{"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)$"},"state":{"type":"string","enum":["queued","sent","done","duplicate","failed"]},"failure":{"description":"Why it failed, in words for the person","type":["string","null"]}},"required":["attachmentId","state","failure"],"additionalProperties":false},{"type":"null"}]},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Save this photo or video to the viewer's Crate library (202; again after a failure retries)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"attachmentId":{"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)$"},"state":{"type":"string","enum":["queued","sent","done","duplicate","failed"]},"failure":{"description":"Why it failed, in words for the person","type":["string","null"]}},"required":["attachmentId","state","failure"],"additionalProperties":false},{"type":"null"}]},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/notifications/settings":{"get":{"summary":"Notification choices and this device's push state","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"direct":{"type":"boolean","description":"Notify for direct chats"},"groups":{"type":"boolean","description":"Notify for groups"},"showPreview":{"type":"boolean","description":"Sender and text in notifications; off: \"New message\" only"},"sound":{"type":"boolean"},"available":{"type":"boolean","description":"Push is set up on this server (VAPID keys)"},"vapidPublicKey":{"description":"The applicationServerKey for PushManager.subscribe","type":["string","null"]},"subscribed":{"type":"boolean","description":"This device has a subscription"},"endpoint":{"description":"This device's subscription endpoint, to compare with the browser's","type":["string","null"]}},"required":["direct","groups","showPreview","sound","available","vapidPublicKey","subscribed","endpoint"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"put":{"summary":"Change notification choices","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"direct":{"type":"boolean","description":"Notify for direct chats"},"groups":{"type":"boolean","description":"Notify for groups"},"showPreview":{"type":"boolean","description":"Sender and text in notifications; off: \"New message\" only"},"sound":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"direct":{"type":"boolean","description":"Notify for direct chats"},"groups":{"type":"boolean","description":"Notify for groups"},"showPreview":{"type":"boolean","description":"Sender and text in notifications; off: \"New message\" only"},"sound":{"type":"boolean"},"available":{"type":"boolean","description":"Push is set up on this server (VAPID keys)"},"vapidPublicKey":{"description":"The applicationServerKey for PushManager.subscribe","type":["string","null"]},"subscribed":{"type":"boolean","description":"This device has a subscription"},"endpoint":{"description":"This device's subscription endpoint, to compare with the browser's","type":["string","null"]}},"required":["direct","groups","showPreview","sound","available","vapidPublicKey","subscribed","endpoint"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/notifications/subscriptions":{"post":{"summary":"This device's Web Push subscription","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"endpoint":{"type":"string","maxLength":1000,"format":"uri"},"expirationTime":{"type":["number","null"]},"keys":{"type":"object","properties":{"p256dh":{"type":"string","minLength":1,"maxLength":200},"auth":{"type":"string","minLength":1,"maxLength":100}},"required":["p256dh","auth"]}},"required":["endpoint","keys"],"additionalProperties":false}}}},"responses":{"204":{"description":"204"}}},"delete":{"summary":"Stop pushes to this device","responses":{"204":{"description":"204"}}}},"/api/v1/notifications/test":{"post":{"summary":"A test notification to this device","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sent":{"type":"boolean"}},"required":["sent"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs":{"get":{"summary":"The organizations I'm in","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"handle":{"type":"string"},"name":{"type":"string"},"about":{"type":["string","null"]},"verified":{"type":"boolean"},"retentionYears":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dpa":{"type":"object","properties":{"version":{"type":["string","null"]},"acceptedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"current":{"type":"boolean"}},"required":["version","acceptedAt","current"],"additionalProperties":false},"role":{"type":"string","enum":["owner","admin","agent","viewer"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","handle","name","about","verified","retentionYears","dpa","role","createdAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Create an organization (by invitation during the beta; accepts the DPA)","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":64},"handle":{"type":"string","minLength":3,"maxLength":33},"about":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"acceptDpa":{"type":"boolean","const":true}},"required":["name","handle","acceptDpa"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"handle":{"type":"string"},"name":{"type":"string"},"about":{"type":["string","null"]},"verified":{"type":"boolean"},"retentionYears":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dpa":{"type":"object","properties":{"version":{"type":["string","null"]},"acceptedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"current":{"type":"boolean"}},"required":["version","acceptedAt","current"],"additionalProperties":false},"role":{"type":"string","enum":["owner","admin","agent","viewer"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","handle","name","about","verified","retentionYears","dpa","role","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}":{"get":{"summary":"An organization and my role in it","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"handle":{"type":"string"},"name":{"type":"string"},"about":{"type":["string","null"]},"verified":{"type":"boolean"},"retentionYears":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dpa":{"type":"object","properties":{"version":{"type":["string","null"]},"acceptedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"current":{"type":"boolean"}},"required":["version","acceptedAt","current"],"additionalProperties":false},"role":{"type":"string","enum":["owner","admin","agent","viewer"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","handle","name","about","verified","retentionYears","dpa","role","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"patch":{"summary":"Change the profile or retention (admins; the handle: owners)","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":{"name":{"type":"string","minLength":1,"maxLength":64},"handle":{"type":"string","minLength":3,"maxLength":33},"about":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"retentionYears":{"anyOf":[{"type":"integer","minimum":1,"maximum":10},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"handle":{"type":"string"},"name":{"type":"string"},"about":{"type":["string","null"]},"verified":{"type":"boolean"},"retentionYears":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dpa":{"type":"object","properties":{"version":{"type":["string","null"]},"acceptedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"current":{"type":"boolean"}},"required":["version","acceptedAt","current"],"additionalProperties":false},"role":{"type":"string","enum":["owner","admin","agent","viewer"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","handle","name","about","verified","retentionYears","dpa","role","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"delete":{"summary":"Delete the organization (owners; fresh sign-in; type its handle)","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":{"confirm":{"type":"string","minLength":1,"maxLength":64}},"required":["confirm"]}}}},"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/dpa":{"post":{"summary":"Accept the current DPA (owners)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"handle":{"type":"string"},"name":{"type":"string"},"about":{"type":["string","null"]},"verified":{"type":"boolean"},"retentionYears":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dpa":{"type":"object","properties":{"version":{"type":["string","null"]},"acceptedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"current":{"type":"boolean"}},"required":["version","acceptedAt","current"],"additionalProperties":false},"role":{"type":"string","enum":["owner","admin","agent","viewer"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","handle","name","about","verified","retentionYears","dpa","role","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/export":{"get":{"summary":"Download everything the organization holds (owners; fresh sign-in)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"application/json attachment"}}}},"/api/v1/orgs/{id}/members":{"get":{"summary":"The organization's people","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},"role":{"type":"string","enum":["owner","admin","agent","viewer"]},"title":{"type":["string","null"]},"teamIds":{"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)$"}},"joinedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["user","role","title","teamIds","joinedAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/members/{userId}":{"patch":{"summary":"Change someone's role or title","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","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":{"role":{"type":"string","enum":["owner","admin","agent","viewer"]},"title":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}}}}}},"responses":{"204":{"description":"204"}}},"delete":{"summary":"Remove someone (access ends at once); my own id: leave","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/invitations":{"get":{"summary":"Open invitation links (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"role":{"type":"string","enum":["owner","admin","agent","viewer"]},"createdById":{"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)$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","role","createdById","createdAt","expiresAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"A one-time invitation link, valid 7 days (shown once)","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":{"role":{"type":"string","enum":["admin","agent","viewer"]}},"required":["role"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"role":{"type":"string","enum":["owner","admin","agent","viewer"]},"createdById":{"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)$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"url":{"type":"string"}},"required":["id","role","createdById","createdAt","expiresAt","url"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/invitations/{invitationId}":{"delete":{"summary":"Revoke an invitation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"invitationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/org-invitations/{token}":{"get":{"summary":"What an invitation link is for","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"org":{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":"string"}},"required":["id","name","handle"],"additionalProperties":false},"role":{"type":"string","enum":["owner","admin","agent","viewer"]},"member":{"type":"boolean"}},"required":["org","role","member"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Join with an invitation link","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"orgId":{"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":["orgId"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/teams":{"get":{"summary":"Teams","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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":{"type":"string"},"memberIds":{"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)$"}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","memberIds","createdAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Create a team (admins)","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":{"name":{"type":"string","minLength":1,"maxLength":48}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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":{"type":"string"},"memberIds":{"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)$"}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","memberIds","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/teams/{teamId}":{"patch":{"summary":"Rename a team or set its people (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"teamId","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":{"name":{"type":"string","minLength":1,"maxLength":48},"memberIds":{"maxItems":200,"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)$"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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":{"type":"string"},"memberIds":{"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)$"}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","memberIds","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"delete":{"summary":"Delete a team (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"teamId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/inbox":{"get":{"summary":"The Business inbox, newest first","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":true,"description":"open | pending | resolved","schema":{"type":"string"}},{"name":"assignee","in":"query","required":true,"description":"me | none | a person's id","schema":{"type":"string"}},{"name":"team","in":"query","required":true,"description":"none | a team's id","schema":{"type":"string"}},{"name":"tag","in":"query","required":true,"description":"a tag","schema":{"type":"string"}},{"name":"cursor","in":"query","required":true,"description":"meta.next of the previous page","schema":{"type":"string"}},{"name":"limit","in":"query","required":true,"description":"1–100 (30)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"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)$"},"status":{"type":"string","enum":["open","pending","resolved"]},"assigneeId":{"anyOf":[{"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)$"},{"type":"null"}]},"teamId":{"anyOf":[{"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)$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"statusChangedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"conversation":{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false}},"required":["conversationId","status","assigneeId","teamId","tags","statusChangedAt","conversation"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations":{"post":{"summary":"Start a conversation: `{ handle }` — the B2B conversation with that organization (a person; an inbox item); M11: `{ title, contacts?, externalRef? }` — a conversation with contacts by SSO id (conversations.write; an app links it to its record, the same record answers the same conversation)","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":{"handle":{"type":"string","minLength":3,"maxLength":33}},"required":["handle"]},{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"contacts":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"sub":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"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,}$"},{"type":"null"}]}},"required":["sub"]}},"externalRef":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","minLength":1,"maxLength":32},"id":{"type":"string","minLength":1,"maxLength":128},"url":{"anyOf":[{"type":"string","maxLength":1000,"format":"uri"},{"type":"null"}]}},"required":["type","id"]},{"type":"null"}]}},"required":["title"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"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)$"},"status":{"type":"string","enum":["open","pending","resolved"]},"assigneeId":{"anyOf":[{"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)$"},{"type":"null"}]},"teamId":{"anyOf":[{"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)$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"statusChangedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"conversation":{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false}},"required":["conversationId","status","assigneeId","teamId","tags","statusChangedAt","conversation"],"additionalProperties":false},{"type":"object","properties":{"id":{"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)$"},"orgId":{"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)$"},"title":{"type":"string"},"status":{"type":"string","enum":["open","pending","resolved"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"members":{"type":"array","items":{"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)$"},"name":{"type":"string"},"username":{"type":["string","null"]},"role":{"type":"string","enum":["agent","contact"]},"sub":{"description":"A contact's SSO id","type":["string","null"]},"pending":{"type":"boolean","description":"A contact who has not accepted yet"}},"required":["userId","name","username","role","sub","pending"],"additionalProperties":false}},"invited":{"type":"array","items":{"type":"object","properties":{"sub":{"type":"string"}},"required":["sub"],"additionalProperties":false},"description":"Named by SSO id, no hiza account yet"},"externalRefs":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"type":{"type":"string"},"refId":{"type":"string"},"url":{"type":["string","null"]},"appId":{"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)$"},"appName":{"type":"string"}},"required":["id","type","refId","url","appId","appName"],"additionalProperties":false}},"links":{"type":"object","properties":{"agents":{"type":"string"},"contacts":{"type":"string"}},"required":["agents","contacts"],"additionalProperties":false}},"required":["id","orgId","title","status","createdAt","lastSeq","lastMessageAt","members","invited","externalRefs","links"],"additionalProperties":false}]},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}":{"get":{"summary":"A conversation and this organization's state for it","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"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)$"},"status":{"type":"string","enum":["open","pending","resolved"]},"assigneeId":{"anyOf":[{"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)$"},{"type":"null"}]},"teamId":{"anyOf":[{"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)$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"statusChangedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"conversation":{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false}},"required":["conversationId","status","assigneeId","teamId","tags","statusChangedAt","conversation"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/assign":{"post":{"summary":"Assign to a person and/or a team","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","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":{"assigneeId":{"anyOf":[{"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)$"},{"type":"null"}]},"teamId":{"anyOf":[{"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)$"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"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)$"},"status":{"type":"string","enum":["open","pending","resolved"]},"assigneeId":{"anyOf":[{"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)$"},{"type":"null"}]},"teamId":{"anyOf":[{"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)$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"statusChangedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"conversation":{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false}},"required":["conversationId","status","assigneeId","teamId","tags","statusChangedAt","conversation"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/status":{"post":{"summary":"Open, pending or resolved","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","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":["open","pending","resolved"]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"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)$"},"status":{"type":"string","enum":["open","pending","resolved"]},"assigneeId":{"anyOf":[{"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)$"},{"type":"null"}]},"teamId":{"anyOf":[{"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)$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"statusChangedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"conversation":{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false}},"required":["conversationId","status","assigneeId","teamId","tags","statusChangedAt","conversation"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/tags":{"post":{"summary":"Set this organization's tags","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","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":{"tags":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":64}}},"required":["tags"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"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)$"},"status":{"type":"string","enum":["open","pending","resolved"]},"assigneeId":{"anyOf":[{"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)$"},{"type":"null"}]},"teamId":{"anyOf":[{"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)$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"statusChangedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"conversation":{"type":"object","properties":{"id":{"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)$"},"visible":{"type":"boolean","const":true},"kind":{"type":"string","enum":["direct","saved","group","private"]},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"isContact":{"type":"boolean"},"deleted":{"type":"boolean"},"blockedViewer":{"type":"boolean"},"blockedByViewer":{"type":"boolean"}},"required":["id","username","displayName","contactName","avatarUrl","isContact","deleted","blockedViewer","blockedByViewer"],"additionalProperties":false},{"type":"null"}]},"group":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"orgName":{"description":"M11: the organization whose conversation it is, for a contact in it","type":["string","null"]},"about":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","admin","member","restricted"]},"permissions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What ordinary members may do: send 1, media 2, add members 4, pin 8, change info 16"},"historyVisible":{"type":"boolean"},"originalsAllowed":{"type":"boolean","description":"Members may send originals and files"},"maxFileBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The largest file members may send; null: the 2 GB limit"},"can":{"type":"object","properties":{"send":{"type":"boolean"},"sendMedia":{"type":"boolean"},"addMembers":{"type":"boolean"},"pin":{"type":"boolean"},"changeInfo":{"type":"boolean"},"deleteOthers":{"type":"boolean"},"banMembers":{"type":"boolean"},"invite":{"type":"boolean"},"manageAdmins":{"type":"boolean"},"editPermissions":{"type":"boolean"}},"required":["send","sendMedia","addMembers","pin","changeInfo","deleteOthers","banMembers","invite","manageAdmins","editPermissions"],"additionalProperties":false},"joinRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","orgName","about","photoUrl","memberCount","role","permissions","historyVisible","originalsAllowed","maxFileBytes","can","joinRequests"],"additionalProperties":false},{"type":"null"}]},"privateChat":{"anyOf":[{"type":"object","properties":{"title":{"description":"A private group's name; null one-to-one","type":["string","null"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["owner","member"]},"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The MLS epoch the server accepts next (0: no group yet)"}},"required":["title","memberCount","role","epoch"],"additionalProperties":false},{"type":"null"}],"description":"M12: an end-to-end encrypted private chat; its messages are ciphertext (docs/E2EE.md)"},"business":{"anyOf":[{"type":"object","properties":{"orgId":{"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)$"},"peer":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"},"handle":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["id","name","handle","deleted"],"additionalProperties":false},{"type":"null"}],"description":"B2B: the other organization"},"visitor":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"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)$"},{"type":"null"}]},"name":{"type":"string"},"verified":{"type":"boolean","description":"the site signed who they are (a verified customer)"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","site"],"additionalProperties":false},{"type":"null"}],"description":"M10, website chat: the visitor and the site"}},"required":["orgId","peer","visitor"],"additionalProperties":false},{"type":"null"}],"description":"M9: a business conversation, as the viewer's organization sees it; null for personal chats"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessage":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderName":{"type":["string","null"]},"kind":{"type":"string","enum":["text","system"]},"preview":{"type":"string"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","senderId","senderName","kind","preview","deleted","createdAt"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadMentions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReadSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"peerReadSeq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pinned":{"anyOf":[{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["messageId","seq","preview","count"],"additionalProperties":false},{"type":"null"}]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mutedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"notifyMentions":{"type":"boolean","description":"While muted, mentions still notify; false with a mute: nothing does"},"draft":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bold","italic","strike","code","pre","spoiler","link","mention"]},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"length":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string"}},"required":["type","offset","length"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text","entities","updatedAt"],"additionalProperties":false},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visible","kind","peer","group","privateChat","business","lastSeq","lastMessage","lastMessageAt","unreadCount","unreadMentions","lastReadSeq","peerReadSeq","pinned","pinnedAt","archivedAt","mutedUntil","notifyMentions","draft","request","createdAt"],"additionalProperties":false}},"required":["conversationId","status","assigneeId","teamId","tags","statusChangedAt","conversation"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/notes":{"get":{"summary":"Internal notes (this organization only)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"authorId":{"anyOf":[{"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)$"},{"type":"null"}]},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","authorId","body","createdAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Add an internal note","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","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":4000}},"required":["body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"authorId":{"anyOf":[{"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)$"},{"type":"null"}]},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","authorId","body","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/notes/{noteId}":{"delete":{"summary":"Delete a note (its author or an admin)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"noteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/tags":{"get":{"summary":"Tags in use","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"string"}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/canned-responses":{"get":{"summary":"Saved replies","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"title":{"type":"string"},"body":{"type":"string"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","title","body","updatedAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Add a saved reply (admins)","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":64},"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["title","body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"title":{"type":"string"},"body":{"type":"string"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","title","body","updatedAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/canned-responses/{cannedId}":{"patch":{"summary":"Change a saved reply (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cannedId","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":64},"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["title","body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"title":{"type":"string"},"body":{"type":"string"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","title","body","updatedAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"delete":{"summary":"Delete a saved reply (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cannedId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/sites":{"get":{"summary":"The organization's websites (M10)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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":{"type":"string"},"publicKey":{"type":"string","description":"the site key the loader names (public)"},"allowedOrigins":{"type":"array","items":{"type":"string"},"description":"the only origins that may embed the widget"},"settings":{"type":"object","properties":{"accentHue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"theme":{"type":"string","enum":["auto","light","dark"]},"position":{"type":"string","enum":["right","left"]},"title":{"type":"string"},"greeting":{"type":"string"},"replyByEmail":{"type":"boolean"}},"required":["accentHue","theme","position","title","greeting","replyByEmail"],"additionalProperties":false},"disabled":{"type":"boolean"},"snippet":{"type":"string","description":"the script tag for the website"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","publicKey","allowedOrigins","settings","disabled","snippet","createdAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Add a website: a new site key (admins)","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":{"name":{"type":"string","minLength":1,"maxLength":64},"allowedOrigins":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"settings":{"type":"object","properties":{"accentHue":{"type":"integer","minimum":0,"maximum":360},"theme":{"type":"string","enum":["auto","light","dark"]},"position":{"type":"string","enum":["right","left"]},"title":{"type":"string","maxLength":40},"greeting":{"type":"string","maxLength":200},"replyByEmail":{"type":"boolean"}}}},"required":["name","allowedOrigins"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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":{"type":"string"},"publicKey":{"type":"string","description":"the site key the loader names (public)"},"allowedOrigins":{"type":"array","items":{"type":"string"},"description":"the only origins that may embed the widget"},"settings":{"type":"object","properties":{"accentHue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"theme":{"type":"string","enum":["auto","light","dark"]},"position":{"type":"string","enum":["right","left"]},"title":{"type":"string"},"greeting":{"type":"string"},"replyByEmail":{"type":"boolean"}},"required":["accentHue","theme","position","title","greeting","replyByEmail"],"additionalProperties":false},"disabled":{"type":"boolean"},"snippet":{"type":"string","description":"the script tag for the website"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","publicKey","allowedOrigins","settings","disabled","snippet","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/sites/{siteId}":{"get":{"summary":"A website","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"siteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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":{"type":"string"},"publicKey":{"type":"string","description":"the site key the loader names (public)"},"allowedOrigins":{"type":"array","items":{"type":"string"},"description":"the only origins that may embed the widget"},"settings":{"type":"object","properties":{"accentHue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"theme":{"type":"string","enum":["auto","light","dark"]},"position":{"type":"string","enum":["right","left"]},"title":{"type":"string"},"greeting":{"type":"string"},"replyByEmail":{"type":"boolean"}},"required":["accentHue","theme","position","title","greeting","replyByEmail"],"additionalProperties":false},"disabled":{"type":"boolean"},"snippet":{"type":"string","description":"the script tag for the website"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","publicKey","allowedOrigins","settings","disabled","snippet","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"patch":{"summary":"Change a website: name, allowed origins, the widget, paused (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"siteId","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":{"name":{"type":"string","minLength":1,"maxLength":64},"allowedOrigins":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"settings":{"type":"object","properties":{"accentHue":{"type":"integer","minimum":0,"maximum":360},"theme":{"type":"string","enum":["auto","light","dark"]},"position":{"type":"string","enum":["right","left"]},"title":{"type":"string","maxLength":40},"greeting":{"type":"string","maxLength":200},"replyByEmail":{"type":"boolean"}}},"disabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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":{"type":"string"},"publicKey":{"type":"string","description":"the site key the loader names (public)"},"allowedOrigins":{"type":"array","items":{"type":"string"},"description":"the only origins that may embed the widget"},"settings":{"type":"object","properties":{"accentHue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"theme":{"type":"string","enum":["auto","light","dark"]},"position":{"type":"string","enum":["right","left"]},"title":{"type":"string"},"greeting":{"type":"string"},"replyByEmail":{"type":"boolean"}},"required":["accentHue","theme","position","title","greeting","replyByEmail"],"additionalProperties":false},"disabled":{"type":"boolean"},"snippet":{"type":"string","description":"the script tag for the website"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","publicKey","allowedOrigins","settings","disabled","snippet","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"delete":{"summary":"Remove a website: its key stops working, its conversations stay (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"siteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/sites/{siteId}/key":{"post":{"summary":"A new site key; the old one stops at once (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"siteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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":{"type":"string"},"publicKey":{"type":"string","description":"the site key the loader names (public)"},"allowedOrigins":{"type":"array","items":{"type":"string"},"description":"the only origins that may embed the widget"},"settings":{"type":"object","properties":{"accentHue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"theme":{"type":"string","enum":["auto","light","dark"]},"position":{"type":"string","enum":["right","left"]},"title":{"type":"string"},"greeting":{"type":"string"},"replyByEmail":{"type":"boolean"}},"required":["accentHue","theme","position","title","greeting","replyByEmail"],"additionalProperties":false},"disabled":{"type":"boolean"},"snippet":{"type":"string","description":"the script tag for the website"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","publicKey","allowedOrigins","settings","disabled","snippet","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/sites/{siteId}/secret":{"get":{"summary":"The website's identity secret (admins; audited)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"siteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"secret":{"type":"string","description":"the identity secret: the website's backend signs its customers with it (HS256)"}},"required":["secret"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"A new identity secret; the old one stops at once (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"siteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"secret":{"type":"string","description":"the identity secret: the website's backend signs its customers with it (HS256)"}},"required":["secret"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/visitor":{"get":{"summary":"The visitor of a website conversation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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":{"type":["string","null"]},"verified":{"type":"boolean"},"email":{"description":"from the website's signed identity only","type":["string","null"]},"externalId":{"type":["string","null"]},"replyEmail":{"description":"left by the visitor for replies while nobody is online","type":["string","null"]},"context":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"}},"required":["type","id"],"additionalProperties":false},{"type":"null"}]},"lastPageUrl":{"type":["string","null"]},"firstSeenAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastSeenAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"site":{"anyOf":[{"type":"object","properties":{"id":{"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":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","verified","email","externalId","replyEmail","context","lastPageUrl","firstSeenAt","lastSeenAt","site"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/apps":{"get":{"summary":"The organization's apps (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"orgId":{"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":{"type":"string"},"about":{"type":["string","null"]},"homepageUrl":{"type":["string","null"]},"clientId":{"type":"string"},"redirectUris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"webhookUrl":{"type":["string","null"]},"webhookEvents":{"type":"array","items":{"type":"string","enum":["conversation.created","conversation.assigned","conversation.status_changed","message.created","message.updated","message.deleted","member.added","member.removed"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"installation":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"installedById":{"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)$"},"webhooksStoppedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","scopes","createdAt","installedById","webhooksStoppedAt"],"additionalProperties":false},{"type":"null"}],"description":"The app's connection to the organization (null: not connected)"}},"required":["id","orgId","name","about","homepageUrl","clientId","redirectUris","scopes","webhookUrl","webhookEvents","createdAt","installation"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Register an app: its client secret and webhook secret are shown once (admins)","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":{"name":{"type":"string","minLength":1,"maxLength":60},"about":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"homepageUrl":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"redirectUris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","maxLength":500}},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"webhookUrl":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"webhookEvents":{"type":"array","items":{"type":"string","enum":["conversation.created","conversation.assigned","conversation.status_changed","message.created","message.updated","message.deleted","member.added","member.removed"]}}},"required":["name","redirectUris","scopes"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"app":{"type":"object","properties":{"id":{"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)$"},"orgId":{"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":{"type":"string"},"about":{"type":["string","null"]},"homepageUrl":{"type":["string","null"]},"clientId":{"type":"string"},"redirectUris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"webhookUrl":{"type":["string","null"]},"webhookEvents":{"type":"array","items":{"type":"string","enum":["conversation.created","conversation.assigned","conversation.status_changed","message.created","message.updated","message.deleted","member.added","member.removed"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"installation":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"installedById":{"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)$"},"webhooksStoppedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","scopes","createdAt","installedById","webhooksStoppedAt"],"additionalProperties":false},{"type":"null"}],"description":"The app's connection to the organization (null: not connected)"}},"required":["id","orgId","name","about","homepageUrl","clientId","redirectUris","scopes","webhookUrl","webhookEvents","createdAt","installation"],"additionalProperties":false},"clientSecret":{"type":"string","description":"Shown once"},"webhookSecret":{"description":"Shown once (with a webhook address)","type":["string","null"]}},"required":["app","clientSecret","webhookSecret"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/apps/{appId}":{"get":{"summary":"An app (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"orgId":{"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":{"type":"string"},"about":{"type":["string","null"]},"homepageUrl":{"type":["string","null"]},"clientId":{"type":"string"},"redirectUris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"webhookUrl":{"type":["string","null"]},"webhookEvents":{"type":"array","items":{"type":"string","enum":["conversation.created","conversation.assigned","conversation.status_changed","message.created","message.updated","message.deleted","member.added","member.removed"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"installation":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"installedById":{"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)$"},"webhooksStoppedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","scopes","createdAt","installedById","webhooksStoppedAt"],"additionalProperties":false},{"type":"null"}],"description":"The app's connection to the organization (null: not connected)"}},"required":["id","orgId","name","about","homepageUrl","clientId","redirectUris","scopes","webhookUrl","webhookEvents","createdAt","installation"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"patch":{"summary":"Change an app; a first webhook address answers its signing secret once (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","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":{"name":{"type":"string","minLength":1,"maxLength":60},"about":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"homepageUrl":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"redirectUris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","maxLength":500}},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"webhookUrl":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"webhookEvents":{"type":"array","items":{"type":"string","enum":["conversation.created","conversation.assigned","conversation.status_changed","message.created","message.updated","message.deleted","member.added","member.removed"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"orgId":{"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":{"type":"string"},"about":{"type":["string","null"]},"homepageUrl":{"type":["string","null"]},"clientId":{"type":"string"},"redirectUris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"webhookUrl":{"type":["string","null"]},"webhookEvents":{"type":"array","items":{"type":"string","enum":["conversation.created","conversation.assigned","conversation.status_changed","message.created","message.updated","message.deleted","member.added","member.removed"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"installation":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"installedById":{"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)$"},"webhooksStoppedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","scopes","createdAt","installedById","webhooksStoppedAt"],"additionalProperties":false},{"type":"null"}],"description":"The app's connection to the organization (null: not connected)"},"webhookSecret":{"type":["string","null"]}},"required":["id","orgId","name","about","homepageUrl","clientId","redirectUris","scopes","webhookUrl","webhookEvents","createdAt","installation","webhookSecret"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"delete":{"summary":"Delete an app: its connection, keys and tokens stop at once (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/apps/{appId}/secret":{"post":{"summary":"A new client secret, shown once; the old one stops (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientSecret":{"type":"string"}},"required":["clientSecret"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/apps/{appId}/webhook-secret":{"post":{"summary":"A new webhook signing secret, shown once (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"webhookSecret":{"type":"string"}},"required":["webhookSecret"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/apps/{appId}/installation":{"put":{"summary":"Connect the app to the organization with these scopes, or change them (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","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":{"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}}},"required":["scopes"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}}},"required":["id","scopes"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"delete":{"summary":"Disconnect the app: its keys and people's tokens stop at once (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/apps/{appId}/installation/webhooks":{"post":{"summary":"Turn webhooks back on after they stopped for failing (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/apps/{appId}/keys":{"get":{"summary":"The app's API keys (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","name","prefix","scopes","createdAt","lastUsedAt","expiresAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"A new API key (`hiza_live_…`), shown once (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","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":{"name":{"type":"string","minLength":1,"maxLength":60},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"key":{"type":"object","properties":{"id":{"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":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","conversations.read","conversations.write","messages.read","messages.write"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","name","prefix","scopes","createdAt","lastUsedAt","expiresAt"],"additionalProperties":false},"secret":{"type":"string","description":"Shown once"}},"required":["key","secret"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/apps/{appId}/keys/{keyId}":{"delete":{"summary":"Revoke an API key (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"type":"string"}},{"name":"keyId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/apps/{appId}/deliveries":{"get":{"summary":"The webhook delivery log, newest first (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"pending, delivered or failed (optional)","schema":{"type":"string"}},{"name":"before","in":"query","required":false,"description":"meta.next of the previous page (optional)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"eventId":{"type":"string"},"eventType":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lastError":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","eventId","eventType","status","attempt","responseStatus","lastError","createdAt","deliveredAt","nextAttemptAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/apps/{appId}/deliveries/{deliveryId}/retry":{"post":{"summary":"Send a webhook delivery again now (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"type":"string"}},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"eventId":{"type":"string"},"eventType":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lastError":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","eventId","eventType","status","attempt","responseStatus","lastError","createdAt","deliveredAt","nextAttemptAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/details":{"get":{"summary":"Who is in it (agents; contacts with their SSO id; invited), its status and links (conversations.read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"orgId":{"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)$"},"title":{"type":"string"},"status":{"type":"string","enum":["open","pending","resolved"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"members":{"type":"array","items":{"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)$"},"name":{"type":"string"},"username":{"type":["string","null"]},"role":{"type":"string","enum":["agent","contact"]},"sub":{"description":"A contact's SSO id","type":["string","null"]},"pending":{"type":"boolean","description":"A contact who has not accepted yet"}},"required":["userId","name","username","role","sub","pending"],"additionalProperties":false}},"invited":{"type":"array","items":{"type":"object","properties":{"sub":{"type":"string"}},"required":["sub"],"additionalProperties":false},"description":"Named by SSO id, no hiza account yet"},"externalRefs":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"type":{"type":"string"},"refId":{"type":"string"},"url":{"type":["string","null"]},"appId":{"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)$"},"appName":{"type":"string"}},"required":["id","type","refId","url","appId","appName"],"additionalProperties":false}},"links":{"type":"object","properties":{"agents":{"type":"string"},"contacts":{"type":"string"}},"required":["agents","contacts"],"additionalProperties":false}},"required":["id","orgId","title","status","createdAt","lastSeq","lastMessageAt","members","invited","externalRefs","links"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/contacts":{"post":{"summary":"Add contacts by SSO id; without a hiza account they are invited and join at sign-in (conversations.write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","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":{"contacts":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"sub":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"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,}$"},{"type":"null"}]}},"required":["sub"]}}},"required":["contacts"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"orgId":{"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)$"},"title":{"type":"string"},"status":{"type":"string","enum":["open","pending","resolved"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"members":{"type":"array","items":{"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)$"},"name":{"type":"string"},"username":{"type":["string","null"]},"role":{"type":"string","enum":["agent","contact"]},"sub":{"description":"A contact's SSO id","type":["string","null"]},"pending":{"type":"boolean","description":"A contact who has not accepted yet"}},"required":["userId","name","username","role","sub","pending"],"additionalProperties":false}},"invited":{"type":"array","items":{"type":"object","properties":{"sub":{"type":"string"}},"required":["sub"],"additionalProperties":false},"description":"Named by SSO id, no hiza account yet"},"externalRefs":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"type":{"type":"string"},"refId":{"type":"string"},"url":{"type":["string","null"]},"appId":{"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)$"},"appName":{"type":"string"}},"required":["id","type","refId","url","appId","appName"],"additionalProperties":false}},"links":{"type":"object","properties":{"agents":{"type":"string"},"contacts":{"type":"string"}},"required":["agents","contacts"],"additionalProperties":false}},"required":["id","orgId","title","status","createdAt","lastSeq","lastMessageAt","members","invited","externalRefs","links"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/contacts/{sub}":{"delete":{"summary":"Take a contact (or an invitation) out, by SSO id (conversations.write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"sub","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/messages":{"get":{"summary":"Messages: newest first before `before`, or oldest first after `after` (messages.read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"before","in":"query","required":false,"description":"a seq (optional)","schema":{"type":"string"}},{"name":"after","in":"query","required":false,"description":"a seq (optional)","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1–100 (optional)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string","enum":["text","system"]},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"fromVisitor":{"type":"boolean"},"appName":{"type":["string","null"]},"mine":{"type":"boolean","description":"This app wrote it"},"body":{"type":["string","null"]},"entities":{"type":"array","items":{}},"attachments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many photos, videos or files it has (not in this API)"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deleted":{"type":"boolean"}},"required":["id","seq","kind","senderId","fromVisitor","appName","mine","body","entities","attachments","createdAt","editedAt","deleted"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Send a message: an API key writes as the app, a person as themselves (messages.write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","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":{"clientMessageId":{"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":4096},"entities":{"maxItems":100,"type":"array","items":{}}},"required":["clientMessageId","body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","seq"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/external-refs":{"get":{"summary":"The records the conversation is linked to (conversations.read)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"type":{"type":"string"},"refId":{"type":"string"},"url":{"type":["string","null"]},"appId":{"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)$"},"appName":{"type":"string"}},"required":["id","type","refId","url","appId","appName"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"put":{"summary":"Link it to one of the app's records (apps only; conversations.write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","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":{"type":{"type":"string","minLength":1,"maxLength":32},"id":{"type":"string","minLength":1,"maxLength":128},"url":{"anyOf":[{"type":"string","maxLength":1000,"format":"uri"},{"type":"null"}]}},"required":["type","id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"type":{"type":"string"},"refId":{"type":"string"},"url":{"type":["string","null"]},"appId":{"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)$"},"appName":{"type":"string"}},"required":["id","type","refId","url","appId","appName"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/orgs/{id}/conversations/{conversationId}/external-refs/{refId}":{"delete":{"summary":"Remove a link (conversations.write)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"refId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/external-refs/{type}/{refId}/conversation":{"get":{"summary":"The conversation the calling app linked to its record, with its 20 newest messages (apps; conversations.read)","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string"}},{"name":"refId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversation":{"type":"object","properties":{"id":{"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)$"},"orgId":{"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)$"},"title":{"type":"string"},"status":{"type":"string","enum":["open","pending","resolved"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"members":{"type":"array","items":{"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)$"},"name":{"type":"string"},"username":{"type":["string","null"]},"role":{"type":"string","enum":["agent","contact"]},"sub":{"description":"A contact's SSO id","type":["string","null"]},"pending":{"type":"boolean","description":"A contact who has not accepted yet"}},"required":["userId","name","username","role","sub","pending"],"additionalProperties":false}},"invited":{"type":"array","items":{"type":"object","properties":{"sub":{"type":"string"}},"required":["sub"],"additionalProperties":false},"description":"Named by SSO id, no hiza account yet"},"externalRefs":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"type":{"type":"string"},"refId":{"type":"string"},"url":{"type":["string","null"]},"appId":{"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)$"},"appName":{"type":"string"}},"required":["id","type","refId","url","appId","appName"],"additionalProperties":false}},"links":{"type":"object","properties":{"agents":{"type":"string"},"contacts":{"type":"string"}},"required":["agents","contacts"],"additionalProperties":false}},"required":["id","orgId","title","status","createdAt","lastSeq","lastMessageAt","members","invited","externalRefs","links"],"additionalProperties":false},"messages":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string","enum":["text","system"]},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"fromVisitor":{"type":"boolean"},"appName":{"type":["string","null"]},"mine":{"type":"boolean","description":"This app wrote it"},"body":{"type":["string","null"]},"entities":{"type":"array","items":{}},"attachments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many photos, videos or files it has (not in this API)"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deleted":{"type":"boolean"}},"required":["id","seq","kind","senderId","fromVisitor","appName","mine","body","entities","attachments","createdAt","editedAt","deleted"],"additionalProperties":false}},{"type":"null"}]}},"required":["conversation","messages"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/apps":{"get":{"summary":"Apps you let act for you","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"appName":{"type":"string"},"orgName":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","appName","orgName","scopes","createdAt","lastUsedAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/me/apps/{grantId}":{"delete":{"summary":"Stop an app acting for you","parameters":[{"name":"grantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/orgs/{id}/audit-log":{"get":{"summary":"The audit log, newest first (admins)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"before","in":"query","required":true,"description":"meta.next of the previous page","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"actorId":{"anyOf":[{"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)$"},{"type":"null"}]},"action":{"type":"string"},"targetType":{"type":["string","null"]},"targetId":{"type":["string","null"]},"data":{},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","actorId","action","targetType","targetId","data","createdAt"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/e2ee/me":{"get":{"summary":"Private chats on this device: its keys, the person's identity, devices waiting for approval","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deviceId":{"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)$","description":"this session's device"},"account":{"anyOf":[{"type":"object","properties":{"identityKey":{"type":"string"},"sealedIdentity":{"type":"string"}},"required":["identityKey","sealedIdentity"],"additionalProperties":false},{"type":"null"}]},"device":{"anyOf":[{"type":"object","properties":{"id":{"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)$"},"signatureKey":{"type":"string"},"transferKey":{"type":"string"},"identitySignature":{"description":"null: waiting for approval","type":["string","null"]},"transfer":{"description":"the recovery key sealed to this device by the one that approved it","type":["string","null"]},"keyPackages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","signatureKey","transferKey","identitySignature","transfer","keyPackages"],"additionalProperties":false},{"type":"null"}]},"pending":{"type":"array","items":{"type":"object","properties":{"id":{"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":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"signatureKey":{"type":"string"},"transferKey":{"type":"string"}},"required":["id","name","createdAt","signatureKey","transferKey"],"additionalProperties":false}},"backup":{"type":"object","properties":{"entries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["entries"],"additionalProperties":false}},"required":["deviceId","account","device","pending","backup"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/e2ee/me/device":{"put":{"summary":"Register this device's keys (it waits for approval)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"signatureKey":{"type":"string","maxLength":100000,"description":"Ed25519 public key of the device's MLS leaves, 32 bytes (base64)"},"transferKey":{"type":"string","maxLength":100000,"description":"X25519 public key the approving device seals the recovery key to, 32 bytes (base64)"}},"required":["signatureKey","transferKey"]}}}},"responses":{"204":{"description":"204"}}}},"/api/v1/e2ee/me/transfer":{"delete":{"summary":"Forget the recovery key sealed to this device","responses":{"204":{"description":"204"}}}},"/api/v1/e2ee/me/key-packages":{"post":{"summary":"Publish MLS KeyPackages made on this approved device","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"packages":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"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)$","description":"made on the device"},"data":{"type":"string","maxLength":100000,"description":"an MLS KeyPackage message (base64)"}},"required":["id","data"]}}},"required":["packages"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["count"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/e2ee/account":{"post":{"summary":"Set up private chats (the first device): identity key, sealed identity, this device signed","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"signatureKey":{"type":"string","maxLength":100000,"description":"Ed25519 public key of the device's MLS leaves, 32 bytes (base64)"},"transferKey":{"type":"string","maxLength":100000,"description":"X25519 public key the approving device seals the recovery key to, 32 bytes (base64)"},"identityKey":{"type":"string","maxLength":100000,"description":"the person's Ed25519 identity public key, 32 bytes (base64)"},"sealedIdentity":{"type":"string","maxLength":100000,"description":"the identity's private key, AES-256-GCM under the recovery code's sealing key (base64)"},"identitySignature":{"type":"string","maxLength":100000,"description":"the identity's signature over this device (packages/core/src/e2ee/format.ts deviceStatement) (base64)"}},"required":["signatureKey","transferKey","identityKey","sealedIdentity","identitySignature"]}}}},"responses":{"204":{"description":"204"}}},"delete":{"summary":"Start over with a new identity (every device's keys and the backup are deleted)","responses":{"204":{"description":"204"}}}},"/api/v1/e2ee/devices/{deviceId}/approve":{"post":{"summary":"Approve a waiting device of yours (the identity's signature; the recovery key sealed to it)","parameters":[{"name":"deviceId","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":{"identitySignature":{"type":"string","maxLength":100000,"description":"the identity's signature over the device (base64)"},"transfer":{"anyOf":[{"type":"string","maxLength":100000,"description":"the recovery key sealed to the device's transfer key (another device approving) (base64)"},{"type":"null"}]}},"required":["identitySignature"]}}}},"responses":{"204":{"description":"204"}}}},"/api/v1/e2ee/directory":{"get":{"summary":"People's identity keys and approved devices (the client verifies every signature)","parameters":[{"name":"ids","in":"query","required":true,"description":"comma-separated user ids (50 at most)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"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)$"},"identityKey":{"description":"null: no private chats set up","type":["string","null"]},"devices":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"signatureKey":{"type":"string"},"transferKey":{"type":"string"},"identitySignature":{"type":"string"}},"required":["id","signatureKey","transferKey","identitySignature"],"additionalProperties":false}}},"required":["userId","identityKey","devices"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/e2ee/conversations":{"post":{"summary":"Open a one-to-one private chat ({ userId }) or make a small private group ({ title, memberIds })","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":{"title":{"type":"string","minLength":1,"maxLength":128},"memberIds":{"maxItems":9,"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":["title","memberIds"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"created":{"type":"boolean"},"notAdded":{"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":["id","created","notAdded"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/e2ee/conversations/{id}":{"get":{"summary":"A private chat's MLS state: the epoch, the group's devices, this device's Welcome","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"memberIds":{"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)$"}},"devices":{"type":"array","items":{"type":"object","properties":{"deviceId":{"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)$"}},"required":["deviceId","userId"],"additionalProperties":false}},"welcome":{"anyOf":[{"type":"object","properties":{"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"afterSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"keyPackageId":{"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)$"},"data":{"type":"string"}},"required":["epoch","afterSeq","keyPackageId","data"],"additionalProperties":false},{"type":"null"}],"description":"this device's Welcome while it has not joined"},"hiddenBeforeSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["epoch","memberIds","devices","welcome","hiddenBeforeSeq"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"delete":{"summary":"Leave a private chat (one-to-one: deleted for both)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/e2ee/conversations/{id}/key-packages":{"post":{"summary":"Claim one KeyPackage for each device to add","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":{"deviceIds":{"minItems":1,"maxItems":100,"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":["deviceIds"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"deviceId":{"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)$"},"keyPackageId":{"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)$"},"data":{"type":"string"}},"required":["deviceId","keyPackageId","data"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/e2ee/conversations/{id}/commits":{"get":{"summary":"Accepted MLS commits from an epoch on, in order","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"the first epoch (optional, default 0)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senderDeviceId":{"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)$"},"afterSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"data":{"type":"string"}},"required":["epoch","senderDeviceId","afterSeq","data"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"An MLS commit for the current epoch, with Welcomes (409 epoch: sync and try again)","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":{"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"the epoch the commit was made in (the chat's current one)"},"commit":{"type":"string","maxLength":100000,"description":"the MLS commit message (base64)"},"added":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"deviceId":{"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)$"},"keyPackageId":{"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)$"},"welcome":{"type":"string","maxLength":100000,"description":"the MLS Welcome for this device (base64)"}},"required":["deviceId","keyPackageId","welcome"]}},"removed":{"maxItems":100,"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":["epoch","commit","added","removed"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"epoch":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["epoch"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/e2ee/conversations/{id}/welcome":{"delete":{"summary":"This device joined with its Welcome","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/e2ee/conversations/{id}/messages":{"get":{"summary":"Ciphertext after a seq, oldest first","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"after","in":"query","required":false,"description":"a seq (optional)","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1–200 (optional)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string","enum":["text","system"]},"senderId":{"anyOf":[{"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)$"},{"type":"null"}]},"senderDeviceId":{"anyOf":[{"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)$"},{"type":"null"}]},"epoch":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"ciphertext":{"description":"null for service messages and deleted ones","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"deleted":{"type":"boolean"},"hidden":{"type":"boolean","description":"deleted for this member only"}},"required":["id","seq","kind","senderId","senderDeviceId","epoch","ciphertext","createdAt","deleted","hidden"],"additionalProperties":false}},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Send ciphertext (409 epoch or group_outdated: sync, then encrypt again)","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":{"clientMessageId":{"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)$"},"epoch":{"type":"integer","minimum":1,"maximum":9007199254740991},"ciphertext":{"type":"string","maxLength":100000,"description":"the MLS PrivateMessage (base64)"}},"required":["clientMessageId","epoch","ciphertext"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"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)$"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","seq","createdAt"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/e2ee/conversations/{id}/members":{"post":{"summary":"Add people to a private group (its owner)","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":{"userIds":{"minItems":1,"maxItems":9,"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":["userIds"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"added":{"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)$"}},"notAdded":{"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":["added","notAdded"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}},"/api/v1/e2ee/conversations/{id}/members/{userId}":{"delete":{"summary":"Remove someone from a private group (its owner; yourself: leave)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"}}}},"/api/v1/e2ee/backup":{"get":{"summary":"A page of the encrypted history backup","parameters":[{"name":"after","in":"query","required":false,"description":"meta: the previous page's next (optional)","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1–500 (optional)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entries":{"type":"array","items":{"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)$"},"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)$"},"data":{"type":"string"}},"required":["messageId","conversationId","data"],"additionalProperties":false}},"next":{"type":["string","null"]}},"required":["entries","next"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}},"post":{"summary":"Store encrypted backup entries of messages this device read or sent","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entries":{"minItems":1,"maxItems":200,"type":"array","items":{"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)$"},"data":{"type":"string","maxLength":100000,"description":"the encrypted entry (base64)"}},"required":["messageId","data"]}}},"required":["entries"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"saved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["saved"],"additionalProperties":false},"meta":{},"error":{"type":"null"}}}}}}}}}}}