{"openapi":"3.1.2","paths":{"/v1/auth/sign-in/code":{"post":{"description":"The one sign-in field (build plan U02): `identifier` is an email address or a phone number, detected from its first character and read exactly as the sign-in page reads it. An email address gets a 6-digit code by email (any address: the first code entered on a new address creates the account); a phone number verified on an account gets it by SMS (`channel` says which). Valid for 5 minutes; a new code replaces the previous one.","operationId":"requestSignInCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInCodeRequest"}}}},"responses":{"202":{"description":"The code was sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SentCode"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"404":{"description":"`AUTH-1012`: no account has verified this phone number.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The provider refused the destination: `AUTH-1030` the email address, `AUTH-1033` the phone number.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits, each in its own window (wait `Retry-After` seconds): `AUTH-1008` too many codes for this email or phone within an hour; `AUTH-1009` a code was sent to it less than a minute ago; `AUTH-1010` too many code requests or wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"502":{"description":"`AUTH-1999`: the email or SMS provider failed with an error Rabt has no specific code for yet (the provider's own code is in the details). `SYS-1007`: the provider could not be reached.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: sending by email or SMS is not configured. `SYS-1003`: it is switched off for now. `SYS-1005`: the provider is failing and calls to it are paused. `AUTH-1031`, `AUTH-1034`: the provider refused Rabt's account or settings. `AUTH-1032`, `AUTH-1035`: the provider is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"504":{"description":"`SYS-1006`: the email or SMS provider did not answer in time.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Send a sign-in code to an email or a phone","tags":["auth"]}},"/v1/auth/sign-in":{"post":{"description":"Checks the code sent to the email address or phone number (`identifier`, read as `requestSignInCode` reads it) and signs in: the session cookie is set, and a session this browser had is ended. The first code on a new email address creates the account (`account_created`).","operationId":"signIn","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInCode"}}}},"responses":{"200":{"description":"Signed in.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Set-Cookie":{"description":"The session cookie, `__Secure-rabt.session_token` (`rabt.session_token` in local development over HTTP): `HttpOnly`, `Secure`, `SameSite=Strict`, `Path=/`. Signing out, ending this session or deleting the account clears it (`Max-Age=0`).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignedIn"}}}},"400":{"description":"`AUTH-1005`: the code is wrong (the text says how many attempts are left). `AUTH-1006`: no valid code (expired after 5 minutes, used, or replaced by a newer one). `AUTH-1007`: the code was cancelled after 5 wrong attempts.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1012`: no account has verified this phone number.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits (wait `Retry-After` seconds): `AUTH-1010` too many wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Sign in with a code","tags":["auth"]}},"/v1/auth/sign-in/email/code":{"post":{"description":"Sends a 6-digit code to the email address, valid for 5 minutes. Any address gets one: the first code entered on a new address creates the account. A new code replaces the previous one.","operationId":"requestEmailSignInCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailCodeRequest"}}}},"responses":{"202":{"description":"The code was sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SentCode"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The provider refused the destination: `AUTH-1030` the email address, `AUTH-1033` the phone number.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits, each in its own window (wait `Retry-After` seconds): `AUTH-1008` too many codes for this email or phone within an hour; `AUTH-1009` a code was sent to it less than a minute ago; `AUTH-1010` too many code requests or wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"502":{"description":"`AUTH-1999`: the email or SMS provider failed with an error Rabt has no specific code for yet (the provider's own code is in the details). `SYS-1007`: the provider could not be reached.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: sending by email or SMS is not configured. `SYS-1003`: it is switched off for now. `SYS-1005`: the provider is failing and calls to it are paused. `AUTH-1031`, `AUTH-1034`: the provider refused Rabt's account or settings. `AUTH-1032`, `AUTH-1035`: the provider is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"504":{"description":"`SYS-1006`: the email or SMS provider did not answer in time.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Send a sign-in code by email","tags":["auth"]}},"/v1/auth/sign-in/email":{"post":{"description":"Checks the code sent to the email address and signs in: the session cookie is set, and a session this browser had is ended. The first code on a new address creates the account (`account_created`).","operationId":"signInWithEmail","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailCode"}}}},"responses":{"200":{"description":"Signed in.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Set-Cookie":{"description":"The session cookie, `__Secure-rabt.session_token` (`rabt.session_token` in local development over HTTP): `HttpOnly`, `Secure`, `SameSite=Strict`, `Path=/`. Signing out, ending this session or deleting the account clears it (`Max-Age=0`).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignedIn"}}}},"400":{"description":"`AUTH-1005`: the code is wrong (the text says how many attempts are left). `AUTH-1006`: no valid code (expired after 5 minutes, used, or replaced by a newer one). `AUTH-1007`: the code was cancelled after 5 wrong attempts.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits (wait `Retry-After` seconds): `AUTH-1010` too many wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Sign in with an email code","tags":["auth"]}},"/v1/auth/sign-in/phone/code":{"post":{"description":"Sends a 6-digit code by SMS to a phone number verified on an account (in international form or as a Saudi number, read as E.164), valid for 5 minutes. `requestSignInCode` takes an email address or a phone number in one `identifier`.","operationId":"requestPhoneSignInCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneCodeRequest"}}}},"responses":{"202":{"description":"The code was sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SentCode"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"404":{"description":"`AUTH-1012`: no account has verified this phone number.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The provider refused the destination: `AUTH-1030` the email address, `AUTH-1033` the phone number.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits, each in its own window (wait `Retry-After` seconds): `AUTH-1008` too many codes for this email or phone within an hour; `AUTH-1009` a code was sent to it less than a minute ago; `AUTH-1010` too many code requests or wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"502":{"description":"`AUTH-1999`: the email or SMS provider failed with an error Rabt has no specific code for yet (the provider's own code is in the details). `SYS-1007`: the provider could not be reached.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: sending by email or SMS is not configured. `SYS-1003`: it is switched off for now. `SYS-1005`: the provider is failing and calls to it are paused. `AUTH-1031`, `AUTH-1034`: the provider refused Rabt's account or settings. `AUTH-1032`, `AUTH-1035`: the provider is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"504":{"description":"`SYS-1006`: the email or SMS provider did not answer in time.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Send a sign-in code by SMS","tags":["auth"]}},"/v1/auth/sign-in/phone":{"post":{"description":"Checks the code sent to the verified phone number and signs in to its account: the session cookie is set, and a session this browser had is ended.","operationId":"signInWithPhone","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneCode"}}}},"responses":{"200":{"description":"Signed in.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Set-Cookie":{"description":"The session cookie, `__Secure-rabt.session_token` (`rabt.session_token` in local development over HTTP): `HttpOnly`, `Secure`, `SameSite=Strict`, `Path=/`. Signing out, ending this session or deleting the account clears it (`Max-Age=0`).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignedIn"}}}},"400":{"description":"`AUTH-1005`: the code is wrong (the text says how many attempts are left). `AUTH-1006`: no valid code (expired after 5 minutes, used, or replaced by a newer one). `AUTH-1007`: the code was cancelled after 5 wrong attempts.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1012`: no account has verified this phone number.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits (wait `Retry-After` seconds): `AUTH-1010` too many wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Sign in with an SMS code","tags":["auth"]}},"/v1/auth/sign-out":{"post":{"description":"Ends this session and clears its cookie.","operationId":"signOut","parameters":[],"responses":{"204":{"description":"Signed out.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Set-Cookie":{"description":"The session cookie, `__Secure-rabt.session_token` (`rabt.session_token` in local development over HTTP): `HttpOnly`, `Secure`, `SameSite=Strict`, `Path=/`. Signing out, ending this session or deleting the account clears it (`Max-Age=0`).","schema":{"type":"string"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Sign out","tags":["auth"]}},"/v1/auth/session":{"get":{"description":"Who is signed in, this session, and until when sensitive actions are allowed without a new code.","operationId":"getCurrentSession","parameters":[],"responses":{"200":{"description":"Signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentSession"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Get the current session","tags":["auth"]}},"/v1/auth/reauthentication/code":{"post":{"description":"Sensitive actions need a code entered within the last 10 minutes (`AUTH-1013`). Sends one to the account's email or verified phone, for this session only.","operationId":"requestReauthenticationCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReauthenticationCodeRequest"}}}},"responses":{"202":{"description":"The code was sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SentCode"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1019`: `sms` was asked but the account has no verified phone.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The provider refused the destination: `AUTH-1030` the email address, `AUTH-1033` the phone number.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits, each in its own window (wait `Retry-After` seconds): `AUTH-1008` too many codes for this email or phone within an hour; `AUTH-1009` a code was sent to it less than a minute ago; `AUTH-1010` too many code requests or wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"502":{"description":"`AUTH-1999`: the email or SMS provider failed with an error Rabt has no specific code for yet (the provider's own code is in the details). `SYS-1007`: the provider could not be reached.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: sending by email or SMS is not configured. `SYS-1003`: it is switched off for now. `SYS-1005`: the provider is failing and calls to it are paused. `AUTH-1031`, `AUTH-1034`: the provider refused Rabt's account or settings. `AUTH-1032`, `AUTH-1035`: the provider is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"504":{"description":"`SYS-1006`: the email or SMS provider did not answer in time.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Send a re-authentication code","tags":["auth"]}},"/v1/auth/reauthentication":{"post":{"description":"Checks the re-authentication code. The session is replaced by a new one verified now (its cookie is set): sensitive actions are allowed for the next 10 minutes.","operationId":"reauthenticate","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reauthentication"}}}},"responses":{"200":{"description":"Verified.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Set-Cookie":{"description":"The session cookie, `__Secure-rabt.session_token` (`rabt.session_token` in local development over HTTP): `HttpOnly`, `Secure`, `SameSite=Strict`, `Path=/`. Signing out, ending this session or deleting the account clears it (`Max-Age=0`).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reauthenticated"}}}},"400":{"description":"`AUTH-1005`: the code is wrong (the text says how many attempts are left). `AUTH-1006`: no valid code (expired after 5 minutes, used, or replaced by a newer one). `AUTH-1007`: the code was cancelled after 5 wrong attempts.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1019`: `sms` was asked but the account has no verified phone.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits (wait `Retry-After` seconds): `AUTH-1010` too many wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Re-authenticate with a code","tags":["auth"]}},"/v1/auth/sessions":{"get":{"description":"The account's sessions that have not ended, newest first, with the device each signed in from and when it was last used.","operationId":"listSessions","parameters":[],"responses":{"200":{"description":"The sessions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"List signed-in devices","tags":["auth"]},"delete":{"description":"Ends every session of the account except this one.","operationId":"endOtherSessions","parameters":[],"responses":{"200":{"description":"Ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionsEnded"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1013`: a sensitive action; no code was entered in this session within the last 10 minutes. Re-authenticate (`POST /v1/auth/reauthentication`), then repeat the request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Sign out everywhere else","tags":["auth"]}},"/v1/auth/sessions/{sessionId}":{"delete":{"description":"Ends one of the account's sessions: its cookie stops working at once. Ending this session signs out (its cookie is cleared); ending another is a sensitive action.","operationId":"endSession","parameters":[{"name":"sessionId","required":true,"in":"path","description":"The session id (from the device list).","schema":{"type":"string","format":"uuid","description":"The session id."}}],"responses":{"204":{"description":"Ended.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Set-Cookie":{"description":"The session cookie, `__Secure-rabt.session_token` (`rabt.session_token` in local development over HTTP): `HttpOnly`, `Secure`, `SameSite=Strict`, `Path=/`. Signing out, ending this session or deleting the account clears it (`Max-Age=0`).","schema":{"type":"string"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1013`: a sensitive action; no code was entered in this session within the last 10 minutes. Re-authenticate (`POST /v1/auth/reauthentication`), then repeat the request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1016`: the account has no such session (it may have ended).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Sign out a device","tags":["auth"]}},"/v1/account":{"get":{"operationId":"getAccount","parameters":[],"responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Get your account","tags":["account"]},"patch":{"description":"Changes the name, the language (of the apps and of codes sent) and the appearance of the apps (light, dark or following the device), which follow the person to every device.","operationId":"updateAccount","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUpdate"}}}},"responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Update your profile","tags":["account"]},"delete":{"description":"Deletes the account for good: the name, email, phone and photo are erased, every membership ends (organizations keep the member's past work, shown as a deleted member), every session is signed out, and the email and phone can then sign up again as a new account. Not possible while the account owns an organization: transfer or delete the organization first.","operationId":"deleteAccount","parameters":[],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Set-Cookie":{"description":"The session cookie, `__Secure-rabt.session_token` (`rabt.session_token` in local development over HTTP): `HttpOnly`, `Secure`, `SameSite=Strict`, `Path=/`. Signing out, ending this session or deleting the account clears it (`Max-Age=0`).","schema":{"type":"string"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1013`: a sensitive action; no code was entered in this session within the last 10 minutes. Re-authenticate (`POST /v1/auth/reauthentication`), then repeat the request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1015`: the account owns organizations (the text names them); transfer their ownership or delete them first.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Delete your account","tags":["account"]}},"/v1/account/phone/code":{"post":{"description":"Sends a code by SMS to the phone number (international form, read as E.164) to make it the sign-in phone of the account.","operationId":"requestPhoneVerificationCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneCodeRequest"}}}},"responses":{"202":{"description":"The code was sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SentCode"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1013`: a sensitive action; no code was entered in this session within the last 10 minutes. Re-authenticate (`POST /v1/auth/reauthentication`), then repeat the request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1017`: another account uses this phone number.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The provider refused the destination: `AUTH-1030` the email address, `AUTH-1033` the phone number.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits, each in its own window (wait `Retry-After` seconds): `AUTH-1008` too many codes for this email or phone within an hour; `AUTH-1009` a code was sent to it less than a minute ago; `AUTH-1010` too many code requests or wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"502":{"description":"`AUTH-1999`: the email or SMS provider failed with an error Rabt has no specific code for yet (the provider's own code is in the details). `SYS-1007`: the provider could not be reached.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: sending by email or SMS is not configured. `SYS-1003`: it is switched off for now. `SYS-1005`: the provider is failing and calls to it are paused. `AUTH-1031`, `AUTH-1034`: the provider refused Rabt's account or settings. `AUTH-1032`, `AUTH-1035`: the provider is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"504":{"description":"`SYS-1006`: the email or SMS provider did not answer in time.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Send a code to verify a phone number","tags":["account"]}},"/v1/account/phone":{"put":{"description":"Checks the code sent to the phone number and makes it the sign-in phone of the account, replacing any other.","operationId":"verifyPhone","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneCode"}}}},"responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1005`: the code is wrong (the text says how many attempts are left). `AUTH-1006`: no valid code (expired after 5 minutes, used, or replaced by a newer one). `AUTH-1007`: the code was cancelled after 5 wrong attempts.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1013`: a sensitive action; no code was entered in this session within the last 10 minutes. Re-authenticate (`POST /v1/auth/reauthentication`), then repeat the request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1017`: another account uses this phone number.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits (wait `Retry-After` seconds): `AUTH-1010` too many wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Verify a phone number","tags":["account"]},"delete":{"description":"The account can then sign in by email only.","operationId":"removePhone","parameters":[],"responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1013`: a sensitive action; no code was entered in this session within the last 10 minutes. Re-authenticate (`POST /v1/auth/reauthentication`), then repeat the request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Remove the phone number","tags":["account"]}},"/v1/account/email/code":{"post":{"description":"Sends a code to the new address, to make it the email of the account. Whether another account has the address is told only when the code is entered (`AUTH-1018`), so this cannot be used to find out which addresses have accounts.","operationId":"requestEmailChangeCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailCodeRequest"}}}},"responses":{"202":{"description":"The code was sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SentCode"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1013`: a sensitive action; no code was entered in this session within the last 10 minutes. Re-authenticate (`POST /v1/auth/reauthentication`), then repeat the request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The provider refused the destination: `AUTH-1030` the email address, `AUTH-1033` the phone number.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits, each in its own window (wait `Retry-After` seconds): `AUTH-1008` too many codes for this email or phone within an hour; `AUTH-1009` a code was sent to it less than a minute ago; `AUTH-1010` too many code requests or wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"502":{"description":"`AUTH-1999`: the email or SMS provider failed with an error Rabt has no specific code for yet (the provider's own code is in the details). `SYS-1007`: the provider could not be reached.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: sending by email or SMS is not configured. `SYS-1003`: it is switched off for now. `SYS-1005`: the provider is failing and calls to it are paused. `AUTH-1031`, `AUTH-1034`: the provider refused Rabt's account or settings. `AUTH-1032`, `AUTH-1035`: the provider is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"504":{"description":"`SYS-1006`: the email or SMS provider did not answer in time.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Send a code to a new email address","tags":["account"]}},"/v1/account/email":{"put":{"description":"Checks the code sent to the new address and makes it the email of the account.","operationId":"changeEmail","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailCode"}}}},"responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1005`: the code is wrong (the text says how many attempts are left). `AUTH-1006`: no valid code (expired after 5 minutes, used, or replaced by a newer one). `AUTH-1007`: the code was cancelled after 5 wrong attempts.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1013`: a sensitive action; no code was entered in this session within the last 10 minutes. Re-authenticate (`POST /v1/auth/reauthentication`), then repeat the request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1018`: another account uses this email address.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits (wait `Retry-After` seconds): `AUTH-1010` too many wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Change the email address","tags":["account"]}},"/v1/api-keys":{"get":{"operationId":"listApiKeys","parameters":[],"responses":{"200":{"description":"Every key, revoked ones included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"List the API keys","tags":["api-keys"]},"post":{"description":"The key acts as you, limited to its scopes: it can never do more than your role allows. It is shown once; Rabt keeps only its hash.","operationId":"createApiKey","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKey"}}}},"responses":{"201":{"description":"The key, shown once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedApiKey"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`API-8115`: the organization has its maximum of active API keys.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Create an API key","tags":["api-keys"]}},"/v1/api-keys/{id}":{"get":{"operationId":"getApiKey","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8110`: no such API key in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Get an API key","tags":["api-keys"]},"delete":{"description":"It stops working at once and stays in the list and the audit log.","operationId":"revokeApiKey","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8110`: no such API key in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Revoke an API key","tags":["api-keys"]}},"/v1/api-keys/{id}/rotate":{"post":{"description":"A new key for the same id, name and scopes; the old key stops working at once.","operationId":"rotateApiKey","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"201":{"description":"The new key, shown once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedApiKey"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8110`: no such API key in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Rotate an API key","tags":["api-keys"]}},"/v1/oauth-apps":{"get":{"operationId":"listOAuthApps","parameters":[],"responses":{"200":{"description":"The apps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAppList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"List the OAuth apps you registered","tags":["oauth-apps"]},"post":{"description":"An app any organization can install through the consent screen (authorization code with PKCE).","operationId":"registerOAuthApp","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOAuthApp"}}}},"responses":{"201":{"description":"The app (and its secret, once).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisteredOAuthApp"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`API-8117`: the organization has its maximum of OAuth apps.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Register an OAuth app","tags":["oauth-apps"]}},"/v1/oauth-apps/{id}":{"get":{"operationId":"getOAuthApp","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The app.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthApp"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8111`: no such OAuth app in this organization (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Get an OAuth app","tags":["oauth-apps"]},"patch":{"operationId":"updateOAuthApp","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOAuthApp"}}}},"responses":{"200":{"description":"The app.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthApp"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8111`: no such OAuth app in this organization (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Update an OAuth app","tags":["oauth-apps"]},"delete":{"description":"Its installations can no longer get or refresh tokens (access tokens already issued end within the hour).","operationId":"deleteOAuthApp","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8111`: no such OAuth app in this organization (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Delete an OAuth app","tags":["oauth-apps"]}},"/v1/oauth-apps/{id}/secret":{"post":{"description":"The old secret stops working at once; the new one is shown once.","operationId":"rotateOAuthAppSecret","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"201":{"description":"The app and its new secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisteredOAuthApp"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8111`: no such OAuth app in this organization (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Rotate a confidential app's secret","tags":["oauth-apps"]}},"/v1/installed-apps":{"get":{"description":"OAuth apps and MCP clients members authorized in this organization, with their scopes.","operationId":"listInstalledApps","parameters":[],"responses":{"200":{"description":"The installed apps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstalledAppList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"List the installed apps","tags":["installed-apps"]}},"/v1/installed-apps/{id}":{"delete":{"description":"Every token of the installation stops working at once.","operationId":"uninstallApp","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The uninstalled app.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstalledApp"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8112`: no such installed app in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Uninstall an app","tags":["installed-apps"]}},"/v1/oauth/authorize":{"get":{"description":"Authorization code with PKCE (S256) only. Redirects the browser to the consent screen, where the person chooses the organization and the scopes; then back to `redirect_uri` with `code`, `state` and `iss` (RFC 9207).","operationId":"authorize","parameters":[{"name":"response_type","required":false,"in":"query","schema":{"type":"string","maxLength":100}},{"name":"client_id","required":false,"in":"query","schema":{"type":"string","maxLength":2000}},{"name":"redirect_uri","required":false,"in":"query","schema":{"type":"string","maxLength":2000}},{"name":"code_challenge","required":false,"in":"query","schema":{"type":"string","maxLength":200}},{"name":"code_challenge_method","required":false,"in":"query","schema":{"type":"string","maxLength":20}},{"name":"scope","required":false,"in":"query","schema":{"type":"string","maxLength":2000}},{"name":"state","required":false,"in":"query","schema":{"type":"string","maxLength":2000}},{"name":"resource","required":false,"in":"query","schema":{"type":"string","maxLength":2000}}],"responses":{"302":{"description":"To the consent screen, or back to the app with an error."},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"OAuth authorization endpoint","tags":["oauth"],"x-rabt-sdk":false}},"/v1/oauth/authorization-requests/{requestId}":{"get":{"operationId":"getAuthorizationRequest","parameters":[{"name":"requestId","required":true,"in":"path","description":"The authorization request id (from the consent screen link).","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","description":"The authorization request id (from the consent screen link)."}}],"responses":{"200":{"description":"The request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationRequest"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`API-8125`: the request expired (10 minutes) or was answered.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Get an authorization request (consent screen)","tags":["oauth"]}},"/v1/oauth/authorization-requests/{requestId}/approve":{"post":{"description":"Installs the app in the organization with the scopes chosen (needs `api.manage` there); its tokens act as you, limited to those scopes.","operationId":"approveAuthorization","parameters":[{"name":"requestId","required":true,"in":"path","description":"The authorization request id (from the consent screen link).","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","description":"The authorization request id (from the consent screen link)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveAuthorization"}}}},"responses":{"200":{"description":"Where to send the browser.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationAnswer"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`API-8125`: the request expired or was answered. `API-8123`: a scope that was not asked for.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: not a member there. `AUTH-1002`: your role lacks `api.manage` there. `AUTH-1003`/`AUTH-1004`: your seat is inactive.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Approve an authorization request","tags":["oauth"]}},"/v1/oauth/authorization-requests/{requestId}/deny":{"post":{"operationId":"denyAuthorization","parameters":[{"name":"requestId","required":true,"in":"path","description":"The authorization request id (from the consent screen link).","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","description":"The authorization request id (from the consent screen link)."}}],"responses":{"200":{"description":"Where to send the browser.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationAnswer"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`API-8125`: the request expired or was answered.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Deny an authorization request","tags":["oauth"]}},"/v1/oauth/token":{"post":{"description":"`authorization_code` (with `code_verifier`) or `refresh_token` (rotated on every use; a reused one revokes the whole authorization). Public clients send `client_id`; confidential ones authenticate with HTTP Basic or `client_secret`.","operationId":"token","parameters":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","maxLength":100},"code":{"type":"string","maxLength":200},"redirect_uri":{"type":"string","maxLength":2000},"code_verifier":{"type":"string","maxLength":200},"refresh_token":{"type":"string","maxLength":200},"scope":{"type":"string","maxLength":2000},"resource":{"type":"string","maxLength":2000},"client_id":{"type":"string","maxLength":2000},"client_secret":{"type":"string","maxLength":200}},"additionalProperties":false}}}},"responses":{"200":{"description":"The tokens.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"OAuth error (`error`, `error_description`) with the problem details: `API-8122` invalid_request, `API-8126`/`API-8127`/`API-8130` invalid_grant, `API-8123` invalid_scope, `API-8124` invalid_target, `API-8129` unsupported_grant_type.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`API-8128` invalid_client.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"OAuth token endpoint","tags":["oauth"],"x-rabt-sdk":false}},"/v1/oauth/revoke":{"post":{"description":"A refresh token revokes every token of its authorization; an access token only itself. Unknown tokens are answered the same way.","operationId":"revokeToken","parameters":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"token":{"type":"string","maxLength":200},"token_type_hint":{"type":"string","maxLength":50},"client_id":{"type":"string","maxLength":2000},"client_secret":{"type":"string","maxLength":200}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Revoked (or not a token of this client).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`API-8128` invalid_client.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"OAuth token revocation (RFC 7009)","tags":["oauth"],"x-rabt-sdk":false}},"/v1/webhook-event-types":{"get":{"description":"Every event an endpoint can subscribe to, with the JSON Schema of its `data`. Deliveries carry `{ type, version, timestamp, data }`, signed per Standard Webhooks.","operationId":"listWebhookEventTypes","parameters":[],"responses":{"200":{"description":"The event types.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventTypeList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `webhooks:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["webhooks:read"]},{"oauth2":["webhooks:read"]}],"summary":"List the webhook event types","tags":["webhooks"]}},"/v1/webhook-endpoints":{"get":{"operationId":"listWebhookEndpoints","parameters":[],"responses":{"200":{"description":"The endpoints.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `api.manage` permission. `API-8102`: the API key or app lacks the `webhooks:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["webhooks:read"]},{"oauth2":["webhooks:read"]}],"summary":"List the webhook endpoints","tags":["webhooks"]},"post":{"description":"Events of the chosen types are POSTed to the URL, signed with the secret returned here once.","operationId":"createWebhookEndpoint","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpoint"}}}},"responses":{"201":{"description":"The endpoint and its secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8102`: the API key or app lacks the `webhooks:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`API-8116`: the organization has its maximum of webhook endpoints.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8140`: the URL is not a public https address. `API-8141`: an event type is not a webhook event.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["webhooks:write"]},{"oauth2":["webhooks:write"]}],"summary":"Create a webhook endpoint","tags":["webhooks"]}},"/v1/webhook-endpoints/{id}":{"get":{"operationId":"getWebhookEndpoint","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `api.manage` permission. `API-8102`: the API key or app lacks the `webhooks:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8113`: no such webhook endpoint (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["webhooks:read"]},{"oauth2":["webhooks:read"]}],"summary":"Get a webhook endpoint","tags":["webhooks"]},"patch":{"description":"Its URL, description or event types; or disable and enable it.","operationId":"updateWebhookEndpoint","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookEndpoint"}}}},"responses":{"200":{"description":"The endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8102`: the API key or app lacks the `webhooks:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8113`: no such webhook endpoint (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8140`: the URL is not a public https address. `API-8141`: an event type is not a webhook event.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["webhooks:write"]},{"oauth2":["webhooks:write"]}],"summary":"Update a webhook endpoint","tags":["webhooks"]},"delete":{"description":"Nothing more is sent to it; its deliveries stay in the log.","operationId":"deleteWebhookEndpoint","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8102`: the API key or app lacks the `webhooks:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8113`: no such webhook endpoint (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["webhooks:write"]},{"oauth2":["webhooks:write"]}],"summary":"Delete a webhook endpoint","tags":["webhooks"]}},"/v1/webhook-endpoints/{id}/secret":{"post":{"description":"A new secret, shown once. For 24 hours every delivery is signed with both secrets (Standard Webhooks multiple signatures), so the receiver can switch without losing events.","operationId":"rotateWebhookSecret","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"201":{"description":"The endpoint and its new secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8102`: the API key or app lacks the `webhooks:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8113`: no such webhook endpoint (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["webhooks:write"]},{"oauth2":["webhooks:write"]}],"summary":"Rotate a webhook endpoint's secret","tags":["webhooks"]}},"/v1/webhook-endpoints/{id}/deliveries":{"get":{"description":"The delivery log, newest first.","operationId":"listWebhookDeliveries","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","format":"uuid"}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 100, default 50).","schema":{"default":50,"description":"Items per page (1 to 100, default 50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of deliveries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `api.manage` permission. `API-8102`: the API key or app lacks the `webhooks:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8113`: no such webhook endpoint (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["webhooks:read"]},{"oauth2":["webhooks:read"]}],"summary":"List an endpoint's deliveries","tags":["webhooks"]}},"/v1/webhook-deliveries/{id}":{"get":{"description":"The body sent and every attempt, with the endpoint answers and errors.","operationId":"getWebhookDelivery","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The delivery.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `api.manage` permission. `API-8102`: the API key or app lacks the `webhooks:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8114`: no such webhook delivery.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["webhooks:read"]},{"oauth2":["webhooks:read"]}],"summary":"Get a webhook delivery","tags":["webhooks"]}},"/v1/webhook-deliveries/{id}/redeliver":{"post":{"description":"Sends the same body again under the same `webhook-id` (receivers de-duplicate by it), with retries.","operationId":"redeliverWebhook","parameters":[{"name":"id","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"202":{"description":"Queued; the attempt appears in the log.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `api.manage` permission. `API-8102`: the API key or app lacks the `webhooks:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`API-8114`: no such webhook delivery.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`API-8146`: the endpoint is disabled; enable it first.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["webhooks:write"]},{"oauth2":["webhooks:write"]}],"summary":"Redeliver a webhook","tags":["webhooks"]}},"/v1/organizations":{"get":{"description":"The organizations the signed-in account is a member of (the organization switcher), the most recently used first. In the Rabt platform organization, `platform_role` is set for members with a platform role.","operationId":"listMyOrganizations","parameters":[],"responses":{"200":{"description":"The organizations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyOrganizationList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"List your organizations","tags":["organizations"]},"post":{"description":"Creates an organization with the default roles (Owner, Admin, Supervisor, Agent); the signed-in account becomes its owner. It starts in the trial.","operationId":"createOrganization","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganization"}}}},"responses":{"201":{"description":"The new organization and your membership in it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipContext"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1056`: another organization uses this short name (slug).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Create an organization","tags":["organizations"]}},"/v1/organizations/{organizationId}/switch":{"post":{"description":"Makes the organization the active one: checks the membership, remembers the choice (it is listed first next time) and returns what you may do there. No new sign-in is needed. Then send its id in the `Rabt-Organization` header of every request made in it.","operationId":"switchOrganization","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The organization id.","schema":{"type":"string","format":"uuid","description":"The organization id."}}],"responses":{"200":{"description":"The organization and your membership in it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipContext"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Switch to an organization","tags":["organizations"]}},"/v1/organization":{"get":{"description":"The organization named by `Rabt-Organization`, and what you may do in it.","operationId":"getActiveOrganization","parameters":[],"responses":{"200":{"description":"The organization and your membership in it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipContext"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `organization:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:read"]},{"oauth2":["organization:read"]}],"summary":"Get the active organization","tags":["organizations"]},"patch":{"description":"The name, default language, time zone and default country of phone numbers.","operationId":"updateOrganization","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganization"}}}},"responses":{"200":{"description":"The organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Update the organization settings","tags":["organizations"]}},"/v1/organization/ownership-transfer":{"post":{"description":"Owner only, a sensitive action (a code entered within the last 10 minutes). The member becomes the owner (the Owner role) and you become an Admin. There is always exactly one owner.","operationId":"transferOwnership","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferOwnership"}}}},"responses":{"200":{"description":"The organization and your membership in it (now an Admin).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipContext"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1042`: only the owner can do this. `AUTH-1013`: a sensitive action; no code was entered in this session within the last 10 minutes. Re-authenticate (`POST /v1/auth/reauthentication`), then repeat the request. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1046`: no such member.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1057`: the member is you, or their seat is inactive (ownership goes to another active member).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Transfer the ownership","tags":["organizations"]}},"/v1/members":{"get":{"description":"The members of the active organization (not removed), in the order they joined.","operationId":"listMembers","parameters":[],"responses":{"200":{"description":"The members.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `members:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:read"]},{"oauth2":["members:read"]}],"summary":"List the members","tags":["members"]}},"/v1/members/{membershipId}":{"get":{"operationId":"getMember","parameters":[{"name":"membershipId","required":true,"in":"path","description":"The membership id.","schema":{"type":"string","format":"uuid","description":"The membership id."}}],"responses":{"200":{"description":"The member.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `members:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1046`: no such member (or the member was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:read"]},{"oauth2":["members:read"]}],"summary":"Get a member","tags":["members"]},"delete":{"description":"The member leaves the organization; their past work stays, shown with their name. A new invitation brings them back.","operationId":"removeMember","parameters":[{"name":"membershipId","required":true,"in":"path","description":"The membership id.","schema":{"type":"string","format":"uuid","description":"The membership id."}}],"responses":{"204":{"description":"Removed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1046`: no such member (or the member was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1043`: the owner's membership cannot be changed this way (transfer the ownership first).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Remove a member","tags":["members"]}},"/v1/members/{membershipId}/role":{"put":{"description":"Not the owner's, and not to the Owner role. You can only give, or take away, permissions your own role has.","operationId":"changeMemberRole","parameters":[{"name":"membershipId","required":true,"in":"path","description":"The membership id.","schema":{"type":"string","format":"uuid","description":"The membership id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberRoleChange"}}}},"responses":{"200":{"description":"The member.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1046`: no such member (or the member was removed). `AUTH-1047`: no such role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1043`: the owner's membership cannot be changed this way (transfer the ownership first). `AUTH-1044`: the Owner role cannot be given.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Change a member's role","tags":["members"]}},"/v1/members/{membershipId}/seat":{"put":{"description":"An inactive member can sign in and view but not change anything; the seat is not billed from the next period. Reactivating bills it again (docs/10).","operationId":"setMemberSeat","parameters":[{"name":"membershipId","required":true,"in":"path","description":"The membership id.","schema":{"type":"string","format":"uuid","description":"The membership id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberSeatChange"}}}},"responses":{"200":{"description":"The member.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1046`: no such member (or the member was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1043`: the owner's membership cannot be changed this way (transfer the ownership first).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Deactivate or reactivate a member's seat","tags":["members"]}},"/v1/organization/membership":{"patch":{"description":"Your job title in this organization (used in email signatures).","operationId":"updateOwnMembership","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OwnMembershipUpdate"}}}},"responses":{"200":{"description":"Your membership.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Update your membership","tags":["members"]}},"/v1/roles":{"get":{"operationId":"listRoles","parameters":[],"responses":{"200":{"description":"The roles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `members:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:read"]},{"oauth2":["members:read"]}],"summary":"List the roles","tags":["roles"]},"post":{"description":"A role from the permission keys (docs/18). You can only include permissions your own role has.","operationId":"createRole","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRole"}}}},"responses":{"201":{"description":"The role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Role"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1049`: a role with this name exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Create a custom role","tags":["roles"]}},"/v1/roles/{roleId}":{"patch":{"description":"The permissions of any role but Owner, and the name of a custom role. You can only edit roles within your own permissions. Members holding the role get the change on their next request.","operationId":"updateRole","parameters":[{"name":"roleId","required":true,"in":"path","description":"The role id.","schema":{"type":"string","format":"uuid","description":"The role id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRole"}}}},"responses":{"200":{"description":"The role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Role"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1047`: no such role (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1044`: the Owner role cannot be edited. `AUTH-1058`: default roles cannot be renamed. `AUTH-1049`: a role with this name exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Edit a role","tags":["roles"]},"delete":{"description":"Only a custom role no member holds and no open invitation offers.","operationId":"deleteRole","parameters":[{"name":"roleId","required":true,"in":"path","description":"The role id.","schema":{"type":"string","format":"uuid","description":"The role id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1047`: no such role (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1048`: members hold the role or open invitations offer it. `AUTH-1058`: default roles cannot be deleted. `AUTH-1044`: the Owner role is fixed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Delete a custom role","tags":["roles"]}},"/v1/invitations":{"get":{"description":"Invitations not answered and not withdrawn (pending or expired), newest first.","operationId":"listInvitations","parameters":[],"responses":{"200":{"description":"The invitations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `members:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:read"]},{"oauth2":["members:read"]}],"summary":"List the open invitations","tags":["invitations"]},"post":{"description":"By email (Rabt emails the link) or by phone (share the returned link yourself), given as `identifier` (read like the sign-in field) or as `email` or `phone`, with a role other than Owner that is within your own permissions. Valid for 7 days.","operationId":"createInvitation","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitation"}}}},"responses":{"201":{"description":"The invitation and its link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedInvitation"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1047`: no such role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1054`: the person is a member already. `AUTH-1055`: they have an open invitation (send it again instead). `AUTH-1044`: the Owner role cannot be offered.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `AUTH-1030`: the email provider refused the address.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"description":"`AUTH-1999`, `SYS-1007`: the email provider failed or could not be reached; nothing was created or changed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: Rabt's email is not configured. `SYS-1003`: it is switched off for now. `SYS-1005`: the provider is failing. `AUTH-1031`, `AUTH-1032`: the provider refused Rabt's settings or is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"504":{"description":"`SYS-1006`: the email provider did not answer in time.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Invite a person","tags":["invitations"]}},"/v1/invitations/{invitationId}/resend":{"post":{"description":"A new link valid for 7 more days (the previous link stops working), emailed again for an invitation by email. Also for an expired invitation.","operationId":"resendInvitation","parameters":[{"name":"invitationId","required":true,"in":"path","description":"The invitation id.","schema":{"type":"string","format":"uuid","description":"The invitation id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"The invitation and its new link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedInvitation"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1050`: no such invitation (a wrong link, withdrawn, or replaced by a newer link).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1052`: the invitation was already accepted or declined.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"description":"`AUTH-1999`, `SYS-1007`: the email provider failed or could not be reached; nothing was created or changed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: Rabt's email is not configured. `SYS-1003`: it is switched off for now. `SYS-1005`: the provider is failing. `AUTH-1031`, `AUTH-1032`: the provider refused Rabt's settings or is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"504":{"description":"`SYS-1006`: the email provider did not answer in time.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Send an invitation again","tags":["invitations"]}},"/v1/invitations/{invitationId}":{"delete":{"description":"Its link stops working. Recorded in the audit log.","operationId":"revokeInvitation","parameters":[{"name":"invitationId","required":true,"in":"path","description":"The invitation id.","schema":{"type":"string","format":"uuid","description":"The invitation id."}}],"responses":{"204":{"description":"Withdrawn.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1050`: no such invitation (a wrong link, withdrawn, or replaced by a newer link).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1052`: the invitation was already accepted or declined.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Withdraw an invitation","tags":["invitations"]}},"/v1/invitations/preview":{"post":{"description":"What the invited person sees before answering: the organization, the role, who invited them, and whether the invitation is for the signed-in account.","operationId":"previewInvitation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationToken"}}}},"responses":{"200":{"description":"The invitation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPreview"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1050`: no such invitation (a wrong link, withdrawn, or replaced by a newer link).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Look at an invitation","tags":["invitations"]}},"/v1/invitations/accept":{"post":{"description":"The signed-in account, whose email (or verified phone) is the one invited, becomes a member with the offered role.","operationId":"acceptInvitation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationToken"}}}},"responses":{"200":{"description":"The organization and your membership in it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipContext"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1053`: the invitation is for another email or phone number.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1050`: no such invitation (a wrong link, withdrawn, or replaced by a newer link).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1052`: the invitation was already answered. `AUTH-1054`: you are a member already.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"`AUTH-1051`: the invitation expired (ask for it to be sent again).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Accept an invitation","tags":["invitations"]}},"/v1/invitations/decline":{"post":{"operationId":"declineInvitation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationToken"}}}},"responses":{"204":{"description":"Declined.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1053`: the invitation is for another email or phone number.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1050`: no such invitation (a wrong link, withdrawn, or replaced by a newer link).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1052`: the invitation was already answered.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"`AUTH-1051`: the invitation expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Decline an invitation","tags":["invitations"]}},"/v1/audit-log":{"get":{"description":"Every change to the organization, its members, roles and invitations (and other sensitive actions), newest first.","operationId":"listAuditLog","parameters":[{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","format":"uuid"}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 100, default 50).","schema":{"default":50,"description":"Entries per page (1 to 100, default 50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of entries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `audit.view` permission. `API-8102`: the API key or app lacks the `audit:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["audit:read"]},{"oauth2":["audit:read"]}],"summary":"Read the audit log","tags":["audit"]}},"/v1/error-log":{"get":{"description":"Every error recorded for the organization (its members' actions and background work), newest first, with the texts in the request language. Filter by `code` or `reference` to find the error a member reported.","operationId":"listErrorLog","parameters":[{"name":"code","required":false,"in":"query","description":"Only errors with this error code.","schema":{"description":"Only errors with this error code.","type":"string","pattern":"^([A-Z]{1,5})-(\\d{4})$","example":"WA-2047"}},{"name":"reference","required":false,"in":"query","description":"Only errors with this reference (as shown with the error).","schema":{"description":"Only errors with this reference (as shown with the error).","type":"string","pattern":"^ref_[A-Za-z0-9]{1,64}$","example":"ref_4bf92f3577b34da6a3ce929d0e0e4736"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 100, default 50).","schema":{"default":50,"description":"Entries per page (1 to 100, default 50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of entries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorLogPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `audit.view` permission. `API-8102`: the API key or app lacks the `error_log:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["error_log:read"]},{"oauth2":["error_log:read"]}],"summary":"Read the error log","tags":["errors"]}},"/v1/error-log/{entryId}":{"get":{"description":"One recorded error with its full details, in the request language.","operationId":"getErrorLogEntry","parameters":[{"name":"entryId","required":true,"in":"path","description":"The error log entry id.","schema":{"type":"string","format":"uuid","description":"The error log entry id."}}],"responses":{"200":{"description":"The error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorLogEntry"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `audit.view` permission. `API-8102`: the API key or app lacks the `error_log:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1060`: the error log has no such entry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["error_log:read"]},{"oauth2":["error_log:read"]}],"summary":"Get an error of the error log","tags":["errors"]}},"/v1/billing/subscription":{"get":{"description":"The billing state (trial, active, seats inactive), the seat price, the trial, the time paid for, the seats and the next seat charge (docs/10).","operationId":"getSubscription","parameters":[],"responses":{"200":{"description":"The subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"Read the seats and their billing","tags":["billing"]}},"/v1/billing/seat-quote":{"get":{"description":"What adding a member or reactivating a seat takes from the wallet now: the seat price prorated to the month's remaining days (today included), nothing during the trial or while seats are inactive, nothing for a seat already paid this month (docs/10 \"Proration\").","operationId":"quoteSeat","parameters":[{"name":"membership_id","required":false,"in":"query","description":"A member whose seat would be reactivated: free when it is already paid for this month. Left out: a new member's seat.","schema":{"description":"A member whose seat would be reactivated: free when it is already paid for this month. Left out: a new member's seat.","type":"string","format":"uuid"}}],"responses":{"200":{"description":"The price.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatQuote"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `members.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1401`: the trial's member limit is reached, so a new member would be refused (without `membership_id`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`WAL-1402`: no seat price is published yet (the Rabt team is alerted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"Price one more seat","tags":["billing"]}},"/v1/billing/seat-events":{"get":{"description":"Every seat added, deactivated, reactivated or removed, with the prorated charge it caused, newest first (docs/10 \"Seats\").","operationId":"listSeatEvents","parameters":[{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","format":"uuid"}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 100, default 50).","schema":{"default":50,"description":"Entries per page (1 to 100, default 50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of the log.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatEventPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"Read the seat log","tags":["billing"]}},"/v1/billing/profile":{"get":{"description":"The legal name, VAT number, commercial registration number, national address and billing email copied onto each invoice when it is finalized (docs/10), or null until first saved.","operationId":"getBillingProfile","parameters":[],"responses":{"200":{"description":"The billing profile.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingProfileResponse"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"Read the billing profile","tags":["billing"]},"put":{"description":"Creates or replaces the whole billing profile. Invoices finalized from now on carry it; invoices already finalized and receipt vouchers already issued keep the profile they were issued with. Audited, and published as `billing.profile_updated`.","operationId":"saveBillingProfile","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingProfileInput"}}}},"responses":{"200":{"description":"The saved profile.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingProfileResponse"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated. `AUTH-1004`: all seats are inactive because the seat charge was not paid (this action stays open to members with `billing.manage`, to pay it). `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1506`: a field of the billing profile is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:write"]},{"oauth2":["billing:write"]}],"summary":"Save the billing profile","tags":["billing"]}},"/v1/billing/invoices":{"get":{"description":"The invoices of months that ended, newest first: finalized, empty (nothing billed) or still a draft (the 24-hour grace after the month ends, or a mismatch with the ledger being investigated). The running month is `GET /v1/billing/invoices/current`.","operationId":"listInvoices","parameters":[{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","pattern":"^\\d{4}-(?:0[1-9]|1[0-2])-01$"}},{"name":"limit","required":false,"in":"query","description":"Invoices per page (1 to 100, default 24).","schema":{"default":24,"description":"Invoices per page (1 to 100, default 24).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of invoices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"List invoices","tags":["billing"]}},"/v1/billing/invoices/current":{"get":{"description":"A draft of the running month's invoice at any time (docs/10 \"Current month so far\"): the same grouping per resource and unit price as the monthly invoice, with the totals so far.","operationId":"getCurrentInvoice","parameters":[],"responses":{"200":{"description":"The month so far.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"Read this month so far","tags":["billing"]}},"/v1/billing/invoices/{invoiceId}":{"get":{"description":"Its sections (seats, each WhatsApp number, X account, phone number, SMS sender name, AI) with their lines and subtotals, the totals with VAT, and the seller and buyer once finalized.","operationId":"getInvoice","parameters":[{"name":"invoiceId","required":true,"in":"path","description":"The invoice id.","schema":{"type":"string","format":"uuid","description":"The invoice id."}}],"responses":{"200":{"description":"The invoice.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1501`: no such invoice.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"Read an invoice","tags":["billing"]}},"/v1/billing/invoices/{invoiceId}/pdf":{"get":{"description":"The finalized tax invoice as a PDF in Arabic and English.","operationId":"getInvoicePdf","parameters":[{"name":"invoiceId","required":true,"in":"path","description":"The invoice id.","schema":{"type":"string","format":"uuid","description":"The invoice id."}}],"responses":{"200":{"description":"The PDF.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1501`: no such invoice.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1502`: the invoice is not finalized yet (a draft has no PDF or CSV).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"Download an invoice (PDF)","tags":["billing"]}},"/v1/billing/invoices/{invoiceId}/csv":{"get":{"description":"Every line of the finalized invoice, one row each, in the member's language (UTF-8; amounts in SAR with two decimals).","operationId":"getInvoiceCsv","parameters":[{"name":"invoiceId","required":true,"in":"path","description":"The invoice id.","schema":{"type":"string","format":"uuid","description":"The invoice id."}}],"responses":{"200":{"description":"The CSV.","content":{"text/csv":{"schema":{"type":"string"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1501`: no such invoice.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1502`: the invoice is not finalized yet (a draft has no PDF or CSV).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"Export an invoice (CSV)","tags":["billing"]}},"/v1/billing/invoices/{invoiceId}/notes":{"get":{"description":"The corrections the Rabt team issued against the invoice (docs/10: a finalized invoice never changes; it is corrected by a credit or debit note).","operationId":"listInvoiceNotes","parameters":[{"name":"invoiceId","required":true,"in":"path","description":"The invoice id.","schema":{"type":"string","format":"uuid","description":"The invoice id."}}],"responses":{"200":{"description":"The notes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceNoteList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1501`: no such invoice.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"List an invoice's credit and debit notes","tags":["billing"]}},"/v1/billing/notes/{noteId}":{"get":{"operationId":"getInvoiceNote","parameters":[{"name":"noteId","required":true,"in":"path","description":"The credit or debit note id.","schema":{"type":"string","format":"uuid","description":"The credit or debit note id."}}],"responses":{"200":{"description":"The note.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceNote"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1509`: no such credit or debit note.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"Read a credit or debit note","tags":["billing"]}},"/v1/billing/notes/{noteId}/pdf":{"get":{"description":"The note as a PDF in Arabic and English.","operationId":"getInvoiceNotePdf","parameters":[{"name":"noteId","required":true,"in":"path","description":"The credit or debit note id.","schema":{"type":"string","format":"uuid","description":"The credit or debit note id."}}],"responses":{"200":{"description":"The PDF.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1509`: no such credit or debit note.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"summary":"Download a credit or debit note (PDF)","tags":["billing"]}},"/v1/wallet/top-ups/checkout":{"post":{"description":"The settings of Tap's card form for a top-up of this amount (public values only). The first call creates the organization's Tap customer. The amount is exactly what is charged: a top-up is a prepayment, not an invoice (VAT is on the monthly invoice, docs/10).","operationId":"createTopUpCheckout","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpCheckoutRequest"}}}},"responses":{"200":{"description":"The card form settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpCheckout"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated. `AUTH-1004`: all seats are inactive because the seat charge was not paid (this action stays open to members with `billing.manage`, to pay it). `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: card payments (Tap) are not set up on this Rabt server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Get the card form's settings","tags":["wallet"]}},"/v1/wallet/top-ups":{"post":{"description":"Charges the card of Tap's card form (the first top-up saves it) or the saved card, with 3-D Secure: when `status` is `requires_action`, send the member to `action_url`; Tap brings them back to the app. The wallet is credited only after Tap confirms the charge (a verified webhook re-checked through Tap's API); poll `GET /v1/wallet/top-ups/{topUpId}`. The same `Idempotency-Key` returns the same top-up and never charges twice.","operationId":"createTopUp","parameters":[{"name":"Idempotency-Key","in":"header","description":"A key of your choice for this top-up (letters, digits and `. _ : - /`, at most 200 characters). Retrying with the same key returns the same top-up and never charges twice.","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:/-]{0,199}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTopUp"}}}},"responses":{"201":{"description":"The top-up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUp"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"402":{"description":"`WAL-1203` to `WAL-1208`, `WAL-1999`: Tap refused the card (its own code and message are in `provider`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated. `AUTH-1004`: all seats are inactive because the seat charge was not paid (this action stays open to members with `billing.manage`, to pay it). `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1202`: no saved card. `WAL-1214`: the idempotency key belongs to another top-up.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1201`: the amount is below the minimum of SAR 50. `WAL-1210`: saving the card needs a verified mobile number. `WAL-1218`: the card form token expired.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"description":"`WAL-1209`: a setting of Rabt's Tap account refused the payment.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: card payments (Tap) are not set up on this Rabt server. `SYS-1005`, `SYS-1006`, `SYS-1007`: Tap could not be reached; retry with the same Idempotency-Key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Top up the wallet by card","tags":["wallet"]},"get":{"description":"Manual and automatic top-ups, newest first.","operationId":"listTopUps","parameters":[{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 100, default 50).","schema":{"default":50,"description":"Items per page (1 to 100, default 50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of top-ups.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:read"]},{"oauth2":["wallet:read"]}],"summary":"List top-ups","tags":["wallet"]}},"/v1/wallet/top-ups/{topUpId}":{"get":{"description":"Its status, and why it failed.","operationId":"getTopUp","parameters":[{"name":"topUpId","required":true,"in":"path","description":"The top-up id.","schema":{"type":"string","format":"uuid","description":"The top-up id."}}],"responses":{"200":{"description":"The top-up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUp"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1213`: no such top-up.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:read"]},{"oauth2":["wallet:read"]}],"summary":"Get a top-up","tags":["wallet"]}},"/v1/wallet/saved-card":{"get":{"description":"The card saved by a top-up (brand, last 4 digits, expiry), or null.","operationId":"getSavedCard","parameters":[],"responses":{"200":{"description":"The saved card.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedCardResponse"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:read"]},{"oauth2":["wallet:read"]}],"summary":"Get the saved card","tags":["wallet"]}},"/v1/wallet/auto-top-up":{"get":{"operationId":"getAutoTopUp","parameters":[],"responses":{"200":{"description":"The settings and state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopUp"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:read"]},{"oauth2":["wallet:read"]}],"summary":"Get the auto top-up settings","tags":["wallet"]},"put":{"description":"When the total balance falls below the threshold, the saved card is charged the amount (a merchant-initiated charge), which must be at or above the threshold. Optional caps per day and month.","operationId":"updateAutoTopUp","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopUpUpdate"}}}},"responses":{"200":{"description":"The settings and state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopUp"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1202`: turning it on needs a saved card.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1219`: the amount is below the threshold. `WAL-1201`: the amount is below the minimum of SAR 50.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:write"]},{"oauth2":["wallet:write"]}],"summary":"Change the auto top-up settings","tags":["wallet"]}},"/v1/wallet/receipt-vouchers":{"get":{"description":"One per confirmed top-up, newest first.","operationId":"listReceiptVouchers","parameters":[{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 100, default 50).","schema":{"default":50,"description":"Items per page (1 to 100, default 50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of vouchers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptVoucherList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:read"]},{"oauth2":["wallet:read"]}],"summary":"List receipt vouchers","tags":["wallet"]}},"/v1/wallet/receipt-vouchers/{voucherId}":{"get":{"operationId":"getReceiptVoucher","parameters":[{"name":"voucherId","required":true,"in":"path","description":"The receipt voucher id.","schema":{"type":"string","format":"uuid","description":"The receipt voucher id."}}],"responses":{"200":{"description":"The voucher.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptVoucher"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1216`: no such receipt voucher.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:read"]},{"oauth2":["wallet:read"]}],"summary":"Get a receipt voucher","tags":["wallet"]}},"/v1/wallet/receipt-vouchers/{voucherId}/pdf":{"get":{"description":"The voucher as a PDF in Arabic and English.","operationId":"getReceiptVoucherPdf","parameters":[{"name":"voucherId","required":true,"in":"path","description":"The receipt voucher id.","schema":{"type":"string","format":"uuid","description":"The receipt voucher id."}}],"responses":{"200":{"description":"The PDF.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1216`: no such receipt voucher.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:read"]},{"oauth2":["wallet:read"]}],"summary":"Download a receipt voucher (PDF)","tags":["wallet"]}},"/v1/wallet":{"get":{"description":"The prepaid balance in halalas: available now, held, and their total (docs/10).","operationId":"getWallet","parameters":[],"responses":{"200":{"description":"The balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletBalance"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:read"]},{"oauth2":["wallet:read"]}],"summary":"Get the wallet balance","tags":["wallet"]}},"/v1/wallet/transactions":{"get":{"description":"The ledger, newest first: top-ups, usage, seats, manual entries of the Rabt team (`adjustment`, with `manual_entry`), holds. Rabt has no refunds.","operationId":"listWalletTransactions","parameters":[{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Transactions per page (1 to 100, default 50).","schema":{"default":50,"description":"Transactions per page (1 to 100, default 50).","type":"integer","minimum":1,"maximum":100}},{"name":"type","required":false,"in":"query","description":"Only transactions of this type.","schema":{"description":"Only transactions of this type.","type":"string","enum":["top_up","usage_debit","seat_charge","adjustment","hold","hold_release"]}}],"responses":{"200":{"description":"A page of transactions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletTransactionPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`WAL-1006`: the cursor is not one this list returned.\n\n`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:read"]},{"oauth2":["wallet:read"]}],"summary":"List the wallet's transactions","tags":["wallet"]}},"/v1/wallet/transactions/export":{"get":{"description":"The wallet history of a period (default: all of it), newest first, in the member's language (UTF-8): date (UTC), type, manual entry number, description, reference, amount and balance after, in SAR with two decimals. At most 100,000 rows: choose a shorter period beyond that.","operationId":"exportWalletTransactions","parameters":[{"name":"from","required":false,"in":"query","description":"Transactions whose event time is at or after this (ISO 8601).","schema":{"description":"Transactions whose event time is at or after this (ISO 8601).","type":"string","format":"date-time"}},{"name":"to","required":false,"in":"query","description":"Transactions whose event time is before this (ISO 8601).","schema":{"description":"Transactions whose event time is before this (ISO 8601).","type":"string","format":"date-time"}},{"name":"type","required":false,"in":"query","description":"Only transactions of this type.","schema":{"description":"Only transactions of this type.","type":"string","enum":["top_up","usage_debit","seat_charge","adjustment","hold","hold_release"]}}],"responses":{"200":{"description":"The CSV.","content":{"text/csv":{"schema":{"type":"string"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `billing.manage` permission. `API-8102`: the API key or app lacks the `wallet:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1006`: `from` is not before `to`. `WAL-1017`: more rows than one file holds.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["wallet:read"]},{"oauth2":["wallet:read"]}],"summary":"Export the wallet's transactions (CSV)","tags":["wallet"]}},"/v1/pricing/quotes":{"post":{"description":"What usage costs at the current prices (or at a future time, as an estimate), line by line, in halalas. Nothing is charged.","operationId":"quotePrices","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}}},"responses":{"200":{"description":"The quote.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceQuote"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `pricing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1101`: an item has no price. `WAL-1102`: no rate card is in effect.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["pricing:read"]},{"oauth2":["pricing:read"]}],"summary":"Get a price quote","tags":["wallet"]}},"/v1/pricing/price-list":{"get":{"description":"The seat price per month and the free trial of new organizations, and every usage price of the published rate card in effect (WhatsApp, X, SMS, voice, AI, email), in halalas. Public: no sign-in needed. An organization with its own agreed markup sees its prices in quotes.","operationId":"getPriceList","parameters":[],"responses":{"200":{"description":"The price list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Get the price list","tags":["wallet"]}},"/v1/contacts":{"get":{"description":"The live contacts (not merged or deleted). `q` searches names, phone numbers (any form), email addresses, usernames, companies, tags and custom fields, Arabic-aware; exact phone or email matches come first.","operationId":"listContacts","parameters":[{"name":"q","required":false,"in":"query","description":"Free text, Arabic-aware (hamza, ta marbuta, diacritics, tatweel and Arabic-Indic digits do not matter).","schema":{"description":"Free text, Arabic-aware (hamza, ta marbuta, diacritics, tatweel and Arabic-Indic digits do not matter).","type":"string","maxLength":200}},{"name":"tag_id","required":false,"in":"query","description":"Only contacts with this tag.","schema":{"description":"Only contacts with this tag.","type":"string","format":"uuid"}},{"name":"company_id","required":false,"in":"query","description":"Only contacts of this company.","schema":{"description":"Only contacts of this company.","type":"string","format":"uuid"}},{"name":"channel_type","required":false,"in":"query","description":"Only contacts with an identity on this channel.","schema":{"description":"Only contacts with an identity on this channel.","$ref":"#/components/schemas/ChannelType"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Records per page (1 to 100, default 25).","schema":{"default":25,"description":"Records per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of contacts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `contacts:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"summary":"List and search contacts","tags":["contacts"]},"post":{"description":"Phone numbers are read with the organization's default country and stored as E.164. A contact with an address at a company's domain is linked to it (when the organization has it on).","operationId":"createContact","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContact"}}}},"responses":{"201":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6003`: the phone number belongs to another contact. `CRM-6004`: the email address belongs to another contact.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6024`: a name, phone number or email address is needed. `CRM-6005`: the phone number is not valid. `CRM-6011`: a tag does not exist. `CRM-6015`: a custom field value does not fit its type. `CRM-6016`: no such custom field.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Create a contact","tags":["contacts"]}},"/v1/contacts/{contactId}":{"get":{"description":"The id of a merged contact gives the contact it was merged into.","operationId":"getContact","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}}],"responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `contacts:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"summary":"Get a contact","tags":["contacts"]},"patch":{"operationId":"updateContact","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContact"}}}},"responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6011`: a tag does not exist. `CRM-6015`: a custom field value does not fit its type. `CRM-6016`: no such custom field.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Edit a contact","tags":["contacts"]},"delete":{"description":"The contact leaves lists and search; its data is kept (Rabt never deletes). A new message from the person brings it back.","operationId":"deleteContact","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Delete a contact","tags":["contacts"]}},"/v1/contacts/{contactId}/phones":{"post":{"operationId":"addContactPhone","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPhoneInput"}}}},"responses":{"201":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6003`: the phone number belongs to another contact. `CRM-6004`: the email address belongs to another contact.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6005`: the phone number is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Add a phone number to a contact","tags":["contacts"]}},"/v1/contacts/{contactId}/phones/{phoneId}":{"patch":{"operationId":"updateContactPhone","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"phoneId","required":true,"in":"path","description":"The phone number id.","schema":{"type":"string","format":"uuid","description":"The phone number id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetailUpdate"}}}},"responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted). `CRM-6022`: the contact has no such phone number or email address.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Change the label of a phone number, or make it primary","tags":["contacts"]},"delete":{"description":"Messages and calls from the number no longer match the contact by it.","operationId":"removeContactPhone","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"phoneId","required":true,"in":"path","description":"The phone number id.","schema":{"type":"string","format":"uuid","description":"The phone number id."}}],"responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted). `CRM-6022`: the contact has no such phone number or email address.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Remove a phone number from a contact","tags":["contacts"]}},"/v1/contacts/{contactId}/emails":{"post":{"operationId":"addContactEmail","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactEmailInput"}}}},"responses":{"201":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6003`: the phone number belongs to another contact. `CRM-6004`: the email address belongs to another contact.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Add an email address to a contact","tags":["contacts"]}},"/v1/contacts/{contactId}/emails/{emailId}":{"patch":{"operationId":"updateContactEmail","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"emailId","required":true,"in":"path","description":"The email address id.","schema":{"type":"string","format":"uuid","description":"The email address id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetailUpdate"}}}},"responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted). `CRM-6022`: the contact has no such phone number or email address.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Change the label of an email address, or make it primary","tags":["contacts"]},"delete":{"operationId":"removeContactEmail","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"emailId","required":true,"in":"path","description":"The email address id.","schema":{"type":"string","format":"uuid","description":"The email address id."}}],"responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted). `CRM-6022`: the contact has no such phone number or email address.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Remove an email address from a contact","tags":["contacts"]}},"/v1/contacts/{contactId}/companies/{companyId}":{"put":{"description":"A contact can work at several companies; one is its primary company.","operationId":"linkContactCompany","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCompanyLink"}}}},"responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted). `CRM-6002`: no such company.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Link a contact to a company, or change the link","tags":["contacts"]},"delete":{"operationId":"unlinkContactCompany","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}}],"responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted). `CRM-6023`: the contact is not linked to it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Unlink a contact from a company","tags":["contacts"]}},"/v1/contacts/{contactId}/notes":{"get":{"operationId":"listContactNotes","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","format":"uuid"}},{"name":"limit","required":false,"in":"query","description":"Records per page (1 to 100, default 25).","schema":{"default":25,"description":"Records per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of notes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotePage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `contacts:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"summary":"List a contact's notes","tags":["contacts"]},"post":{"operationId":"addContactNote","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNote"}}}},"responses":{"201":{"description":"The note.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted). `AUTH-1046`: a mentioned member does not exist.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Add an internal note to a contact","tags":["contacts"]}},"/v1/contacts/{contactId}/notes/{noteId}":{"patch":{"operationId":"updateContactNote","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"noteId","required":true,"in":"path","description":"The note id.","schema":{"type":"string","format":"uuid","description":"The note id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNote"}}}},"responses":{"200":{"description":"The note.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted). `CRM-6021`: the contact has no such note. `AUTH-1046`: a mentioned member does not exist.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Edit a note of a contact","tags":["contacts"]},"delete":{"operationId":"deleteContactNote","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"noteId","required":true,"in":"path","description":"The note id.","schema":{"type":"string","format":"uuid","description":"The note id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted). `CRM-6021`: the contact has no such note.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Delete a note of a contact","tags":["contacts"]}},"/v1/contacts/{contactId}/merge":{"post":{"description":"The secondary contact's identities, phone numbers, email addresses, notes, companies and tickets move to this contact; the secondary is kept, pointing to this one, and the merge can be undone.","operationId":"mergeContacts","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeContacts"}}}},"responses":{"200":{"description":"The merge and the merged contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMergeResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.merge` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6006`: both are the same contact (maybe through an earlier merge).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Merge another contact into this one","tags":["contacts"]}},"/v1/contacts/{contactId}/merges":{"get":{"description":"The merge history of the contact page, with the merges that can be undone.","operationId":"listContactMerges","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}}],"responses":{"200":{"description":"The merges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `contacts:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"summary":"List the merges into a contact","tags":["contacts"]}},"/v1/contact-merges/{mergeId}/unmerge":{"post":{"description":"The secondary contact is separate again with everything that moved; fields of the primary return to their values before the merge unless changed since.","operationId":"unmergeContacts","parameters":[{"name":"mergeId","required":true,"in":"path","description":"The merge id.","schema":{"type":"string","format":"uuid","description":"The merge id."}}],"responses":{"200":{"description":"The merge (undone) and the separated contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMergeResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.merge` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6007`: no such merge.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6008`: the merge was already undone. `CRM-6009`: the primary was merged into another contact since; undo that merge first.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Undo a contact merge","tags":["contacts"]}},"/v1/companies":{"get":{"description":"The live companies. `q` searches names, domains, websites, phone numbers, industries, tags and custom fields, Arabic-aware.","operationId":"listCompanies","parameters":[{"name":"q","required":false,"in":"query","description":"Free text, Arabic-aware (hamza, ta marbuta, diacritics, tatweel and Arabic-Indic digits do not matter).","schema":{"description":"Free text, Arabic-aware (hamza, ta marbuta, diacritics, tatweel and Arabic-Indic digits do not matter).","type":"string","maxLength":200}},{"name":"tag_id","required":false,"in":"query","description":"Only companies with this tag.","schema":{"description":"Only companies with this tag.","type":"string","format":"uuid"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Records per page (1 to 100, default 25).","schema":{"default":25,"description":"Records per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of companies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `companies:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:read"]},{"oauth2":["companies:read"]}],"summary":"List and search companies","tags":["companies"]},"post":{"operationId":"createCompany","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCompany"}}}},"responses":{"201":{"description":"The company.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `companies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1046`: the account owner is not a member.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6019`: a domain belongs to another company.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6005`: the phone number is not valid. `CRM-6011`: a tag does not exist. `CRM-6015`: a custom field value does not fit its type. `CRM-6016`: no such custom field. `CRM-6018`: a public email provider (gmail.com, outlook.com…) is never a company domain. `CRM-6020`: not a domain.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:write"]},{"oauth2":["companies:write"]}],"summary":"Create a company","tags":["companies"]}},"/v1/companies/{companyId}":{"get":{"description":"The id of a merged company gives the company it was merged into.","operationId":"getCompany","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}}],"responses":{"200":{"description":"The company.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `companies:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:read"]},{"oauth2":["companies:read"]}],"summary":"Get a company","tags":["companies"]},"patch":{"operationId":"updateCompany","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCompany"}}}},"responses":{"200":{"description":"The company.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `companies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted). `AUTH-1046`: the account owner is not a member.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6005`: the phone number is not valid. `CRM-6011`: a tag does not exist. `CRM-6015`: a custom field value does not fit its type. `CRM-6016`: no such custom field.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:write"]},{"oauth2":["companies:write"]}],"summary":"Edit a company","tags":["companies"]},"delete":{"description":"The company leaves lists and search and its domains are released; its data is kept (Rabt never deletes).","operationId":"deleteCompany","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `companies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:write"]},{"oauth2":["companies:write"]}],"summary":"Delete a company","tags":["companies"]}},"/v1/companies/{companyId}/domains":{"post":{"description":"New contacts with an address at the domain are linked to the company (when the organization has it on).","operationId":"addCompanyDomain","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyDomainInput"}}}},"responses":{"201":{"description":"The company.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `companies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6019`: the domain belongs to another company.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6018`: a public email provider (gmail.com, outlook.com…) is never a company domain. `CRM-6020`: not a domain.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:write"]},{"oauth2":["companies:write"]}],"summary":"Add an email domain to a company","tags":["companies"]}},"/v1/companies/{companyId}/domains/{domainId}":{"delete":{"operationId":"removeCompanyDomain","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}},{"name":"domainId","required":true,"in":"path","description":"The domain id.","schema":{"type":"string","format":"uuid","description":"The domain id."}}],"responses":{"200":{"description":"The company.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `companies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted). `CRM-6026`: the company has no such domain.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:write"]},{"oauth2":["companies:write"]}],"summary":"Remove an email domain from a company","tags":["companies"]}},"/v1/companies/{companyId}/notes":{"get":{"operationId":"listCompanyNotes","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","format":"uuid"}},{"name":"limit","required":false,"in":"query","description":"Records per page (1 to 100, default 25).","schema":{"default":25,"description":"Records per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of notes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotePage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `companies:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:read"]},{"oauth2":["companies:read"]}],"summary":"List a company's notes","tags":["companies"]},"post":{"operationId":"addCompanyNote","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNote"}}}},"responses":{"201":{"description":"The note.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `companies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted). `AUTH-1046`: a mentioned member does not exist.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:write"]},{"oauth2":["companies:write"]}],"summary":"Add an internal note to a company","tags":["companies"]}},"/v1/companies/{companyId}/notes/{noteId}":{"patch":{"operationId":"updateCompanyNote","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}},{"name":"noteId","required":true,"in":"path","description":"The note id.","schema":{"type":"string","format":"uuid","description":"The note id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNote"}}}},"responses":{"200":{"description":"The note.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `companies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted). `CRM-6021`: the company has no such note. `AUTH-1046`: a mentioned member does not exist.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:write"]},{"oauth2":["companies:write"]}],"summary":"Edit a note of a company","tags":["companies"]},"delete":{"operationId":"deleteCompanyNote","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}},{"name":"noteId","required":true,"in":"path","description":"The note id.","schema":{"type":"string","format":"uuid","description":"The note id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `companies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted). `CRM-6021`: the company has no such note.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:write"]},{"oauth2":["companies:write"]}],"summary":"Delete a note of a company","tags":["companies"]}},"/v1/companies/{companyId}/merge":{"post":{"description":"The secondary company's contacts, domains, notes and tickets move to this company; the secondary is kept, pointing to this one, and the merge can be undone.","operationId":"mergeCompanies","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeCompanies"}}}},"responses":{"200":{"description":"The merge and the merged company.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyMergeResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.merge` permission. `API-8102`: the API key or app lacks the `companies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6006`: both are the same company (maybe through an earlier merge).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:write"]},{"oauth2":["companies:write"]}],"summary":"Merge another company into this one","tags":["companies"]}},"/v1/companies/{companyId}/merges":{"get":{"operationId":"listCompanyMerges","parameters":[{"name":"companyId","required":true,"in":"path","description":"The company id.","schema":{"type":"string","format":"uuid","description":"The company id."}}],"responses":{"200":{"description":"The merges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `companies:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6002`: no such company (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:read"]},{"oauth2":["companies:read"]}],"summary":"List the merges into a company","tags":["companies"]}},"/v1/company-merges/{mergeId}/unmerge":{"post":{"description":"The secondary company is separate again with everything that moved; fields of the primary return to their values before the merge unless changed since.","operationId":"unmergeCompanies","parameters":[{"name":"mergeId","required":true,"in":"path","description":"The merge id.","schema":{"type":"string","format":"uuid","description":"The merge id."}}],"responses":{"200":{"description":"The merge (undone) and the separated company.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyMergeResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.merge` permission. `API-8102`: the API key or app lacks the `companies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6007`: no such merge.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6008`: the merge was already undone. `CRM-6009`: the primary was merged into another company since; undo that merge first.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["companies:write"]},{"oauth2":["companies:write"]}],"summary":"Undo a company merge","tags":["companies"]}},"/v1/tags":{"get":{"operationId":"listTags","parameters":[],"responses":{"200":{"description":"The tags, by name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `organization:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:read"]},{"oauth2":["organization:read"]}],"summary":"List the tags","tags":["tags"]},"post":{"description":"For contacts, companies and tickets. Names are unique, Arabic-aware.","operationId":"createTag","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagInput"}}}},"responses":{"201":{"description":"The tag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6012`: a tag with this name exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Create a tag","tags":["tags"]}},"/v1/tags/{tagId}":{"patch":{"operationId":"renameTag","parameters":[{"name":"tagId","required":true,"in":"path","description":"The tag id.","schema":{"type":"string","format":"uuid","description":"The tag id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagInput"}}}},"responses":{"200":{"description":"The tag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6010`: no such tag (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6012`: a tag with this name exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Rename a tag","tags":["tags"]},"delete":{"description":"It is no longer shown on records or offered (Rabt never deletes: records keep it).","operationId":"deleteTag","parameters":[{"name":"tagId","required":true,"in":"path","description":"The tag id.","schema":{"type":"string","format":"uuid","description":"The tag id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6010`: no such tag (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Delete a tag","tags":["tags"]}},"/v1/custom-fields":{"get":{"operationId":"listCustomFields","parameters":[{"name":"entity","required":false,"in":"query","description":"Only the fields of contacts, companies or tickets.","schema":{"description":"Only the fields of contacts, companies or tickets.","type":"string","enum":["contact","company","ticket"]}}],"responses":{"200":{"description":"The fields, by entity and position.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `organization:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:read"]},{"oauth2":["organization:read"]}],"summary":"List the custom fields","tags":["custom-fields"]},"post":{"description":"A text, number, date or list field of contacts, companies or tickets.","operationId":"createCustomField","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomField"}}}},"responses":{"201":{"description":"The field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6014`: the key is taken (keys are never reused).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6017`: a list field needs options (no repeats); other fields take none.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Create a custom field","tags":["custom-fields"]}},"/v1/custom-fields/{fieldId}":{"patch":{"operationId":"updateCustomField","parameters":[{"name":"fieldId","required":true,"in":"path","description":"The custom field id.","schema":{"type":"string","format":"uuid","description":"The custom field id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomField"}}}},"responses":{"200":{"description":"The field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6013`: no such custom field (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6017`: a list field needs options (no repeats); other fields take none.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Edit a custom field","tags":["custom-fields"]},"delete":{"description":"Its values are no longer shown or accepted (Rabt never deletes: they are kept).","operationId":"deleteCustomField","parameters":[{"name":"fieldId","required":true,"in":"path","description":"The custom field id.","schema":{"type":"string","format":"uuid","description":"The custom field id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6013`: no such custom field (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Delete a custom field","tags":["custom-fields"]}},"/v1/crm/settings":{"get":{"operationId":"getCrmSettings","parameters":[],"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `organization:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:read"]},{"oauth2":["organization:read"]}],"summary":"Get the CRM settings","tags":["crm-settings"]},"put":{"operationId":"updateCrmSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSettingsInput"}}}},"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Change the CRM settings","tags":["crm-settings"]}},"/v1/notifications":{"get":{"description":"Your notifications in the organization, newest first, with your unread count (docs/21). Texts are in the request’s language.","operationId":"listNotifications","parameters":[{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","format":"uuid"}},{"name":"limit","required":false,"in":"query","description":"Notifications per page (1 to 100, default 30).","schema":{"default":30,"description":"Notifications per page (1 to 100, default 30).","type":"integer","minimum":1,"maximum":100}},{"name":"unread","required":false,"in":"query","description":"Only unread notifications.","schema":{"description":"Only unread notifications.","default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"A page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `notifications:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["notifications:read"]},{"oauth2":["notifications:read"]}],"summary":"List your notifications","tags":["notifications"]}},"/v1/notifications/unread-count":{"get":{"description":"The number on the bell (docs/21).","operationId":"getUnreadNotificationCount","parameters":[],"responses":{"200":{"description":"The count.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationUnreadCount"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `notifications:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["notifications:read"]},{"oauth2":["notifications:read"]}],"summary":"Count your unread notifications","tags":["notifications"]}},"/v1/notifications/read":{"post":{"description":"Marks every unread notification read, up to `up_to_id` (the newest one you saw) or up to now.","operationId":"markAllNotificationsRead","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkAllNotificationsRead"}}}},"responses":{"200":{"description":"How many were marked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationsMarkedRead"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `notifications:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["notifications:write"]},{"oauth2":["notifications:write"]}],"summary":"Mark all your notifications as read","tags":["notifications"]}},"/v1/notifications/preferences":{"get":{"description":"Per notification type: browser push and sound (in-app is always on); and whether the limited push while Unavailable stays on (docs/21). Per membership.","operationId":"getNotificationPreferences","parameters":[],"responses":{"200":{"description":"The preferences.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferences"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `notifications:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["notifications:read"]},{"oauth2":["notifications:read"]}],"summary":"Read your notification preferences","tags":["notifications"]},"patch":{"description":"Changes the preferences given; the others stay as they are.","operationId":"updateNotificationPreferences","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferencesUpdate"}}}},"responses":{"200":{"description":"The preferences.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferences"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `notifications:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["notifications:write"]},{"oauth2":["notifications:write"]}],"summary":"Change your notification preferences","tags":["notifications"]}},"/v1/notifications/{notificationId}":{"get":{"operationId":"getNotification","parameters":[{"name":"notificationId","required":true,"in":"path","description":"The notification id.","schema":{"type":"string","format":"uuid","description":"The notification id."}}],"responses":{"200":{"description":"The notification.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notification"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `notifications:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`NTF-8201`: no such notification among yours in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["notifications:read"]},{"oauth2":["notifications:read"]}],"summary":"Get one of your notifications","tags":["notifications"]}},"/v1/notifications/{notificationId}/read":{"post":{"description":"Marking a read notification again changes nothing.","operationId":"markNotificationRead","parameters":[{"name":"notificationId","required":true,"in":"path","description":"The notification id.","schema":{"type":"string","format":"uuid","description":"The notification id."}}],"responses":{"200":{"description":"The notification.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notification"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `notifications:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`NTF-8201`: no such notification among yours in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["notifications:write"]},{"oauth2":["notifications:write"]}],"summary":"Mark one of your notifications as read","tags":["notifications"]}},"/v1/push/key":{"get":{"description":"The VAPID public key a browser subscribes with (`PushManager.subscribe({ applicationServerKey })`, RFC 8292).","operationId":"getPushKey","parameters":[],"responses":{"200":{"description":"The key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushKey"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: browser push is not set up on Rabt (no VAPID key pair).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Get Rabt's push key","tags":["notifications"]}},"/v1/push/subscriptions":{"get":{"operationId":"listPushSubscriptions","parameters":[],"responses":{"200":{"description":"The live subscriptions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscriptionList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"List your browsers that receive push notifications","tags":["notifications"]},"post":{"description":"Registers the browser's push subscription (`PushSubscription.toJSON()`) for your account. The same endpoint again updates its keys. If another account had push on in this browser, it stops there.","operationId":"createPushSubscription","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscriptionCreate"}}}},"responses":{"201":{"description":"The subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscription"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `NTF-8203`: the endpoint is not a browser push service Rabt sends to.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: browser push is not set up on Rabt (no VAPID key pair).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Turn on push notifications for this browser","tags":["notifications"]}},"/v1/push/subscriptions/{subscriptionId}":{"delete":{"description":"Stops the subscription (kept as stopped, never erased). Stopping it again changes nothing.","operationId":"deletePushSubscription","parameters":[{"name":"subscriptionId","required":true,"in":"path","description":"The push subscription id.","schema":{"type":"string","format":"uuid","description":"The push subscription id."}}],"responses":{"204":{"description":"Stopped.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`NTF-8202`: no such push subscription of your account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[]}],"summary":"Turn off push notifications for a browser","tags":["notifications"]}},"/v1/segments":{"get":{"description":"By name, each with how many records it lists now.","operationId":"listSegments","parameters":[{"name":"entity","required":false,"in":"query","description":"Only segments of contacts or of companies.","schema":{"description":"Only segments of contacts or of companies.","$ref":"#/components/schemas/CrmListEntity"}}],"responses":{"200":{"description":"The segments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `segments:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["segments:read"]},{"oauth2":["segments:read"]}],"summary":"List the segments","tags":["segments"]},"post":{"operationId":"createSegment","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSegment"}}}},"responses":{"201":{"description":"The segment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `segments:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6028`: a segment has this name.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6011`: a tag does not exist. `API-8001` with `API-8020`: a companies segment filters only by `q` and `tag_ids`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["segments:write"]},{"oauth2":["segments:write"]}],"summary":"Save a filter as a segment","tags":["segments"]}},"/v1/segments/{segmentId}":{"get":{"operationId":"getSegment","parameters":[{"name":"segmentId","required":true,"in":"path","description":"The segment id.","schema":{"type":"string","format":"uuid","description":"The segment id."}}],"responses":{"200":{"description":"The segment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `segments:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6027`: no such segment (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["segments:read"]},{"oauth2":["segments:read"]}],"summary":"Get a segment","tags":["segments"]},"patch":{"operationId":"updateSegment","parameters":[{"name":"segmentId","required":true,"in":"path","description":"The segment id.","schema":{"type":"string","format":"uuid","description":"The segment id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSegment"}}}},"responses":{"200":{"description":"The segment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `segments:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6027`: no such segment (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6028`: a segment has this name.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6011`: a tag does not exist. `API-8001` with `API-8020`: a companies segment filters only by `q` and `tag_ids`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["segments:write"]},{"oauth2":["segments:write"]}],"summary":"Rename a segment or change its filter","tags":["segments"]},"delete":{"description":"It is no longer listed; it is kept (Rabt never deletes).","operationId":"deleteSegment","parameters":[{"name":"segmentId","required":true,"in":"path","description":"The segment id.","schema":{"type":"string","format":"uuid","description":"The segment id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `segments:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6027`: no such segment (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["segments:write"]},{"oauth2":["segments:write"]}],"summary":"Delete a segment","tags":["segments"]}},"/v1/segments/{segmentId}/contacts":{"get":{"operationId":"listSegmentContacts","parameters":[{"name":"segmentId","required":true,"in":"path","description":"The segment id.","schema":{"type":"string","format":"uuid","description":"The segment id."}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Records per page (1 to 100, default 25).","schema":{"default":25,"description":"Records per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of contacts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `segments:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6027`: no such segment (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6041`: the segment lists companies.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["segments:read"]},{"oauth2":["segments:read"]}],"summary":"List the contacts a segment lists now","tags":["segments"]}},"/v1/segments/{segmentId}/companies":{"get":{"operationId":"listSegmentCompanies","parameters":[{"name":"segmentId","required":true,"in":"path","description":"The segment id.","schema":{"type":"string","format":"uuid","description":"The segment id."}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Records per page (1 to 100, default 25).","schema":{"default":25,"description":"Records per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of companies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `segments:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6027`: no such segment (or it was deleted).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6041`: the segment lists contacts.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["segments:read"]},{"oauth2":["segments:read"]}],"summary":"List the companies a segment lists now","tags":["segments"]}},"/v1/crm-transfers":{"get":{"operationId":"listCrmTransfers","parameters":[{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","format":"uuid"}},{"name":"limit","required":false,"in":"query","description":"Records per page (1 to 100, default 25).","schema":{"default":25,"description":"Records per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTransferPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `contacts.import_export` permission. `API-8102`: the API key or app lacks the `imports_exports:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["imports_exports:read"]},{"oauth2":["imports_exports:read"]}],"summary":"List the imports and exports","tags":["imports-exports"]}},"/v1/crm-transfers/{transferId}":{"get":{"description":"Its status and progress; read it again while it runs.","operationId":"getCrmTransfer","parameters":[{"name":"transferId","required":true,"in":"path","description":"The import or export id.","schema":{"type":"string","format":"uuid","description":"The import or export id."}}],"responses":{"200":{"description":"The import or export.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTransfer"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `contacts.import_export` permission. `API-8102`: the API key or app lacks the `imports_exports:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6029`: no such import or export.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["imports_exports:read"]},{"oauth2":["imports_exports:read"]}],"summary":"Get an import or export","tags":["imports-exports"]}},"/v1/crm-imports":{"post":{"description":"The file is read now (its size, CSV and columns); then every row is checked in the background, writing nothing (`validating` → `validated`, with what it would create and update and the errors of every row). Start the import with `POST /v1/crm-transfers/{id}/start`. Rows match existing contacts by phone number or email address, as messages do: a match is completed (empty fields filled, numbers, addresses and tags added), never overwritten.","operationId":"createCrmImport","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateImport"}}}},"responses":{"202":{"description":"The import, being checked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTransfer"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.import_export` permission. `API-8102`: the API key or app lacks the `imports_exports:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6030`: more than 10 MB or 50,000 rows. `CRM-6031`: not a readable CSV. `CRM-6032`: an unknown column. `CRM-6033`: no name, phone or email column. `CRM-6034`: a column twice.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["imports_exports:write"]},{"oauth2":["imports_exports:write"]}],"summary":"Upload a CSV file of contacts","tags":["imports-exports"]}},"/v1/crm-imports/template":{"get":{"description":"The header row with every column an import reads, the organization's custom fields included.","operationId":"getCrmImportTemplate","parameters":[],"responses":{"200":{"description":"The file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvFile"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `contacts.import_export` permission. `API-8102`: the API key or app lacks the `imports_exports:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["imports_exports:read"]},{"oauth2":["imports_exports:read"]}],"summary":"An empty import file","tags":["imports-exports"]}},"/v1/crm-transfers/{transferId}/start":{"post":{"description":"Only once, and only when its check found no errors; it runs in the background.","operationId":"startCrmImport","parameters":[{"name":"transferId","required":true,"in":"path","description":"The import or export id.","schema":{"type":"string","format":"uuid","description":"The import or export id."}}],"responses":{"202":{"description":"The import, running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTransfer"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.import_export` permission. `API-8102`: the API key or app lacks the `imports_exports:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6029`: no such import or export.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6035`: still being checked, already started, or the file has errors.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["imports_exports:write"]},{"oauth2":["imports_exports:write"]}],"summary":"Start a checked import","tags":["imports-exports"]}},"/v1/crm-exports":{"post":{"description":"What a segment or a filter lists (at most 100,000 records), written in the background; download it with `GET /v1/crm-transfers/{id}/file` when it is `completed`.","operationId":"createCrmExport","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExport"}}}},"responses":{"202":{"description":"The export, running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTransfer"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.import_export` permission. `API-8102`: the API key or app lacks the `imports_exports:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6027`: no such segment.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6039`: more than 100,000 records. `CRM-6041`: the segment lists the other entity. `CRM-6011`: a tag does not exist.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["imports_exports:write"]},{"oauth2":["imports_exports:write"]}],"summary":"Export contacts or companies to a CSV file","tags":["imports-exports"]}},"/v1/crm-transfers/{transferId}/file":{"get":{"description":"Recorded in the audit log.","operationId":"downloadCrmExport","parameters":[{"name":"transferId","required":true,"in":"path","description":"The import or export id.","schema":{"type":"string","format":"uuid","description":"The import or export id."}}],"responses":{"200":{"description":"The file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvFile"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `contacts.import_export` permission. `API-8102`: the API key or app lacks the `imports_exports:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6029`: no such import or export.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CRM-6040`: the export has not completed (or it is an import).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["imports_exports:read"]},{"oauth2":["imports_exports:read"]}],"summary":"Download an exported file","tags":["imports-exports"]}},"/v1/crm-transfers/{transferId}/errors":{"get":{"description":"A CSV with the row, the column, the error code, the error and how to fix it, in the language of the request.","operationId":"downloadCrmTransferErrors","parameters":[{"name":"transferId","required":true,"in":"path","description":"The import or export id.","schema":{"type":"string","format":"uuid","description":"The import or export id."}}],"responses":{"200":{"description":"The file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvFile"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `contacts.import_export` permission. `API-8102`: the API key or app lacks the `imports_exports:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6029`: no such import or export.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["imports_exports:read"]},{"oauth2":["imports_exports:read"]}],"summary":"Download an import's row errors","tags":["imports-exports"]}},"/v1/contacts/{contactId}/duplicates":{"get":{"description":"Contacts that may be the same person, by rules only: a phone number or email address of one in a custom field of the other, or a similar name with activity within 30 days of each other. Suggestions only: nothing is merged automatically.","operationId":"listContactDuplicates","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}}],"responses":{"200":{"description":"At most 10 suggestions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateSuggestionList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `contacts:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"summary":"Likely duplicates of a contact","tags":["contacts"]}},"/v1/organization/membership/list-views/{view}":{"get":{"description":"How you last left a list (customers: its tab, filters and open segment; tickets: its space chip, status counter, channel and assignee filters), on any device; `state` is null until you change it. A tag or segment deleted since is left out, a space archived since becomes `all`.","operationId":"getListView","parameters":[{"name":"view","required":true,"in":"path","schema":{"$ref":"#/components/schemas/MemberListView"}}],"responses":{"200":{"description":"Your view.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberListViewDocument"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `members:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:read"]},{"oauth2":["members:read"]}],"summary":"Get your view of a list","tags":["members"]},"put":{"description":"Replaces how the list opens for you on every device. Allowed on an inactive seat: it changes nothing of the organization.","operationId":"saveListView","parameters":[{"name":"view","required":true,"in":"path","schema":{"$ref":"#/components/schemas/MemberListView"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveListViewRequest"}}}},"responses":{"200":{"description":"Your view.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberListViewDocument"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `members:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"summary":"Save your view of a list","tags":["members"]}},"/v1/tickets":{"get":{"description":"The tickets you may see (your own, your spaces, all with `tickets.view_all`), newest activity first, with filters.","operationId":"listTickets","parameters":[{"name":"status","required":false,"in":"query","description":"Statuses, comma-separated (e.g. `open,in_progress`).","schema":{"description":"Statuses, comma-separated (e.g. `open,in_progress`).","type":"string","maxLength":40,"pattern":"^(open|in_progress|closed)(,(open|in_progress|closed))*$"}},{"name":"space_id","required":false,"in":"query","description":"A department space, or `none` for tickets in no department space.","schema":{"description":"A department space, or `none` for tickets in no department space.","type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|none)$"}},{"name":"assignee_membership_id","required":false,"in":"query","description":"A member (membership id), or `none` for unassigned tickets (the queue).","schema":{"description":"A member (membership id), or `none` for unassigned tickets (the queue).","type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|none)$"}},{"name":"channel_type","required":false,"in":"query","description":"Only this channel.","schema":{"description":"Only this channel.","$ref":"#/components/schemas/ChannelType"}},{"name":"contact_id","required":false,"in":"query","description":"Only this contact's tickets.","schema":{"description":"Only this contact's tickets.","type":"string","format":"uuid"}},{"name":"q","required":false,"in":"query","description":"A ticket number (`1283` or `#1283`) or words of the subject.","schema":{"description":"A ticket number (`1283` or `#1283`) or words of the subject.","type":"string","maxLength":200}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 100, default 25).","schema":{"default":25,"description":"Items per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of tickets.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"List tickets (the ticket log)","tags":["tickets"]},"post":{"description":"A ticket for a contact on a channel, assigned to you (docs/13 \"created by a member\").","operationId":"createTicket","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTicket"}}}},"responses":{"201":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact. `TKT-6109`: no such ticket type.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6015`, `CRM-6016`: a custom field value that does not fit.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Start a ticket","tags":["tickets"]}},"/v1/tickets/counts":{"get":{"description":"Open, in progress, in queue, closed and new today, of the tickets you may see: in one department space (`space_id`), of one member (`assignee_membership_id`: your own for the Personal space), or all of them.","operationId":"countTickets","parameters":[{"name":"space_id","required":false,"in":"query","description":"A department space, or `none` for tickets in no department space.","schema":{"description":"A department space, or `none` for tickets in no department space.","type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|none)$"}},{"name":"assignee_membership_id","required":false,"in":"query","description":"A member (membership id), or `none` for unassigned tickets (the queue).","schema":{"description":"A member (membership id), or `none` for unassigned tickets (the queue).","type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|none)$"}}],"responses":{"200":{"description":"The counters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketCounts"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"Count tickets (the live counters)","tags":["tickets"]}},"/v1/tickets/space-counts":{"get":{"description":"The non-closed tickets you may see in each space chip of the overview: Personal (yours), each department space, All, and those in no department space (docs/13).","operationId":"countTicketsBySpace","parameters":[],"responses":{"200":{"description":"The counts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketSpaceCounts"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"Count tickets per space (the space chips)","tags":["tickets"]}},"/v1/tickets/start-options":{"get":{"description":"Each of the contact’s email addresses, phone numbers and channel identities, with the connected channels that can open a conversation there, those not connected yet, and those the customer starts (web chat). Start one with `createTicket` (docs/12, docs/13).","operationId":"listTicketStartOptions","parameters":[{"name":"contact_id","required":true,"in":"query","description":"The contact to start a ticket for.","schema":{"type":"string","format":"uuid","description":"The contact to start a ticket for."}}],"responses":{"200":{"description":"The options.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketStartOptions"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"Where a ticket can be started for a contact","tags":["tickets"]}},"/v1/tickets/by-number/{number}":{"get":{"operationId":"getTicketByNumber","parameters":[{"name":"number","required":true,"in":"path","description":"The ticket number (#1283).","schema":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The ticket number (#1283)."}}],"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"Get a ticket by its number","tags":["tickets"]}},"/v1/ticket-references":{"post":{"description":"For ticket, contact and company notes and internal chat: the tickets you may see link to them, the others answer only `accessible: false`.","operationId":"resolveTicketReferences","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveTicketReferences"}}}},"responses":{"200":{"description":"The references.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketReferences"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"Resolve #<number> references","tags":["tickets"]}},"/v1/tickets/{ticketId}":{"get":{"operationId":"getTicket","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"Get a ticket","tags":["tickets"]},"patch":{"description":"Subject, type, priority, custom fields, company and the AI switch. Send the `version` you edited: a teammate’s change since answers `TKT-6104` instead of being overwritten.","operationId":"updateTicket","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTicket"}}}},"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed). `TKT-6109`: no such ticket type. `CRM-6002`: no such company.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6104`: someone else changed the ticket since your version. `TKT-6102`: the ticket is closed (final).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CRM-6015`, `CRM-6016`: a custom field value that does not fit.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Edit a ticket","tags":["tickets"]}},"/v1/tickets/{ticketId}/ai/resume":{"post":{"description":"After the AI agent handed the conversation off, failed (`ai.error`) or was switched off, it replies to the customer again: to their next messages, and to the last one if it is unanswered. Turns `ai_enabled` on. Doing it while it replies changes nothing.","operationId":"resumeTicketAi","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AI-5042`: the ticket is closed or a call. `AI-5044`: an admin stopped the AI agent everywhere.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Turn the AI agent on again in a ticket","tags":["tickets"]}},"/v1/tickets/{ticketId}/status":{"post":{"description":"open → in progress (an unassigned ticket becomes yours), open or in progress → closed (final, docs/13).","operationId":"changeTicketStatus","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeTicketStatus"}}}},"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6102`: the ticket is closed (final). `TKT-6103`: the state machine does not allow this change.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Pick up or close a ticket","tags":["tickets"]}},"/v1/tickets/{ticketId}/take":{"post":{"description":"A ticket without an assignee, e.g. waiting in a queue (docs/25 \"Take\"), becomes yours; an open one is in progress. Taking your own ticket again changes nothing.","operationId":"takeTicket","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6102`: the ticket is closed (final). `TKT-6123`: another member took the ticket first (it has another assignee).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Take a ticket nobody holds","tags":["tickets"]}},"/v1/tickets/{ticketId}/assign":{"post":{"operationId":"assignTicket","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignTicket"}}}},"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.assign` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6102`: the ticket is closed (final).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `TKT-6107`: the member is not in this organization. `TKT-6122`: their seat is inactive.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Assign or reassign a ticket","tags":["tickets"]}},"/v1/tickets/{ticketId}/move":{"post":{"description":"To a department space or the All space (`space_id` null). The ticket is handed over: its assignee is cleared and it waits in the space’s queue for the automatic distribution (docs/17).","operationId":"moveTicket","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveTicket"}}}},"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed). `SPC-6201`: no such space, or it is archived.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6102`: the ticket is closed (final).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Move a ticket to another space","tags":["tickets"]}},"/v1/tickets/{ticketId}/merge":{"post":{"description":"Two open or in-progress tickets of the same contact: the other ticket’s messages move here and it is closed, pointing here.","operationId":"mergeTickets","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeTickets"}}}},"responses":{"200":{"description":"This ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6108`: not two live tickets of the same contact.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Merge another ticket into this one","tags":["tickets"]}},"/v1/tickets/{ticketId}/follow":{"put":{"description":"Notified of its updates (any member, for a ticket they may see).","operationId":"followTicket","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Follow a ticket","tags":["tickets"]},"delete":{"operationId":"unfollowTicket","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Stop following a ticket","tags":["tickets"]}},"/v1/tickets/{ticketId}/followers":{"get":{"operationId":"listTicketFollowers","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"responses":{"200":{"description":"Their membership ids.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketFollowers"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"The members following a ticket","tags":["tickets"]}},"/v1/tickets/{ticketId}/read":{"post":{"description":"Your own read state (the unread marker and the \"New messages\" divider): through one item of the timeline, or through the newest. It only moves forward.","operationId":"markTicketRead","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkTicketRead"}}}},"responses":{"200":{"description":"The ticket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed). `TKT-6105`: no such item in this ticket's timeline.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Mark a ticket read","tags":["tickets"]}},"/v1/tickets/{ticketId}/draft":{"get":{"operationId":"getTicketDraft","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"responses":{"200":{"description":"The draft, or null.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Your draft on a ticket","tags":["tickets"]},"put":{"description":"Kept on the server: it survives reloads, crashes and switching devices.","operationId":"saveTicketDraft","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftInput"}}}},"responses":{"200":{"description":"The draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Save your draft on a ticket","tags":["tickets"]},"delete":{"operationId":"clearTicketDraft","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"responses":{"204":{"description":"Cleared.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8103`: not available to API keys and apps (members only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is in a space you cannot access (the same answer, so nothing is revealed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]}],"summary":"Clear your draft on a ticket","tags":["tickets"]}},"/v1/tickets/{ticketId}/messages":{"get":{"description":"Messages in both directions, internal notes, system events and calls, newest first (load older pages with `cursor`).","operationId":"listTicketMessages","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 100, default 25).","schema":{"default":25,"description":"Items per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of the timeline.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or one you cannot access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"A ticket’s timeline","tags":["tickets"]},"post":{"description":"A reply is queued and sent on the ticket channel (its status follows: queued → sending → sent → delivered → read, or failed with the reason). Send a `client_key` so a retried request creates one message, and `base_message_id` to learn what arrived since you started writing.","operationId":"sendTicketMessage","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessage"}}}},"responses":{"201":{"description":"The message and the send-time warning.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or one you cannot access. `TKT-6111`: no such attachment.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6102`: the ticket is closed (notes are still possible). `TKT-6119`: no replies on the voice channel. `TKT-6112`: a file is not scanned yet. `TKT-6113`: a file is blocked (malware).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `TKT-6107`: a mentioned member is not in the organization. `TKT-6116`: a file of another ticket or already sent, or a reply to a message of another ticket.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Reply to the customer or add an internal note","tags":["tickets"]}},"/v1/tickets/{ticketId}/activity":{"get":{"operationId":"getTicketActivitySince","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}},{"name":"since","required":false,"in":"query","description":"Your compose base: the newest item you had seen (left out: since the start).","schema":{"description":"Your compose base: the newest item you had seen (left out: since the start).","type":"string","format":"uuid"}}],"responses":{"200":{"description":"The counts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendWarnings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or one you cannot access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `TKT-6116`: the base is not a message of this ticket.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"What arrived since your compose base (the send-time warning)","tags":["tickets"]}},"/v1/messages/{messageId}":{"get":{"description":"With the number of its current ticket (after a merge too).","operationId":"getMessage","parameters":[{"name":"messageId","required":true,"in":"path","description":"The message id.","schema":{"type":"string","format":"uuid","description":"The message id."}}],"responses":{"200":{"description":"The message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageLookup"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6105`: no such message, or one in a ticket you cannot access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"Get a message (a copied link)","tags":["tickets"]}},"/v1/messages/{messageId}/link-preview":{"get":{"description":"The title, description, site name and image of the first link in a message: the preview the channel sent, or read by Rabt from the public page (http or https, never a private network, redirects checked, 4-second and size limits, no cookies), the image kept by Rabt. Cached per address for 7 days (an hour when the page could not be read).","operationId":"getMessageLinkPreview","parameters":[{"name":"messageId","required":true,"in":"path","description":"The message id.","schema":{"type":"string","format":"uuid","description":"The message id."}}],"responses":{"200":{"description":"The preview, or null.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkPreviewResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6105`: no such message, or one in a ticket you cannot access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"The preview of a message’s link","tags":["tickets"]}},"/v1/messages/{messageId}/retry":{"post":{"description":"Queued again with the next attempt.","operationId":"retryMessage","parameters":[{"name":"messageId","required":true,"in":"path","description":"The message id.","schema":{"type":"string","format":"uuid","description":"The message id."}}],"responses":{"200":{"description":"The message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6105`: no such message, or one in a ticket you cannot access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6106`: only a failed message is retried. `TKT-6102`: the ticket is closed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Send a failed message again","tags":["tickets"]}},"/v1/tickets/{ticketId}/attachments":{"post":{"description":"Returns the signed request that uploads the file straight to storage (valid 15 minutes). Then complete the upload.","operationId":"requestAttachmentUpload","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadRequest"}}}},"responses":{"201":{"description":"The file and its upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUpload"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or one you cannot access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `TKT-6114`: the file is larger than allowed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Upload a file to a ticket","tags":["tickets"]}},"/v1/attachments/{attachmentId}/complete":{"post":{"description":"Once the file is in storage with its size; it is scanned for malware next.","operationId":"completeAttachmentUpload","parameters":[{"name":"attachmentId","required":true,"in":"path","description":"The attachment id.","schema":{"type":"string","format":"uuid","description":"The attachment id."}}],"responses":{"200":{"description":"The file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attachment"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6111`: no such attachment, or one in a ticket you cannot access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6115`: the file is not in storage, or has another size.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Complete an upload","tags":["tickets"]}},"/v1/attachments/{attachmentId}":{"get":{"operationId":"getAttachment","parameters":[{"name":"attachmentId","required":true,"in":"path","description":"The attachment id.","schema":{"type":"string","format":"uuid","description":"The attachment id."}}],"responses":{"200":{"description":"The file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attachment"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6111`: no such attachment, or one in a ticket you cannot access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"Get a file (its scan status)","tags":["tickets"]}},"/v1/attachments/{attachmentId}/download":{"get":{"operationId":"downloadAttachment","parameters":[{"name":"attachmentId","required":true,"in":"path","description":"The attachment id.","schema":{"type":"string","format":"uuid","description":"The attachment id."}}],"responses":{"200":{"description":"The link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentDownload"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6111`: no such attachment, or one in a ticket you cannot access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6112`: not uploaded or scanned yet (or the scan failed). `TKT-6113`: blocked, it contains malware.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"A download link for a file (valid 5 minutes)","tags":["tickets"]}},"/v1/contacts/{contactId}/history":{"get":{"description":"Tickets and calls across channels, newest first (and campaign messages), following merges.","operationId":"getContactHistory","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"filter","required":false,"in":"query","description":"all, tickets, calls or campaigns (docs/13 side panel).","schema":{"default":"all","description":"all, tickets, calls or campaigns (docs/13 side panel).","type":"string","enum":["all","tickets","calls","campaigns"]}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 100, default 25).","schema":{"default":25,"description":"Items per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of the history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommunicationHistory"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `contacts:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"summary":"A contact’s communication history","tags":["tickets"]}},"/v1/contacts/{contactId}/full-context":{"get":{"description":"Every message, call, campaign message and (with `include_notes`) internal note, across channels, tickets and merged identities; newest first, loaded page by page.","operationId":"getContactFullContext","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"include_notes","required":false,"in":"query","description":"Include internal notes (the toggle of the view).","schema":{"description":"Include internal notes (the toggle of the view).","type":"string"}},{"name":"channel_type","required":false,"in":"query","description":"Only this channel.","schema":{"description":"Only this channel.","$ref":"#/components/schemas/ChannelType"}},{"name":"from","required":false,"in":"query","description":"Only items at or after this time (ISO 8601).","schema":{"description":"Only items at or after this time (ISO 8601).","type":"string","format":"date-time"}},{"name":"to","required":false,"in":"query","description":"Only items at or before this time (ISO 8601).","schema":{"description":"Only items at or before this time (ISO 8601).","type":"string","format":"date-time"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 100, default 25).","schema":{"default":25,"description":"Items per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of the view.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FullContext"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `contacts:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"summary":"The full context of a contact (read-only)","tags":["tickets"]}},"/v1/ticket-types":{"get":{"operationId":"listTicketTypes","parameters":[],"responses":{"200":{"description":"The types.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketTypeList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `organization:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:read"]},{"oauth2":["organization:read"]}],"summary":"The ticket types","tags":["tickets"]},"post":{"operationId":"createTicketType","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketTypeInput"}}}},"responses":{"201":{"description":"The type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketType"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6110`: a ticket type with this name exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Add a ticket type","tags":["tickets"]}},"/v1/ticket-types/{typeId}":{"patch":{"operationId":"updateTicketType","parameters":[{"name":"typeId","required":true,"in":"path","description":"The ticket type id.","schema":{"type":"string","format":"uuid","description":"The ticket type id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketTypeUpdate"}}}},"responses":{"200":{"description":"The type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketType"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6109`: no such ticket type.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6110`: a ticket type with this name exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Rename or reorder a ticket type","tags":["tickets"]},"delete":{"description":"Tickets that have it keep it (it is not offered for new ones).","operationId":"deleteTicketType","parameters":[{"name":"typeId","required":true,"in":"path","description":"The ticket type id.","schema":{"type":"string","format":"uuid","description":"The ticket type id."}}],"responses":{"204":{"description":"Removed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6109`: no such ticket type.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Remove a ticket type","tags":["tickets"]}},"/v1/ticket-settings":{"get":{"operationId":"getTicketSettings","parameters":[],"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `organization:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:read"]},{"oauth2":["organization:read"]}],"summary":"The ticket settings","tags":["tickets"]},"put":{"description":"`auto_close_days`: days without a customer reply before auto-close (docs/13).","operationId":"updateTicketSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketSettings"}}}},"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Change the ticket settings","tags":["tickets"]}},"/v1/canned-replies":{"get":{"description":"The replies you may use, by title: the organization’s, your spaces’ (every space’s with `settings.manage`) and your own. With `ticket_id` (the \"/\" picker): the organization’s, the ticket’s space’s and your own.","operationId":"listCannedReplies","parameters":[{"name":"scope","required":false,"in":"query","description":"Only replies of this scope.","schema":{"description":"Only replies of this scope.","$ref":"#/components/schemas/CannedReplyScope"}},{"name":"space_id","required":false,"in":"query","description":"Only the replies of this department space.","schema":{"description":"Only the replies of this department space.","type":"string","format":"uuid"}},{"name":"ticket_id","required":false,"in":"query","description":"The ticket being answered (the \"/\" picker): the organization’s replies, the replies of the ticket’s space and your own.","schema":{"description":"The ticket being answered (the \"/\" picker): the organization’s replies, the replies of the ticket’s space and your own.","type":"string","format":"uuid"}},{"name":"q","required":false,"in":"query","description":"Words of the title (Arabic-aware) or of the text.","schema":{"description":"Words of the title (Arabic-aware) or of the text.","type":"string","maxLength":200}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":400,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 100, default 25).","schema":{"default":25,"description":"Items per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of replies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedReplyPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `replies:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or one you cannot access.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["replies:read"]},{"oauth2":["replies:read"]}],"summary":"List canned replies","tags":["replies"]},"post":{"description":"The organization’s (`settings.manage`), a department space’s (`space_id`; `space_replies.manage` in a space you belong to, or `settings.manage`) or your own (any member). `AUTH-1002`: the scope needs `settings.manage` (organization) or `space_replies.manage` (space). `TKT-6131`: you are not a member of the space.","operationId":"createCannedReply","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCannedReply"}}}},"responses":{"201":{"description":"The reply.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedReply"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `replies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space, or it is archived.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["replies:write"]},{"oauth2":["replies:write"]}],"summary":"Save a canned reply","tags":["replies"]}},"/v1/canned-replies/{replyId}":{"get":{"operationId":"getCannedReply","parameters":[{"name":"replyId","required":true,"in":"path","description":"The canned reply id.","schema":{"type":"string","format":"uuid","description":"The canned reply id."}}],"responses":{"200":{"description":"The reply.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedReply"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `replies:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6130`: no such canned reply, or one you may not see (another member’s personal reply, a space you are not in).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["replies:read"]},{"oauth2":["replies:read"]}],"summary":"Get a canned reply","tags":["replies"]},"patch":{"description":"`AUTH-1002`: the scope needs `settings.manage` (organization) or `space_replies.manage` (space). `TKT-6131`: you are not a member of the space.","operationId":"updateCannedReply","parameters":[{"name":"replyId","required":true,"in":"path","description":"The canned reply id.","schema":{"type":"string","format":"uuid","description":"The canned reply id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCannedReply"}}}},"responses":{"200":{"description":"The reply.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedReply"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `replies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6130`: no such canned reply, or one you may not see (another member’s personal reply, a space you are not in).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["replies:write"]},{"oauth2":["replies:write"]}],"summary":"Change a canned reply","tags":["replies"]},"delete":{"description":"It is no longer offered (kept with its history: Rabt never deletes). `AUTH-1002`: the scope needs `settings.manage` (organization) or `space_replies.manage` (space). `TKT-6131`: you are not a member of the space.","operationId":"deleteCannedReply","parameters":[{"name":"replyId","required":true,"in":"path","description":"The canned reply id.","schema":{"type":"string","format":"uuid","description":"The canned reply id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `replies:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6130`: no such canned reply, or one you may not see (another member’s personal reply, a space you are not in).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["replies:write"]},{"oauth2":["replies:write"]}],"summary":"Delete a canned reply","tags":["replies"]}},"/v1/channels/email/google":{"get":{"description":"Every Google Workspace / Gmail mailbox connected, with its status, addresses (send-as aliases), push and sync state and sending in the last 24 hours; disconnected ones last. Tokens are never returned.","operationId":"listGmailChannels","parameters":[],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the Gmail channels","tags":["channels"]}},"/v1/channels/email/google/authorizations":{"post":{"description":"Returns the Google sign-in URL (authorization code with PKCE and `state`, offline access, the `gmail.modify` permission). The member signs in there; Google sends them back to Rabt’s callback page with `state` and `code`, which finishes with `completeGmailConnection` within ten minutes.","operationId":"startGmailConnection","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"The sign-in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailAuthorization"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Google is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Start connecting a Gmail mailbox","tags":["channels"]}},"/v1/channels/email/google/authorizations/complete":{"post":{"description":"With what Google sent back: the code is exchanged, the Gmail permission checked, the mailbox and its send-as addresses read, and the channel stored `active` (or reconnected). Push notifications and sync start from now. Each sign-in is used once, in the organization that started it.","operationId":"completeGmailConnection","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteGmailConnection"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3614`: the mailbox is already another channel’s. `EM-3715`: a reconnection signed in with another account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"`EM-3705`: the sign-in expired, was used, or belongs to another organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `EM-3700`: the member declined at Google. `EM-3701`: the Gmail permission was not granted. `EM-3706`: Gmail is not enabled for the account.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Google is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Finish connecting a Gmail mailbox","tags":["channels"]}},"/v1/channels/email/google/{channelId}":{"get":{"operationId":"getGmailChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Gmail channel id.","schema":{"type":"string","format":"uuid","description":"The Gmail channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no Gmail channel (or address) with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"A Gmail channel","tags":["channels"]},"patch":{"description":"Its name, or the address replies leave from when their ticket has none of its own (an address Gmail may send as).","operationId":"updateGmailChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Gmail channel id.","schema":{"type":"string","format":"uuid","description":"The Gmail channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGmailChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no Gmail channel (or address) with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3716`: the channel is disconnected or waits for a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `EM-3713`: Gmail may not send as that address.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Change a Gmail channel","tags":["channels"]}},"/v1/channels/email/google/{channelId}/addresses/{addressId}":{"patch":{"operationId":"updateGmailAddress","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Gmail channel id.","schema":{"type":"string","format":"uuid","description":"The Gmail channel id."}},{"name":"addressId","required":true,"in":"path","description":"The channel address id.","schema":{"type":"string","format":"uuid","description":"The channel address id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGmailAddress"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no Gmail channel (or address) with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3716`: the channel is disconnected or waits for a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Change the sender name of an address","tags":["channels"]}},"/v1/channels/email/google/{channelId}/addresses/refresh":{"post":{"description":"Reads Gmail’s “Send mail as” addresses: new aliases are added, their verification kept current, removed ones removed. Once a minute per channel.","operationId":"refreshGmailAddresses","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Gmail channel id.","schema":{"type":"string","format":"uuid","description":"The Gmail channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no Gmail channel (or address) with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3716`: the channel is disconnected or waits for a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `EM-3719`: asked less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Read the mailbox’s addresses again","tags":["channels"]}},"/v1/channels/email/google/{channelId}/sync":{"post":{"description":"Asks for the mailbox’s new messages to be fetched now (Rabt also does it on every push and every few minutes). Once a minute per channel.","operationId":"syncGmailChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Gmail channel id.","schema":{"type":"string","format":"uuid","description":"The Gmail channel id."}}],"responses":{"202":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no Gmail channel (or address) with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3716`: the channel is disconnected or waits for a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `EM-3719`: asked less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Fetch new mail now","tags":["channels"]}},"/v1/channels/email/google/{channelId}/domain-check":{"post":{"description":"Reads SPF, DKIM (Google’s `google` selector) and DMARC of a Workspace mailbox’s domain and keeps the report on the channel. Once a minute per channel.","operationId":"checkGmailSenderDomain","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Gmail channel id.","schema":{"type":"string","format":"uuid","description":"The Gmail channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no Gmail channel (or address) with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `EM-3719`: asked less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Check the sender domain","tags":["channels"]}},"/v1/channels/email/google/{channelId}/reconnect":{"post":{"description":"Returns a Google sign-in URL for the channel’s own account (`needs_reauth` after Google refused the saved access); finishing it with `completeGmailConnection` makes the channel active again.","operationId":"reconnectGmailChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Gmail channel id.","schema":{"type":"string","format":"uuid","description":"The Gmail channel id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"The sign-in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailAuthorization"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no Gmail channel (or address) with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3716`: the channel is disconnected or waits for a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Google is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Reconnect a Gmail channel","tags":["channels"]}},"/v1/channels/email/google/{channelId}/disconnect":{"post":{"description":"Stops the push notifications, revokes Rabt’s access at Google and in the token vault, and removes the addresses; the channel and its tickets stay (Rabt never deletes).","operationId":"disconnectGmailChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Gmail channel id.","schema":{"type":"string","format":"uuid","description":"The Gmail channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no Gmail channel (or address) with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect a Gmail channel","tags":["channels"]}},"/v1/channels/email":{"get":{"description":"Every address connected by forwarding, with its status, inbound address, SMTP server (never its password) and sender domain checks; disconnected ones last.","operationId":"listEmailChannels","parameters":[],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the email forwarding channels","tags":["channels"]},"post":{"description":"Rabt signs in to the SMTP server over TLS first; then the channel is stored `pending` with its inbound address, until the forwarding check comes back.","operationId":"connectEmailChannel","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectEmailChannel"}}}},"responses":{"201":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3614`: the address is already connected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `EM-3601`–`EM-3609`: the SMTP server refused (credentials, TLS, address, unreachable); the server’s own reply is in `provider`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: inbound email is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Connect an address by forwarding","tags":["channels"]}},"/v1/channels/email/{channelId}":{"get":{"operationId":"getEmailChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"An email forwarding channel","tags":["channels"]},"patch":{"description":"Its name, sender name, SMTP server settings or password. New server settings need `smtp_password` with them (the saved password is only sent to the server it was saved for); they are tried first, and a channel waiting for a reconnection works again when they work.","operationId":"updateEmailChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmailChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `EM-3601`–`EM-3609`: the SMTP server refused (credentials, TLS, address, unreachable); the server’s own reply is in `provider`. `EM-3618`: new server settings without `smtp_password`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Change an email channel","tags":["channels"]}},"/v1/channels/email/{channelId}/reconnect":{"post":{"description":"After the SMTP server refused the saved password (`needs_reauth`): the new one is tried, then kept.","operationId":"reconnectEmailChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectEmailChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `EM-3601`–`EM-3609`: the SMTP server refused (credentials, TLS, address, unreachable); the server’s own reply is in `provider`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Reconnect with a new password","tags":["channels"]}},"/v1/channels/email/{channelId}/forwarding-check":{"post":{"description":"Rabt sends a message with a one-time token from the address to itself through its SMTP server; when it comes back through the forwarding, the channel becomes `active`. Once a minute per channel.","operationId":"sendEmailForwardingCheck","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3610`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `EM-3617`: a check was sent less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Send the forwarding check message","tags":["channels"]}},"/v1/channels/email/{channelId}/domain-check":{"post":{"description":"Reads the DNS of the address’s domain: SPF, DKIM (from the forwarding check message), DMARC and the SMTP server’s reverse DNS, and keeps the report on the channel. Once a minute per channel.","operationId":"checkEmailSenderDomain","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `EM-3619`: the domain was checked less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Check the sender domain","tags":["channels"]}},"/v1/channels/email/{channelId}/disconnect":{"post":{"description":"Revokes the saved password and stops sending and receiving for the address; the channel and its tickets stay (Rabt never deletes).","operationId":"disconnectEmailChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect an email channel","tags":["channels"]}},"/v1/channels/microsoft/setup":{"get":{"description":"Whether Microsoft 365 is set up on this Rabt, the redirect URI of its Entra app, and the page where a Microsoft 365 administrator approves Rabt for the whole organization.","operationId":"getMicrosoftSetup","parameters":[],"responses":{"200":{"description":"The setup.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftSetup"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"Microsoft 365 setup","tags":["channels"]}},"/v1/channels/microsoft":{"get":{"description":"Every connected Microsoft 365 mailbox with its status, addresses, receiving state and daily sending use (never its tokens); disconnected ones last.","operationId":"listMicrosoftChannels","parameters":[],"responses":{"200":{"description":"The mailboxes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the Microsoft 365 mailboxes","tags":["channels"]}},"/v1/channels/microsoft/connect":{"post":{"description":"Returns Microsoft’s sign-in page (OAuth 2.0 with state and PKCE). The person signs in and approves; Microsoft returns to Rabt, which connects the mailbox (or reconnects `channel_id`) and emits `channel.connected`.","operationId":"connectMicrosoftChannel","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftConnect"}}}},"responses":{"200":{"description":"The sign-in page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftConnectStart"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Microsoft 365 is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Start connecting a Microsoft 365 mailbox","tags":["channels"]}},"/v1/channels/microsoft/callback":{"get":{"description":"Microsoft sends the browser here with `code` and `state` (or `error`). Rabt connects the mailbox and redirects to the email settings: `?microsoft=<channel id>`, or `?microsoft_error=<code>&reference=<reference>`.","operationId":"microsoftCallback","parameters":[{"name":"state","required":false,"in":"query","schema":{"type":"string","maxLength":200}},{"name":"code","required":false,"in":"query","schema":{"type":"string","maxLength":10000}},{"name":"error","required":false,"in":"query","schema":{"type":"string","maxLength":200}},{"name":"error_description","required":false,"in":"query","schema":{"type":"string","maxLength":10000}}],"responses":{"302":{"description":"To the email settings."},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Microsoft’s return after signing in","tags":["channels"],"x-rabt-sdk":false}},"/v1/channels/microsoft/{channelId}":{"get":{"operationId":"getMicrosoftChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"responses":{"200":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"A Microsoft 365 mailbox","tags":["channels"]},"patch":{"description":"Its name, or the address replies without one of their own leave from.","operationId":"updateMicrosoftChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMicrosoftChannel"}}}},"responses":{"200":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization. `EM-3125`: no such address on this channel.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Change a Microsoft 365 mailbox","tags":["channels"]}},"/v1/channels/microsoft/{channelId}/addresses/refresh":{"post":{"description":"Reads the mailbox’s addresses (its primary address and aliases) from Microsoft and keeps the channel’s in step; aliases members added stay.","operationId":"refreshMicrosoftAddresses","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"responses":{"200":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3126`: the mailbox needs a reconnection or is disconnected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Discover the mailbox’s addresses again","tags":["channels"]}},"/v1/channels/microsoft/{channelId}/addresses":{"post":{"description":"An alias of the mailbox Microsoft does not list to Rabt (a shared mailbox’s aliases); the send-as check shows whether mail can leave from it.","operationId":"addMicrosoftAddress","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMicrosoftAddress"}}}},"responses":{"201":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3614`: the address is already connected. `EM-3126`: the mailbox is not working.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `EM-3130`: the mailbox carries the most addresses it can.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Add an alias by hand","tags":["channels"]}},"/v1/channels/microsoft/{channelId}/addresses/{addressId}":{"patch":{"description":"Its sender name, or the member its new tickets are assigned to (docs/02 §4: `ahmed@` → Ahmed). Spaces take an address’s tickets through the spaces API (`POST /v1/spaces/{id}/channels` with `channel_address_id`).","operationId":"updateMicrosoftAddress","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}},{"name":"addressId","required":true,"in":"path","description":"The address id (of the channel).","schema":{"type":"string","format":"uuid","description":"The address id (of the channel)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMicrosoftAddress"}}}},"responses":{"200":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization. `EM-3125`: no such address on this channel. `TKT-6107`: no such member.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6122`: the member’s seat is inactive.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Change an address of the mailbox","tags":["channels"]},"delete":{"description":"Only aliases members added (not the default address). The address row and its tickets stay (Rabt never deletes).","operationId":"removeMicrosoftAddress","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}},{"name":"addressId","required":true,"in":"path","description":"The address id (of the channel).","schema":{"type":"string","format":"uuid","description":"The address id (of the channel)."}}],"responses":{"200":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization. `EM-3125`: no such address on this channel.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Remove an alias added by hand","tags":["channels"]}},"/v1/channels/microsoft/{channelId}/addresses/{addressId}/send-as-check":{"post":{"description":"Sends a message from the address to the mailbox itself; when it comes back, the address is `verified` (Microsoft kept it) or `rewritten` (the tenant needs SendFromAliasEnabled); a check Microsoft refuses makes it `refused` (EM-3109) and one that cannot be sent `failed`, with the error on the address. Once a minute per address.","operationId":"checkMicrosoftSendAs","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}},{"name":"addressId","required":true,"in":"path","description":"The address id (of the channel).","schema":{"type":"string","format":"uuid","description":"The address id (of the channel)."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization. `EM-3125`: no such address on this channel.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3126`: the mailbox needs a reconnection or is disconnected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `EM-3123`: the address was checked less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Check sending from an address","tags":["channels"]}},"/v1/channels/microsoft/{channelId}/sync":{"post":{"description":"Asks for the inbox’s delta sync now (it also runs every 30 minutes and after missed notifications). Once a minute per mailbox.","operationId":"syncMicrosoftChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"responses":{"200":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3126`: the mailbox needs a reconnection or is disconnected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `EM-3124`: a sync was asked for less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Read the mailbox’s new mail now","tags":["channels"]}},"/v1/channels/microsoft/{channelId}/messages/{messageId}/download-files":{"post":{"description":"For a customer’s message whose files were not all downloaded (`EM-3128` on it, listed in `messages_missing_files`): downloads each missing file again, on its own; stored files are kept. `EM-3128` is cleared when none is missing, or attached again with a new reference. Emits `message.files_downloaded` (and `attachment.stored` per file). A message with no file missing is left as it is.","operationId":"downloadMicrosoftMessageFiles","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}},{"name":"messageId","required":true,"in":"path","description":"The message id (of the ticket).","schema":{"type":"string","format":"uuid","description":"The message id (of the ticket)."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization. `TKT-6105`: no customer email with this id on the mailbox.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`EM-3126`: the mailbox needs a reconnection or is disconnected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Download a message’s missing files again","tags":["channels"]}},"/v1/channels/microsoft/{channelId}/domain-check":{"post":{"description":"Reads the DNS of the default address’s domain: SPF, DKIM (Microsoft 365’s selector1 and selector2) and DMARC, and keeps the report on the mailbox. It also runs when the mailbox is connected. Once a minute per mailbox.","operationId":"checkMicrosoftSenderDomain","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"responses":{"200":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `EM-3619`: the domain was checked less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Check the sender domain","tags":["channels"]}},"/v1/channels/microsoft/{channelId}/disconnect":{"post":{"description":"Removes the notification subscription at Microsoft, revokes Rabt’s copy of the tokens and stops sending and receiving; the channel and its tickets stay (Rabt never deletes). To remove Rabt from the Microsoft account too, remove it from the account’s apps (myapps.microsoft.com).","operationId":"disconnectMicrosoftChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The email channel id.","schema":{"type":"string","format":"uuid","description":"The email channel id."}}],"responses":{"200":{"description":"The mailbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`EM-3615`: no email channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect a Microsoft 365 mailbox","tags":["channels"]}},"/v1/email-signatures":{"get":{"description":"The organization’s template and the spaces’ overrides.","operationId":"listEmailSignatures","parameters":[],"responses":{"200":{"description":"The signatures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignatureList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `organization:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:read"]},{"oauth2":["organization:read"]}],"summary":"The email signatures","tags":["organizations"]}},"/v1/email-signatures/preview":{"get":{"description":"The signature your email replies on a ticket of the space carry, filled in with your name and job title (null: none).","operationId":"previewEmailSignature","parameters":[{"name":"space_id","required":false,"in":"query","description":"The ticket’s space (none: the All space).","schema":{"description":"The ticket’s space (none: the All space).","type":"string","format":"uuid"}}],"responses":{"200":{"description":"The signature.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignaturePreview"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `organization:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:read"]},{"oauth2":["organization:read"]}],"summary":"The signature of your replies","tags":["organizations"]}},"/v1/email-signatures/organization":{"put":{"operationId":"setOrganizationEmailSignature","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignatureInput"}}}},"responses":{"200":{"description":"The signature.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignature"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1002`: `settings.manage` (or `space_replies.manage` for a space you belong to) is needed.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Set the organization’s signature","tags":["organizations"]}},"/v1/email-signatures/spaces/{spaceId}":{"put":{"operationId":"setSpaceEmailSignature","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignatureInput"}}}},"responses":{"200":{"description":"The signature.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignature"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1002`: `settings.manage` (or `space_replies.manage` for a space you belong to) is needed.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Set a space’s signature","tags":["organizations"]},"delete":{"description":"The organization’s template applies to the space again.","operationId":"removeSpaceEmailSignature","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}}],"responses":{"200":{"description":"The signatures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignatureList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1002`: `settings.manage` (or `space_replies.manage` for a space you belong to) is needed.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `organization:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["organization:write"]},{"oauth2":["organization:write"]}],"summary":"Remove a space’s signature","tags":["organizations"]}},"/v1/channels/whatsapp":{"get":{"description":"Every connected WhatsApp number with its status, quality rating, messaging limit, health status, registration and chat history import; disconnected ones last. Tokens are never returned.","operationId":"listWhatsappChannels","parameters":[],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the WhatsApp numbers","tags":["channels"]},"post":{"description":"With Embedded Signup's result: Rabt exchanges the code for the business's token, subscribes to its account's webhooks, registers the number (not for the WhatsApp Business app), attaches Rabt's credit line (Rabt pays Meta; you pay Rabt from your balance), then stores the channel `active`. A number waiting for a reconnection is reconnected.","operationId":"connectWhatsappChannel","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectWhatsappChannel"}}}},"responses":{"201":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WA-2102`: the number is already connected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WA-2100`: the signup result or its state is not valid. `WA-20xx`: Meta refused (its code and message are in `provider`); `WA-2999` for a code Rabt does not know yet.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"description":"`WA-2111`: attaching the credit line failed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: WhatsApp is not set up on this Rabt (the Meta app variables).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Connect a WhatsApp number","tags":["channels"]}},"/v1/channels/whatsapp/signup":{"post":{"description":"The configuration the browser runs Meta's Embedded Signup v4 with, and a signed `state` (30 minutes) to send back with its result. `coexistence` onboards a number that stays on the WhatsApp Business app.","operationId":"beginWhatsappSignup","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BeginWhatsappSignup"}}}},"responses":{"200":{"description":"The signup configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappSignup"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: WhatsApp is not set up on this Rabt (the Meta app variables).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Begin Embedded Signup","tags":["channels"]}},"/v1/channels/whatsapp/{channelId}":{"get":{"operationId":"getWhatsappChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"A WhatsApp number","tags":["channels"]},"patch":{"operationId":"updateWhatsappChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWhatsappChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WA-2103`: the channel is not active (disconnected or waiting for a reconnection).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Rename a WhatsApp number","tags":["channels"]}},"/v1/channels/whatsapp/{channelId}/register":{"post":{"description":"Registers the number on the Cloud API again (after `WA-2022` or `WA-2075`) with its two-step verification PIN: the given one, or the saved one.","operationId":"registerWhatsappNumber","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterWhatsappNumber"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WA-2103`: the channel is not active (disconnected or waiting for a reconnection).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WA-2104`: no PIN. `WA-2071`–`WA-2077`: Meta refused the registration. `WA-20xx`: Meta refused (its code and message are in `provider`); `WA-2999` for a code Rabt does not know yet.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Register the number again","tags":["channels"]}},"/v1/channels/whatsapp/{channelId}/health-check":{"post":{"description":"Reads Meta's health status of the number (can it send, and why not) with its quality rating and messaging limit. Rabt also checks it before sending.","operationId":"checkWhatsappHealth","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WA-2103`: the channel is not active (disconnected or waiting for a reconnection).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Check the health status now","tags":["channels"]}},"/v1/channels/whatsapp/{channelId}/resume-sending":{"post":{"description":"Lifts the stop Rabt put on the number after WhatsApp flagged spam or restricted the account. Meta's health status is read again first: a number Meta reports blocked stays stopped (`WA-2105`). A number that is not stopped is returned as it is.","operationId":"resumeWhatsappSending","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WA-2103`: the channel is not active (disconnected or waiting for a reconnection).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WA-2105`: Meta reports the number blocked: it stays stopped.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: WhatsApp is not set up on this Rabt (the Meta app variables).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Resume sending after a stop","tags":["channels"]}},"/v1/channels/whatsapp/{channelId}/history":{"post":{"description":"For a WhatsApp Business app number (coexistence): asks Meta again to share the app's contacts and up to 6 months of chat history (within 24 hours of connecting). Imported chats are kept in closed history tickets.","operationId":"requestWhatsappHistory","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WA-2122`: not a WhatsApp Business app number, or the history cannot be shared.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Ask for the WhatsApp Business app history again","tags":["channels"]}},"/v1/channels/whatsapp/{channelId}/disconnect":{"post":{"description":"Stops the account's webhooks to Rabt, revokes Rabt's credit line and the saved token; the number stays registered at Meta. The channel and its tickets stay (Rabt never deletes).","operationId":"disconnectWhatsappChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect a WhatsApp number","tags":["channels"]}},"/v1/channels/whatsapp/{channelId}/events":{"get":{"description":"Quality rating and messaging limit changes, account updates (restrictions, violations), capability limits, template approvals, pauses and quality, health status and history import, newest first.","operationId":"listWhatsappAccountEvents","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}},{"name":"before","required":false,"in":"query","description":"Only events before this time (paging).","schema":{"description":"Only events before this time (paging).","type":"string","format":"date-time"}},{"name":"limit","required":false,"in":"query","schema":{"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"The events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappAccountEventList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"What Meta reported about the number","tags":["channels"]}},"/v1/channels/whatsapp/{channelId}/templates":{"get":{"description":"The number's account templates with their approval status, quality and pauses.","operationId":"listWhatsappTemplates","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}},{"name":"status","required":false,"in":"query","description":"Only templates with this status, e.g. `approved`.","schema":{"description":"Only templates with this status, e.g. `approved`.","type":"string","pattern":"^[a-z_]{1,40}$"}}],"responses":{"200":{"description":"The templates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappTemplateList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the templates","tags":["channels"]},"post":{"description":"Submits the template to Meta for review (`pending`); its approval arrives by webhook. Meta may put it in another category than asked.","operationId":"createWhatsappTemplate","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWhatsappTemplate"}}}},"responses":{"201":{"description":"The template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappTemplate"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WA-2110`: a template with this name and language exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WA-20xx`: Meta refused (its code and message are in `provider`); `WA-2999` for a code Rabt does not know yet.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Create a template","tags":["channels"]}},"/v1/channels/whatsapp/{channelId}/templates/sync":{"post":{"description":"Once a minute per number.","operationId":"syncWhatsappTemplates","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}}],"responses":{"200":{"description":"The templates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappTemplateList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `WA-2118`: synchronized less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Read the templates from Meta again","tags":["channels"]}},"/v1/channels/whatsapp/{channelId}/templates/{templateId}":{"get":{"operationId":"getWhatsappTemplate","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}},{"name":"templateId","required":true,"in":"path","description":"The template id.","schema":{"type":"string","format":"uuid","description":"The template id."}}],"responses":{"200":{"description":"The template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappTemplate"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization. `WA-2109`: no such template.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"A template","tags":["channels"]},"patch":{"description":"Changes its components or category at Meta; it is reviewed again.","operationId":"editWhatsappTemplate","parameters":[{"name":"channelId","required":true,"in":"path","description":"The WhatsApp channel id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp channel id."}},{"name":"templateId","required":true,"in":"path","description":"The template id.","schema":{"type":"string","format":"uuid","description":"The template id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditWhatsappTemplate"}}}},"responses":{"200":{"description":"The template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappTemplate"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WA-2101`: no WhatsApp channel with this id in your organization. `WA-2109`: no such template.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WA-20xx`: Meta refused (its code and message are in `provider`); `WA-2999` for a code Rabt does not know yet.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Edit a template","tags":["channels"]}},"/v1/channels/whatsapp/tickets/{ticketId}/composer":{"get":{"description":"The 24-hour window (from Meta’s timestamp of the customer’s last message), whether free-form content may be sent or only an approved template, the content types and limits, and the approved templates.","operationId":"getWhatsappComposer","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The WhatsApp ticket id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp ticket id."}}],"responses":{"200":{"description":"The composer’s capabilities.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappComposer"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"What can be sent on a WhatsApp ticket","tags":["channels"]}},"/v1/channels/whatsapp/tickets/{ticketId}/messages":{"post":{"description":"Queued like any reply and paid when sent (prepaid: `WAL-1001` on the message when the balance cannot pay). Free-form content needs the 24-hour window open; a template needs to be approved.","operationId":"sendWhatsappMessage","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The WhatsApp ticket id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp ticket id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendWhatsappMessage"}}}},"responses":{"201":{"description":"The queued message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappSentMessage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket you can see. `WA-2109`: no such template.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WA-2103`: the channel is not active (disconnected or waiting for a reconnection).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WA-2047`: the 24-hour window is closed: send a template. `WA-2108`: the template is not approved.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Send a template, location, contact cards or reaction","tags":["channels"]}},"/v1/channels/whatsapp/tickets/{ticketId}/messages/{messageId}/media-download":{"post":{"description":"For a customer's message whose file could not be downloaded from Meta (its `error`): downloads it again in the background; the file appears on the message once stored, or the message shows the new error. Meta keeps received files for 30 days.","operationId":"retryWhatsappMediaDownload","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The WhatsApp ticket id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp ticket id."}},{"name":"messageId","required":true,"in":"path","description":"The message id.","schema":{"type":"string","format":"uuid","description":"The message id."}}],"responses":{"202":{"description":"The download is queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappMediaRetry"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket you can see. `TKT-6105`: no such message.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WA-2124`: the message misses no file. `WA-2103`: the channel is not active (disconnected or waiting for a reconnection).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"`WA-2125`: Meta no longer keeps the file (after 30 days).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: WhatsApp is not set up on this Rabt (the Meta app variables).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Download a customer's file again","tags":["channels"]}},"/v1/channels/whatsapp/tickets/{ticketId}/typing":{"post":{"description":"Marks the customer's newest message read and shows the typing indicator for up to 25 seconds or until the reply is sent. Nothing is stored; free.","operationId":"sendWhatsappTyping","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The WhatsApp ticket id.","schema":{"type":"string","format":"uuid","description":"The WhatsApp ticket id."}}],"responses":{"204":{"description":"Shown (or nothing to show: the window is closed).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Show the customer that you are typing","tags":["channels"]}},"/v1/channels/facebook":{"get":{"description":"Every connected Page with its status, the permissions granted and who connected it (never a token); disconnected ones last.","operationId":"listFacebookChannels","parameters":[],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacebookChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the Facebook Page channels","tags":["channels"]}},"/v1/channels/facebook/connect":{"post":{"description":"Returns Facebook's login dialog (Facebook Login for Business, with `state` and PKCE) for the person to sign in, choose Pages and approve permissions. Facebook sends them back to Rabt's callback page, which completes the connection (`POST /v1/channels/facebook/connect/complete`) within 10 minutes.","operationId":"startFacebookConnect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartFacebookConnect"}}}},"responses":{"200":{"description":"The login dialog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacebookConnectStart"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`FB-2006`: no Facebook channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`FB-2007`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Facebook is not set up on this Rabt (the Meta app).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Start connecting Facebook Pages","tags":["channels"]}},"/v1/channels/facebook/connect/complete":{"post":{"description":"Takes what Facebook sent back (the `state` of a flow this member started here, and the `code`), exchanges it server side and connects every Page chosen: a new channel each, or a reconnection of the Page's channel here. Each is subscribed to Rabt's webhooks (`active`), or stays `pending` with the error.","operationId":"completeFacebookConnect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteFacebookConnect"}}}},"responses":{"200":{"description":"The Pages connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacebookConnectResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`FB-2004`: the flow expired, was already used or was started elsewhere.\n\n`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`FB-2005`: the only Page chosen is connected to another organization in Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `FB-2002`: the sign-in was cancelled or refused. `FB-2003`: no Page was chosen. `FB-2008`: permissions Rabt needs were declined. Meta’s own refusals keep their FB code and Meta’s message in `provider`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Facebook is not set up on this Rabt (the Meta app).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Complete connecting Facebook Pages","tags":["channels"]}},"/v1/channels/facebook/{channelId}":{"get":{"operationId":"getFacebookChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Facebook channel id.","schema":{"type":"string","format":"uuid","description":"The Facebook channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacebookChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`FB-2006`: no Facebook channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"A Facebook Page channel","tags":["channels"]},"patch":{"description":"The name members see in Rabt; the Page keeps its name on Facebook.","operationId":"updateFacebookChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Facebook channel id.","schema":{"type":"string","format":"uuid","description":"The Facebook channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFacebookChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacebookChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`FB-2006`: no Facebook channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`FB-2007`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Rename a Facebook Page channel","tags":["channels"]}},"/v1/channels/facebook/{channelId}/subscription":{"post":{"description":"After a subscription Meta refused (the channel is `pending` with the error): the Page is subscribed to its messages, deliveries, reads, reactions, edits, postbacks, policy notices and comments again, and becomes `active`.","operationId":"subscribeFacebookChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Facebook channel id.","schema":{"type":"string","format":"uuid","description":"The Facebook channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacebookChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`FB-2006`: no Facebook channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`FB-2007`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Facebook is not set up on this Rabt (the Meta app).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Subscribe the Page to Rabt’s webhooks again","tags":["channels"]}},"/v1/channels/facebook/{channelId}/disconnect":{"post":{"description":"Unsubscribes the Page from Rabt’s webhooks, revokes its token and stops sending and receiving; the channel and its tickets stay (Rabt never deletes).","operationId":"disconnectFacebookChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Facebook channel id.","schema":{"type":"string","format":"uuid","description":"The Facebook channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacebookChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`FB-2006`: no Facebook channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect a Facebook Page","tags":["channels"]}},"/v1/channels/instagram/tickets/{ticketId}/media":{"get":{"description":"The 25 latest posts, reels and stories of the ticket’s Instagram account (newest first), read from Meta, to choose one for `post_share`.","operationId":"listInstagramMedia","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The Instagram ticket id (a customer’s direct conversation).","schema":{"type":"string","format":"uuid","description":"The Instagram ticket id (a customer’s direct conversation)."}}],"responses":{"200":{"description":"The media.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstagramMediaList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket you can see. `IG-2006`: no Instagram channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`IG-2007`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `IG-2023`: not a customer’s direct conversation.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"The account’s recent media, to share in a conversation","tags":["channels"]}},"/v1/channels/instagram/tickets/{ticketId}/messages":{"post":{"description":"Queued like any reply on the customer’s direct conversation (the reply window and the human agent tag apply; the status follows: queued, sending, sent, read, or failed with the reason). `post_share` takes one of the account’s recent media.","operationId":"sendInstagramMessage","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The Instagram ticket id (a customer’s direct conversation).","schema":{"type":"string","format":"uuid","description":"The Instagram ticket id (a customer’s direct conversation)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInstagramMessage"}}}},"responses":{"201":{"description":"The queued message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstagramSentMessage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket you can see. `IG-2006`: no Instagram channel with this id in your organization. `IG-2025`: no such recent media of the account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`IG-2007`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `IG-2023`: not a customer’s direct conversation. `IG-2010`/`IG-2011`: the reply window.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Share one of the account’s posts, or send the heart sticker","tags":["channels"]}},"/v1/channels/instagram":{"get":{"description":"Every connected professional account with its status, how it was connected, the permissions granted and who connected it (never a token); disconnected ones last. `logins` says which ways to connect this Rabt offers.","operationId":"listInstagramChannels","parameters":[],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstagramChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the Instagram channels","tags":["channels"]}},"/v1/channels/instagram/connect":{"post":{"description":"Returns Meta's sign-in window for the chosen way: Facebook Login for Business (`facebook`, with `state` and PKCE; the person chooses the Pages whose Instagram accounts to connect) or Instagram Login (`instagram`, with `state`; the professional account signs in). Meta sends them back to Rabt's callback page, which completes the connection (`POST /v1/channels/instagram/connect/complete`) within 10 minutes.","operationId":"startInstagramConnect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartInstagramConnect"}}}},"responses":{"200":{"description":"The sign-in window.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstagramConnectStart"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`IG-2006`: no Instagram channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`IG-2007`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Instagram (or the chosen way to connect) is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Start connecting Instagram accounts","tags":["channels"]}},"/v1/channels/instagram/connect/complete":{"post":{"description":"Takes what Meta sent back (the `state` of a flow this member started here, and the `code`), exchanges it server side and connects every professional account the sign-in gives access to: a new channel each, or a reconnection of the account's channel here. Each is subscribed to Rabt's webhooks (`active`), or stays `pending` with the error.","operationId":"completeInstagramConnect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteInstagramConnect"}}}},"responses":{"200":{"description":"The accounts connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstagramConnectResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`IG-2004`: the flow expired, was already used or was started elsewhere.\n\n`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`IG-2005`: the only account is connected to another organization in Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `IG-2002`: the sign-in was cancelled or refused. `IG-2003`: no professional account in the sign-in. `IG-2008`: permissions Rabt needs were declined. Meta’s own refusals keep their IG code and Meta’s message in `provider`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Instagram (or the chosen way to connect) is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Complete connecting Instagram accounts","tags":["channels"]}},"/v1/channels/instagram/{channelId}":{"get":{"operationId":"getInstagramChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Instagram channel id.","schema":{"type":"string","format":"uuid","description":"The Instagram channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstagramChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`IG-2006`: no Instagram channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"An Instagram channel","tags":["channels"]},"patch":{"description":"The name members see in Rabt; the account keeps its username on Instagram.","operationId":"updateInstagramChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Instagram channel id.","schema":{"type":"string","format":"uuid","description":"The Instagram channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInstagramChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstagramChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`IG-2006`: no Instagram channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`IG-2007`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Rename an Instagram channel","tags":["channels"]}},"/v1/channels/instagram/{channelId}/subscription":{"post":{"description":"After a subscription Meta refused (the channel is `pending` with the error): the account (Instagram Login) or its Page (Facebook Login) is subscribed again, and the channel becomes `active`.","operationId":"subscribeInstagramChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Instagram channel id.","schema":{"type":"string","format":"uuid","description":"The Instagram channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstagramChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`IG-2006`: no Instagram channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`IG-2007`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Instagram (or the chosen way to connect) is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Subscribe the account to Rabt’s webhooks again","tags":["channels"]}},"/v1/channels/instagram/{channelId}/disconnect":{"post":{"description":"Unsubscribes the account from Rabt’s webhooks (Instagram Login), revokes its token and stops sending and receiving; the channel and its tickets stay (Rabt never deletes).","operationId":"disconnectInstagramChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Instagram channel id.","schema":{"type":"string","format":"uuid","description":"The Instagram channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstagramChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`IG-2006`: no Instagram channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect an Instagram account","tags":["channels"]}},"/v1/tickets/{ticketId}/messages/{messageId}/comment-actions":{"post":{"description":"Carried out on the ticket’s platform (Facebook or Instagram) at once. A deleted comment stays in the ticket (Rabt never deletes); only the platform’s copy goes. Doing what is already so changes nothing. Instagram has no like.","operationId":"actOnComment","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}},{"name":"messageId","required":true,"in":"path","description":"The message id.","schema":{"type":"string","format":"uuid","description":"The message id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAction"}}}},"responses":{"200":{"description":"The comment’s state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentState"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is not visible to you. `FB-2025` / `IG-2025`: the comment no longer exists on the platform.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`FB-2007` / `IG-2007`: the Page or Instagram account is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `FB-2027` / `IG-2027`: the message is not a customer’s comment of that platform (or `like` on Instagram). Meta’s refusals keep their FB or IG code and Meta’s message in `provider`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Facebook or Instagram is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Hide, unhide, delete or like a customer’s comment","tags":["tickets"]}},"/v1/tickets/{ticketId}/messages/{messageId}/reaction":{"post":{"description":"The Page (Messenger) or the Instagram account reacts with one emoji to a customer’s message in a direct conversation ticket; another emoji changes the reaction and `null` removes it. Carried out on the platform at once; asking for what is already so changes nothing. Channels that support it say `send.reaction` in their capabilities.","operationId":"reactToMessage","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}},{"name":"messageId","required":true,"in":"path","description":"The message id.","schema":{"type":"string","format":"uuid","description":"The message id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageReaction"}}}},"responses":{"200":{"description":"The Page’s reaction to the message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageReaction"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket, or it is not visible to you.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`FB-2007` / `IG-2007`: the Page or Instagram account is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `FB-2029` / `IG-2028`: the message is not a customer’s Messenger or Instagram direct message. Meta’s refusals keep their FB or IG code and Meta’s message in `provider` (`FB-2012`/`IG-2012` outside the reply window, `FB-2013`/`IG-2013` the customer is not available, `FB-2024`/`IG-2024` Meta refused the reaction).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Facebook or Instagram is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"React to a customer’s message, change the reaction or remove it","tags":["tickets"]}},"/v1/channels/capabilities":{"get":{"description":"Per channel: what can be sent (text, files and their kinds and sizes), the text limit, the reply window and what may go out after it, the actions on public items and the delivery statuses reported. The composer offers only these.","operationId":"listChannelCapabilities","parameters":[],"responses":{"200":{"description":"The capabilities.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelCapabilitiesList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"What each channel supports","tags":["channels"]}},"/v1/meta/data-deletions/{code}":{"get":{"description":"Public (the person asking has no Rabt account). `completed` once Rabt disconnected every channel the person connected and erased who connected them; `pending` before.","operationId":"getMetaDataDeletionStatus","parameters":[{"name":"code","required":true,"in":"path","description":"The confirmation code Meta gave the person (32 hexadecimal digits).","schema":{"type":"string","maxLength":128,"description":"The confirmation code Meta gave the person (32 hexadecimal digits)."}}],"responses":{"200":{"description":"The status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetaDataDeletionStatus"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"404":{"description":"`FB-2028`: this is not a data deletion code.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"The status of a Facebook data deletion request","tags":["channels"]}},"/v1/channels/x":{"get":{"description":"Every connected X account with its status, how events arrive, whether it is paused at zero balance, and what it can do; disconnected ones last. Never its tokens.","operationId":"listXChannels","parameters":[],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the X channels","tags":["channels"]}},"/v1/channels/x/connect":{"post":{"description":"The address of X’s consent page (OAuth 2.0 with PKCE). Open it in the member’s browser: X sends them back to Rabt’s callback with its answer, which `POST /v1/channels/x/connect/complete` finishes within 10 minutes. With `channel_id`, reconnects that channel.","operationId":"beginXConnect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BeginXConnect"}}}},"responses":{"200":{"description":"The consent page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XConnectStart"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`X-3023`: no X channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`X-3024`: the channel to reconnect is disconnected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: X is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Start connecting an X account","tags":["channels"]}},"/v1/channels/x/connect/complete":{"post":{"description":"Takes X’s answer from the callback (`state`, `code` or `error`), exchanges the code, reads the account (a paid read) and stores the channel `active`; the account is then subscribed to X’s events and its recent history is read. Connecting an account already connected in the organization reconnects it.","operationId":"completeXConnect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteXConnect"}}}},"responses":{"201":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`X-3025`: the connection was not started by this member here, expired or was already used.\n\n`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"402":{"description":"`WAL-1001`: the wallet cannot pay the call at X (top up first). Nothing was read at X; the connection can be started again after a top-up.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`X-3011`: the member declined on X’s consent page.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`X-3026`: the account is connected in another organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `X-3027`: X granted fewer permissions than Rabt needs.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"description":"`X-3001`–`X-3017`: X refused or failed the call; X’s own answer is in `provider`. `X-3009`: X no longer accepts the code (valid 30 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: X is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Finish connecting an X account","tags":["channels"]}},"/v1/channels/x/{channelId}":{"get":{"operationId":"getXChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The X channel id.","schema":{"type":"string","format":"uuid","description":"The X channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`X-3023`: no X channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"An X channel","tags":["channels"]},"patch":{"operationId":"updateXChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The X channel id.","schema":{"type":"string","format":"uuid","description":"The X channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateXChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`X-3023`: no X channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Rename an X channel","tags":["channels"]}},"/v1/channels/x/{channelId}/sync":{"post":{"description":"Reads the account’s recent mentions and DMs at X (paid reads) and handles the ones Rabt missed like webhook events, in the background. Once a minute per channel.","operationId":"syncXChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The X channel id.","schema":{"type":"string","format":"uuid","description":"The X channel id."}}],"responses":{"202":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`X-3023`: no X channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`X-3024`: the channel is disconnected, needs a reconnection, or is paused at zero balance.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `X-3030`: a sync was asked for less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Read missed X messages","tags":["channels"]}},"/v1/channels/x/{channelId}/disconnect":{"post":{"description":"Revokes Rabt’s tokens at X and in the vault and removes the account’s event subscriptions; the channel and its tickets stay (Rabt never deletes).","operationId":"disconnectXChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The X channel id.","schema":{"type":"string","format":"uuid","description":"The X channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`X-3023`: no X channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect an X channel","tags":["channels"]}},"/v1/channels/x/messages/{messageId}/moderation":{"post":{"description":"Hides or shows again a customer’s reply to the account’s post, or deletes the account’s own reply or DM on X (a paid call). The message stays in the ticket, marked with what was done.","operationId":"moderateXMessage","parameters":[{"name":"messageId","required":true,"in":"path","description":"The message id (an X item).","schema":{"type":"string","format":"uuid","description":"The message id (an X item)."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerateXMessage"}}}},"responses":{"200":{"description":"What was done.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XModeration"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"402":{"description":"`WAL-1001`: the wallet cannot pay the call at X (top up first).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no X message with this id in a ticket you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`X-3024`: the channel is disconnected, needs a reconnection, or is paused at zero balance.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `X-3029`: X does not allow this action on this item.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"description":"`X-3001`–`X-3017`: X refused or failed the call; X’s own answer is in `provider`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Hide, show or delete an X item","tags":["channels"]}},"/v1/channels/x/tickets/{ticketId}/chat-messages":{"post":{"description":"X Chat is end-to-end encrypted and its keys never leave the member’s device: the client encrypts and signs the message with the X Chat XDK, and Rabt queues and relays it as is (paid like a DM). Rabt never sees its text.","operationId":"sendXChatMessage","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The X Chat ticket id.","schema":{"type":"string","format":"uuid","description":"The X Chat ticket id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XChatMessage"}}}},"responses":{"201":{"description":"The queued message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XChatMessageQueued"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no ticket with this id you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `X-3029`: the ticket is not an X Chat conversation.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: X is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Send an X Chat message encrypted on the device","tags":["channels"]}},"/v1/channels/tiktok":{"get":{"description":"Every connected TikTok business account with its status, permissions and token expiry (never its tokens); disconnected ones last. `configured` is false when TikTok is not set up on this Rabt.","operationId":"listTikTokChannels","parameters":[],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the TikTok channels","tags":["channels"]}},"/v1/channels/tiktok/capabilities":{"get":{"description":"The capability matrix (docs/channels/tiktok.md): what may be sent, the limits and the public actions. The composer offers only this.","operationId":"getTikTokCapabilities","parameters":[],"responses":{"200":{"description":"The capabilities.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokCapabilities"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"What TikTok supports","tags":["channels"]}},"/v1/channels/tiktok/connect":{"post":{"description":"Returns TikTok’s page where the account holder signs in and approves Rabt (valid 10 minutes, once). TikTok sends them back to Rabt’s callback page, which completes the connection.","operationId":"startTikTokConnect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartTikTokConnect"}}}},"responses":{"200":{"description":"Where to sign in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokConnectStart"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TT-3018`: no TikTok channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: TikTok is not set up on this Rabt (TIKTOK_APP_ID, TIKTOK_APP_SECRET).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Start connecting a TikTok account","tags":["channels"]}},"/v1/channels/tiktok/connect/complete":{"post":{"description":"With the `state` and `code` TikTok sent back: the account is checked (a business account, every permission granted) and connected, or reconnected when it is already connected here.","operationId":"completeTikTokConnect","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteTikTokConnect"}}}},"responses":{"201":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`TT-3016`: the state is unknown, expired, used, or another member’s.\n\n`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TT-3020`: the account is connected to another organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `TT-3001`–`TT-3030`: TikTok refused (credentials, permissions, eligibility, limits); TikTok’s own code and message are in `provider`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: TikTok is not set up on this Rabt (TIKTOK_APP_ID, TIKTOK_APP_SECRET).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Complete connecting a TikTok account","tags":["channels"]}},"/v1/channels/tiktok/tickets/{ticketId}/reply-rules":{"get":{"description":"TikTok’s rules for the ticket: replies within 48 hours of the customer’s last message, at most 10 until the customer writes again, text or one image; comment replies of up to 150 characters. `applies` is false for tickets of other channels.","operationId":"getTikTokReplyRules","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"responses":{"200":{"description":"The rules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokReplyRules"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no ticket with this id that you may see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"What a reply on a ticket may be now","tags":["channels"]}},"/v1/channels/tiktok/comments/{messageId}/actions":{"post":{"description":"Acts on a customer’s comment on the account’s video, from its ticket. Deleting removes it on TikTok only: Rabt keeps its copy, marked as deleted there. Audited; emits `message.channel_changed`.","operationId":"actOnTikTokComment","parameters":[{"name":"messageId","required":true,"in":"path","description":"The id of the comment’s message.","schema":{"type":"string","format":"uuid","description":"The id of the comment’s message."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokCommentAction"}}}},"responses":{"200":{"description":"What was done.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokCommentActionResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6105`: no message with this id that you may see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TT-3019`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `TT-3022`: not a customer’s TikTok comment. `TT-3001`–`TT-3030`: TikTok refused (credentials, permissions, eligibility, limits); TikTok’s own code and message are in `provider`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Hide, unhide or delete a comment on TikTok","tags":["channels"]}},"/v1/channels/tiktok/messages/{messageId}/fetch-files":{"post":{"description":"For an image or video received from TikTok whose file could not be fetched (the message shows the error in `metadata.fileError`): the worker fetches it again. On success the file arrives as `attachment.stored` and the error is cleared; a new failure is attached again. Audited; emits `message.file_fetch_requested`.","operationId":"fetchTikTokMessageFiles","parameters":[{"name":"messageId","required":true,"in":"path","description":"The id of the comment’s message.","schema":{"type":"string","format":"uuid","description":"The id of the comment’s message."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"202":{"description":"The fetch is queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokFileFetch"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6105`: no message with this id that you may see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TT-3019`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `TT-3034`: the message has no file to fetch from TikTok.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: TikTok is not set up on this Rabt (TIKTOK_APP_ID, TIKTOK_APP_SECRET).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Fetch a received file from TikTok again","tags":["channels"]}},"/v1/channels/tiktok/{channelId}":{"get":{"operationId":"getTikTokChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The TikTok channel id.","schema":{"type":"string","format":"uuid","description":"The TikTok channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TT-3018`: no TikTok channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"A TikTok channel","tags":["channels"]},"patch":{"operationId":"updateTikTokChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The TikTok channel id.","schema":{"type":"string","format":"uuid","description":"The TikTok channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTikTokChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TT-3018`: no TikTok channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TT-3019`: the channel is disconnected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Rename a TikTok channel","tags":["channels"]}},"/v1/channels/tiktok/{channelId}/disconnect":{"post":{"description":"Revokes Rabt’s access at TikTok and the tokens in the vault, and stops receiving and sending on the account; the channel and its tickets stay (Rabt never deletes).","operationId":"disconnectTikTokChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The TikTok channel id.","schema":{"type":"string","format":"uuid","description":"The TikTok channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TT-3018`: no TikTok channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect a TikTok channel","tags":["channels"]}},"/v1/channels/app-store":{"get":{"description":"Every App Store Connect team connected, with its status, key ID (never the private key), apps and how their polling goes; disconnected ones last.","operationId":"listAppStoreChannels","parameters":[],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStoreChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the App Store channels","tags":["channels"]},"post":{"description":"Rabt signs a token with the key and lists its apps first (the key is validated on save); then the channel is stored `active`, the key in the token vault, and each app becomes an address routed to the All space until a space takes it. Reviews arrive by polling.","operationId":"connectAppStoreChannel","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectAppStoreChannel"}}}},"responses":{"201":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStoreChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`APS-3723`: this team (issuer ID) is already connected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `APS-3720` the `.p8` file is not an ES256 key; `APS-3701`–`APS-3708` Apple refused the key or the request (Apple’s code and message in `provider`); `APS-3730` the key sees no apps.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Connect an App Store Connect team","tags":["channels"]}},"/v1/channels/app-store/{channelId}":{"get":{"operationId":"getAppStoreChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The App Store channel id.","schema":{"type":"string","format":"uuid","description":"The App Store channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStoreChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`APS-3722`: no App Store channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"An App Store channel","tags":["channels"]},"patch":{"operationId":"updateAppStoreChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The App Store channel id.","schema":{"type":"string","format":"uuid","description":"The App Store channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAppStoreChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStoreChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`APS-3722`: no App Store channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`APS-3724`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Rename an App Store channel","tags":["channels"]}},"/v1/channels/app-store/{channelId}/reconnect":{"post":{"description":"After Apple refused the saved key (`needs_reauth`), or to rotate it: a new key of the same team is tried, then kept, and the apps are read again.","operationId":"reconnectAppStoreChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The App Store channel id.","schema":{"type":"string","format":"uuid","description":"The App Store channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectAppStoreChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStoreChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`APS-3722`: no App Store channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`APS-3724`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `APS-3720` the `.p8` file is not an ES256 key; `APS-3701`–`APS-3708` Apple refused the key or the request (Apple’s code and message in `provider`); `APS-3730` the key sees no apps.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Reconnect with a new key","tags":["channels"]}},"/v1/channels/app-store/{channelId}/refresh-apps":{"post":{"description":"New apps become addresses (routed to the All space until a space takes them), removed apps are removed with their address; reviews and tickets stay.","operationId":"refreshAppStoreApps","parameters":[{"name":"channelId","required":true,"in":"path","description":"The App Store channel id.","schema":{"type":"string","format":"uuid","description":"The App Store channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStoreChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`APS-3722`: no App Store channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`APS-3724`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `APS-3720` the `.p8` file is not an ES256 key; `APS-3701`–`APS-3708` Apple refused the key or the request (Apple’s code and message in `provider`); `APS-3730` the key sees no apps.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Read the key’s apps again","tags":["channels"]}},"/v1/channels/app-store/{channelId}/disconnect":{"post":{"description":"Revokes Rabt’s copy of the key and stops polling and replying; the channel, its reviews and their tickets stay (Rabt never deletes). Revoke the key itself in App Store Connect.","operationId":"disconnectAppStoreChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The App Store channel id.","schema":{"type":"string","format":"uuid","description":"The App Store channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStoreChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`APS-3722`: no App Store channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect an App Store channel","tags":["channels"]}},"/v1/channels/google-play":{"get":{"description":"Every service account connected, with its status, key id (never the key), apps and how current their reviews are; disconnected ones last.","operationId":"listGooglePlayChannels","parameters":[],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GooglePlayChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the Google Play channels","tags":["channels"]},"post":{"description":"Rabt gets an access token with the key, lists the apps Google’s Reporting API gives for it and the package names sent, and reads each app’s reviews once (the key is validated on save); then the channel is stored `active`, the key in the token vault, and each app becomes an address routed to the All space until a space takes it. Reviews arrive by polling (Google lists the last 7 days).","operationId":"connectGooglePlayChannel","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectGooglePlayChannel"}}}},"responses":{"201":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GooglePlayChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GPL-3823`: this service account is already connected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `GPL-3820` the key file is not a service account JSON key; `GPL-3801`–`GPL-3808` Google refused the key, a permission, an API or the request (Google’s code and message in `provider`); `GPL-3831` the key reaches no app.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Connect a Google Play service account","tags":["channels"]}},"/v1/channels/google-play/{channelId}":{"get":{"operationId":"getGooglePlayChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Play channel id.","schema":{"type":"string","format":"uuid","description":"The Google Play channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GooglePlayChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GPL-3822`: no Google Play channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"A Google Play channel","tags":["channels"]},"patch":{"description":"New package names are tried with the saved key first; apps no longer named or listed are removed with their address (reviews and tickets stay).","operationId":"updateGooglePlayChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Play channel id.","schema":{"type":"string","format":"uuid","description":"The Google Play channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGooglePlayChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GooglePlayChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GPL-3822`: no Google Play channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GPL-3824`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `GPL-3820` the key file is not a service account JSON key; `GPL-3801`–`GPL-3808` Google refused the key, a permission, an API or the request (Google’s code and message in `provider`); `GPL-3831` the key reaches no app.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Rename a Google Play channel or change its package names","tags":["channels"]}},"/v1/channels/google-play/{channelId}/reconnect":{"post":{"description":"After Google refused the key, a permission or an API (`needs_reauth`), or to rotate the key: a new key of the same service account (`GPL-3836` otherwise), or none to try the saved key again. The apps are read again and the channel is `active`.","operationId":"reconnectGooglePlayChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Play channel id.","schema":{"type":"string","format":"uuid","description":"The Google Play channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectGooglePlayChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GooglePlayChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GPL-3822`: no Google Play channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GPL-3824`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `GPL-3820` the key file is not a service account JSON key; `GPL-3801`–`GPL-3808` Google refused the key, a permission, an API or the request (Google’s code and message in `provider`); `GPL-3831` the key reaches no app. `GPL-3836`: a key of another service account.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Reconnect with a new key, or check again","tags":["channels"]}},"/v1/channels/google-play/{channelId}/refresh-apps":{"post":{"description":"New apps become addresses (routed to the All space until a space takes them), removed apps are removed with their address; reviews and tickets stay.","operationId":"refreshGooglePlayApps","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Play channel id.","schema":{"type":"string","format":"uuid","description":"The Google Play channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GooglePlayChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GPL-3822`: no Google Play channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GPL-3824`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `GPL-3820` the key file is not a service account JSON key; `GPL-3801`–`GPL-3808` Google refused the key, a permission, an API or the request (Google’s code and message in `provider`); `GPL-3831` the key reaches no app.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Read the service account’s apps again","tags":["channels"]}},"/v1/channels/google-play/{channelId}/poll":{"post":{"description":"Queues a poll of the channel’s apps at once (after fixing what stopped polling, or to retry a failed poll without waiting for the next round every 15 minutes). The apps’ `polled_at`, `last_poll_error` and `coverage` show the outcome.","operationId":"pollGooglePlayChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Play channel id.","schema":{"type":"string","format":"uuid","description":"The Google Play channel id."}}],"responses":{"202":{"description":"The channel, the poll queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GooglePlayChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GPL-3822`: no Google Play channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GPL-3824`: the channel is disconnected or needs a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Read the reviews now","tags":["channels"]}},"/v1/channels/google-play/{channelId}/disconnect":{"post":{"description":"Revokes Rabt’s copy of the key and stops polling and replying; the channel, its reviews and their tickets stay (Rabt never deletes). Delete the key itself in Google Cloud.","operationId":"disconnectGooglePlayChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Play channel id.","schema":{"type":"string","format":"uuid","description":"The Google Play channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GooglePlayChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GPL-3822`: no Google Play channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect a Google Play channel","tags":["channels"]}},"/v1/reviews/{reviewId}":{"get":{"description":"The review as the customer wrote it (stars, title, text, public name, country, app version when given), its app or location, its ticket, and its public reply with the reply’s state on the store.","operationId":"getReview","parameters":[{"name":"reviewId","required":true,"in":"path","description":"The review id (Rabt’s).","schema":{"type":"string","format":"uuid","description":"The review id (Rabt’s)."}}],"responses":{"200":{"description":"The review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Review"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`APS-3725`: no review with this id, or the ticket holds no review (or you may not see it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"A store review","tags":["reviews"]}},"/v1/tickets/{ticketId}/review":{"get":{"description":"For a ticket of a review channel (App Store, Google Maps): the review and its reply.","operationId":"getTicketReview","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}}],"responses":{"200":{"description":"The review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Review"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `tickets:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`APS-3725`: no review with this id, or the ticket holds no review (or you may not see it). `TKT-6101`: no such ticket.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:read"]},{"oauth2":["tickets:read"]}],"summary":"The review a ticket holds","tags":["reviews"]}},"/v1/reviews/{reviewId}/reply":{"delete":{"description":"Deletes the review’s public reply on the store (the App Store takes some time to remove it; on Google Maps a reply already gone counts as deleted). The reply stays in the ticket’s timeline and on the review as `deleted`, and the deletion is audited.","operationId":"deleteReviewReply","parameters":[{"name":"reviewId","required":true,"in":"path","description":"The review id (Rabt’s).","schema":{"type":"string","format":"uuid","description":"The review id (Rabt’s)."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"The review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Review"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`GBP-3803`: Google refused the channel’s access (it is now `needs_reauth`).\n\n`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`APS-3725`: no review with this id, or the ticket holds no review (or you may not see it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`APS-3726` (`GBP-3832` on Google Maps): the review has no reply on the store; `APS-3724` (`GBP-3823`): the channel is not active.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Delete the public reply on the store","tags":["reviews"]}},"/v1/channels/google-business":{"get":{"description":"Every Google account connected for Google Maps reviews, with its status, business accounts (and their real-time notifications), chosen locations (each a channel address with its last reading) and reply rules; disconnected ones last. Tokens are never returned.","operationId":"listGoogleBusinessChannels","parameters":[],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the Google Maps channels","tags":["channels"]}},"/v1/channels/google-business/authorizations":{"post":{"description":"Returns the Google sign-in URL (authorization code with PKCE and `state`, offline access, the `business.manage` permission). The member signs in there; Google sends them back to Rabt’s callback page with `state` and `code`, which finishes with `completeGoogleBusinessConnection` within ten minutes.","operationId":"startGoogleBusinessConnection","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"The sign-in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessAuthorization"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Google is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Start connecting a Google account for Google Maps reviews","tags":["channels"]}},"/v1/channels/google-business/authorizations/complete":{"post":{"description":"With what Google sent back: the code is exchanged, the `business.manage` permission checked, the business accounts read, and the channel stored `active` (or reconnected). Then choose its locations with `selectGoogleBusinessLocations`. Each sign-in is used once, in the organization that started it.","operationId":"completeGoogleBusinessConnection","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteGoogleBusinessConnection"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GBP-3822`: a reconnection signed in with another Google account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"`GBP-3820`: the sign-in expired, was used, or belongs to another organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `GBP-3800`: the member declined at Google. `GBP-3801`: the business permission was not granted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Google is not set up on this Rabt. `GBP-3805`: the Business Profile APIs are not enabled for Rabt yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Finish connecting a Google account for Google Maps reviews","tags":["channels"]}},"/v1/channels/google-business/{channelId}":{"get":{"operationId":"getGoogleBusinessChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Maps channel id.","schema":{"type":"string","format":"uuid","description":"The Google Maps channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GBP-3821`: no Google Maps channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"A Google Maps channel","tags":["channels"]},"patch":{"operationId":"updateGoogleBusinessChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Maps channel id.","schema":{"type":"string","format":"uuid","description":"The Google Maps channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGoogleBusinessChannel"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GBP-3821`: no Google Maps channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GBP-3823`: the channel is disconnected or waits for a reconnection (`needs_reauth`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Rename a Google Maps channel","tags":["channels"]}},"/v1/channels/google-business/{channelId}/available-locations":{"get":{"description":"Reads the business accounts and their locations from Google (the location picker), each marked chosen on this channel, or carried by another channel of the organization.","operationId":"listGoogleBusinessAvailableLocations","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Maps channel id.","schema":{"type":"string","format":"uuid","description":"The Google Maps channel id."}}],"responses":{"200":{"description":"The accounts and locations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessAvailableLocations"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`GBP-3803`: Google refused the saved access (the channel is now `needs_reauth`). `GBP-3806`: the Google account no longer manages the account or location.\n\n`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GBP-3821`: no Google Maps channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GBP-3823`: the channel is disconnected or waits for a reconnection (`needs_reauth`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"The business locations the Google account manages","tags":["channels"]}},"/v1/channels/google-business/{channelId}/locations":{"put":{"description":"The chosen locations become the channel’s addresses (each routed to the All space until a space or member takes it, docs/17); locations left out are removed (their reviews and tickets stay). Each business account with a chosen location publishes its review notifications to Rabt, and the new locations’ reviews of the last 30 days are read.","operationId":"selectGoogleBusinessLocations","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Maps channel id.","schema":{"type":"string","format":"uuid","description":"The Google Maps channel id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectGoogleBusinessLocations"}}}},"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`GBP-3803`: Google refused the saved access (the channel is now `needs_reauth`). `GBP-3806`: the Google account no longer manages the account or location.\n\n`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GBP-3821`: no Google Maps channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GBP-3823`: the channel is disconnected or waits for a reconnection (`needs_reauth`). `GBP-3825`: another channel of the organization carries the location.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `GBP-3826`: the Google account does not manage the location.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Choose the locations of a Google Maps channel","tags":["channels"]}},"/v1/channels/google-business/{channelId}/sync":{"post":{"description":"Asks for every chosen location’s reviews to be read now, and the account notifications to be set again (Rabt also does it on every notification and every few minutes). This also retries a location’s failed reading. Once a minute per channel.","operationId":"syncGoogleBusinessChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Maps channel id.","schema":{"type":"string","format":"uuid","description":"The Google Maps channel id."}}],"responses":{"202":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GBP-3821`: no Google Maps channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GBP-3823`: the channel is disconnected or waits for a reconnection (`needs_reauth`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `GBP-3824`: asked less than a minute ago.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Read the reviews now","tags":["channels"]}},"/v1/channels/google-business/{channelId}/reconnect":{"post":{"description":"Returns a Google sign-in URL for the channel’s own Google account (`needs_reauth` after Google refused the saved access); finishing it with `completeGoogleBusinessConnection` makes the channel active again and reads the reviews missed meanwhile.","operationId":"reconnectGoogleBusinessChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Maps channel id.","schema":{"type":"string","format":"uuid","description":"The Google Maps channel id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"The sign-in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessAuthorization"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GBP-3821`: no Google Maps channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`GBP-3823`: the channel is disconnected or waits for a reconnection (`needs_reauth`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Google is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Reconnect a Google Maps channel","tags":["channels"]}},"/v1/channels/google-business/{channelId}/disconnect":{"post":{"description":"Turns the accounts’ review notifications off, revokes Rabt’s access at Google (unless another channel of the organization signs in with the same Google account) and in the token vault, and removes the locations; the channel, its reviews and tickets stay (Rabt never deletes).","operationId":"disconnectGoogleBusinessChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The Google Maps channel id.","schema":{"type":"string","format":"uuid","description":"The Google Maps channel id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`GBP-3821`: no Google Maps channel with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect a Google Maps channel","tags":["channels"]}},"/v1/chat/rooms":{"get":{"description":"Your space groups, the All room, your private groups and direct messages, most recently active first, with unread counters.","operationId":"listChatRooms","parameters":[],"responses":{"200":{"description":"The rooms.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRoomList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:read"]},{"oauth2":["chat:read"]}],"summary":"List your chat rooms","tags":["chat"]}},"/v1/chat/rooms/{roomId}":{"get":{"operationId":"getChatRoom","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}}],"responses":{"200":{"description":"The room.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRoom"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:read"]},{"oauth2":["chat:read"]}],"summary":"A chat room","tags":["chat"]},"patch":{"operationId":"renameChatGroup","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameChatGroup"}}}},"responses":{"200":{"description":"The group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRoom"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`CHT-6406`: only its creator or `spaces.manage` manage a group.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Rename a private group","tags":["chat"]}},"/v1/chat/groups":{"post":{"description":"You and the members you invite; you manage it.","operationId":"createChatGroup","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatGroup"}}}},"responses":{"201":{"description":"The group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRoom"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CHT-6408`: a member is not in the organization.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Create a private group","tags":["chat"]}},"/v1/chat/direct":{"post":{"description":"The direct message with a colleague, started when it does not exist yet.","operationId":"openDirectMessage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenDirectMessage"}}}},"responses":{"200":{"description":"The room.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRoom"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CHT-6408`: the colleague is not in the organization. `CHT-6409`: yourself.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Open a direct message","tags":["chat"]}},"/v1/chat/rooms/{roomId}/members":{"get":{"operationId":"listChatRoomMembers","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}}],"responses":{"200":{"description":"The members.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRoomMemberList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:read"]},{"oauth2":["chat:read"]}],"summary":"A room's members","tags":["chat"]},"post":{"operationId":"addChatGroupMembers","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddChatGroupMembers"}}}},"responses":{"200":{"description":"The group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRoom"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`CHT-6406`: only its creator or `spaces.manage` manage a group.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CHT-6408`: a member is not in the organization.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Add members to a private group","tags":["chat"]}},"/v1/chat/rooms/{roomId}/members/{membershipId}":{"delete":{"operationId":"removeChatGroupMember","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}},{"name":"membershipId","required":true,"in":"path","description":"The member (membership id).","schema":{"type":"string","format":"uuid","description":"The member (membership id)."}}],"responses":{"204":{"description":"Removed (their messages stay).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`CHT-6406`: only its creator or `spaces.manage` manage a group.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Remove a member from a private group","tags":["chat"]}},"/v1/chat/rooms/{roomId}/leave":{"post":{"operationId":"leaveChatRoom","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}}],"responses":{"204":{"description":"Left.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6413`: only private groups can be left.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Leave a private group","tags":["chat"]}},"/v1/chat/rooms/{roomId}/notify":{"put":{"description":"All messages, mentions only, or mute (docs/20 \"Notifications\").","operationId":"setChatNotify","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetChatNotify"}}}},"responses":{"200":{"description":"The room.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRoom"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Set a room's notifications","tags":["chat"]}},"/v1/chat/rooms/{roomId}/typing":{"post":{"description":"The room's members see who is typing (a signal that lasts 8 seconds; repeat it every few seconds while typing, and send `active: false` when done).","operationId":"setChatTyping","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatTyping"}}}},"responses":{"204":{"description":"Told to the room.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: live updates are not running on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Say you are typing in a room","tags":["chat"]}},"/v1/chat/rooms/{roomId}/read":{"post":{"description":"Moves your last-read position forward (to a message number, or the last).","operationId":"markChatRead","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkChatRead"}}}},"responses":{"200":{"description":"The room.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRoom"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Mark a room as read","tags":["chat"]}},"/v1/chat/rooms/{roomId}/messages":{"get":{"description":"A page, oldest first: the latest by default, or before, after or around a message number.","operationId":"listChatMessages","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}},{"name":"before","required":false,"in":"query","description":"Messages before this number (older). The latest page when absent.","schema":{"description":"Messages before this number (older). The latest page when absent.","type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"after","required":false,"in":"query","description":"Messages after this number (newer), e.g. after reconnecting.","schema":{"description":"Messages after this number (newer), e.g. after reconnecting.","type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"around","required":false,"in":"query","description":"Messages around this number (a search result, the first unread).","schema":{"description":"Messages around this number (a search result, the first unread).","type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"limit","required":false,"in":"query","description":"Messages per page (1 to 100, default 50).","schema":{"default":50,"description":"Messages per page (1 to 100, default 50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"The page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessagePage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:read"]},{"oauth2":["chat:read"]}],"summary":"A room's messages","tags":["chat"]},"post":{"description":"Markdown text with mentions (`<@membership-id>`, `@all`), ticket cards (`#1291` or `ticket_ids`), a quote and files. A retry with the same `client_message_id` returns the first message.","operationId":"postChatMessage","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostChatMessage"}}}},"responses":{"201":{"description":"The message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`CHT-6407`: `@all` in the All room needs `members.manage`.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer). `TKT-6101`: a ticket you cannot see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only). `CHT-6411`: a file not sendable here. `TKT-6112`: a file still uploading. `TKT-6113`: a blocked file.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CHT-6410`: an empty message. `CHT-6412`: a quote from another room. `CHT-6415`: too many tickets.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Post a message","tags":["chat"]}},"/v1/chat/ask-the-team":{"post":{"description":"Posts a question with the ticket attached as a card, in one of your rooms (a space group) or in the direct message with a colleague (docs/20 \"Ask the team\").","operationId":"askTheTeam","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskTheTeam"}}}},"responses":{"201":{"description":"The room and the message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskTheTeamResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer). `TKT-6101`: a ticket you cannot see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CHT-6408`: the colleague is not in the organization.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Ask the team about a ticket","tags":["chat"]}},"/v1/chat/rooms/{roomId}/pins":{"get":{"description":"Most recently pinned first (shown at the top of the room).","operationId":"listPinnedChatMessages","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}}],"responses":{"200":{"description":"The messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:read"]},{"oauth2":["chat:read"]}],"summary":"A room's pinned messages","tags":["chat"]}},"/v1/chat/messages/{messageId}":{"get":{"operationId":"getChatMessage","parameters":[{"name":"messageId","required":true,"in":"path","description":"The chat message id.","schema":{"type":"string","format":"uuid","description":"The chat message id."}}],"responses":{"200":{"description":"The message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6402`: no such message in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:read"]},{"oauth2":["chat:read"]}],"summary":"A chat message","tags":["chat"]},"patch":{"description":"The previous text is kept in its edit history.","operationId":"editChatMessage","parameters":[{"name":"messageId","required":true,"in":"path","description":"The chat message id.","schema":{"type":"string","format":"uuid","description":"The chat message id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditChatMessage"}}}},"responses":{"200":{"description":"The message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`CHT-6404`: only its author edits a message.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6402`: no such message in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only). `CHT-6405`: the message was deleted.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CHT-6410`: an empty message.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Edit your message","tags":["chat"]},"delete":{"description":"A soft delete: it shows as \"message deleted\".","operationId":"deleteChatMessage","parameters":[{"name":"messageId","required":true,"in":"path","description":"The chat message id.","schema":{"type":"string","format":"uuid","description":"The chat message id."}}],"responses":{"204":{"description":"Deleted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`CHT-6404`: only its author deletes a message.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6402`: no such message in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Delete your message","tags":["chat"]}},"/v1/chat/messages/{messageId}/edits":{"get":{"operationId":"listChatMessageEdits","parameters":[{"name":"messageId","required":true,"in":"path","description":"The chat message id.","schema":{"type":"string","format":"uuid","description":"The chat message id."}}],"responses":{"200":{"description":"The earlier texts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageEditList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6402`: no such message in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:read"]},{"oauth2":["chat:read"]}],"summary":"A message's edit history","tags":["chat"]}},"/v1/chat/messages/{messageId}/unread":{"post":{"description":"Your read position moves back to just before it.","operationId":"markChatMessageUnread","parameters":[{"name":"messageId","required":true,"in":"path","description":"The chat message id.","schema":{"type":"string","format":"uuid","description":"The chat message id."}}],"responses":{"200":{"description":"The room.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRoom"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6402`: no such message in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6405`: the message was deleted.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Mark a message as unread","tags":["chat"]}},"/v1/chat/messages/{messageId}/reactions":{"post":{"operationId":"addChatReaction","parameters":[{"name":"messageId","required":true,"in":"path","description":"The chat message id.","schema":{"type":"string","format":"uuid","description":"The chat message id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatReactionInput"}}}},"responses":{"200":{"description":"The message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6402`: no such message in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only). `CHT-6405`: the message was deleted.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"React to a message","tags":["chat"]}},"/v1/chat/messages/{messageId}/reactions/{emoji}":{"delete":{"operationId":"removeChatReaction","parameters":[{"name":"messageId","required":true,"in":"path","description":"The chat message id.","schema":{"type":"string","format":"uuid","description":"The chat message id."}},{"name":"emoji","required":true,"in":"path","description":"The emoji (URL-encoded).","schema":{"type":"string","minLength":1,"maxLength":32,"description":"The emoji (URL-encoded)."}}],"responses":{"200":{"description":"The message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6402`: no such message in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Remove your reaction","tags":["chat"]}},"/v1/chat/messages/{messageId}/pin":{"put":{"operationId":"pinChatMessage","parameters":[{"name":"messageId","required":true,"in":"path","description":"The chat message id.","schema":{"type":"string","format":"uuid","description":"The chat message id."}}],"responses":{"200":{"description":"The message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6402`: no such message in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only). `CHT-6405`: the message was deleted.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Pin a message at the top of its room","tags":["chat"]},"delete":{"operationId":"unpinChatMessage","parameters":[{"name":"messageId","required":true,"in":"path","description":"The chat message id.","schema":{"type":"string","format":"uuid","description":"The chat message id."}}],"responses":{"200":{"description":"The message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6402`: no such message in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only). `CHT-6405`: the message was deleted.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Unpin a message","tags":["chat"]}},"/v1/chat/search":{"get":{"description":"In the rooms you belong to, newest first (PostgreSQL full-text search).","operationId":"searchChat","parameters":[{"name":"q","required":true,"in":"query","description":"Words to find (prefixes match; Arabic-aware).","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Words to find (prefixes match; Arabic-aware)."}},{"name":"room_id","required":false,"in":"query","description":"Only this room.","schema":{"description":"Only this room.","type":"string","format":"uuid"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","format":"uuid"}},{"name":"limit","required":false,"in":"query","description":"Results per page (1 to 50, default 20).","schema":{"default":20,"description":"Results per page (1 to 50, default 20).","type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"The results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSearchPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:read"]},{"oauth2":["chat:read"]}],"summary":"Search your chat messages","tags":["chat"]}},"/v1/chat/rooms/{roomId}/attachments":{"post":{"description":"Returns the signed request that uploads the file straight to storage (valid 15 minutes). Then complete the upload and send it with a message.","operationId":"requestChatAttachmentUpload","parameters":[{"name":"roomId","required":true,"in":"path","description":"The chat room id.","schema":{"type":"string","format":"uuid","description":"The chat room id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadRequest"}}}},"responses":{"201":{"description":"The file and its upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentUpload"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CHT-6401`: no such room, or you are not a member of it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6403`: the room is archived (read-only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `TKT-6114`: the file is larger than allowed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Upload a file to a chat room","tags":["chat"]}},"/v1/chat/attachments/{attachmentId}/complete":{"post":{"description":"Once the file is in storage with its size; it is scanned for malware next.","operationId":"completeChatAttachmentUpload","parameters":[{"name":"attachmentId","required":true,"in":"path","description":"The chat file id.","schema":{"type":"string","format":"uuid","description":"The chat file id."}}],"responses":{"200":{"description":"The file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachment"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6111`: no such file in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6115`: the file is not in storage, or has another size. `CHT-6411`: not your pending upload.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Complete a chat file upload","tags":["chat"]}},"/v1/chat/attachments/{attachmentId}/renew":{"post":{"description":"A new signed request for a file whose upload did not complete (lost connection, expired link): upload it again; the message keeps it.","operationId":"renewChatAttachmentUpload","parameters":[{"name":"attachmentId","required":true,"in":"path","description":"The chat file id.","schema":{"type":"string","format":"uuid","description":"The chat file id."}}],"responses":{"200":{"description":"The file and its upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentUpload"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `chat:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6111`: no such file in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CHT-6411`: not your pending upload (or already stored).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:write"]},{"oauth2":["chat:write"]}],"summary":"Renew a chat file upload","tags":["chat"]}},"/v1/chat/attachments/{attachmentId}":{"get":{"operationId":"getChatAttachment","parameters":[{"name":"attachmentId","required":true,"in":"path","description":"The chat file id.","schema":{"type":"string","format":"uuid","description":"The chat file id."}}],"responses":{"200":{"description":"The file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachment"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6111`: no such file in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:read"]},{"oauth2":["chat:read"]}],"summary":"Get a chat file (its scan status)","tags":["chat"]}},"/v1/chat/attachments/{attachmentId}/download":{"get":{"operationId":"downloadChatAttachment","parameters":[{"name":"attachmentId","required":true,"in":"path","description":"The chat file id.","schema":{"type":"string","format":"uuid","description":"The chat file id."}}],"responses":{"200":{"description":"The link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentDownload"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `chat:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6111`: no such file in a room you belong to.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`TKT-6112`: not uploaded or scanned yet (or the scan failed). `TKT-6113`: blocked, it contains malware.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["chat:read"]},{"oauth2":["chat:read"]}],"summary":"A download link for a chat file (valid 5 minutes)","tags":["chat"]}},"/v1/integrations/platforms":{"get":{"description":"Salla, Zid and Shopify, each with whether it can be connected on this Rabt and what the member types before signing in.","operationId":"listIntegrationPlatforms","parameters":[],"responses":{"200":{"description":"The platforms.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationPlatformList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `integrations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:read"]},{"oauth2":["integrations:read"]}],"summary":"List the platforms stores can be connected from","tags":["integrations"]}},"/v1/integrations/orders":{"get":{"description":"Asks every working store, live, for the orders matching an order number, a phone number, an email address or a contact’s phone numbers and email addresses; newest first. Stores that could not answer are listed in `failures` with their error. Read only.","operationId":"lookUpOrders","parameters":[{"name":"order_number","required":false,"in":"query","description":"The order number the customer gave.","schema":{"description":"The order number the customer gave.","type":"string","minLength":1,"maxLength":100}},{"name":"phone","required":false,"in":"query","description":"The customer’s phone number, E.164.","schema":{"description":"The customer’s phone number, E.164.","type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},{"name":"email","required":false,"in":"query","description":"The customer’s email address.","schema":{"description":"The customer’s email address.","type":"string","maxLength":254,"format":"email"}},{"name":"contact_id","required":false,"in":"query","description":"A contact: its phone numbers and email addresses are looked up.","schema":{"description":"A contact: its phone numbers and email addresses are looked up.","type":"string","format":"uuid"}},{"name":"limit","required":false,"in":"query","description":"Orders per store and key (1 to 20, default 10).","schema":{"default":10,"description":"Orders per store and key (1 to 20, default 10).","type":"integer","minimum":1,"maximum":20}}],"responses":{"200":{"description":"The orders found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderLookupResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`INT-7010`: no order number, phone, email or contact was given.\n\n`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `integrations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no contact with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:read"]},{"oauth2":["integrations:read"]}],"summary":"Look up orders in the connected stores","tags":["integrations"]}},"/v1/integrations/contacts/{contactId}":{"get":{"description":"The store customers matching the contact’s verified phone numbers and email addresses (orders count, total spent) and their latest orders, as last read from the stores.","operationId":"getContactStoreRecords","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}}],"responses":{"200":{"description":"The records.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactStoreRecords"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `integrations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no contact with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:read"]},{"oauth2":["integrations:read"]}],"summary":"A contact’s customer records and orders in the connected stores","tags":["integrations"]}},"/v1/integrations":{"get":{"description":"Every connected store with its status, last error, webhook and sync state and how many customers and orders were read; disconnected ones last. Credentials are never returned.","operationId":"listIntegrations","parameters":[],"responses":{"200":{"description":"The integrations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `integrations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:read"]},{"oauth2":["integrations:read"]}],"summary":"List the integrations","tags":["integrations"]}},"/v1/integrations/authorizations":{"post":{"description":"Returns the platform’s sign-in URL (authorization code with PKCE and `state`). The store’s owner signs in there and approves; the platform sends them back to Rabt’s callback page, which finishes with `completeIntegrationConnection` within ten minutes.","operationId":"startIntegrationConnection","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartIntegrationConnection"}}}},"responses":{"201":{"description":"The sign-in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationAuthorization"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `integrations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `INT-7007`: the platform needs the store’s address.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:write"]},{"oauth2":["integrations:write"]}],"summary":"Start connecting a store","tags":["integrations"]}},"/v1/integrations/authorizations/complete":{"post":{"description":"With every parameter the platform sent back: the code is exchanged, the store read, and the integration stored `active` (or reconnected); its webhooks are created where needed and its first sync queued. Each sign-in is used once, in the organization that started it.","operationId":"completeIntegrationConnection","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteIntegrationConnection"}}}},"responses":{"200":{"description":"The integration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `integrations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`INT-7005`: a reconnection signed in to another store. `INT-7002`: the integration to reconnect is disconnected.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"`INT-7003`: the sign-in expired, was used, or belongs to another organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `INT-7004`: the owner declined at the platform. `INT-7015`: a permission Rabt needs was not granted.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:write"]},{"oauth2":["integrations:write"]}],"summary":"Finish connecting a store","tags":["integrations"]}},"/v1/integrations/{integrationId}":{"get":{"operationId":"getIntegration","parameters":[{"name":"integrationId","required":true,"in":"path","description":"The integration id.","schema":{"type":"string","format":"uuid","description":"The integration id."}}],"responses":{"200":{"description":"The integration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `integrations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`INT-7001`: no integration with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:read"]},{"oauth2":["integrations:read"]}],"summary":"An integration","tags":["integrations"]}},"/v1/integrations/{integrationId}/sync-runs":{"get":{"description":"The last 20 runs, newest first, each with its counts and, when it failed, its error.","operationId":"listIntegrationSyncRuns","parameters":[{"name":"integrationId","required":true,"in":"path","description":"The integration id.","schema":{"type":"string","format":"uuid","description":"The integration id."}}],"responses":{"200":{"description":"The runs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationSyncRunList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `integrations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`INT-7001`: no integration with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:read"]},{"oauth2":["integrations:read"]}],"summary":"The latest sync runs of an integration","tags":["integrations"]}},"/v1/integrations/{integrationId}/sync":{"post":{"description":"Queues a reading of the store’s customers and orders changed since the last one (Rabt also syncs hourly and on every webhook). While a run waits or runs, that run is returned.","operationId":"syncIntegration","parameters":[{"name":"integrationId","required":true,"in":"path","description":"The integration id.","schema":{"type":"string","format":"uuid","description":"The integration id."}}],"responses":{"202":{"description":"The sync run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationSyncRun"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `integrations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`INT-7001`: no integration with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`INT-7002`: the integration is disconnected or waits for a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:write"]},{"oauth2":["integrations:write"]}],"summary":"Sync a store now","tags":["integrations"]}},"/v1/integrations/{integrationId}/reconnect":{"post":{"description":"Returns a sign-in URL for the integration’s own store (`needs_reauth` after the platform refused the saved access); finishing it with `completeIntegrationConnection` makes it active again.","operationId":"reconnectIntegration","parameters":[{"name":"integrationId","required":true,"in":"path","description":"The integration id.","schema":{"type":"string","format":"uuid","description":"The integration id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"The sign-in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationAuthorization"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `integrations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`INT-7001`: no integration with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`INT-7002`: the integration is disconnected or waits for a reconnection.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:write"]},{"oauth2":["integrations:write"]}],"summary":"Reconnect an integration","tags":["integrations"]}},"/v1/integrations/{integrationId}/disconnect":{"post":{"description":"Removes Rabt’s app from the store where the platform allows it and revokes the access in the token vault; the integration and the customers and orders read stay (Rabt never deletes).","operationId":"disconnectIntegration","parameters":[{"name":"integrationId","required":true,"in":"path","description":"The integration id.","schema":{"type":"string","format":"uuid","description":"The integration id."}}],"responses":{"200":{"description":"The integration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `settings.manage` permission. `API-8102`: the API key or app lacks the `integrations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`INT-7001`: no integration with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["integrations:write"]},{"oauth2":["integrations:write"]}],"summary":"Disconnect an integration","tags":["integrations"]}},"/v1/search":{"get":{"description":"Tickets, message texts on every channel, internal notes, contacts, companies and their notes, and your internal chat messages, in one query, grouped by kind, newest first within a kind (a ticket number or an exact phone or email match first). Only what you may see: tickets assigned to you or in your spaces (all of them with `tickets.view_all`) and only the chat rooms you belong to. An API key or app gets only the kinds it also has a read scope for (`tickets:read`, `contacts:read`, `companies:read`, `chat:read`). While the Rabt team has paused non-essential features during an incident, it answers `SYS-1071`.","operationId":"search","parameters":[{"name":"q","required":true,"in":"query","description":"What to find: words (prefixes match), a phone number, an email address or a ticket number (`1283` or `#1283`). Arabic-aware (hamza, ta marbuta, diacritics, Arabic-Indic digits).","schema":{"type":"string","minLength":1,"maxLength":200,"description":"What to find: words (prefixes match), a phone number, an email address or a ticket number (`1283` or `#1283`). Arabic-aware (hamza, ta marbuta, diacritics, Arabic-Indic digits)."}},{"name":"types","required":false,"in":"query","description":"Only these kinds, comma-separated (e.g. `ticket,message`); default: all.","schema":{"description":"Only these kinds, comma-separated (e.g. `ticket,message`); default: all.","type":"string","maxLength":200,"pattern":"^(ticket|message|note|contact|company|contact_note|company_note|chat_message)(,(ticket|message|note|contact|company|contact_note|company_note|chat_message))*$"}},{"name":"limit","required":false,"in":"query","description":"Results of each kind (1 to 20, default 5).","schema":{"default":5,"description":"Results of each kind (1 to 20, default 5).","type":"integer","minimum":1,"maximum":20}}],"responses":{"200":{"description":"The results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResults"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `search:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["search:read"]},{"oauth2":["search:read"]}],"summary":"Search everything","tags":["search"]}},"/v1/spaces":{"get":{"description":"The department spaces you see: yours, or all with `tickets.view_all` or `spaces.manage`, with how many members are available now.","operationId":"listSpaces","parameters":[],"responses":{"200":{"description":"The spaces.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpaceList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"List spaces","tags":["spaces"]},"post":{"operationId":"createSpace","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSpace"}}}},"responses":{"201":{"description":"The space.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Space"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SPC-6202`: a space with this name exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Create a department space","tags":["spaces"]}},"/v1/spaces/{spaceId}":{"get":{"operationId":"getSpace","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}}],"responses":{"200":{"description":"The space.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Space"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space, it is archived, or you are not in it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"A space","tags":["spaces"]},"patch":{"description":"Its name, description, returning-customer window and \"no member available\" message.","operationId":"updateSpace","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSpace"}}}},"responses":{"200":{"description":"The space.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Space"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space, it is archived, or you are not in it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SPC-6202`: a space with this name exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Edit a space","tags":["spaces"]}},"/v1/spaces/{spaceId}/archive":{"post":{"description":"Never deleted: its channels are released and its tickets that are not closed move to the All space.","operationId":"archiveSpace","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}}],"responses":{"204":{"description":"Archived.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space, it is archived, or you are not in it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Archive a space","tags":["spaces"]}},"/v1/spaces/{spaceId}/members":{"get":{"operationId":"listSpaceMembers","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}}],"responses":{"200":{"description":"The members.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpaceMemberList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space, it is archived, or you are not in it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"The members of a space","tags":["spaces"]}},"/v1/spaces/{spaceId}/members/{membershipId}":{"put":{"description":"A member can be in several spaces; adding them again changes nothing.","operationId":"addSpaceMember","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}},{"name":"membershipId","required":true,"in":"path","description":"The member (membership id).","schema":{"type":"string","format":"uuid","description":"The member (membership id)."}}],"responses":{"200":{"description":"The member.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpaceMember"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space, it is archived, or you are not in it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SPC-6205`: the member is not in this organization.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Add a member to a space","tags":["spaces"]},"delete":{"description":"Tickets assigned to them stay theirs.","operationId":"removeSpaceMember","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}},{"name":"membershipId","required":true,"in":"path","description":"The member (membership id).","schema":{"type":"string","format":"uuid","description":"The member (membership id)."}}],"responses":{"204":{"description":"Removed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space, it is archived, or you are not in it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Remove a member from a space","tags":["spaces"]}},"/v1/spaces/{spaceId}/channels":{"get":{"operationId":"listSpaceChannels","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}}],"responses":{"200":{"description":"The assignments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpaceChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space, it is archived, or you are not in it (the same answer).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"The channels, email addresses and phone numbers of a space","tags":["spaces"]},"post":{"description":"Its new tickets go to this space. Already here: the assignment is returned.","operationId":"assignSpaceChannel","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignSpaceChannel"}}}},"responses":{"201":{"description":"The assignment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpaceChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space, it is archived, or you are not in it (the same answer). `SPC-6208`: no connected email address with this `channel_address_id`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SPC-6203`: it belongs to another space (named).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SPC-6209`: no channel of the organization has this `channel_id`.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Assign a channel, email address or phone number to a space","tags":["spaces"]}},"/v1/spaces/{spaceId}/channels/{assignmentId}":{"delete":{"description":"Its new tickets go to the All space.","operationId":"unassignSpaceChannel","parameters":[{"name":"spaceId","required":true,"in":"path","description":"The space id.","schema":{"type":"string","format":"uuid","description":"The space id."}},{"name":"assignmentId","required":true,"in":"path","description":"The channel assignment id.","schema":{"type":"string","format":"uuid","description":"The channel assignment id."}}],"responses":{"204":{"description":"Removed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6201`: no such space, it is archived, or you are not in it (the same answer). `SPC-6204`: no such assignment in this space.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Remove a channel from a space","tags":["spaces"]}},"/v1/availability":{"get":{"description":"Every member’s status (Available or Unavailable), open tickets, limit and spaces (the team board).","operationId":"listTeamAvailability","parameters":[],"responses":{"200":{"description":"The members.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamAvailability"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"Who is available now","tags":["availability"]}},"/v1/availability/me":{"get":{"description":"Your status (Available or Unavailable), open tickets, limit and spaces.","operationId":"getMyAvailability","parameters":[],"responses":{"200":{"description":"You.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMember"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"Your availability","tags":["availability"]},"put":{"description":"Available or Unavailable. You also become Unavailable after 5 minutes with Rabt closed or disconnected.","operationId":"setMyAvailability","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAvailability"}}}},"responses":{"200":{"description":"You.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMember"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Set your availability","tags":["availability"]}},"/v1/team-board":{"get":{"description":"Live numbers, not reports (docs/25): members available now, tickets waiting and the oldest of them, open tickets; each space’s queue; every member’s status and open tickets against their limit; and the waiting tickets you may see, oldest first, to take or assign. Needs `members.view_availability`.","operationId":"getTeamBoard","parameters":[],"responses":{"200":{"description":"The board.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamBoard"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `members.view_availability` permission. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"The live team board","tags":["availability"]}},"/v1/availability/totals":{"get":{"description":"The available time of each member on every local date from `from_date` to `to_date` (inclusive), and the total (docs/17: a day, a week, a month). Every member’s with `members.view_availability`, otherwise yours.","operationId":"getAvailabilityTotals","parameters":[{"name":"from_date","required":true,"in":"query","description":"A local date (YYYY-MM-DD) in the time zone; the period is at most 93 days.","schema":{"type":"string","format":"date","description":"A local date (YYYY-MM-DD) in the time zone; the period is at most 93 days."}},{"name":"to_date","required":true,"in":"query","description":"A local date (YYYY-MM-DD) in the time zone; the period is at most 93 days.","schema":{"type":"string","format":"date","description":"A local date (YYYY-MM-DD) in the time zone; the period is at most 93 days."}},{"name":"time_zone","required":false,"in":"query","description":"An IANA time zone for the daily totals (default: the organization’s).","schema":{"description":"An IANA time zone for the daily totals (default: the organization’s).","type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"The totals.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityTotals"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SPC-6206`: the period is empty or too long. `SPC-6207`: unknown time zone.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"Available hours per member and day","tags":["availability"]}},"/v1/availability/log":{"get":{"description":"The available and unavailable periods of a member, the available time per day and the total for a period (docs/17). Yours, or anyone’s with `members.view_availability`.","operationId":"getAvailabilityLog","parameters":[{"name":"from","required":true,"in":"query","description":"An ISO 8601 time; the period is at most 93 days.","schema":{"type":"string","format":"date-time","description":"An ISO 8601 time; the period is at most 93 days."}},{"name":"to","required":true,"in":"query","description":"An ISO 8601 time; the period is at most 93 days.","schema":{"type":"string","format":"date-time","description":"An ISO 8601 time; the period is at most 93 days."}},{"name":"membership_id","required":false,"in":"query","description":"The member; yours by default. Another member’s needs `members.view_availability`.","schema":{"type":"string","format":"uuid","description":"The member; yours by default. Another member’s needs `members.view_availability`."}},{"name":"time_zone","required":false,"in":"query","description":"An IANA time zone for the daily totals (default: the organization’s).","schema":{"description":"An IANA time zone for the daily totals (default: the organization’s).","type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"The log.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityLog"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SPC-6205`: no such member. `SPC-6206`: the period is empty or too long. `SPC-6207`: unknown time zone.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"A member’s availability log","tags":["availability"]}},"/v1/routing-settings":{"get":{"operationId":"getRoutingSettings","parameters":[],"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"The routing settings","tags":["availability"]},"put":{"description":"`max_open_tickets`: the default maximum of open tickets per member, across all spaces; members at it are skipped by the automatic distribution.","operationId":"updateRoutingSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingSettings"}}}},"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Change the routing settings","tags":["availability"]}},"/v1/availability/members/{membershipId}/limit":{"put":{"description":"Null returns the member to the organization default.","operationId":"setMemberRoutingLimit","parameters":[{"name":"membershipId","required":true,"in":"path","description":"The member (membership id).","schema":{"type":"string","format":"uuid","description":"The member (membership id)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberRoutingLimit"}}}},"responses":{"200":{"description":"The member.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMember"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SPC-6205`: the member is not in this organization.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Set a member’s own maximum of open tickets","tags":["availability"]}},"/v1/routing/items":{"get":{"description":"Everything connected, grouped by channel type: email addresses and aliases, WhatsApp numbers, Instagram, X and TikTok accounts, Facebook pages, phone numbers, web chat widgets, apps and Google Maps locations, each with its one destination (All by default).","operationId":"listRoutingItems","parameters":[{"name":"channel_type","required":false,"in":"query","description":"Only these channel types (repeat the parameter for several).","schema":{"description":"Only these channel types (repeat the parameter for several).","anyOf":[{"$ref":"#/components/schemas/ChannelType"},{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/ChannelType"}}]}},{"name":"destination","required":false,"in":"query","description":"Only items with this destination.","schema":{"description":"Only items with this destination.","type":"string","enum":["all","space","member"]}},{"name":"space_id","required":false,"in":"query","description":"With `destination=space`: only items routed to this space.","schema":{"description":"With `destination=space`: only items routed to this space.","type":"string","format":"uuid"}},{"name":"membership_id","required":false,"in":"query","description":"With `destination=member`: only items routed to this member.","schema":{"description":"With `destination=member`: only items routed to this member.","type":"string","format":"uuid"}},{"name":"q","required":false,"in":"query","description":"Words found in the address, the sender name or the channel’s name (Arabic-aware search).","schema":{"description":"Words found in the address, the sender name or the channel’s name (Arabic-aware search).","type":"string","maxLength":200}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 500, default 100).","schema":{"default":100,"description":"Items per page (1 to 500, default 100).","type":"integer","minimum":1,"maximum":500}}],"responses":{"200":{"description":"The items.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingItemPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"List the address routing page","tags":["routing"]}},"/v1/routing/items/{target}/{targetId}":{"get":{"operationId":"getRoutingItem","parameters":[{"name":"target","required":true,"in":"path","schema":{"$ref":"#/components/schemas/RoutingTargetType"}},{"name":"targetId","required":true,"in":"path","description":"The channel address id (`address`), or the channel or widget id (`channel`).","schema":{"type":"string","format":"uuid","description":"The channel address id (`address`), or the channel or widget id (`channel`)."}}],"responses":{"200":{"description":"The item.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingItem"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6211`: no connected address, account, channel or widget with this id (disconnected or removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:read"]},{"oauth2":["spaces:read"]}],"summary":"One item of the address routing page","tags":["routing"]}},"/v1/routing/items/{target}/{targetId}/destination":{"put":{"description":"Exactly one destination (`all`, a space or a member) replaces the previous one; it applies to the next new ticket and is written to the audit log.","operationId":"setRoutingDestination","parameters":[{"name":"target","required":true,"in":"path","schema":{"$ref":"#/components/schemas/RoutingTargetType"}},{"name":"targetId","required":true,"in":"path","description":"The channel address id (`address`), or the channel or widget id (`channel`).","schema":{"type":"string","format":"uuid","description":"The channel address id (`address`), or the channel or widget id (`channel`)."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetRoutingDestination"}}}},"responses":{"200":{"description":"The item.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingItem"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `spaces.manage` permission. `API-8102`: the API key or app lacks the `spaces:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6211`: no connected address, account, channel or widget with this id (disconnected or removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SPC-6212`: the channel carries addresses (route each); `SPC-6201`: no such space; `TKT-6107`/`TKT-6122`: the member cannot receive tickets.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["spaces:write"]},{"oauth2":["spaces:write"]}],"summary":"Set the destination of an item","tags":["routing"]}},"/v1/ai/levels":{"get":{"description":"The organization's connected channels and web chat widgets with their addresses (each a level below the organization), and how many blocks and whether switches are set at each level.","operationId":"listAiLevels","parameters":[],"responses":{"200":{"description":"The levels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiLevels"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"The levels of AI blocks and switches","tags":["ai"]}},"/v1/ai/blocks":{"get":{"description":"The Markdown blocks of the AI agent, by level and order; filter by level, channel, private/public or address.","operationId":"listAiBlocks","parameters":[{"name":"level","required":false,"in":"query","schema":{"$ref":"#/components/schemas/AiLevel"}},{"name":"channel_id","required":false,"in":"query","description":"Blocks of this channel (every level).","schema":{"description":"Blocks of this channel (every level).","type":"string","format":"uuid"}},{"name":"kind","required":false,"in":"query","schema":{"$ref":"#/components/schemas/AiKind"}},{"name":"channel_address_id","required":false,"in":"query","schema":{"type":"string","format":"uuid"}},{"name":"phone_number_id","required":false,"in":"query","schema":{"type":"string","format":"uuid"}},{"name":"include_archived","required":false,"in":"query","description":"Include archived blocks (default false).","schema":{"description":"Include archived blocks (default false).","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"The blocks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiBlockList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"List AI blocks","tags":["ai"]},"post":{"description":"A Markdown block of knowledge or instructions at one level. It applies immediately; the more specific levels come last and take precedence.","operationId":"createAiBlock","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAiBlock"}}}},"responses":{"201":{"description":"The block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiBlock"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `AI-5031`: `channel_id` is not a connected channel or web chat widget of the organization. `AI-5032`: `channel_address_id` is not a current address (of that channel).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:write"]},{"oauth2":["ai:write"]}],"summary":"Add an AI block","tags":["ai"]}},"/v1/ai/blocks/{blockId}":{"get":{"operationId":"getAiBlock","parameters":[{"name":"blockId","required":true,"in":"path","description":"The block id.","schema":{"type":"string","format":"uuid","description":"The block id."}}],"responses":{"200":{"description":"The block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiBlock"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AI-5030`: no such block in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"An AI block","tags":["ai"]},"patch":{"description":"Its title, content, 'always include' flag, active flag or order.","operationId":"updateAiBlock","parameters":[{"name":"blockId","required":true,"in":"path","description":"The block id.","schema":{"type":"string","format":"uuid","description":"The block id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAiBlock"}}}},"responses":{"200":{"description":"The block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiBlock"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AI-5030`: no such block in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AI-5033`: the block is archived.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:write"]},{"oauth2":["ai:write"]}],"summary":"Edit an AI block","tags":["ai"]}},"/v1/ai/blocks/{blockId}/archive":{"post":{"description":"Never deleted: the AI agent no longer receives it. Archiving it again changes nothing.","operationId":"archiveAiBlock","parameters":[{"name":"blockId","required":true,"in":"path","description":"The block id.","schema":{"type":"string","format":"uuid","description":"The block id."}}],"responses":{"200":{"description":"The archived block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiBlock"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AI-5030`: no such block in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:write"]},{"oauth2":["ai:write"]}],"summary":"Archive an AI block","tags":["ai"]}},"/v1/ai/settings":{"get":{"description":"Every level whose switches were set (null: inherited). Until an admin sets the organization level, its defaults apply: off, replying whether or not members are available, routing between spaces.","operationId":"listAiSettings","parameters":[],"responses":{"200":{"description":"The switches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiSettingsList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"List the AI switches of every level","tags":["ai"]},"put":{"description":"The AI agent on/off, \"reply only when no member is available\" and \"route to the right space\", at one level. Omitted: unchanged; null: inherited from the wider level.","operationId":"setAiSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAiSettings"}}}},"responses":{"200":{"description":"The switches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `AI-5031`: `channel_id` is not a connected channel or web chat widget of the organization. `AI-5032`: `channel_address_id` is not a current address (of that channel). `AI-5034`: the organization level cannot inherit.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:write"]},{"oauth2":["ai:write"]}],"summary":"Set the AI switches of a level","tags":["ai"]}},"/v1/ai/settings/effective":{"get":{"description":"For a ticket on a channel, private or public, and address: each switch with the level that decided it.","operationId":"getEffectiveAiSettings","parameters":[{"name":"channel_id","required":false,"in":"query","description":"The channel or web chat widget; omitted: the organization level only.","schema":{"description":"The channel or web chat widget; omitted: the organization level only.","type":"string","format":"uuid"}},{"name":"kind","required":false,"in":"query","description":"Private (default) or public.","schema":{"description":"Private (default) or public.","$ref":"#/components/schemas/AiKind"}},{"name":"channel_address_id","required":false,"in":"query","description":"The address, if any.","schema":{"description":"The address, if any.","type":"string","format":"uuid"}},{"name":"phone_number_id","required":false,"in":"query","description":"The phone number, if any.","schema":{"description":"The phone number, if any.","type":"string","format":"uuid"}}],"responses":{"200":{"description":"The switches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EffectiveAiSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `AI-5032`: `channel_address_id` is not a current address (of that channel).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"The AI switches that apply","tags":["ai"]}},"/v1/ai/knowledge":{"get":{"description":"The blocks of the organization, the channel, private or public, and the address, in the order they are sent; whether they are sent in full or as the relevant parts; and the switches that apply.","operationId":"previewAiKnowledge","parameters":[{"name":"channel_id","required":false,"in":"query","description":"The channel or web chat widget; omitted: the organization level only.","schema":{"description":"The channel or web chat widget; omitted: the organization level only.","type":"string","format":"uuid"}},{"name":"kind","required":false,"in":"query","description":"Private (default) or public.","schema":{"description":"Private (default) or public.","$ref":"#/components/schemas/AiKind"}},{"name":"channel_address_id","required":false,"in":"query","description":"The address, if any.","schema":{"description":"The address, if any.","type":"string","format":"uuid"}},{"name":"phone_number_id","required":false,"in":"query","description":"The phone number, if any.","schema":{"description":"The phone number, if any.","type":"string","format":"uuid"}}],"responses":{"200":{"description":"The knowledge.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiKnowledgePreview"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `AI-5032`: `channel_address_id` is not a current address (of that channel).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"What the AI agent receives for a ticket","tags":["ai"]}},"/v1/ai/knowledge/embed":{"post":{"description":"Asks the worker to embed the organization's large block set now (after a failure shown as `embedding_error` on the blocks), instead of waiting for the hourly run. Paid per call like every embedding; nothing is embedded while the blocks are small.","operationId":"requestAiKnowledgeEmbedding","parameters":[],"responses":{"202":{"description":"Asked for.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEmbeddingRequest"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:write"]},{"oauth2":["ai:write"]}],"summary":"Embed the AI blocks again now","tags":["ai"]}},"/v1/ai/agent":{"get":{"description":"The organization's kill switch of the AI agent: while it is stopped the AI agent replies nowhere, whatever the level switches say.","operationId":"getAiAgentSwitch","parameters":[],"responses":{"200":{"description":"The switch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAgentSwitch"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"Whether the AI agent is stopped everywhere","tags":["ai"]},"put":{"description":"One click (docs/24 #41): `stopped: true` stops the AI agent on every channel and hands every conversation it is replying in to the members at once; `false` starts it again (it takes new conversations; a member turns it on again in a handed-off one). Setting the state it has changes nothing.","operationId":"setAiAgentSwitch","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAiAgentSwitch"}}}},"responses":{"200":{"description":"The switch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAgentSwitch"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:write"]},{"oauth2":["ai:write"]}],"summary":"Stop the AI agent everywhere, or start it again","tags":["ai"]}},"/v1/ai/interactions":{"get":{"description":"Every turn of the AI agent, newest first: the customer message it answered, its reply, the blocks it read, the tools it called, its tokens and cost, or its error. Filter by ticket or outcome.","operationId":"listAiInteractions","parameters":[{"name":"ticket_id","required":false,"in":"query","description":"Only the turns of this ticket.","schema":{"description":"Only the turns of this ticket.","type":"string","format":"uuid"}},{"name":"outcome","required":false,"in":"query","schema":{"$ref":"#/components/schemas/AiInteractionOutcome"}},{"name":"cursor","required":false,"in":"query","description":"`next_cursor` of a page.","schema":{"description":"`next_cursor` of a page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"1–100 (50).","schema":{"description":"1–100 (50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiInteractionPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`API-8001`: a cursor that is not one of ours.\n\n`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"The AI agent's turns","tags":["ai"]}},"/v1/ai/interactions/{interactionId}":{"get":{"operationId":"getAiInteraction","parameters":[{"name":"interactionId","required":true,"in":"path","description":"The AI agent turn id.","schema":{"type":"string","format":"uuid","description":"The AI agent turn id."}}],"responses":{"200":{"description":"The turn.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiInteraction"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AI-5041`: no such turn in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"One turn of the AI agent","tags":["ai"]}},"/v1/ai/gaps":{"get":{"description":"The questions the AI agent handed off because its blocks had no answer, grouped with the identical or near-identical ones (normalized text, no AI): each group with its count, channels and last time, the most recently asked first. Filter by status or channel.","operationId":"listAiGaps","parameters":[{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/AiGapClusterStatus"}},{"name":"channel","required":false,"in":"query","description":"Only the groups asked through this channel type.","schema":{"description":"Only the groups asked through this channel type.","$ref":"#/components/schemas/ChannelType"}},{"name":"cursor","required":false,"in":"query","description":"`next_cursor` of a page.","schema":{"description":"`next_cursor` of a page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"1–100 (50).","schema":{"description":"1–100 (50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGapClusterPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`API-8001`: a cursor that is not one of ours.\n\n`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"The unanswered questions","tags":["ai"]}},"/v1/ai/gaps/{clusterId}":{"get":{"operationId":"getAiGap","parameters":[{"name":"clusterId","required":true,"in":"path","description":"The id of a group of unanswered questions.","schema":{"type":"string","format":"uuid","description":"The id of a group of unanswered questions."}}],"responses":{"200":{"description":"The group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGapCluster"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AI-5060`: no such group of unanswered questions in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"One group of unanswered questions","tags":["ai"]}},"/v1/ai/gaps/{clusterId}/questions":{"get":{"description":"Each question as the customer wrote it, with its ticket, newest first.","operationId":"listAiGapQuestions","parameters":[{"name":"clusterId","required":true,"in":"path","description":"The id of a group of unanswered questions.","schema":{"type":"string","format":"uuid","description":"The id of a group of unanswered questions."}},{"name":"cursor","required":false,"in":"query","description":"`next_cursor` of a page.","schema":{"description":"`next_cursor` of a page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"1–100 (50).","schema":{"description":"1–100 (50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGapPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`API-8001`: a cursor that is not one of ours.\n\n`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AI-5060`: no such group of unanswered questions in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:read"]},{"oauth2":["ai:read"]}],"summary":"The questions of a group, with their tickets","tags":["ai"]}},"/v1/ai/gaps/{clusterId}/add-to-knowledge":{"post":{"description":"Writes the question (as a heading) and the answer into an existing live block (`block_id`, at its end) or a new block at a level (`new_block`), and marks the group `added` with the block. The AI agent uses it at once.","operationId":"addAiGapToKnowledge","parameters":[{"name":"clusterId","required":true,"in":"path","description":"The id of a group of unanswered questions.","schema":{"type":"string","format":"uuid","description":"The id of a group of unanswered questions."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddAiGapToKnowledge"}}}},"responses":{"200":{"description":"The group and the block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGapAddedToKnowledge"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AI-5060`: no such group of unanswered questions in this organization. `AI-5030`: no such block.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AI-5033`: the block is archived.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `AI-5061`: the block would be longer than allowed. `AI-5031`, `AI-5032`: a new block whose channel or address is not the organization’s.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:write"]},{"oauth2":["ai:write"]}],"summary":"Add the answer to knowledge","tags":["ai"]}},"/v1/ai/gaps/{clusterId}/ignore":{"post":{"description":"The group leaves the open list; its new questions are still counted. Ignoring an ignored group changes nothing.","operationId":"ignoreAiGap","parameters":[{"name":"clusterId","required":true,"in":"path","description":"The id of a group of unanswered questions.","schema":{"type":"string","format":"uuid","description":"The id of a group of unanswered questions."}}],"responses":{"200":{"description":"The group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGapCluster"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AI-5060`: no such group of unanswered questions in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:write"]},{"oauth2":["ai:write"]}],"summary":"Ignore a group of unanswered questions","tags":["ai"]}},"/v1/ai/gaps/{clusterId}/reopen":{"post":{"description":"An ignored or answered group is back in the open list. Opening an open group changes nothing.","operationId":"reopenAiGap","parameters":[{"name":"clusterId","required":true,"in":"path","description":"The id of a group of unanswered questions.","schema":{"type":"string","format":"uuid","description":"The id of a group of unanswered questions."}}],"responses":{"200":{"description":"The group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGapCluster"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `ai.manage` permission. `API-8102`: the API key or app lacks the `ai:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AI-5060`: no such group of unanswered questions in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["ai:write"]},{"oauth2":["ai:write"]}],"summary":"Open a group of unanswered questions again","tags":["ai"]}},"/v1/webchat-widgets":{"get":{"operationId":"listWebchatWidgets","parameters":[],"responses":{"200":{"description":"The widgets.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebchatWidgetList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the chat widgets","tags":["webchat"]},"post":{"description":"A widget for the organization’s websites. The answer carries its embed snippet and, once, its identity-verification secret.","operationId":"createWebchatWidget","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebchatWidget"}}}},"responses":{"201":{"description":"The widget and its identity secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebchatWidgetWithSecret"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WEB-4015`: the organization has its maximum of chat widgets.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WEB-4016`: an allowed domain is not a valid host name.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Create a chat widget","tags":["webchat"]}},"/v1/webchat-widgets/{id}":{"get":{"operationId":"getWebchatWidget","parameters":[{"name":"id","required":true,"in":"path","description":"The widget id.","schema":{"type":"string","format":"uuid","description":"The widget id."}}],"responses":{"200":{"description":"The widget.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebchatWidget"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WEB-4014`: no such chat widget (or it was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"Get a chat widget","tags":["webchat"]},"patch":{"description":"Its name, allowed domains, appearance, languages or pre-chat form; `status: disabled` switches it off on every website.","operationId":"updateWebchatWidget","parameters":[{"name":"id","required":true,"in":"path","description":"The widget id.","schema":{"type":"string","format":"uuid","description":"The widget id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebchatWidget"}}}},"responses":{"200":{"description":"The widget.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebchatWidget"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WEB-4014`: no such chat widget (or it was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WEB-4016`: an allowed domain is not a valid host name.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Update a chat widget","tags":["webchat"]},"delete":{"description":"It stops loading on every website and its visitors’ sessions end; its conversations stay tickets.","operationId":"deleteWebchatWidget","parameters":[{"name":"id","required":true,"in":"path","description":"The widget id.","schema":{"type":"string","format":"uuid","description":"The widget id."}}],"responses":{"204":{"description":"Removed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WEB-4014`: no such chat widget (or it was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Remove a chat widget","tags":["webchat"]}},"/v1/webchat-widgets/{id}/logo":{"put":{"description":"PNG, JPEG or WebP, at most 128 KB, sent as base64.","operationId":"setWebchatWidgetLogo","parameters":[{"name":"id","required":true,"in":"path","description":"The widget id.","schema":{"type":"string","format":"uuid","description":"The widget id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebchatWidgetLogo"}}}},"responses":{"200":{"description":"The widget.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebchatWidget"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WEB-4014`: no such chat widget (or it was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WEB-4017`: the image is not a PNG, JPEG or WebP of at most 128 KB.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Replace a chat widget’s logo","tags":["webchat"]},"delete":{"description":"The widget shows the business’s initials instead.","operationId":"removeWebchatWidgetLogo","parameters":[{"name":"id","required":true,"in":"path","description":"The widget id.","schema":{"type":"string","format":"uuid","description":"The widget id."}}],"responses":{"200":{"description":"The widget.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebchatWidget"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WEB-4014`: no such chat widget (or it was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Remove a chat widget’s logo","tags":["webchat"]}},"/v1/webchat-widgets/{id}/identity-secret":{"post":{"description":"A new identity-verification secret, shown once. The previous one keeps verifying signed-in users for 24 hours, so the website can switch without signing anyone out.","operationId":"rotateWebchatWidgetSecret","parameters":[{"name":"id","required":true,"in":"path","description":"The widget id.","schema":{"type":"string","format":"uuid","description":"The widget id."}}],"responses":{"201":{"description":"The widget and its new secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebchatWidgetWithSecret"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WEB-4014`: no such chat widget (or it was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Rotate a chat widget’s identity secret","tags":["webchat"]}},"/v1/phone-numbers":{"get":{"description":"The organization’s numbers with their destination (All, a space or a member), recording, voicemail, ringing times and rental; released ones last.","operationId":"listPhoneNumbers","parameters":[],"responses":{"200":{"description":"The numbers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `voice:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:read"]},{"oauth2":["voice:read"]}],"summary":"List the phone numbers","tags":["voice"]},"post":{"description":"Takes an available number: its first month is charged from the wallet now (the rental is prepaid, monthly), then it is active with the All destination. Nothing is charged when the wallet cannot pay (`WAL-1001`): the number stays in the stock.","operationId":"assignPhoneNumber","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignPhoneNumber"}}}},"responses":{"201":{"description":"The number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumber"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"402":{"description":"`WAL-1001`: the wallet cannot pay the first month.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `voice:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4501`: the number is no longer available.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:write"]},{"oauth2":["voice:write"]}],"summary":"Pick a phone number","tags":["voice"]}},"/v1/phone-numbers/available":{"get":{"description":"Numbers of Rabt’s stock the organization may pick, with their monthly rental in halalas (charged in advance when picked).","operationId":"listAvailablePhoneNumbers","parameters":[{"name":"type","required":false,"in":"query","description":"Only numbers of this type.","schema":{"description":"Only numbers of this type.","type":"string","enum":["geographic","unified_9200","toll_free_800","mobile"]}},{"name":"contains","required":false,"in":"query","description":"Digits the number contains.","schema":{"description":"Digits the number contains.","type":"string","pattern":"^\\d{1,15}$"}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 100).","schema":{"description":"Items per page (1 to 100).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"The available numbers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableNumberList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `voice:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:read"]},{"oauth2":["voice:read"]}],"summary":"Numbers available to pick","tags":["voice"]}},"/v1/phone-numbers/{phoneNumberId}":{"get":{"operationId":"getPhoneNumber","parameters":[{"name":"phoneNumberId","required":true,"in":"path","description":"The phone number id.","schema":{"type":"string","format":"uuid","description":"The phone number id."}}],"responses":{"200":{"description":"The number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumber"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `voice:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4500`: no phone number with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:read"]},{"oauth2":["voice:read"]}],"summary":"A phone number","tags":["voice"]},"patch":{"description":"Its name, its one destination (All, a space or a member), recording and the recording notice, voicemail, and how long members ring and callers wait.","operationId":"updatePhoneNumber","parameters":[{"name":"phoneNumberId","required":true,"in":"path","description":"The phone number id.","schema":{"type":"string","format":"uuid","description":"The phone number id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePhoneNumber"}}}},"responses":{"200":{"description":"The number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumber"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `voice:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4500`: no phone number with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4504`: the number was released.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `VOI-4539`: the member cannot take calls. `SPC-6201`: no such space.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:write"]},{"oauth2":["voice:write"]}],"summary":"Change a phone number","tags":["voice"]}},"/v1/phone-numbers/{phoneNumberId}/release":{"post":{"description":"Final: the number stops taking calls and goes back to Rabt’s stock; its calls and tickets stay. The paid month is not returned (no refunds).","operationId":"releasePhoneNumber","parameters":[{"name":"phoneNumberId","required":true,"in":"path","description":"The phone number id.","schema":{"type":"string","format":"uuid","description":"The phone number id."}}],"responses":{"200":{"description":"The number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumber"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `voice:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4500`: no phone number with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4504`: the number was released.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:write"]},{"oauth2":["voice:write"]}],"summary":"Release a phone number","tags":["voice"]}},"/v1/voice/settings":{"get":{"operationId":"getVoiceSettings","parameters":[],"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `voice:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:read"]},{"oauth2":["voice:read"]}],"summary":"The voice settings","tags":["voice"]},"patch":{"description":"International calling (off by default) with the countries allowed, and the default number outbound calls leave from.","operationId":"updateVoiceSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVoiceSettings"}}}},"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `voice:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4500`: no phone number with this id in your organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:write"]},{"oauth2":["voice:write"]}],"summary":"Change the voice settings","tags":["voice"]}},"/v1/calls":{"get":{"description":"Calls of the tickets you can see, newest first, with their legs, outcome, duration, minutes charged and quality.","operationId":"listCalls","parameters":[{"name":"ticket_id","required":false,"in":"query","description":"Only calls of this ticket.","schema":{"description":"Only calls of this ticket.","type":"string","format":"uuid"}},{"name":"phone_number_id","required":false,"in":"query","description":"Only calls of this number.","schema":{"description":"Only calls of this number.","type":"string","format":"uuid"}},{"name":"direction","required":false,"in":"query","schema":{"type":"string","enum":["inbound","outbound"]}},{"name":"status","required":false,"in":"query","description":"`live` (not ended yet) or `ended`.","schema":{"description":"`live` (not ended yet) or `ended`.","type":"string","enum":["live","ended"]}},{"name":"cursor","required":false,"in":"query","description":"The previous page’s `next_cursor`.","schema":{"description":"The previous page’s `next_cursor`.","type":"string","maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Items per page (1 to 100).","schema":{"description":"Items per page (1 to 100).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `voice:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:read"]},{"oauth2":["voice:read"]}],"summary":"List calls","tags":["voice"]},"post":{"description":"The Call button: checks the destination (international calling, blocked premium ranges, the spending cap per destination and hour, concurrent calls), holds the first minute (the call is prepaid), rings your own device (the softphone or the mobile app), then dials the customer and bridges them when they answer. Each minute is charged as it starts; the call ends with a short prompt when the next minute cannot be paid.","operationId":"startCall","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartCall"}}}},"responses":{"201":{"description":"The call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartedCall"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"402":{"description":"`WAL-1001`: the wallet cannot hold the first minute.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `voice:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4529`: a call is already in progress on this ticket. `VOI-4516`: you have no connected device. `VOI-4511`: too many calls at once.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `VOI-4505`: no number to call from. `VOI-4506`: the customer has no phone number. `VOI-4507` to `VOI-4510`, `VOI-4512`: the destination is not allowed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: voice is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:write"]},{"oauth2":["voice:write"]}],"summary":"Call a customer from a ticket","tags":["voice"]}},"/v1/calls/{callId}":{"get":{"operationId":"getCall","parameters":[{"name":"callId","required":true,"in":"path","description":"The call id.","schema":{"type":"string","format":"uuid","description":"The call id."}}],"responses":{"200":{"description":"The call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `voice:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4513`: no call with this id that you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:read"]},{"oauth2":["voice:read"]}],"summary":"A call","tags":["voice"]}},"/v1/calls/{callId}/transfer":{"post":{"description":"An answered inbound call (outbound calls cannot be transferred) to a space (its members are rung, fewest calls first) or to one member; the caller hears music meanwhile. The member on the call may transfer it; anyone else needs `tickets.assign`.","operationId":"transferCall","parameters":[{"name":"callId","required":true,"in":"path","description":"The call id.","schema":{"type":"string","format":"uuid","description":"The call id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferCall"}}}},"responses":{"200":{"description":"The call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `voice:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4513`: no call with this id that you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4514`: the call is not answered, or already ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `VOI-4539`: the member cannot take calls. `SPC-6201`: no such space.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: voice is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:write"]},{"oauth2":["voice:write"]}],"summary":"Transfer a call","tags":["voice"]}},"/v1/calls/{callId}/hangup":{"post":{"description":"Ends the call on every leg; its minutes are settled. The member on the call may hang it up; anyone else needs `tickets.assign`.","operationId":"hangupCall","parameters":[{"name":"callId","required":true,"in":"path","description":"The call id.","schema":{"type":"string","format":"uuid","description":"The call id."}}],"responses":{"200":{"description":"The call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `voice:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4513`: no call with this id that you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4514`: the call has already ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: voice is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:write"]},{"oauth2":["voice:write"]}],"summary":"Hang up a call","tags":["voice"]}},"/v1/calls/{callId}/recording":{"get":{"description":"A download link valid for five minutes (each access is in the audit log).","operationId":"getCallRecording","parameters":[{"name":"callId","required":true,"in":"path","description":"The call id.","schema":{"type":"string","format":"uuid","description":"The call id."}}],"responses":{"200":{"description":"The link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallMediaLink"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `voice:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4513`: no call with this id that you can see. `VOI-4515`: there is no stored recording.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:read"]},{"oauth2":["voice:read"]}],"summary":"Play a call’s recording","tags":["voice"]}},"/v1/calls/{callId}/voicemail":{"get":{"description":"A download link valid for five minutes (each access is in the audit log).","operationId":"getCallVoicemail","parameters":[{"name":"callId","required":true,"in":"path","description":"The call id.","schema":{"type":"string","format":"uuid","description":"The call id."}}],"responses":{"200":{"description":"The link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallMediaLink"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `voice:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4513`: no call with this id that you can see. `VOI-4515`: there is no stored voicemail.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:read"]},{"oauth2":["voice:read"]}],"summary":"Play a call’s voicemail","tags":["voice"]}},"/v1/voice/softphone-credentials":{"post":{"description":"Time-limited SIP (over secure WebSocket) and TURN credentials for any standard SIP/WebRTC client: the web app’s softphone or a mobile app. Only from inside Saudi Arabia (`VOI-4526`); each check is in the audit log.","operationId":"getSoftphoneCredentials","parameters":[],"responses":{"200":{"description":"The credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SoftphoneCredentials"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`VOI-4526`: the request does not come from Saudi Arabia.\n\n`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `voice:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: voice is not set up on this Rabt.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:write"]},{"oauth2":["voice:write"]}],"summary":"Your softphone credentials","tags":["voice"]}},"/v1/voice/devices":{"get":{"description":"The app installs woken by a push (iOS VoIP push, Android FCM) for your calls.","operationId":"listVoiceDevices","parameters":[],"responses":{"200":{"description":"The devices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceDeviceList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `voice:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:read"]},{"oauth2":["voice:read"]}],"summary":"Your mobile devices for calls","tags":["voice"]},"post":{"description":"A mobile app registers its push token: when you are rung and the app is not connected, Rabt wakes it with a push, waits a short time for it to register, then rings it (else the next member, or voicemail).","operationId":"registerVoiceDevice","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterVoiceDevice"}}}},"responses":{"201":{"description":"The device.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceDevice"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `voice:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:write"]},{"oauth2":["voice:write"]}],"summary":"Register a device for incoming calls","tags":["voice"]}},"/v1/voice/devices/{deviceId}":{"delete":{"description":"It is no longer woken for calls (kept in the audit log).","operationId":"removeVoiceDevice","parameters":[{"name":"deviceId","required":true,"in":"path","description":"The device id.","schema":{"type":"string","format":"uuid","description":"The device id."}}],"responses":{"204":{"description":"Removed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `voice:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4528`: no such device of yours.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["voice:write"]},{"oauth2":["voice:write"]}],"summary":"Remove a device","tags":["voice"]}},"/v1/platform/voice/trunks":{"get":{"description":"Every operator trunk profile by failover priority: the operator’s signaling host, port and transport, the operator addresses allowed to send signaling and media, the codec order, DTMF (always RFC 2833), the caller ID and dialed number formats, the channel limit, and whether it is enabled.","operationId":"listVoiceTrunks","parameters":[],"responses":{"200":{"description":"The trunks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTrunkList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"List the operator trunks","tags":["platform-operations"]},"post":{"description":"Adds an operator trunk profile with the reason (platform audit log `voice_trunk.created`, event `voice.trunk.created`). The voice controller uses it within seconds and the voice nodes allow its addresses within a minute. Digest credentials, when `authentication` is `digest`, are set on the voice nodes (SIP_TRUNK_CREDENTIALS), never here.","operationId":"createVoiceTrunk","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVoiceTrunk"}}}},"responses":{"201":{"description":"The trunk.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTrunk"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4541`: a trunk has this name.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:write"]}],"summary":"Add an operator trunk","tags":["platform-operations"]}},"/v1/platform/voice/trunks/{trunkId}":{"get":{"operationId":"getVoiceTrunk","parameters":[{"name":"trunkId","required":true,"in":"path","description":"The trunk id.","schema":{"type":"string","format":"uuid","description":"The trunk id."}}],"responses":{"200":{"description":"The trunk.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTrunk"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4543`: no operator trunk has this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"Get an operator trunk","tags":["platform-operations"]},"patch":{"description":"Changes a trunk profile (its name never changes) with the reason (platform audit log `voice_trunk.updated` with before and after, event `voice.trunk.updated` naming the fields). Calls in progress keep their trunk; new calls use the change.","operationId":"updateVoiceTrunk","parameters":[{"name":"trunkId","required":true,"in":"path","description":"The trunk id.","schema":{"type":"string","format":"uuid","description":"The trunk id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVoiceTrunk"}}}},"responses":{"200":{"description":"The trunk.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTrunk"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4543`: no operator trunk has this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:write"]}],"summary":"Change an operator trunk","tags":["platform-operations"]}},"/v1/platform/voice/trunks/{trunkId}/disable":{"post":{"description":"Disables a trunk with the reason (platform audit log `voice_trunk.disabled`, event `voice.trunk.disabled`): no new call uses it and the voice nodes stop accepting its addresses; calls in progress on it go on. Trunks are never deleted.","operationId":"disableVoiceTrunk","parameters":[{"name":"trunkId","required":true,"in":"path","description":"The trunk id.","schema":{"type":"string","format":"uuid","description":"The trunk id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTrunkReason"}}}},"responses":{"200":{"description":"The trunk.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTrunk"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4543`: no operator trunk has this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:write"]}],"summary":"Disable an operator trunk","tags":["platform-operations"]}},"/v1/platform/voice/trunks/{trunkId}/enable":{"post":{"description":"Enables a disabled trunk again with the reason (platform audit log `voice_trunk.enabled`, event `voice.trunk.enabled`).","operationId":"enableVoiceTrunk","parameters":[{"name":"trunkId","required":true,"in":"path","description":"The trunk id.","schema":{"type":"string","format":"uuid","description":"The trunk id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTrunkReason"}}}},"responses":{"200":{"description":"The trunk.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTrunk"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4543`: no operator trunk has this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:write"]}],"summary":"Enable an operator trunk","tags":["platform-operations"]}},"/v1/platform/voice/numbers":{"get":{"description":"Every number allocated to Rabt, in id order, with its type, stock status and note, and the organization holding it with its number’s state (active or suspended, and why) and paid rental; never its calls.","operationId":"listPlatformPhoneNumbers","parameters":[{"name":"status","required":false,"in":"query","description":"Only numbers in this stock status.","schema":{"description":"Only numbers in this stock status.","type":"string","enum":["available","assigned","porting","retired"]}},{"name":"type","required":false,"in":"query","description":"Only numbers of this type.","schema":{"description":"Only numbers of this type.","type":"string","enum":["geographic","unified_9200","toll_free_800","mobile"]}},{"name":"contains","required":false,"in":"query","description":"Digits the number contains.","schema":{"description":"Digits the number contains.","type":"string","pattern":"^\\d{1,15}$"}},{"name":"after","required":false,"in":"query","description":"The previous page’s `next_cursor`.","schema":{"description":"The previous page’s `next_cursor`.","type":"string","format":"uuid"}},{"name":"limit","required":false,"in":"query","description":"Numbers per page (1 to 200, default 50).","schema":{"description":"Numbers per page (1 to 200, default 50).","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"A page of the stock.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStockNumberPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:read"]}],"summary":"List Rabt’s stock of phone numbers (platform)","tags":["platform"]},"post":{"description":"Adds up to 500 numbers allocated to Rabt, available at once or `porting` (not offered until put on sale), each written to the platform audit log (`platform.phone_number.stocked`) with the reason. A number already in the stock, in any status, adds nothing (`VOI-4536`).","operationId":"addPlatformPhoneNumbers","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddStockNumbers"}}}},"responses":{"201":{"description":"The numbers added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStockNumberList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4536`: a number is already in the stock (nothing was added).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Add numbers to Rabt’s stock (platform)","tags":["platform"]}},"/v1/platform/voice/numbers/{stockNumberId}":{"get":{"operationId":"getPlatformPhoneNumber","parameters":[{"name":"stockNumberId","required":true,"in":"path","description":"The stock number id.","schema":{"type":"string","format":"uuid","description":"The stock number id."}}],"responses":{"200":{"description":"The number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStockNumber"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4500`: no stock number has this id (or it is not held by an organization).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:read"]}],"summary":"Get a stock number (platform)","tags":["platform"]}},"/v1/platform/voice/numbers/{stockNumberId}/status":{"post":{"description":"An available number becomes `porting` or `retired` (final), a porting number `available`, with the reason (platform audit log `platform.phone_number.stock_status_changed`, before and after). An assigned number changes only through its organization (release) or suspension.","operationId":"setPlatformPhoneNumberStatus","parameters":[{"name":"stockNumberId","required":true,"in":"path","description":"The stock number id.","schema":{"type":"string","format":"uuid","description":"The stock number id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetStockNumberStatus"}}}},"responses":{"200":{"description":"The number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStockNumber"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4500`: no stock number has this id (or it is not held by an organization).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4537`: the number cannot move from its status to this one.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Mark a stock number porting, on sale or retired (platform)","tags":["platform"]}},"/v1/platform/voice/numbers/{stockNumberId}/assign":{"post":{"description":"Gives an available number to an organization as if it picked it: its first month’s rental is charged from the organization’s wallet (`WAL-1001` when it cannot pay: the number stays in the stock), written to the platform audit log (`platform.phone_number.assigned`) with the reason. Answers the organization’s new number.","operationId":"assignPlatformPhoneNumber","parameters":[{"name":"stockNumberId","required":true,"in":"path","description":"The stock number id.","schema":{"type":"string","format":"uuid","description":"The stock number id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignStockNumber"}}}},"responses":{"200":{"description":"The organization’s number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumber"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"402":{"description":"`WAL-1001`: the organization’s balance does not cover the first month.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4500`: no stock number has this id (or it is not held by an organization).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4501`: the number is no longer available.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Give a stock number to an organization (platform)","tags":["platform"]}},"/v1/platform/voice/numbers/{stockNumberId}/suspend":{"post":{"description":"Suspends the number an organization holds with the reason: calls to it are refused (`VOI-4503`) and its rental pauses; the organization is told (`phone_number.suspended`, reason `platform`) and the platform audit log has `platform.phone_number.suspended`. Suspending it again changes nothing.","operationId":"suspendPlatformPhoneNumber","parameters":[{"name":"stockNumberId","required":true,"in":"path","description":"The stock number id.","schema":{"type":"string","format":"uuid","description":"The stock number id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockNumberReason"}}}},"responses":{"200":{"description":"The number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStockNumber"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`VOI-4500`: no stock number has this id (or it is not held by an organization).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4504`: the number was released.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Suspend an organization’s number (platform)","tags":["platform"]}},"/v1/platform/voice/numbers/{stockNumberId}/lift":{"post":{"description":"Lifts a suspension the Rabt team made, with the reason: the number works again (`phone_number.resumed`), or, when its paid month ended meanwhile, waits for its rental to be charged. Platform audit log `platform.phone_number.lifted`.","operationId":"liftPlatformPhoneNumber","parameters":[{"name":"stockNumberId","required":true,"in":"path","description":"The stock number id.","schema":{"type":"string","format":"uuid","description":"The stock number id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockNumberReason"}}}},"responses":{"200":{"description":"The number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStockNumber"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`VOI-4538`: the Rabt team did not suspend this number.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Lift the Rabt team’s suspension of a number (platform)","tags":["platform"]}},"/v1/sms/sender-names":{"get":{"description":"Every sender name of the organization with its registration status and suspension.","operationId":"listSmsSenderNames","parameters":[],"responses":{"200":{"description":"The sender names.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSenderNameList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:read"]},{"oauth2":["sms:read"]}],"summary":"List the sender names","tags":["sms"]},"post":{"description":"Pending until the Rabt platform team registers it with the operators through the unified sender name system; upload its documents next.","operationId":"requestSmsSenderName","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestSmsSenderName"}}}},"responses":{"201":{"description":"The request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SMS-4025`: the name is already requested or registered.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SMS-4024`: the name is not in a valid format for its classification.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:write"]},{"oauth2":["sms:write"]}],"summary":"Request a sender name","tags":["sms"]}},"/v1/sms/sender-names/{id}":{"get":{"description":"With its registration documents and the spam complaints logged against it.","operationId":"getSmsSenderName","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}}],"responses":{"200":{"description":"The sender name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020`: no such sender name in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:read"]},{"oauth2":["sms:read"]}],"summary":"Get a sender name","tags":["sms"]},"patch":{"description":"Its purpose (while pending), or make it the default for SMS from tickets and the API.","operationId":"updateSmsSenderName","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSmsSenderName"}}}},"responses":{"200":{"description":"The sender name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020`: no such sender name in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SMS-4042`: the purpose of a name that is no longer pending.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SMS-4023`: only an approved service name can be the default.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:write"]},{"oauth2":["sms:write"]}],"summary":"Update a sender name","tags":["sms"]}},"/v1/sms/sender-name-documents":{"post":{"description":"A document for the sender name registration (commercial registration, authorization letter, trademark): PDF, PNG or JPEG, at most 5 MB, sent as base64.","operationId":"uploadSmsSenderNameDocument","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadSmsSenderNameDocument"}}}},"responses":{"201":{"description":"The sender name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020`: no such sender name in this organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SMS-4045`: not a PDF, PNG or JPEG of at most 5 MB.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:write"]},{"oauth2":["sms:write"]}],"summary":"Upload a registration document","tags":["sms"]}},"/v1/sms/sender-names/{id}/documents/{documentId}/withdraw":{"post":{"description":"It no longer counts for the registration (the file is kept).","operationId":"withdrawSmsSenderNameDocument","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}},{"name":"documentId","required":true,"in":"path","description":"The document id.","schema":{"type":"string","format":"uuid","description":"The document id."}}],"responses":{"200":{"description":"The sender name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020` or `SMS-4046`: no such sender name or document.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:write"]},{"oauth2":["sms:write"]}],"summary":"Withdraw a registration document","tags":["sms"]}},"/v1/sms/sender-names/{id}/documents/{documentId}/download":{"get":{"operationId":"downloadSmsSenderNameDocument","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}},{"name":"documentId","required":true,"in":"path","description":"The document id.","schema":{"type":"string","format":"uuid","description":"The document id."}}],"responses":{"200":{"description":"The link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsDocumentDownload"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4046`: no such document.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:read"]},{"oauth2":["sms:read"]}],"summary":"A download link for a registration document (valid 5 minutes)","tags":["sms"]}},"/v1/sms/opt-outs":{"get":{"description":"The numbers that get no SMS from the organization, newest first.","operationId":"listSmsOptOuts","parameters":[{"name":"phone","required":false,"in":"query","description":"Only this number (E.164).","schema":{"description":"Only this number (E.164).","type":"string","pattern":"^\\+[1-9]\\d{6,14}$"}},{"name":"include_lifted","required":false,"in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"A page of opt-outs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsOptOutPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:read"]},{"oauth2":["sms:read"]}],"summary":"List the opt-outs","tags":["sms"]},"post":{"description":"The number gets no SMS from the organization (one-time codes it asks for excepted).","operationId":"createSmsOptOut","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSmsOptOut"}}}},"responses":{"201":{"description":"The opt-out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsOptOut"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SMS-4032`: not a valid mobile number.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:write"]},{"oauth2":["sms:write"]}],"summary":"Add a number to the opt-out list","tags":["sms"]}},"/v1/sms/opt-outs/{id}/lift":{"post":{"description":"With the reason (the recipient asked to receive SMS again); the entry is kept.","operationId":"liftSmsOptOut","parameters":[{"name":"id","required":true,"in":"path","description":"The opt-out id.","schema":{"type":"string","format":"uuid","description":"The opt-out id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiftSmsOptOut"}}}},"responses":{"200":{"description":"The opt-out, lifted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsOptOut"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4041`: no such opt-out, or it was lifted already.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:write"]},{"oauth2":["sms:write"]}],"summary":"Take a number off the opt-out list","tags":["sms"]}},"/v1/sms/settings":{"get":{"operationId":"getSmsSettings","parameters":[],"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:read"]},{"oauth2":["sms:read"]}],"summary":"Get the SMS settings","tags":["sms"]},"patch":{"description":"The allowed destination countries and the allowed link domains.","operationId":"updateSmsSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSmsSettings"}}}},"responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSettings"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SMS-4044`: a link domain that is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:write"]},{"oauth2":["sms:write"]}],"summary":"Update the SMS settings","tags":["sms"]}},"/v1/sms/messages":{"get":{"description":"Every SMS of the organization with its status, newest first.","operationId":"listSms","parameters":[{"name":"sender_name_id","required":false,"in":"query","description":"Only SMS under this sender name.","schema":{"description":"Only SMS under this sender name.","type":"string","format":"uuid"}},{"name":"status","required":false,"in":"query","description":"Only SMS in this status.","schema":{"description":"Only SMS in this status.","type":"string","enum":["queued","submitting","submitted","delivered","failed","unknown"]}},{"name":"ticket_id","required":false,"in":"query","description":"Only SMS sent from this ticket.","schema":{"description":"Only SMS sent from this ticket.","type":"string","format":"uuid"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"A page of SMS.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:read"]},{"oauth2":["sms:read"]}],"summary":"List the SMS","tags":["sms"]},"post":{"description":"A service message or a one-time code, under an approved service sender name. Paid from the wallet when an operator accepts it (per segment, by destination); `status` follows with the delivery report (webhook `sms.status_changed`). Report a code as used with `verifySms` (OTP conversion tracking).","operationId":"sendSms","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendSms"}}}},"responses":{"201":{"description":"The SMS, queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SentSms"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The SMS was refused before sending, with its code: `SMS-4021` (not approved), `SMS-4022` (suspended by the platform team), `SMS-4023` (wrong classification), `SMS-4027` (opted out), `SMS-4028`–`SMS-4031`, `SMS-4034` (KSA content rules), `SMS-4032`/`SMS-4033` (number, country), `SMS-4038` (promotional).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. `SMS-4035`–`SMS-4036`: SMS pumping protection.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:write"]},{"oauth2":["sms:write"]}],"summary":"Send an SMS","tags":["sms"]}},"/v1/sms/messages/{id}":{"get":{"description":"With each submitted part and its delivery report.","operationId":"getSms","parameters":[{"name":"id","required":true,"in":"path","description":"The SMS id.","schema":{"type":"string","format":"uuid","description":"The SMS id."}}],"responses":{"200":{"description":"The SMS.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4040`: no such SMS.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:read"]},{"oauth2":["sms:read"]}],"summary":"Get an SMS","tags":["sms"]}},"/v1/sms/messages/{id}/verify":{"post":{"description":"OTP conversion tracking (SMS pumping protection): codes that are sent but never used limit the organization’s code messages (`SMS-4036`).","operationId":"verifySms","parameters":[{"name":"id","required":true,"in":"path","description":"The SMS id.","schema":{"type":"string","format":"uuid","description":"The SMS id."}}],"responses":{"200":{"description":"The SMS.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4040`: no such SMS.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `SMS-4043`: not a one-time code.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:write"]},{"oauth2":["sms:write"]}],"summary":"Report a one-time code as used","tags":["sms"]}},"/v1/sms/preview":{"post":{"description":"Its encoding and parts, and the same checks as sending (sender name, KSA content rules, the number when given).","operationId":"previewSms","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewSms"}}}},"responses":{"200":{"description":"The count.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsPreview"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The SMS was refused before sending, with its code: `SMS-4021` (not approved), `SMS-4022` (suspended by the platform team), `SMS-4023` (wrong classification), `SMS-4027` (opted out), `SMS-4028`–`SMS-4031`, `SMS-4034` (KSA content rules), `SMS-4032`/`SMS-4033` (number, country), `SMS-4038` (promotional).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["sms:read"]},{"oauth2":["sms:read"]}],"summary":"Count and check an SMS without sending it","tags":["sms"]}},"/v1/tickets/{ticketId}/sms":{"post":{"description":"To one of the contact’s mobile numbers, under an approved service sender name: recorded in the ticket’s timeline with its delivery status (SMS is one-way: the customer answers on other channels).","operationId":"sendTicketSms","parameters":[{"name":"ticketId","required":true,"in":"path","description":"The ticket id.","schema":{"type":"string","format":"uuid","description":"The ticket id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTicketSms"}}}},"responses":{"201":{"description":"The SMS, queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketSmsResult"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `tickets.reply` permission. `API-8102`: the API key or app lacks the `tickets:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`TKT-6101`: no such ticket (or not visible to you).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The SMS was refused before sending, with its code: `SMS-4021` (not approved), `SMS-4022` (suspended by the platform team), `SMS-4023` (wrong classification), `SMS-4027` (opted out), `SMS-4028`–`SMS-4031`, `SMS-4034` (KSA content rules), `SMS-4032`/`SMS-4033` (number, country), `SMS-4038` (promotional). `SMS-4039`: not one of the contact’s numbers.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["tickets:write"]},{"oauth2":["tickets:write"]}],"summary":"Send an SMS to the ticket’s contact","tags":["sms"]}},"/v1/platform/sms/sender-names":{"get":{"description":"Newest status change first; filter by status, suspension or organization.","operationId":"listPlatformSmsSenderNames","parameters":[{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["pending","approved","rejected"]}},{"name":"suspended","required":false,"in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"organization_id","required":false,"in":"query","description":"Only this organization’s names.","schema":{"description":"Only this organization’s names.","type":"string","format":"uuid"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"A page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSmsSenderNamePage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:read"]}],"summary":"List every organization’s sender names (platform)","tags":["platform"]}},"/v1/platform/sms/sender-names/{id}":{"get":{"operationId":"getPlatformSmsSenderName","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}}],"responses":{"200":{"description":"The sender name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020`: no such sender name.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:read"]}],"summary":"Get a sender name with its documents and complaints (platform)","tags":["platform"]}},"/v1/platform/sms/sender-names/{id}/documents/{documentId}/download":{"get":{"operationId":"downloadPlatformSmsSenderNameDocument","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}},{"name":"documentId","required":true,"in":"path","description":"The document id.","schema":{"type":"string","format":"uuid","description":"The document id."}}],"responses":{"200":{"description":"The link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsDocumentDownload"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4046`: no such document.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:read"]}],"summary":"A download link for a registration document, valid 5 minutes (platform)","tags":["platform"]}},"/v1/platform/sms/sender-names/{id}/submit":{"post":{"operationId":"submitPlatformSmsSenderName","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}}],"responses":{"200":{"description":"The sender name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020`: no such sender name.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SMS-4042`: not possible from the sender name’s current status.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Record the submission to the operators (platform)","tags":["platform"]}},"/v1/platform/sms/sender-names/{id}/approve":{"post":{"description":"Sending under the name is allowed; the organization is notified.","operationId":"approvePlatformSmsSenderName","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}}],"responses":{"200":{"description":"The sender name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020`: no such sender name.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SMS-4042`: not possible from the sender name’s current status.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Record the operators’ approval (platform)","tags":["platform"]}},"/v1/platform/sms/sender-names/{id}/reject":{"post":{"operationId":"rejectPlatformSmsSenderName","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsPlatformReason"}}}},"responses":{"200":{"description":"The sender name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020`: no such sender name.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SMS-4042`: not possible from the sender name’s current status.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Record the operators’ rejection with its reason (platform)","tags":["platform"]}},"/v1/platform/sms/sender-names/{id}/suspend":{"post":{"description":"Never the organization: SMS under this name are refused (`SMS-4022`) until the suspension is lifted. The organization is notified in the app and by email; the platform audit log keeps the reason.","operationId":"suspendPlatformSmsSenderName","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsPlatformReason"}}}},"responses":{"200":{"description":"The sender name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020`: no such sender name.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SMS-4042`: not possible from the sender name’s current status.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Suspend a sender name, with a mandatory reason (platform)","tags":["platform"]}},"/v1/platform/sms/sender-names/{id}/lift":{"post":{"operationId":"liftPlatformSmsSenderNameSuspension","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsPlatformReason"}}}},"responses":{"200":{"description":"The sender name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSmsSenderNameDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020`: no such sender name.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SMS-4042`: not possible from the sender name’s current status.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Lift a sender name’s suspension, with a mandatory reason (platform)","tags":["platform"]}},"/v1/platform/sms/sender-names/{id}/complaints":{"post":{"description":"From the regulator, an operator or a recipient; append-only.","operationId":"logPlatformSmsComplaint","parameters":[{"name":"id","required":true,"in":"path","description":"The sender name id.","schema":{"type":"string","format":"uuid","description":"The sender name id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogSmsComplaint"}}}},"responses":{"201":{"description":"The complaint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSenderNameComplaint"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.numbers.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_sms:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SMS-4020`: no such sender name.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_sms:write"]}],"summary":"Log a spam complaint against a sender name (platform)","tags":["platform"]}},"/v1/campaigns":{"get":{"description":"Newest first, each with its status and results so far. Needs `campaigns.manage`.","operationId":"listCampaigns","parameters":[{"name":"status","required":false,"in":"query","description":"Only campaigns in this status.","schema":{"description":"Only campaigns in this status.","type":"string","enum":["draft","scheduled","sending","paused","paused_no_balance","completed","cancelled"]}},{"name":"channel_type","required":false,"in":"query","description":"Only campaigns on this channel.","schema":{"description":"Only campaigns on this channel.","type":"string","enum":["whatsapp","sms","voice"]}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Campaigns per page (1 to 100, default 25).","schema":{"default":25,"description":"Campaigns per page (1 to 100, default 25).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of campaigns.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:read"]},{"oauth2":["campaigns:read"]}],"summary":"List the campaigns","tags":["campaigns"]},"post":{"description":"A draft on WhatsApp, SMS or voice: name its audience (a segment), its channel, its content and when to send, now or later. Needs `campaigns.manage`. `client_key` (or `Idempotency-Key`) never creates two.","operationId":"createCampaign","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCampaign"}}}},"responses":{"201":{"description":"The draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6027`, `VOI-4500`, `SMS-4020` or `API-8003`: no such segment, number, sender name or WhatsApp channel.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CAMP-6309`: the time has passed. `CAMP-6322`: too many calls at once. `CAMP-6324`: an unknown variable.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:write"]},{"oauth2":["campaigns:write"]}],"summary":"Create a campaign","tags":["campaigns"]}},"/v1/campaigns/sources":{"get":{"description":"The builder’s choices: the active WhatsApp numbers with their approved marketing templates, the approved promotional sender names (`-AD`) that are not suspended, and the active phone numbers. Ids, names and public template content only. Needs `campaigns.manage` (not `channels.manage`).","operationId":"listCampaignSources","parameters":[],"responses":{"200":{"description":"The sources.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSources"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:read"]},{"oauth2":["campaigns:read"]}],"summary":"List what campaigns can send from","tags":["campaigns"]}},"/v1/campaigns/{campaignId}":{"get":{"description":"With its content and results. Needs `campaigns.manage`.","operationId":"getCampaign","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}}],"responses":{"200":{"description":"The campaign.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:read"]},{"oauth2":["campaigns:read"]}],"summary":"Get a campaign","tags":["campaigns"]},"patch":{"description":"Its name, audience, channel, content or time. Needs `campaigns.manage`.","operationId":"updateCampaign","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCampaign"}}}},"responses":{"200":{"description":"The draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CAMP-6302`: not possible in the campaign’s status (e.g. editing a launched campaign).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CAMP-6309`: the time has passed. `CAMP-6322`: too many calls at once. `CAMP-6324`: an unknown variable.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:write"]},{"oauth2":["campaigns:write"]}],"summary":"Update a draft campaign","tags":["campaigns"]},"delete":{"description":"It is no longer listed; it is kept (Rabt never deletes). Launched campaigns cannot be removed: cancel them. Needs `campaigns.manage`.","operationId":"removeCampaign","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}}],"responses":{"204":{"description":"Removed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CAMP-6302`: not possible in the campaign’s status (e.g. editing a launched campaign).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:write"]},{"oauth2":["campaigns:write"]}],"summary":"Remove a draft campaign","tags":["campaigns"]}},"/v1/campaigns/{campaignId}/audio":{"post":{"description":"A WAV file (PCM, at most 5 MB and five minutes), sent as base64: the message its calls play. Needs `campaigns.manage`.","operationId":"uploadCampaignAudio","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadCampaignAudio"}}}},"responses":{"200":{"description":"The draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CAMP-6302`: not possible in the campaign’s status (e.g. editing a launched campaign). Only voice drafts take audio.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CAMP-6311`: not a PCM WAV file of at most 5 MB and five minutes.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: object storage is not configured.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:write"]},{"oauth2":["campaigns:write"]}],"summary":"Add a voice campaign’s recording","tags":["campaigns"]}},"/v1/campaigns/{campaignId}/speech":{"post":{"description":"Turns its `speech_text` into the message its calls play, in its `speech_voice`. Text to speech is paid from the wallet (the same text and voice are never paid twice). Needs `campaigns.send`.","operationId":"createCampaignSpeech","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"The draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"402":{"description":"`WAL-1001`: the wallet’s balance cannot pay for it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.send` permission. `API-8102`: the API key or app lacks the `campaigns:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CAMP-6302`: not possible in the campaign’s status (e.g. editing a launched campaign). Only voice drafts take speech.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CAMP-6303`: no speech text. `CAMP-6312`: the text is too long.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: text to speech (OpenAI) or object storage is not configured.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:write"]},{"oauth2":["campaigns:write"]}],"summary":"Create a voice campaign’s speech","tags":["campaigns"]}},"/v1/campaigns/{campaignId}/audio/download":{"get":{"description":"Needs `campaigns.manage`.","operationId":"getCampaignAudioLink","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}}],"responses":{"200":{"description":"The link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignAudioLink"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `CAMP-6307`: the campaign has no audio.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: object storage is not configured.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:read"]},{"oauth2":["campaigns:read"]}],"summary":"A link to listen to a voice campaign’s audio (valid 5 minutes)","tags":["campaigns"]}},"/v1/campaigns/{campaignId}/review":{"get":{"description":"Who it would send to after the automatic exclusions (no consent, opted out, no address, duplicates, suppressed, destinations not allowed), the estimated cost from the rate card (nothing is reserved) and the compliance checks. Needs `campaigns.manage`.","operationId":"reviewCampaign","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}}],"responses":{"200":{"description":"The review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignReview"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CAMP-6302`: not possible in the campaign’s status (e.g. editing a launched campaign).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:read"]},{"oauth2":["campaigns:read"]}],"summary":"Review a draft before launch","tags":["campaigns"]}},"/v1/campaigns/{campaignId}/launch":{"post":{"description":"Every check must pass. The recipients are snapshot (later CRM changes do not affect it) and it sends now or at its time, each recipient paid from the wallet as it is sent. Needs `campaigns.send`.","operationId":"launchCampaign","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LaunchCampaign"}}}},"responses":{"200":{"description":"The campaign.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.send` permission. `API-8102`: the API key or app lacks the `campaigns:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CAMP-6302`: not possible in the campaign’s status (e.g. editing a launched campaign). `WAL-1113`: the prices changed since the review.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The first failed check, with its code: `CAMP-6303` (something missing), `CAMP-6304`/`CAMP-6305` (the WhatsApp template), `CAMP-6306` (the sender name), `CAMP-6307` (no audio), `CAMP-6308` (no one to send to), `CAMP-6309` (the time has passed), `CAMP-6320` (audience too large), `CAMP-6324` (unknown variable).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:write"]},{"oauth2":["campaigns:write"]}],"summary":"Launch a campaign","tags":["campaigns"]}},"/v1/campaigns/{campaignId}/pause":{"post":{"description":"A sending or scheduled campaign stops until it is resumed. Needs `campaigns.send`.","operationId":"pauseCampaign","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}}],"responses":{"200":{"description":"The campaign.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.send` permission. `API-8102`: the API key or app lacks the `campaigns:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CAMP-6302`: not possible in the campaign’s status (e.g. editing a launched campaign).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:write"]},{"oauth2":["campaigns:write"]}],"summary":"Pause a campaign","tags":["campaigns"]}},"/v1/campaigns/{campaignId}/resume":{"post":{"description":"From where it stopped (one the wallet stopped: after a top-up). Needs `campaigns.send`.","operationId":"resumeCampaign","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}}],"responses":{"200":{"description":"The campaign.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.send` permission. `API-8102`: the API key or app lacks the `campaigns:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CAMP-6302`: not possible in the campaign’s status (e.g. editing a launched campaign).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:write"]},{"oauth2":["campaigns:write"]}],"summary":"Resume a paused campaign","tags":["campaigns"]}},"/v1/campaigns/{campaignId}/cancel":{"post":{"description":"The recipients not reached yet are not sent to; the campaign, its recipients and results stay. Needs `campaigns.send`.","operationId":"cancelCampaign","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}}],"responses":{"200":{"description":"The campaign.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `campaigns.send` permission. `API-8102`: the API key or app lacks the `campaigns:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`CAMP-6302`: not possible in the campaign’s status (e.g. editing a launched campaign).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:write"]},{"oauth2":["campaigns:write"]}],"summary":"Cancel a campaign","tags":["campaigns"]}},"/v1/campaigns/{campaignId}/recipients":{"get":{"description":"In sending order, each with its status (the excluded ones with their reason). Needs `campaigns.manage`.","operationId":"listCampaignRecipients","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}},{"name":"status","required":false,"in":"query","description":"Only recipients in this status.","schema":{"description":"Only recipients in this status.","type":"string","enum":["pending","excluded","sending","sent","delivered","read","failed","replied","opted_out"]}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},{"name":"limit","required":false,"in":"query","description":"Recipients per page (1 to 200, default 50).","schema":{"default":50,"description":"Recipients per page (1 to 200, default 50).","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"A page of recipients.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignRecipientPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:read"]},{"oauth2":["campaigns:read"]}],"summary":"List a campaign’s recipients","tags":["campaigns"]}},"/v1/campaigns/{campaignId}/recipients/{recipientId}":{"get":{"description":"Needs `campaigns.manage`.","operationId":"getCampaignRecipient","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign id.","schema":{"type":"string","format":"uuid","description":"The campaign id."}},{"name":"recipientId","required":true,"in":"path","description":"The recipient id.","schema":{"type":"string","format":"uuid","description":"The recipient id."}}],"responses":{"200":{"description":"The recipient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignRecipient"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your role lacks the `campaigns.manage` permission. `API-8102`: the API key or app lacks the `campaigns:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CAMP-6301`: no such campaign (or a draft that was removed). `CAMP-6323`: no such recipient in it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["campaigns:read"]},{"oauth2":["campaigns:read"]}],"summary":"Get a campaign recipient","tags":["campaigns"]}},"/v1/contacts/{contactId}/consents":{"get":{"description":"On each campaign channel now, and every change with its proof, newest first (merged contacts’ included).","operationId":"listContactConsents","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}}],"responses":{"200":{"description":"The consent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactConsents"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `API-8102`: the API key or app lacks the `contacts:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"summary":"A contact’s marketing consent","tags":["campaigns"]},"post":{"description":"An opt-in with its proof (docs/14 \"proof required\"), or an opt-out the contact asked for, on one campaign channel. Kept with the others (never replaced); audited. Needs `contacts.edit`.","operationId":"recordContactConsent","parameters":[{"name":"contactId","required":true,"in":"path","description":"The contact id.","schema":{"type":"string","format":"uuid","description":"The contact id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordConsent"}}}},"responses":{"201":{"description":"The consent change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Consent"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `contacts.edit` permission. `API-8102`: the API key or app lacks the `contacts:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`CRM-6001`: no such contact.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["contacts:write"]},{"oauth2":["contacts:write"]}],"summary":"Record a contact’s marketing consent","tags":["campaigns"]}},"/v1/public/campaign-opt-outs/{code}":{"get":{"description":"Public (the recipient has no Rabt account): the sender name the SMS came under, whether the recipient already opted out, and the language to show the page in.","operationId":"getCampaignOptOut","parameters":[{"name":"code","required":true,"in":"path","description":"The code of the opt-out link (10 letters and digits).","schema":{"type":"string","maxLength":40,"description":"The code of the opt-out link (10 letters and digits)."}}],"responses":{"200":{"description":"The page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignOptOutPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"404":{"description":"`CAMP-6313`: the opt-out link is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"The opt-out page of a campaign SMS","tags":["campaigns"]},"post":{"description":"Public: the recipient confirms on the opt-out page. Honored at once: no later SMS campaign of the organization reaches them until they opt in again with proof. Repeating it changes nothing.","operationId":"optOutOfCampaign","parameters":[{"name":"code","required":true,"in":"path","description":"The code of the opt-out link (10 letters and digits).","schema":{"type":"string","maxLength":40,"description":"The code of the opt-out link (10 letters and digits)."}}],"responses":{"200":{"description":"The confirmation page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignOptOutPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"404":{"description":"`CAMP-6313`: the opt-out link is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Opt out of a sender’s campaign SMS","tags":["campaigns"]}},"/v1/channels":{"get":{"description":"Every connected channel of every type and every web chat widget, with its status, error, number, addresses and sender names (the Channels page).","operationId":"listConnectedChannels","parameters":[{"name":"type","required":false,"in":"query","description":"Only these channel types (repeat the parameter for several).","schema":{"description":"Only these channel types (repeat the parameter for several).","anyOf":[{"$ref":"#/components/schemas/ChannelType"},{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/ChannelType"}}]}},{"name":"status","required":false,"in":"query","description":"Only these statuses; without it, every channel that is not disconnected.","schema":{"description":"Only these statuses; without it, every channel that is not disconnected.","anyOf":[{"$ref":"#/components/schemas/ConnectedChannelStatus"},{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/ConnectedChannelStatus"}}]}}],"responses":{"200":{"description":"The channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedChannelList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"List the connected channels","tags":["channels"]}},"/v1/channels/{channelId}":{"get":{"operationId":"getConnectedChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The channel id, or the web chat widget id.","schema":{"type":"string","format":"uuid","description":"The channel id, or the web chat widget id."}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6211`: no channel or widget with this id in the organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:read"]},{"oauth2":["channels:read"]}],"summary":"A connected channel","tags":["channels"]}},"/v1/channels/{channelId}/disconnect":{"post":{"description":"Disconnects a channel of any type (or removes a web chat widget) exactly as its own page does: its credentials revoked, its subscriptions at the provider removed, audited. Final: connecting again makes a new channel.","operationId":"disconnectConnectedChannel","parameters":[{"name":"channelId","required":true,"in":"path","description":"The channel id, or the web chat widget id.","schema":{"type":"string","format":"uuid","description":"The channel id, or the web chat widget id."}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedChannel"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your role lacks the `channels.manage` permission. `API-8102`: the API key or app lacks the `channels:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SPC-6211`: no channel or widget with this id in the organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["channels:write"]},{"oauth2":["channels:write"]}],"summary":"Disconnect a channel","tags":["channels"]}},"/v1/platform/me":{"get":{"description":"Your platform role and permissions in the Rabt platform organization, and until when sensitive actions are allowed (a code entered within the last 10 minutes).","operationId":"getPlatformAccess","parameters":[],"responses":{"200":{"description":"The access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAccess"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: you hold no platform role (platform organization only). `API-8102`: the API key or app lacks the `platform_team:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_team:read"]}],"summary":"Get your platform access","tags":["platform"]}},"/v1/platform/reauthentication/code":{"post":{"description":"Sensitive platform actions made with an API key need a code entered for that key within the last 10 minutes (`AUTH-1013`). Sends one to the key's member (their email or verified phone). A member's session re-authenticates with `POST /v1/auth/reauthentication/code` instead (`API-8103` here).","operationId":"requestPlatformReauthenticationCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformReauthenticationCodeRequest"}}}},"responses":{"202":{"description":"The code was sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSentCode"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: you hold no platform role (platform organization only). `API-8102`: the API key or app lacks the `platform_team:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1019`: `sms` was asked but the account has no verified phone.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). The provider refused the destination: `AUTH-1030` the email address, `AUTH-1033` the phone number.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits, each in its own window (wait `Retry-After` seconds): `AUTH-1008` too many codes for this email or phone within an hour; `AUTH-1009` a code was sent to it less than a minute ago; `AUTH-1010` too many code requests or wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"502":{"description":"`AUTH-1999`: the email or SMS provider failed with an error Rabt has no specific code for yet (the provider's own code is in the details). `SYS-1007`: the provider could not be reached.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"`SYS-1001`: sending by email or SMS is not configured. `SYS-1003`: it is switched off for now. `SYS-1005`: the provider is failing and calls to it are paused. `AUTH-1031`, `AUTH-1034`: the provider refused Rabt's account or settings. `AUTH-1032`, `AUTH-1035`: the provider is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"504":{"description":"`SYS-1006`: the email or SMS provider did not answer in time.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_team:read"]}],"summary":"Send a code to re-authenticate an API key","tags":["platform"]}},"/v1/platform/reauthentication":{"post":{"description":"Checks the code sent for this API key: sensitive platform actions made with it are allowed for the next 10 minutes. The check is written to the platform audit log.","operationId":"reauthenticatePlatformKey","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformReauthentication"}}}},"responses":{"200":{"description":"Verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformVerified"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1005`: the code is wrong (the text says how many attempts are left). `AUTH-1006`: no valid code (expired after 5 minutes, used, or replaced by a newer one). `AUTH-1007`: the code was cancelled after 5 wrong attempts.\n\n`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: you hold no platform role (platform organization only). `API-8102`: the API key or app lacks the `platform_team:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1019`: `sms` was asked but the account has no verified phone.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds. Code limits (wait `Retry-After` seconds): `AUTH-1010` too many wrong codes from this network; `AUTH-1011` this email or phone is paused after too many wrong codes, for this network (or, after wrong codes from many networks, for everyone), each pause twice as long as the last.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_team:read"]}],"summary":"Re-authenticate an API key with a code","tags":["platform"]}},"/v1/platform/roles":{"get":{"description":"The platform roles (the fixed platform owner role first) and how many hold each.","operationId":"listPlatformRoles","parameters":[],"responses":{"200":{"description":"The roles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformRoleList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: you hold no platform role (platform organization only). `API-8102`: the API key or app lacks the `platform_team:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_team:read"]}],"summary":"List the platform roles","tags":["platform"]},"post":{"description":"A platform role from the platform permission keys (platform owner).","operationId":"createPlatformRole","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlatformRole"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformRole"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1063`: only the platform owner manages the platform team. `AUTH-1013`: a sensitive action; no code was entered within the last 10 minutes. Re-authenticate (a session: `POST /v1/auth/reauthentication`; an API key: `POST /v1/platform/reauthentication`), then repeat the request. `API-8102`: the API key or app lacks the `platform_team:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1049`: a platform role with this name already exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_team:write"]}],"summary":"Create a platform role","tags":["platform"]}},"/v1/platform/roles/{roleId}":{"patch":{"description":"Its name or its permissions (platform owner); never the platform owner role's.","operationId":"updatePlatformRole","parameters":[{"name":"roleId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePlatformRole"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformRole"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1063`: only the platform owner manages the platform team. `AUTH-1013`: a sensitive action; no code was entered within the last 10 minutes. Re-authenticate (a session: `POST /v1/auth/reauthentication`; an API key: `POST /v1/platform/reauthentication`), then repeat the request. `API-8102`: the API key or app lacks the `platform_team:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1047`: no platform role with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1064`: the platform owner role is fixed. `AUTH-1049`: a platform role with this name already exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_team:write"]}],"summary":"Edit a platform role","tags":["platform"]},"delete":{"description":"Removes a platform role no member holds (platform owner; kept in the records, never deleted).","operationId":"removePlatformRole","parameters":[{"name":"roleId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemovePlatformRole"}}}},"responses":{"204":{"description":"Removed.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1063`: only the platform owner manages the platform team. `AUTH-1013`: a sensitive action; no code was entered within the last 10 minutes. Re-authenticate (a session: `POST /v1/auth/reauthentication`; an API key: `POST /v1/platform/reauthentication`), then repeat the request. `API-8102`: the API key or app lacks the `platform_team:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1047`: no platform role with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1064`: the platform owner role is fixed. `AUTH-1048`: members hold the role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_team:write"]}],"summary":"Remove a platform role","tags":["platform"]}},"/v1/platform/team":{"get":{"description":"The members of the Rabt platform organization and their platform roles.","operationId":"listPlatformTeam","parameters":[],"responses":{"200":{"description":"The team.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformTeam"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: you hold no platform role (platform organization only). `API-8102`: the API key or app lacks the `platform_team:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_team:read"]}],"summary":"List the platform team","tags":["platform"]}},"/v1/platform/team/{membershipId}/platform-role":{"put":{"description":"Gives a member of the Rabt organization a platform role, or takes it away with `null` (platform owner). Never the platform owner role.","operationId":"setPlatformRole","parameters":[{"name":"membershipId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPlatformRole"}}}},"responses":{"200":{"description":"Set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformTeamMember"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1063`: only the platform owner manages the platform team. `AUTH-1013`: a sensitive action; no code was entered within the last 10 minutes. Re-authenticate (a session: `POST /v1/auth/reauthentication`; an API key: `POST /v1/platform/reauthentication`), then repeat the request. `API-8102`: the API key or app lacks the `platform_team:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`AUTH-1046`: no member of the platform organization with this id. `AUTH-1047`: no platform role with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`AUTH-1064`: the platform owner role is fixed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_team:write"]}],"summary":"Set a member's platform role","tags":["platform"]}},"/v1/platform/organizations":{"get":{"description":"Every organization, newest first, with its owner, billing state, seats, wallet balance and usage this month (halalas).","operationId":"listPlatformOrganizations","parameters":[{"name":"search","required":false,"in":"query","description":"Part of the name, the short name or the owner's email.","schema":{"description":"Part of the name, the short name or the owner's email.","type":"string","minLength":1,"maxLength":200}},{"name":"status","required":false,"in":"query","description":"Only organizations in this billing state.","schema":{"description":"Only organizations in this billing state.","type":"string","enum":["trial","active","seats_inactive"]}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 200, default 50).","schema":{"default":50,"description":"Entries per page (1 to 200, default 50).","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"A page of organizations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformOrganizationPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.orgs.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_organizations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: the cursor is not one this list returned.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:read"]}],"summary":"Search and list the organizations","tags":["platform"]}},"/v1/platform/organizations/{organizationId}":{"get":{"description":"Its summary, subscription and trial, channel counts, usage this month by service (selling price and cost) and abuse limits.","operationId":"getPlatformOrganization","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformOrganization"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.orgs.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_organizations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1112`: no organization with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:read"]}],"summary":"Get an organization","tags":["platform"]}},"/v1/platform/organizations/{organizationId}/wallet/transactions":{"get":{"description":"The organization's ledger, newest first (its wallet history).","operationId":"listPlatformOrganizationWalletTransactions","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Transactions per page (1 to 100, default 50).","schema":{"default":50,"description":"Transactions per page (1 to 100, default 50).","type":"integer","minimum":1,"maximum":100}},{"name":"type","required":false,"in":"query","description":"Only transactions of this type.","schema":{"description":"Only transactions of this type.","type":"string","enum":["top_up","usage_debit","seat_charge","adjustment","hold","hold_release"]}}],"responses":{"200":{"description":"A page of transactions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletTransactionPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.orgs.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_organizations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1112`: no organization with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1006`: the cursor is not one this list returned.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:read"]}],"summary":"List an organization's wallet transactions","tags":["platform"]}},"/v1/platform/organizations/{organizationId}/wallet/manual-entries":{"post":{"description":"A credit (adds to the balance) or a debit (takes from it, never below zero), with a description shown to the customer, an optional external reference and an internal note (platform only). Numbered `MN-YYYY-NNNNNN`; never edited or deleted: correct a mistake with an opposite entry naming the original (`corrects_entry_id`). Rabt has no refunds: this is how a balance is corrected. Written to the platform audit log; the organization sees it in its wallet history and receives `wallet.manual_entry_added`. The same `Idempotency-Key` returns the same entry. A sensitive action: needs a code entered within the last 10 minutes.","operationId":"createManualWalletEntry","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}},{"name":"Idempotency-Key","in":"header","description":"A key of your choice for this top-up (letters, digits and `. _ : - /`, at most 200 characters). Retrying with the same key returns the same top-up and never charges twice.","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:/-]{0,199}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateManualWalletEntry"}}}},"responses":{"201":{"description":"The entry. A repeated Idempotency-Key answers the first entry with the same status and `Idempotent-Replayed: true`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualWalletEntry"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.orgs.manage` permission (platform organization only). `AUTH-1013`: a sensitive action; no code was entered within the last 10 minutes. Re-authenticate (a session: `POST /v1/auth/reauthentication`; an API key: `POST /v1/platform/reauthentication`), then repeat the request. `API-8102`: the API key or app lacks the `platform_organizations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1112`: no organization with this id. `WAL-1015`: the entry to correct is not this organization's.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1014`: a debit beyond the available balance. `WAL-1016`: a correction in the same direction as the original, or beyond what remains of it. `WAL-1002`: the Idempotency-Key was used for another entry.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:write"]}],"summary":"Add a manual entry to an organization's wallet","tags":["platform"]},"get":{"description":"Newest first, with the internal note and how much of each later entries corrected.","operationId":"listManualWalletEntries","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 100, default 50).","schema":{"default":50,"description":"Entries per page (1 to 100, default 50).","type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of entries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualWalletEntryPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.orgs.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_organizations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1112`: no organization with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: the cursor is not one this list returned.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:read"]}],"summary":"List an organization's manual wallet entries","tags":["platform"]}},"/v1/platform/organizations/{organizationId}/wallet/manual-entries/{entryId}":{"get":{"description":"One entry of the organization, with its internal note.","operationId":"getManualWalletEntry","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}},{"name":"entryId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The entry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualWalletEntry"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.orgs.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_organizations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1112`: no organization with this id. `WAL-1015`: no manual entry with this id in the organization.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:read"]}],"summary":"Get a manual wallet entry","tags":["platform"]}},"/v1/platform/organizations/{organizationId}/limits":{"get":{"description":"Concurrent calls, SMS per minute and auto top-ups per day (the defaults until set).","operationId":"getOrganizationLimits","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The limits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationLimits"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.orgs.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_organizations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1112`: no organization with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:read"]}],"summary":"Get an organization's abuse limits","tags":["platform"]},"put":{"description":"All three limits at once, with a reason. A sensitive action: needs a code entered within the last 10 minutes.","operationId":"setOrganizationLimits","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetOrganizationLimits"}}}},"responses":{"200":{"description":"Set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationLimits"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.orgs.manage` permission (platform organization only). `AUTH-1013`: a sensitive action; no code was entered within the last 10 minutes. Re-authenticate (a session: `POST /v1/auth/reauthentication`; an API key: `POST /v1/platform/reauthentication`), then repeat the request. `API-8102`: the API key or app lacks the `platform_organizations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1112`: no organization with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:write"]}],"summary":"Set an organization's abuse limits","tags":["platform"]}},"/v1/platform/organizations/{organizationId}/markup-overrides":{"get":{"description":"The override in force per service, and every entry (they apply to new events only).","operationId":"listMarkupOverrides","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The overrides.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkupOverrides"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.orgs.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_organizations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:read"]}],"summary":"List an organization's markup overrides","tags":["platform"]}},"/v1/platform/organizations/{organizationId}/markup-overrides/{service}":{"put":{"description":"The organization's markup for one service (null removes it), for new events from now on. A sensitive action: needs a code entered within the last 10 minutes.","operationId":"setMarkupOverride","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}},{"name":"service","required":true,"in":"path","description":"The service.","schema":{"type":"string","enum":["whatsapp","x","sms","voice","ai","email"],"description":"The service."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetMarkupOverride"}}}},"responses":{"200":{"description":"Set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkupOverride"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.orgs.manage` permission (platform organization only). `AUTH-1013`: a sensitive action; no code was entered within the last 10 minutes. Re-authenticate (a session: `POST /v1/auth/reauthentication`; an API key: `POST /v1/platform/reauthentication`), then repeat the request. `API-8102`: the API key or app lacks the `platform_organizations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1112`: no organization with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1103`: the markup is not a valid percentage.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`WAL-1114`: usage being priced held the pricing lock too long (retryable).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:write"]}],"summary":"Set or remove a markup override","tags":["platform"]}},"/v1/platform/organizations/{organizationId}/trial-extension":{"post":{"description":"Moves the end of the trial later (only while the organization is in its trial).","operationId":"extendTrial","parameters":[{"name":"organizationId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtendTrial"}}}},"responses":{"200":{"description":"Extended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtendedTrial"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.orgs.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_organizations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1404`: the organization is not in its trial, or the new end is not later.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:write"]}],"summary":"Extend an organization's trial","tags":["platform"]}},"/v1/platform/audit-log":{"get":{"description":"Every platform action (who, what, before and after, reason, address, API key), newest first; append-only.","operationId":"listPlatformAuditLog","parameters":[{"name":"action","required":false,"in":"query","description":"Only this action.","schema":{"description":"Only this action.","type":"string","minLength":1,"maxLength":100}},{"name":"target_type","required":false,"in":"query","description":"Only this target type.","schema":{"description":"Only this target type.","type":"string","minLength":1,"maxLength":100}},{"name":"target_id","required":false,"in":"query","description":"Only this target.","schema":{"description":"Only this target.","type":"string","minLength":1,"maxLength":200}},{"name":"membership_id","required":false,"in":"query","description":"Only this member.","schema":{"description":"Only this member.","type":"string","format":"uuid"}},{"name":"from","required":false,"in":"query","description":"Entries at or after this time.","schema":{"description":"Entries at or after this time.","type":"string","format":"date-time"}},{"name":"to","required":false,"in":"query","description":"Entries at or before this time.","schema":{"description":"Entries at or before this time.","type":"string","format":"date-time"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 200, default 50).","schema":{"default":50,"description":"Entries per page (1 to 200, default 50).","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"A page of entries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAuditPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.audit.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_audit:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: the cursor is not one this list returned.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_audit:read"]}],"summary":"Read the platform audit log","tags":["platform"]}},"/v1/platform/pricing/versions":{"get":{"description":"Every version (published, drafts, discarded drafts), newest first, and the one in effect now.","operationId":"listRateCardVersions","parameters":[],"responses":{"200":{"description":"The versions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCardVersionList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.pricing.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_pricing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_pricing:read"]}],"summary":"List the rate-card versions","tags":["platform"]}},"/v1/platform/pricing/versions/{versionId}":{"get":{"description":"One row per billable item: cost, currency, cost in SAR, markup, selling price and profit per unit.","operationId":"getRateCard","parameters":[{"name":"versionId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"responses":{"200":{"description":"The rate card.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCard"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.pricing.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_pricing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1109`: no rate-card version with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_pricing:read"]}],"summary":"Get a rate-card version with its pricing table","tags":["platform"]}},"/v1/platform/pricing/drafts":{"post":{"description":"Copies the latest published version (or the one named, or starts empty with settings). One draft at a time.","operationId":"createRateCardDraft","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRateCardDraft"}}}},"responses":{"201":{"description":"The draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCard"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.pricing.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_pricing:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1108`: a draft is already open.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1103`: a value is not valid (the problem names it).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_pricing:write"]}],"summary":"Start a rate-card draft","tags":["platform"]}},"/v1/platform/pricing/drafts/{versionId}":{"patch":{"description":"The USD→SAR rate, the FX buffer, the default markup or the note of a draft.","operationId":"updateRateCardDraft","parameters":[{"name":"versionId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRateCardDraft"}}}},"responses":{"200":{"description":"The draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCard"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.pricing.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_pricing:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1109`: no rate-card version with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1105`: the version is not an open draft (published versions never change; a discarded draft stays discarded).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1103`: a value is not valid (the problem names it).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_pricing:write"]}],"summary":"Change a draft's settings","tags":["platform"]}},"/v1/platform/pricing/drafts/{versionId}/items":{"post":{"description":"One billable item (metric and dimensions) with its cost, currency and markup or fixed price; replaces the item with the same key.","operationId":"putRateCardItem","parameters":[{"name":"versionId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutRateCardItem"}}}},"responses":{"200":{"description":"The draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCard"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.pricing.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_pricing:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1109`: no rate-card version with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1105`: the version is not an open draft (published versions never change; a discarded draft stays discarded).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1103`: a value is not valid (the problem names it). `WAL-1106`: a fixed price below the cost.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_pricing:write"]}],"summary":"Add or change an item of a draft","tags":["platform"]}},"/v1/platform/pricing/drafts/{versionId}/items/removal":{"post":{"description":"The item stops being priced from the version that publishes this draft.","operationId":"removeRateCardItem","parameters":[{"name":"versionId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveRateCardItem"}}}},"responses":{"200":{"description":"The draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCard"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.pricing.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_pricing:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1109`: no rate-card version with this id. `WAL-1110`: the draft has no such item.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1105`: the version is not an open draft (published versions never change; a discarded draft stays discarded).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_pricing:write"]}],"summary":"Take an item out of a draft","tags":["platform"]}},"/v1/platform/pricing/drafts/{versionId}/discard":{"post":{"description":"The draft is kept, marked discarded; it is never published.","operationId":"discardRateCardDraft","parameters":[{"name":"versionId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscardRateCardDraft"}}}},"responses":{"200":{"description":"Discarded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCardVersion"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.pricing.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_pricing:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1109`: no rate-card version with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1105`: the version is not an open draft (published versions never change; a discarded draft stays discarded).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_pricing:write"]}],"summary":"Discard a draft","tags":["platform"]}},"/v1/platform/pricing/drafts/{versionId}/publish":{"post":{"description":"The draft becomes the next version, effective now or at a future time; usage is priced with the version valid when it happened. A sensitive action: needs a code entered within the last 10 minutes.","operationId":"publishRateCardDraft","parameters":[{"name":"versionId","required":true,"in":"path","description":"The id.","schema":{"type":"string","format":"uuid","description":"The id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRateCardDraft"}}}},"responses":{"200":{"description":"Published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCardVersion"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.pricing.manage` permission (platform organization only). `AUTH-1013`: a sensitive action; no code was entered within the last 10 minutes. Re-authenticate (a session: `POST /v1/auth/reauthentication`; an API key: `POST /v1/platform/reauthentication`), then repeat the request. `API-8102`: the API key or app lacks the `platform_pricing:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`WAL-1109`: no rate-card version with this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`WAL-1105`: the version is not an open draft (published versions never change; a discarded draft stays discarded).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1103`: a value is not valid (the problem names it). `WAL-1107`: the effective time is in the past. `WAL-1111`: the draft has no items.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`WAL-1114`: usage being priced held the pricing lock too long (retryable).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_pricing:write"]}],"summary":"Publish a draft","tags":["platform"]}},"/v1/platform/plans":{"get":{"description":"Every version of every plan: seat price per month, trial length and member limit.","operationId":"listPlans","parameters":[],"responses":{"200":{"description":"The plans.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlanList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.pricing.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_pricing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_pricing:read"]}],"summary":"List the fixed prices (plans)","tags":["platform"]},"post":{"description":"A new seat price, trial length or member limit, used from the next charge on (past charges keep theirs). A sensitive action: needs a code entered within the last 10 minutes.","operationId":"publishPlan","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishPlatformPlan"}}}},"responses":{"201":{"description":"Published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformPlan"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.pricing.manage` permission (platform organization only). `AUTH-1013`: a sensitive action; no code was entered within the last 10 minutes. Re-authenticate (a session: `POST /v1/auth/reauthentication`; an API key: `POST /v1/platform/reauthentication`), then repeat the request. `API-8102`: the API key or app lacks the `platform_pricing:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `WAL-1403`: a value of the plan is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_pricing:write"]}],"summary":"Publish a new plan version","tags":["platform"]}},"/v1/platform/overview":{"get":{"description":"Organizations by billing state, paid seats, seat revenue and usage sales, cost, profit and margin this month, the total of wallet balances (what Rabt owes its customers), and what needs attention: reconciliation mismatches, failed auto top-ups, sender names waiting, failed webhook events.","operationId":"getPlatformOverview","parameters":[],"responses":{"200":{"description":"The overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformOverview"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.orgs.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_organizations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_organizations:read"]}],"summary":"Get the platform overview","tags":["platform"]}},"/v1/platform/invoices":{"get":{"description":"Newest month first, with totals (halalas), e-invoicing status and email status; filter by month, state, e-invoicing status and organization.","operationId":"listPlatformInvoices","parameters":[{"name":"month","required":false,"in":"query","description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","schema":{"description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},{"name":"status","required":false,"in":"query","description":"Only invoices in this state.","schema":{"description":"Only invoices in this state.","type":"string","enum":["draft","finalized","empty"]}},{"name":"einvoice_status","required":false,"in":"query","description":"Only invoices with this e-invoicing status.","schema":{"description":"Only invoices with this e-invoicing status.","type":"string","enum":["pending","submitted","accepted","rejected"]}},{"name":"organization_id","required":false,"in":"query","description":"Only this organization.","schema":{"description":"Only this organization.","type":"string","format":"uuid"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 200, default 50).","schema":{"default":50,"description":"Entries per page (1 to 200, default 50).","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"A page of invoices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformInvoicePage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.billing.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: a filter or the cursor is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_billing:read"]}],"summary":"List every organization's monthly invoices","tags":["platform"]}},"/v1/platform/invoices/csv":{"get":{"description":"The invoices of the same filters, one row each, headers in the member's language (UTF-8; amounts in SAR with two decimals).","operationId":"exportPlatformInvoices","parameters":[{"name":"month","required":false,"in":"query","description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","schema":{"description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},{"name":"status","required":false,"in":"query","description":"Only invoices in this state.","schema":{"description":"Only invoices in this state.","type":"string","enum":["draft","finalized","empty"]}},{"name":"einvoice_status","required":false,"in":"query","description":"Only invoices with this e-invoicing status.","schema":{"description":"Only invoices with this e-invoicing status.","type":"string","enum":["pending","submitted","accepted","rejected"]}},{"name":"organization_id","required":false,"in":"query","description":"Only this organization.","schema":{"description":"Only this organization.","type":"string","format":"uuid"}}],"responses":{"200":{"description":"The CSV.","content":{"text/csv":{"schema":{"type":"string"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.billing.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: a filter or the cursor is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_billing:read"]}],"summary":"Export the invoices (CSV)","tags":["platform"]}},"/v1/platform/receipt-vouchers":{"get":{"description":"Newest first; filter by month of issue and organization.","operationId":"listPlatformReceiptVouchers","parameters":[{"name":"month","required":false,"in":"query","description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","schema":{"description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},{"name":"organization_id","required":false,"in":"query","description":"Only this organization.","schema":{"description":"Only this organization.","type":"string","format":"uuid"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 200, default 50).","schema":{"default":50,"description":"Entries per page (1 to 200, default 50).","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"A page of receipt vouchers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformReceiptVoucherPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.billing.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: a filter or the cursor is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_billing:read"]}],"summary":"List every receipt voucher","tags":["platform"]}},"/v1/platform/receipt-vouchers/csv":{"get":{"description":"The receipt vouchers of the same filters, one row each, headers in the member's language.","operationId":"exportPlatformReceiptVouchers","parameters":[{"name":"month","required":false,"in":"query","description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","schema":{"description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},{"name":"organization_id","required":false,"in":"query","description":"Only this organization.","schema":{"description":"Only this organization.","type":"string","format":"uuid"}}],"responses":{"200":{"description":"The CSV.","content":{"text/csv":{"schema":{"type":"string"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.billing.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: a filter or the cursor is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_billing:read"]}],"summary":"Export the receipt vouchers (CSV)","tags":["platform"]}},"/v1/platform/failed-payments":{"get":{"description":"Card top-ups (manual and automatic) that failed, newest first, with the error's code and reference and the gateway's own code and message. A seat renewal the wallet could not pay puts its organization in the `seats_inactive` state (the organizations list filters by it).","operationId":"listPlatformFailedPayments","parameters":[{"name":"month","required":false,"in":"query","description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","schema":{"description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},{"name":"kind","required":false,"in":"query","description":"Only manual or automatic top-ups.","schema":{"description":"Only manual or automatic top-ups.","type":"string","enum":["manual","auto"]}},{"name":"organization_id","required":false,"in":"query","description":"Only this organization.","schema":{"description":"Only this organization.","type":"string","format":"uuid"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 200, default 50).","schema":{"default":50,"description":"Entries per page (1 to 200, default 50).","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"A page of failed top-ups.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformFailedTopUpPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.billing.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: a filter or the cursor is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_billing:read"]}],"summary":"List the failed payments","tags":["platform"]}},"/v1/platform/failed-payments/csv":{"get":{"description":"The failed top-ups of the same filters, one row each, headers in the member's language.","operationId":"exportPlatformFailedPayments","parameters":[{"name":"month","required":false,"in":"query","description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","schema":{"description":"Only this calendar month (Asia/Riyadh), `YYYY-MM`.","type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},{"name":"kind","required":false,"in":"query","description":"Only manual or automatic top-ups.","schema":{"description":"Only manual or automatic top-ups.","type":"string","enum":["manual","auto"]}},{"name":"organization_id","required":false,"in":"query","description":"Only this organization.","schema":{"description":"Only this organization.","type":"string","format":"uuid"}}],"responses":{"200":{"description":"The CSV.","content":{"text/csv":{"schema":{"type":"string"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.billing.view` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_billing:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: a filter or the cursor is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_billing:read"]}],"summary":"Export the failed payments (CSV)","tags":["platform"]}},"/v1/platform/operations/queues":{"get":{"description":"Every job queue (the lanes, the worker pools and the event consumers) with its waiting, active, delayed and dead jobs and how long the next job has waited.","operationId":"listPlatformQueues","parameters":[],"responses":{"200":{"description":"The queues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformQueueList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Redis or the platform database is not configured.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"List the queues","tags":["platform"]}},"/v1/platform/operations/dead-letters":{"get":{"description":"Jobs that failed for good, most recent failure first: name, organization, tries, the last error (code and reference) and when. Never the payload.","operationId":"listPlatformDeadLetters","parameters":[{"name":"queue","required":true,"in":"query","description":"A queue name, e.g. `jobs.standard` or `events.billing-seat-reactivation`.","schema":{"type":"string","pattern":"^[a-z][a-z0-9.-]{0,99}$","description":"A queue name, e.g. `jobs.standard` or `events.billing-seat-reactivation`."}},{"name":"start","required":false,"in":"query","description":"How many dead jobs to skip (most recent failure first).","schema":{"default":0,"description":"How many dead jobs to skip (most recent failure first).","type":"integer","minimum":0,"maximum":100000}},{"name":"count","required":false,"in":"query","description":"How many dead jobs to return.","schema":{"default":50,"description":"How many dead jobs to return.","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"A page of dead jobs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformDeadLetterPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Redis or the platform database is not configured.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"List a queue's dead jobs","tags":["platform"]}},"/v1/platform/operations/dead-letters/replay":{"post":{"description":"Puts the dead job back in its queue with all its tries, once: `failed_at` names the failure replayed, so a second click or a second operator never runs it twice. The reason is written to the platform audit log with the job's last error.","operationId":"replayPlatformDeadLetter","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayDeadLetter"}}}},"responses":{"200":{"description":"The outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformReplay"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Redis or the platform database is not configured.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:write"]}],"summary":"Replay a dead job","tags":["platform"]}},"/v1/platform/operations/providers":{"get":{"description":"Every external provider (Meta, X, TikTok, Tap, OpenAI, SMPP, SIP and the others) with its adapters' kill switches, the provider errors recorded in the last hour and day, and the last one's code and reference.","operationId":"listPlatformProviderHealth","parameters":[],"responses":{"200":{"description":"The providers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderHealthList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"Get provider health","tags":["platform"]}},"/v1/platform/operations/reconciliation":{"get":{"description":"Every mismatch the wallet reconciliation recorded (WAL-1007 balance, WAL-1008 held total, WAL-1009 sequence, WAL-1010 hold, WAL-1011 counter), newest first, with its reference and organization.","operationId":"listPlatformReconciliationMismatches","parameters":[{"name":"organization_id","required":false,"in":"query","description":"Only this organization.","schema":{"description":"Only this organization.","type":"string","format":"uuid"}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 200, default 50).","schema":{"default":50,"description":"Entries per page (1 to 200, default 50).","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"A page of mismatches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconciliationMismatchPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: a filter or the cursor is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"List the wallet reconciliation mismatches","tags":["platform"]}},"/v1/platform/operations/sms-routes":{"get":{"description":"The SMS gateway's operator routes as it last reported them (every 10 seconds): priority (the next one is the failover), bound or not, current rate and SMPP sessions. `reported` is false when the gateway has not reported for 30 seconds.","operationId":"getPlatformSmsRoutes","parameters":[],"responses":{"200":{"description":"The routes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsGatewayRoutes"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: Redis or the platform database is not configured.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"Get the SMS operator routes","tags":["platform"]}},"/v1/platform/problems":{"get":{"description":"Every error or rejection users saw (server errors, provider rejections, browser failures), grouped into problems (same code, place and cause), most recently seen first, with counts, affected organizations and members, the trend and the status.","operationId":"listPlatformProblems","parameters":[{"name":"status","required":false,"in":"query","description":"Only problems in this status.","schema":{"description":"Only problems in this status.","type":"string","enum":["new","investigating","resolved"]}},{"name":"kind","required":false,"in":"query","description":"Only problems raised by the servers, a provider or browsers.","schema":{"description":"Only problems raised by the servers, a provider or browsers.","type":"string","enum":["server","provider","browser"]}},{"name":"code","required":false,"in":"query","description":"Only problems of this error code, e.g. `WA-2047`.","schema":{"description":"Only problems of this error code, e.g. `WA-2047`.","type":"string","pattern":"^[A-Z]{1,5}-\\d{4}$"}},{"name":"q","required":false,"in":"query","description":"Part of the code, place or cause.","schema":{"description":"Part of the code, place or cause.","type":"string","minLength":1,"maxLength":100}},{"name":"cursor","required":false,"in":"query","description":"The `next_cursor` of the previous page.","schema":{"description":"The `next_cursor` of the previous page.","type":"string","minLength":1,"maxLength":200}},{"name":"limit","required":false,"in":"query","description":"Entries per page (1 to 200, default 50).","schema":{"default":50,"description":"Entries per page (1 to 200, default 50).","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"A page of problems.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_problems:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format). `API-8001`: a filter or the cursor is not valid.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_problems:read"]}],"summary":"List the problems","tags":["platform"]}},"/v1/platform/problems/{problemId}":{"get":{"description":"One problem: counts, occurrences per day of the last 30 days, releases, the organizations most affected and the latest sample references.","operationId":"getPlatformProblem","parameters":[{"name":"problemId","required":true,"in":"path","description":"The problem.","schema":{"type":"string","format":"uuid","description":"The problem."}}],"responses":{"200":{"description":"The problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_problems:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SYS-1303`: no problem has this ID.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_problems:read"]}],"summary":"Get a problem","tags":["platform"]}},"/v1/platform/problems/{problemId}/investigation":{"get":{"description":"The problem as text for Claude Code (H08): code and title, place, cause, counts, releases, sample references, the error code page and the runbooks.","operationId":"getPlatformProblemInvestigation","parameters":[{"name":"problemId","required":true,"in":"path","description":"The problem.","schema":{"type":"string","format":"uuid","description":"The problem."}}],"responses":{"200":{"description":"The text.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemInvestigation"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_problems:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SYS-1303`: no problem has this ID.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_problems:read"]}],"summary":"Copy a problem for investigation","tags":["platform"]}},"/v1/platform/problems/{problemId}/status":{"post":{"description":"New, investigating or resolved, with an optional note, written to the platform audit log. A resolved problem that happens again reopens by itself (regression).","operationId":"changePlatformProblemStatus","parameters":[{"name":"problemId","required":true,"in":"path","description":"The problem.","schema":{"type":"string","format":"uuid","description":"The problem."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeProblemStatus"}}}},"responses":{"200":{"description":"The problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_problems:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SYS-1303`: no problem has this ID.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SYS-1304`: the problem already has this status.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_problems:write"]}],"summary":"Change a problem's status","tags":["platform"]}},"/health":{"get":{"description":"Answers as long as the server process runs, whatever the state of its dependencies. Not rate limited.","operationId":"getHealth","parameters":[],"responses":{"200":{"description":"The process is running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Liveness","tags":["operations"]}},"/ready":{"get":{"description":"Whether this server can serve requests now: its database and Redis answer within their time limits and it is not shutting down. Not rate limited.","operationId":"getReadiness","parameters":[],"responses":{"200":{"description":"Ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ready"}}}},"503":{"description":"Not ready: `SYS-1002` the database cannot be reached, `SYS-1011` Redis cannot be reached, `SYS-1012` the server is shutting down. `checks` has the result of each check.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ReadinessProblem"}}}},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Readiness","tags":["operations"]}},"/v1/errors/{code}":{"get":{"description":"What an error code means: its texts in Arabic and English (title, cause, what to do), HTTP status, whether it is retryable, and the provider codes that map to it. Every error Rabt returns has a code (`code` in problem+json) documented here.","operationId":"getErrorCode","parameters":[{"name":"code","required":true,"in":"path","description":"The error code, e.g. `WA-2047`.","schema":{"type":"string","pattern":"^([A-Z]{1,5})-(\\d{4})$","description":"An error code: module letters, a hyphen and 4 digits.","example":"WA-2047"}}],"responses":{"200":{"description":"The error code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCode"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"404":{"description":"`API-8021`: the catalog has no such code.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Get an error code","tags":["errors"]}},"/v1/client-errors":{"post":{"description":"Used by Rabt's own apps: errors a member's browser raised or showed (page crashes, files that did not load, unhandled failures, requests that got no answer), each with its code, reference, release, page and cause. Recorded in the error log (the member's organization when the request names one they belong to) and in the Rabt team's Problems log. Values are removed from pages and causes before they are kept.","operationId":"reportClientErrors","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientErrorReports"}}}},"responses":{"202":{"description":"The reports were recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientErrorReceipt"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Report errors that happened in the browser","tags":["errors"]}},"/v1/status":{"get":{"description":"The public status of Rabt: each status page component with its state (from the worst open incident naming it), the open incidents and those resolved in the last 14 days with their updates in Arabic and English, and the degraded modes switched on (`read_only`: changes are refused with `SYS-1070`; `outbound_hold`: outbound messages wait queued; `non_essential_off`: search answers `SYS-1071`). No sign-in needed. Cached for 15 seconds.","operationId":"getStatus","parameters":[],"responses":{"200":{"description":"The status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicStatus"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1002`: the status cannot be read now (the database is unreachable).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Get the platform status","tags":["status"]}},"/v1/platform/degraded-modes":{"get":{"description":"Each degraded mode and whether it is on: `read_only` (changes by members, API keys and apps are refused with `SYS-1070`), `outbound_hold` (outbound messages stay queued and visible as pending, sent when it is switched back), `non_essential_off` (search, AI and analytics answer `SYS-1071`). `source` is `switch` (set here) or `environment` (the DEGRADED_MODES break-glass variable).","operationId":"listDegradedModes","parameters":[],"responses":{"200":{"description":"The modes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DegradedModeList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"List the degraded modes","tags":["platform-operations"]}},"/v1/platform/degraded-modes/{mode}":{"put":{"description":"Switches a degraded mode on or off for the whole platform, with the reason (platform audit log `platform_flag.set`). Every server applies it within seconds. A mode on in the DEGRADED_MODES environment variable stays on until that variable is removed.","operationId":"setDegradedMode","parameters":[{"name":"mode","required":true,"in":"path","schema":{"type":"string","enum":["read_only","outbound_hold","non_essential_off"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetDegradedMode"}}}},"responses":{"200":{"description":"The mode now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DegradedMode"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:write"]}],"summary":"Switch a degraded mode","tags":["platform-operations"]}},"/v1/platform/switches":{"get":{"description":"The owner rules of the Operations page (docs/22 \"Platform switches\"): `calls_ksa_only` (Calls only inside Saudi Arabia, default on: softphone registration, outbound calls and inbound rings check the member is inside the Kingdom; off, the checks are still logged and nothing is refused). `warning` is true while a switch is in a state the console shows a permanent warning banner for. Every platform role can read them.","operationId":"listPlatformSwitches","parameters":[],"responses":{"200":{"description":"The switches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSwitchList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: you hold no platform role (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"List the platform switches","tags":["platform-operations"]}},"/v1/platform/switches/{name}":{"put":{"description":"Platform owner only, with a fresh verification code (a key first calls `/v1/platform/reauthentication`) and a mandatory reason; written to the platform audit log (`platform_flag.set`, target `feature:<name>`). Every server applies it within seconds.","operationId":"setPlatformSwitch","parameters":[{"name":"name","required":true,"in":"path","schema":{"type":"string","enum":["calls_ksa_only"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPlatformSwitch"}}}},"responses":{"200":{"description":"The switch now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSwitch"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1063`: only the platform owner manages the platform team. `AUTH-1013`: a sensitive action; no code was entered within the last 10 minutes. Re-authenticate (a session: `POST /v1/auth/reauthentication`; an API key: `POST /v1/platform/reauthentication`), then repeat the request. `API-8102`: the API key or app lacks the `platform_operations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:write"]}],"summary":"Turn a platform switch on or off","tags":["platform-operations"]}},"/v1/platform/incidents":{"get":{"description":"Incidents newest first, with their public updates; `open=true` for open ones only.","operationId":"listIncidents","parameters":[{"name":"open","required":false,"in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":200}},{"name":"limit","required":false,"in":"query","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of incidents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentPage"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"List status page incidents","tags":["platform-operations"]},"post":{"description":"Opens an incident on the public status page with its first update in Arabic and English (docs/runbooks/incident-response.md has the templates; the first update is due within 15 minutes of the start). With `show_in_app` (default) members see it in the in-app banner while it is open. Platform audit log: `status_incident.opened`.","operationId":"openIncident","parameters":[{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenIncident"}}}},"responses":{"201":{"description":"The incident.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Incident"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:write"]}],"summary":"Open a status page incident","tags":["platform-operations"]}},"/v1/platform/incidents/{incidentId}":{"get":{"operationId":"getIncident","parameters":[{"name":"incidentId","required":true,"in":"path","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The incident.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Incident"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SYS-1080`: no incident has this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"Get an incident with its updates","tags":["platform-operations"]},"patch":{"description":"Changes the title, impact, severity, components or banner of an open incident, with the reason (platform audit log `status_incident.changed`).","operationId":"changeIncident","parameters":[{"name":"incidentId","required":true,"in":"path","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeIncident"}}}},"responses":{"200":{"description":"The incident.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Incident"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SYS-1080`: no incident has this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SYS-1081`: the incident is resolved (final).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:write"]}],"summary":"Change an open incident","tags":["platform-operations"]}},"/v1/platform/incidents/{incidentId}/updates":{"post":{"description":"Posts a public update in Arabic and English with the incident's new stage; `resolved` resolves it (final). Platform audit log: `status_incident.updated` or `status_incident.resolved`.","operationId":"postIncidentUpdate","parameters":[{"name":"incidentId","required":true,"in":"path","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","description":"A unique key for this operation (e.g. a UUID, 1 to 255 visible characters), kept 24 hours: repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`) instead of doing it again. Errors: `API-8109` (400) a key that is not valid, `API-8108` (409, retryable) the first request with this key is still running, `API-8107` (422) the key was used for a different request; `API-8118` (409) the first request created something whose secret is shown only once, so its answer is not repeated.","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostIncidentUpdate"}}}},"responses":{"201":{"description":"The incident.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Incident"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1003`: your seat was deactivated (view only). `AUTH-1004`: all seats are inactive because the seat charge was not paid (view only). `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:write` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"`SYS-1080`: no incident has this id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"`SYS-1081`: the incident is resolved (final).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:write"]}],"summary":"Post an incident update","tags":["platform-operations"]}},"/v1/platform/slos":{"get":{"description":"Each SLO with its objective, the last 30 days (events, share of the error budget left) and the burn rates of its alert rules (page when both 1 h and its short window burn ≥ 14.4×; page when both 6 h and its short window burn ≥ 6×; ticket when both 3 d and its short window burn ≥ 1×).","operationId":"listSlos","parameters":[],"responses":{"200":{"description":"The SLOs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SloList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"List the SLOs and their error budgets","tags":["platform-operations"]}},"/v1/platform/synthetic-checks":{"get":{"description":"Each check (a test message into the test organization every 5 minutes) with its latest run (outcome, duration, error code and reference) and its outcomes over the last 24 hours.","operationId":"listSyntheticChecks","parameters":[],"responses":{"200":{"description":"The checks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyntheticCheckList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the platform database login (PLATFORM_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"List the synthetic end-to-end checks","tags":["platform-operations"]}},"/v1/platform/api-versions":{"get":{"description":"Every provider API version Rabt uses, with its end of life from the API version calendar and its alert: `end_of_life_soon` (within 90 days, `days` left), `end_of_life_passed` (`days` negative) or `unknown_version` (not in the calendar).","operationId":"listApiVersions","parameters":[],"responses":{"200":{"description":"The versions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiVersionList"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"List the provider API versions in use","tags":["platform-operations"]}},"/v1/platform/references/{reference}":{"get":{"description":"Everything recorded under one reference (the `ref_…` an error surface shows, the trace ID): the error log rows with their code, organization, place, provider error, release and process; the affected organizations; and the rows of the same trace in stored webhooks, outbound messages and webhook deliveries, domain events, synthetic checks and system email (their processing columns only, never customer content). Empty lists when nothing was recorded under it (another environment, or never recorded).","operationId":"lookupReference","parameters":[{"name":"reference","required":true,"in":"path","description":"The reference an error surface shows, e.g. ref_4bf92f3577b34da6a3ce929d0e0e4736.","schema":{"type":"string","pattern":"^ref_[0-9a-f]{32}$","description":"The reference an error surface shows, e.g. ref_4bf92f3577b34da6a3ce929d0e0e4736."}}],"responses":{"200":{"description":"The trace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceTrace"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the investigation database login (READONLY_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"Trace an error reference","tags":["platform-operations"]}},"/v1/platform/error-codes/{code}/occurrences":{"get":{"description":"How often an error code occurred in a period (default: the last 24 hours, at most 90 days), across organizations: the affected organizations, the releases and processes that recorded it, and the newest references. With `release`, only that release’s occurrences: after a fix is deployed, the new release’s count shows whether it stopped.","operationId":"listCodeOccurrences","parameters":[{"name":"code","required":true,"in":"path","description":"The error code, e.g. WA-2047.","schema":{"type":"string","pattern":"^([A-Z]{1,5})-(\\d{4})$","description":"The error code, e.g. WA-2047."}},{"name":"since","required":false,"in":"query","description":"Start of the period (ISO 8601); default: 24 hours before `until`.","schema":{"description":"Start of the period (ISO 8601); default: 24 hours before `until`.","type":"string","format":"date-time"}},{"name":"until","required":false,"in":"query","description":"End of the period (ISO 8601); default: now.","schema":{"description":"End of the period (ISO 8601); default: now.","type":"string","format":"date-time"}},{"name":"release","required":false,"in":"query","description":"Only occurrences recorded by this release, e.g. v1.4.2+a1b2c3d.","schema":{"description":"Only occurrences recorded by this release, e.g. v1.4.2+a1b2c3d.","type":"string","pattern":"^v\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?\\+(?:[0-9a-f]{7}|local)$"}}],"responses":{"200":{"description":"The occurrences.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeOccurrences"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the investigation database login (READONLY_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"Count the occurrences of an error code","tags":["platform-operations"]}},"/v1/platform/errors":{"get":{"description":"Every error code recorded in a period (default: the last 24 hours, at most 90 days), most occurrences first, with how many organizations each touched; with `release`, one release’s only. What changed after a deploy, and the error rate the deploy pipeline watches.","operationId":"summarizeErrors","parameters":[{"name":"since","required":false,"in":"query","description":"Start of the period (ISO 8601); default: 24 hours before `until`.","schema":{"description":"Start of the period (ISO 8601); default: 24 hours before `until`.","type":"string","format":"date-time"}},{"name":"until","required":false,"in":"query","description":"End of the period (ISO 8601); default: now.","schema":{"description":"End of the period (ISO 8601); default: now.","type":"string","format":"date-time"}},{"name":"release","required":false,"in":"query","description":"Only occurrences recorded by this release, e.g. v1.4.2+a1b2c3d.","schema":{"description":"Only occurrences recorded by this release, e.g. v1.4.2+a1b2c3d.","type":"string","pattern":"^v\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?\\+(?:[0-9a-f]{7}|local)$"}}],"responses":{"200":{"description":"The summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorSummary"}}},"headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"`AUTH-1041`: no organization was named (send its id in the `Rabt-Organization` header).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"`AUTH-1001`: not signed in, or the session has ended. `API-8101`: the API key or access token is not valid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"`AUTH-1040`: you are not a member of the organization named. `AUTH-1002`: your platform role lacks the `platform.ops.manage` permission (platform organization only). `API-8102`: the API key or app lacks the `platform_operations:read` scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"`SYS-1001`: the investigation database login (READONLY_DATABASE_URL) is not set on this server.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"$ref":"#/components/responses/Problem"}},"security":[{"session":[],"organization":[]},{"apiKey":["platform_operations:read"]}],"summary":"Summarize the errors of a period","tags":["platform-operations"]}}},"info":{"title":"Rabt API","description":"The public REST API of Rabt (rabt.systems): the Rabt apps use the same API.\n\n- **Versions** are in the path (`/v1`); breaking changes only come in a new version.\n- **JSON** in UTF-8; times in ISO 8601, UTC.\n- **Errors** are RFC 9457 problem details (`application/problem+json`) with a stable `code`, documented at `docs_url` and by `GET /v1/errors/{code}`, and a `reference` unique to the occurrence: quote it to Rabt support. Texts follow `Accept-Language` (`ar`, the default, or `en`).\n- **Rate limits** apply per client address to every request, then per API key and per organization, per signed-in account outside an organization, or per client address without any of them, and are returned in the `RateLimit` and `RateLimit-Policy` headers. Sending and checking sign-in codes have limits of their own (per email or phone, per network).\n- **Signing in** is by a one-time code sent by email or SMS; the session is an `HttpOnly`, `Secure`, `SameSite=Strict` cookie. Requests that change something with the cookie, and sign-in requests, must come from a Rabt web page (their `Origin`), or they are refused (`AUTH-1014`).\n- **Organizations**: a request made in an organization names it with the `Rabt-Organization` header (its id). Permissions are checked on every request against your membership there: your role (`AUTH-1002`), and your seat (an inactive seat can only view: `AUTH-1003`, `AUTH-1004`).\n- **Integrations** call the same routes with `Authorization: Bearer <credential>`: an API key of the organization (`rbk_…`) or an OAuth access token (`rbat_…`, authorization code with PKCE; metadata at `/.well-known/oauth-authorization-server`). A credential acts as the member who created or authorized it, in its organization, limited to its scopes and to that member's current permissions; routes without a scope are refused to credentials (`API-8103`), a missing scope is `API-8102`. Changes appear in the audit log under the key or app.\n- **Idempotency**: operations that create or send accept an `Idempotency-Key` header; repeating the request with the same key returns the first answer (`Idempotent-Replayed: true`).\n- **MCP**: the same capabilities are tools and resources of the MCP server at `/mcp` (Streamable HTTP), with the same credentials; **webhooks** send the public events to your endpoints, signed per Standard Webhooks.","version":"1.0.0","contact":{}},"tags":[{"name":"auth","description":"Signing in with one-time codes, sessions and devices, re-authentication."},{"name":"account","description":"The signed-in person's account: profile, sign-in phone and email, deletion."},{"name":"organizations","description":"Your organizations, creating one, switching the active one, its settings and ownership."},{"name":"members","description":"The members of the organization: roles, seats, removal."},{"name":"roles","description":"Roles and their permissions."},{"name":"invitations","description":"Inviting people, and answering an invitation."},{"name":"audit","description":"The audit log of the organization."},{"name":"errors","description":"Rabt's error codes explained, and the organization's error log."},{"name":"billing","description":"Seats and their billing: the subscription, the seat log, the price of a seat; the monthly invoices, their credit and debit notes and the billing profile."},{"name":"wallet","description":"The prepaid wallet's balance and transactions, the public price list, price quotes, card top-ups, auto top-up and receipt vouchers."},{"name":"contacts","description":"Contacts: their details, companies, notes, merges and history."},{"name":"companies","description":"Companies: their email domains, notes and merges."},{"name":"tags","description":"The tags of contacts, companies and tickets."},{"name":"custom-fields","description":"The custom fields of contacts, companies and tickets."},{"name":"crm-settings","description":"The settings of the CRM."},{"name":"segments","description":"Segments: saved filters of contacts or companies, and what they list now."},{"name":"imports-exports","description":"CSV imports of contacts (checked row by row before they start) and CSV exports of contacts and companies, with their progress and error files."},{"name":"tickets","description":"Tickets: the ticket log, the timeline, replies and notes, files, assignment, moving to a space, merging, following, ticket types and settings."},{"name":"replies","description":"Canned replies (the organization’s, the spaces’ and your own)."},{"name":"spaces","description":"Department spaces: their members and channels, email addresses and voice numbers."},{"name":"routing","description":"The address routing page: every connected address, account, channel and chat widget with its one destination (the All space, a space or a member)."},{"name":"availability","description":"Members' availability and its log, who is available now, and the limits of open tickets for the automatic distribution."},{"name":"ai","description":"The AI agent: its knowledge (Markdown blocks at every level: organization, channel, private/public, address), the AI switches of every level, what it receives for a ticket, the switch that stops it everywhere, the log of its replies, and the questions it could not answer (grouped, with Add to knowledge)."},{"name":"chat","description":"Internal chat: your rooms (space groups, All, private groups, direct messages), messages with mentions, ticket cards, quotes, reactions, edits and pins, read positions, search, files and Ask the team."},{"name":"search","description":"Universal search: one query over the tickets, messages, internal notes, contacts, companies, their notes and your chat messages you may see."},{"name":"channels","description":"Connected channels: email addresses connected by forwarding, with replies through your own SMTP server (the forwarding check and the sender domain checks); Google Workspace / Gmail mailboxes connected by signing in with Google (their send-as addresses and sync); TikTok business accounts (direct messages and comments), their reply rules and comment actions; App Store channels connected with an App Store Connect API key, with their apps; Google Play channels connected with a service account key, with their apps and how current their reviews are; Google Maps reviews connected by signing in with Google (the business locations each channel carries); Facebook Pages connected through Facebook Login for Business (their webhook subscription); Instagram professional accounts connected through Facebook Login or Instagram Login; what each channel supports; the status of Meta data deletion requests."},{"name":"reviews","description":"Store reviews (App Store, Google Play, Google Maps): each review is a ticket; read a review with its rating, app or location and version, and its public reply with the reply's state on the store; delete a reply (not on Google Play: its replies are deleted in Play Console)."},{"name":"integrations","description":"Integrations: stores connected by signing in to their platform (Salla, Zid, Shopify), their status and syncs, a contact's customer records and orders in them, and the order lookup."},{"name":"notifications","description":"Your notifications and their preferences, and the browsers that receive push notifications (with a session)."},{"name":"webchat","description":"Website chat widgets: allowed domains, appearance, the pre-chat form, the embed snippet and the identity-verification secret."},{"name":"webhooks","description":"Webhook endpoints, the public event types, and the delivery log."},{"name":"api-keys","description":"The organization's API keys (managed with a session)."},{"name":"oauth","description":"The OAuth 2.1 authorization server: authorization, consent, tokens."},{"name":"oauth-apps","description":"OAuth apps registered by the organization (managed with a session)."},{"name":"installed-apps","description":"Apps authorized in the organization (managed with a session)."},{"name":"platform","description":"The Rabt team's platform console (docs/22): the overview, organizations, abuse limits, markup overrides, trials, pricing and fixed prices, invoices and payments, SMS sender names, operations (queues and dead jobs, provider health, reconciliation, SMS operator routes), the platform team and the platform audit log. Members of the Rabt organization with a platform role, or its API keys with platform scopes."},{"name":"operations","description":"Probes for the platform that runs the API."},{"name":"status","description":"Rabt's public status: the status page's components, incidents and the degraded modes switched on."},{"name":"platform-operations","description":"The platform's operations, for the Rabt team (platform organization, `platform.ops.manage`): degraded modes, status page incidents, SLOs, synthetic checks, the API version calendar, the operator trunks, and incident investigation (error references, code occurrences and error summaries, read only)."}],"servers":[{"url":"https://api.rabt.systems"}],"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"__Secure-rabt.session_token","description":"The sign-in session cookie set by `POST /v1/auth/sign-in` (the one sign-in field: an email address or a phone number), `/v1/auth/sign-in/email` or `/v1/auth/sign-in/phone` (`rabt.session_token` in local development over HTTP)."},"organization":{"type":"apiKey","in":"header","name":"Rabt-Organization","description":"The id of the organization the request acts in (the active organization), with the session of one of its members."},"apiKey":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"An API key of the organization (`rbk_…`), created by a member with `api.manage`; it acts as that member, limited to its scopes. Each operation names the scope it needs."},"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://api.rabt.systems/v1/oauth/authorize","tokenUrl":"https://api.rabt.systems/v1/oauth/token","refreshUrl":"https://api.rabt.systems/v1/oauth/token","scopes":{"organization:read":"Read the organization's settings (name, language, time zone, country), its tags and custom fields, the CRM settings, the ticket types, the ticket settings and the email signatures.","organization:write":"Change the organization's settings, its tags and custom fields, the CRM settings, the ticket types, the ticket settings and the email signatures.","members:read":"Read the members, the roles and their permissions, and the invitations.","members:write":"Invite people, change roles and seats, remove members, and manage custom roles (only within the permissions of the member who granted access).","contacts:read":"Read and search the contacts, their notes, their merge history and a contact's communication history.","contacts:write":"Create, edit and delete contacts, their phone numbers, email addresses, company links and notes, and merge or unmerge contacts.","segments:read":"Read the segments (saved filters of contacts and companies) and how many records each lists.","segments:write":"Create, change and delete segments.","imports_exports:read":"Read the CSV imports and exports of contacts and companies, their progress and errors, and download exported files.","imports_exports:write":"Import contacts from CSV files and export contacts and companies to CSV files.","companies:read":"Read and search the companies, their notes and their merge history.","companies:write":"Create, edit and delete companies, their email domains and notes, and merge or unmerge companies.","tickets:read":"Read the tickets the member may see, their timelines (messages, internal notes, files), their followers, and the store reviews they hold with their public replies.","tickets:write":"Start, edit, pick up, close, assign and merge tickets, reply to customers (on WhatsApp also with templates, locations, contact cards, reactions and the typing indicator; and to store reviews), delete a public reply to a store review, add internal notes and files, retry failed messages, and follow tickets.","replies:read":"Read the canned replies (the organization's, the spaces' and the connected member's own).","replies:write":"Create, change and delete canned replies (only within the permissions of the member who granted access).","audit:read":"Read the audit log.","error_log:read":"Read the organization's error log (every recorded error with its code and reference).","billing:read":"Read the seats and their billing (the subscription, the seat log), price one more seat, and read the monthly invoices (with their PDF and CSV), their credit and debit notes and the billing profile.","billing:write":"Save the billing profile copied onto invoices.","wallet:read":"Read the prepaid wallet's balance and its transactions, the top-ups, the saved card, the auto top-up settings and the receipt vouchers.","wallet:write":"Change the auto top-up settings.","pricing:read":"Get price quotes for usage (messages, calls, AI) at the current prices.","notifications:read":"Read your notifications and your notification preferences.","notifications:write":"Mark your notifications as read and change your notification preferences.","chat:read":"Read the connected member's internal chat rooms, their members, messages, pinned messages, files and read positions, and search their messages.","chat:write":"Post, edit, delete, react to and pin messages in the connected member's rooms, send files, create and manage private groups, start direct messages, and set their read positions and notifications.","search:read":"Search everything the connected member may see in one query: tickets, messages and internal notes, contacts, companies and their notes, and their chat rooms. Each kind of result also needs its own module's read scope.","spaces:read":"Read the spaces, their members and channels, who is available, the availability log, the routing limits and the address routing page (every connected item with its destination).","spaces:write":"Create, change and archive spaces, manage their members and channels, set the routing limits, set the destination of every connected address, account, channel and widget, and set the connected member's own availability.","ai:read":"Read the AI agent's Markdown blocks of every level (organization, channel, private/public and address), the AI switches of every level and which apply to a channel, and what the AI agent receives for a ticket on a channel.","ai:write":"Add, edit, reorder, switch off and archive the AI agent's blocks, and set the AI switches of every level.","channels:read":"Read the channels: the web chat widgets with their settings, allowed domains and status, the email channels with their status and settings (never their credentials), inbound address and sender domain checks, the Microsoft 365 mailboxes with their addresses and receiving state, and the WhatsApp numbers with their status, quality, messaging limit, health, templates and the account events Meta reported, the App Store channels with their status, key IDs (never the private key) and apps, the Google Maps review channels with their status, locations and the business locations their Google account can connect, and the Google Play channels with their status, service account, key id (never the key), apps and how current their reviews are.","channels:write":"Create, change, switch off and remove web chat widgets and rotate a widget's identity-verification secret; connect, change, reconnect and disconnect email channels, send forwarding check messages and run the sender domain checks; connect Microsoft 365 mailboxes, manage their addresses, check sending from them, sync and disconnect them; connect WhatsApp numbers with Embedded Signup, rename, register, check health, ask for the WhatsApp Business app history, create, edit and sync templates, and disconnect; connect, rename, reconnect and disconnect App Store channels and refresh their apps; connect, rename, reconnect and disconnect Google Maps review channels, choose their locations and read their reviews again; connect, rename, change the package names of, reconnect or check again, read now and disconnect Google Play channels and refresh their apps.","sms:read":"Read SMS: the sender names with their registration status, documents and complaints, the opt-out list, the SMS settings, and every SMS sent with its delivery status.","sms:write":"Request sender names and upload their registration documents, choose the default sender name, add and lift opt-outs, change the SMS settings, send SMS (service messages and one-time codes, paid from the wallet) and report one-time codes as used.","campaigns:read":"Read the campaigns on WhatsApp, SMS and voice with their results, their review before launch (recipients, estimated cost, compliance checks), their recipients with each one’s status, and listen to a voice campaign’s audio.","campaigns:write":"Create, change and remove draft campaigns, add a voice campaign’s recording, create its speech (paid from the wallet), and launch, pause, resume and cancel campaigns (they spend from the wallet).","voice:read":"Read the phone numbers with their settings and destinations, the numbers available to pick, the voice settings, the calls with their recordings and voicemail, and your registered devices.","voice:write":"Pick, change and release phone numbers, change the voice settings, call customers from tickets, transfer and end calls, get your softphone credentials, and register or remove your devices.","integrations:read":"Read the connected stores and systems with their status and sync runs (never their credentials), a contact's customer records and orders in them, and look up orders by number, phone or email.","integrations:write":"Connect stores and systems by signing in to their platform, reconnect and disconnect them, and ask for a sync of their customers and orders.","webhooks:read":"Read the webhook endpoints, the event types and the delivery log.","webhooks:write":"Create, change and delete webhook endpoints, rotate their secrets and redeliver events."}}},"description":"OAuth 2.1 authorization code with PKCE (S256). Access tokens (`rbat_…`) last an hour and are issued for one resource (this API, or the MCP server at `/mcp`); refresh tokens rotate on every use."}},"schemas":{"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"phone":{"description":"The verified phone number (E.164) that can sign in, if any.","type":["string","null"]},"name":{"type":"string","description":"Empty until the person sets it."},"locale":{"type":"string","enum":["ar","en"]},"theme":{"$ref":"#/components/schemas/ThemeMode"},"avatar_url":{"type":["string","null"]},"email_verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"phone_verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","email","phone","name","locale","theme","avatar_url","email_verified_at","phone_verified_at","created_at"],"additionalProperties":false,"description":"The signed-in person (docs/05 \"Account\")."},"AccountUpdate":{"type":"object","properties":{"name":{"description":"The name shown to teammates.","type":"string","minLength":1,"maxLength":100},"locale":{"description":"The language of the apps and codes.","type":"string","enum":["ar","en"]},"theme":{"$ref":"#/components/schemas/ThemeMode"}},"additionalProperties":false},"AddAiGapToKnowledge":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":500,"description":"The question as it goes into the block, as a heading (the group's label, maybe edited)."},"answer":{"type":"string","maxLength":50000,"description":"The answer (Markdown), below the question."},"block_id":{"description":"Add the question and answer at the end of this live block.","type":"string","format":"uuid"},"new_block":{"$ref":"#/components/schemas/AiGapNewBlock"}},"required":["question","answer"],"additionalProperties":false},"AddChatGroupMembers":{"type":"object","properties":{"member_ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid"}}},"required":["member_ids"],"additionalProperties":false},"AddMicrosoftAddress":{"type":"object","properties":{"address":{"type":"string","maxLength":254},"display_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["address"],"additionalProperties":false},"AddStockNumbers":{"type":"object","properties":{"numbers":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"e164":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$","description":"E.164, e.g. `+966112345678`."},"type":{"type":"string","enum":["geographic","unified_9200","toll_free_800","mobile"]},"porting":{"description":"Being ported in: organizations cannot pick it until it is put on sale.","type":"boolean"},"note":{"description":"For the Rabt team only.","type":"string","maxLength":500}},"required":["e164","type"],"additionalProperties":false}},"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Why (the platform audit log)."}},"required":["numbers","reason"],"additionalProperties":false},"AiAgentSwitch":{"type":"object","properties":{"stopped":{"type":"boolean","description":"The AI agent is stopped everywhere in the organization: it replies nowhere, whatever the level switches say."},"changed_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["stopped","changed_by_membership_id","changed_at"],"additionalProperties":false,"description":"The organization's AI agent kill switch."},"AiBlock":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"level":{"$ref":"#/components/schemas/AiLevel"},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/AiKind"},{"type":"null"}]},"channel_address_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"title":{"type":"string"},"content_markdown":{"type":"string"},"always_include":{"type":"boolean"},"active":{"type":"boolean"},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_by_membership_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"embedding_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"The error code (error catalog)."},"reference":{"type":"string","description":"The error reference, for support."},"failed_at":{"type":"string","format":"date-time"}},"required":["code","reference","failed_at"],"additionalProperties":false},{"type":"null"}],"description":"The last failure to embed the block (large block sets only): it is sent whole until a run succeeds. Try again with `POST /v1/ai/knowledge/embed`. Null when none."}},"required":["id","level","channel_id","kind","channel_address_id","phone_number_id","title","content_markdown","always_include","active","sort_order","updated_by_membership_id","created_at","updated_at","archived_at","embedding_error"],"additionalProperties":false},"AiBlockList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AiBlock"}}},"required":["data"],"additionalProperties":false},"AiEmbeddingRequest":{"type":"object","properties":{"requested_at":{"type":"string","format":"date-time","description":"When the embedding was asked for; the worker runs it shortly after."}},"required":["requested_at"],"additionalProperties":false},"AiGap":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"cluster_id":{"type":"string","format":"uuid"},"question":{"type":"string","description":"The customer message the AI agent could not answer."},"ticket_id":{"type":"string","format":"uuid"},"ticket_number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The ticket number (#1283)."},"channel":{"anyOf":[{"$ref":"#/components/schemas/ChannelType"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","cluster_id","question","ticket_id","ticket_number","channel","created_at"],"additionalProperties":false,"description":"One question the AI agent could not answer."},"AiGapAddedToKnowledge":{"type":"object","properties":{"cluster":{"$ref":"#/components/schemas/AiGapCluster"},"block":{"$ref":"#/components/schemas/AiBlock"}},"required":["cluster","block"],"additionalProperties":false,"description":"The group, now `added`, and the block the AI agent reads from now on."},"AiGapCluster":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"label":{"type":"string","description":"The group's first question, as the customer wrote it."},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many times it was asked."},"channels":{"type":"array","items":{"$ref":"#/components/schemas/ChannelType"},"description":"The channel types it was asked through."},"status":{"$ref":"#/components/schemas/AiGapClusterStatus"},"block_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The block the answer was added to (kept when it opens again)."},"last_asked_at":{"type":"string","format":"date-time"},"status_changed_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Who added the answer, ignored or opened the group; null when Rabt opened it again because the question came again."},"status_changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","label","count","channels","status","block_id","last_asked_at","status_changed_by_membership_id","status_changed_at","created_at"],"additionalProperties":false,"description":"Identical or near-identical questions the AI agent could not answer from its blocks, grouped by normalized text (docs/25; no AI)."},"AiGapClusterPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AiGapCluster"},"description":"The most recently asked first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"AiGapClusterStatus":{"type":"string","enum":["open","added","ignored"],"description":"`open`: waiting for an answer; `added`: the answer was added to a block (`block_id`); `ignored`: an admin ignored it (its new questions are still counted)."},"AiGapNewBlock":{"type":"object","properties":{"level":{"$ref":"#/components/schemas/AiLevel"},"channel_id":{"description":"The channel (or web chat widget): for `channel` and `kind`, and for `address` with a phone number.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"kind":{"description":"For `kind` only.","anyOf":[{"$ref":"#/components/schemas/AiKind"},{"type":"null"}]},"channel_address_id":{"description":"For `address`: an email address, account, app or location of the channel.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"description":"For `address`: a phone number of the channel (instead of an address).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":200}},"required":["level","title"],"additionalProperties":false,"description":"A new block at a level (the fields of `CreateAiBlock`), with its title."},"AiGapPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AiGap"},"description":"Newest first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"AiInteraction":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ticket_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"ticket_number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The ticket number (#1283)."},"call_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"feature":{"type":"string","enum":["auto_reply"]},"trigger_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The customer message it answered."},"reply_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Its reply in the thread (sender `bot`)."},"outcome":{"$ref":"#/components/schemas/AiInteractionOutcome"},"model":{"type":["string","null"]},"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"output_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tools_called":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"accepted":{"type":"boolean"},"error_code":{"type":["string","null"]}},"required":["name","arguments","accepted","error_code"],"additionalProperties":false},"description":"The actions it asked for (`route_to_space`, `hand_off_to_human`) and whether Rabt carried them out."},"block_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The knowledge blocks it read, from the organization down."},"knowledge_mode":{"anyOf":[{"type":"string","enum":["full","retrieval"]},{"type":"null"}]},"handed_off":{"type":"boolean"},"handoff_reason":{"anyOf":[{"type":"string","enum":["customer_asked","negative_sentiment","no_answer"]},{"type":"null"}]},"routed_to_space_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"response_ids":{"type":"array","items":{"type":"string"},"description":"OpenAI's response ids."},"charged_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas charged to the wallet for the turn."},"error":{"anyOf":[{"$ref":"#/components/schemas/AttachedError"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","ticket_id","ticket_number","call_id","feature","trigger_message_id","reply_message_id","outcome","model","input_tokens","output_tokens","cached_tokens","tools_called","block_ids","knowledge_mode","handed_off","handoff_reason","routed_to_space_id","response_ids","charged_minor","error","created_at"],"additionalProperties":false,"description":"One turn of the AI agent in a conversation (docs/15 AiInteraction)."},"AiInteractionOutcome":{"type":"string","enum":["replied","handed_off","failed","discarded"],"description":"`replied`: a reply went to the customer (maybe with a move or a hand-off); `handed_off`: it handed off without a reply; `failed`: it failed and handed off (`error`); `discarded`: its answer came after a member took over or the customer wrote again, and was not sent."},"AiInteractionPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AiInteraction"},"description":"Newest first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"AiKind":{"type":"string","enum":["private","public"],"description":"Private (direct messages) or public (comments, reviews)."},"AiKnowledgePreview":{"type":"object","properties":{"mode":{"type":"string","enum":["full","retrieval"],"description":"`full`: every block is sent; `retrieval`: the blocks are large, so only the parts relevant to the message are sent, plus the blocks marked `whole`."},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The UTF-8 size of the blocks."},"limit_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Above this size, blocks are sent as relevant parts."},"embedding_model":{"type":"string"},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"level":{"$ref":"#/components/schemas/AiLevel"},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/AiKind"},{"type":"null"}]},"channel_address_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"title":{"type":"string"},"content_markdown":{"type":"string"},"always_include":{"type":"boolean"},"active":{"type":"boolean"},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_by_membership_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"embedding_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"The error code (error catalog)."},"reference":{"type":"string","description":"The error reference, for support."},"failed_at":{"type":"string","format":"date-time"}},"required":["code","reference","failed_at"],"additionalProperties":false},{"type":"null"}],"description":"The last failure to embed the block (large block sets only): it is sent whole until a run succeeds. Try again with `POST /v1/ai/knowledge/embed`. Null when none."},"delivery":{"type":"string","enum":["full","chunks","whole","pending"],"description":"`full`: sent whole (small set); `chunks`: its relevant parts; `whole`: sent whole (\"always include\"); `pending`: sent whole because its parts are not embedded yet, or embedding failed (`embedding_error`)."}},"required":["id","level","channel_id","kind","channel_address_id","phone_number_id","title","content_markdown","always_include","active","sort_order","updated_by_membership_id","created_at","updated_at","archived_at","embedding_error","delivery"],"additionalProperties":false}},"settings":{"$ref":"#/components/schemas/EffectiveAiSettings"}},"required":["mode","bytes","limit_bytes","embedding_model","blocks","settings"],"additionalProperties":false},"AiLevel":{"type":"string","enum":["organization","channel","kind","address"],"description":"The level, from the widest: `organization`, `channel`, `kind` (private or public of a channel), `address` (one address or phone number of a channel)."},"AiLevels":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","description":"The channel type, or `webchat`."},"name":{"type":"string"},"status":{"type":"string"},"addresses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","description":"`email`, `account`, `app` or `location`."},"address":{"type":"string"},"display_name":{"type":["string","null"]}},"required":["id","kind","address","display_name"],"additionalProperties":false}}},"required":["id","type","name","status","addresses"],"additionalProperties":false}},"counts":{"type":"array","items":{"type":"object","properties":{"level":{"$ref":"#/components/schemas/AiLevel"},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/AiKind"},{"type":"null"}]},"channel_address_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"blocks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active_blocks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_settings":{"type":"boolean"}},"required":["level","channel_id","kind","channel_address_id","phone_number_id","blocks","active_blocks","has_settings"],"additionalProperties":false}}},"required":["channels","counts"],"additionalProperties":false},"AiSettings":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"level":{"$ref":"#/components/schemas/AiLevel"},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/AiKind"},{"type":"null"}]},"channel_address_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"enabled":{"type":["boolean","null"]},"only_when_no_member_available":{"type":["boolean","null"]},"route_between_spaces":{"type":["boolean","null"]},"updated_by_membership_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","level","channel_id","kind","channel_address_id","phone_number_id","enabled","only_when_no_member_available","route_between_spaces","updated_by_membership_id","created_at","updated_at"],"additionalProperties":false},"AiSettingsList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AiSettings"}}},"required":["data"],"additionalProperties":false},"ApiKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prefix":{"type":"string","description":"The first characters of the key, to recognize it."},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"status":{"type":"string","enum":["active","expired","revoked"]},"member":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["membership_id","name"],"additionalProperties":false,"description":"The member the key acts as: it can never do more than they can."},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"rotated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","prefix","scopes","status","member","expires_at","last_used_at","rotated_at","revoked_at","created_at"],"additionalProperties":false,"description":"An API key (never the key itself, shown once)."},"ApiKeyList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["data"],"additionalProperties":false},"ApiVersionList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"api":{"type":"string"},"version":{"type":"string"},"set_by":{"type":"string"},"label":{"type":["string","null"]},"end_of_life":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"alert":{"anyOf":[{"type":"string","enum":["end_of_life_soon","end_of_life_passed","unknown_version"]},{"type":"null"}]},"days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["api","version","set_by","label","end_of_life","source","alert","days"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false},"ApproveAuthorization":{"type":"object","properties":{"organization_id":{"type":"string","format":"uuid"},"scopes":{"description":"A subset of the scopes asked for; all of them when absent.","minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Scope"}}},"required":["organization_id"],"additionalProperties":false},"AppStoreChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"issuer_id":{"type":"string"},"key_id":{"type":"string"},"status":{"type":"string","enum":["pending","active","needs_reauth","disconnected"],"description":"`active`, `needs_reauth` (Apple refused the key: reconnect with a new key) or `disconnected`."},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"The catalog code, e.g. `APS-3701` or `GBP-3806`."},"reference":{"type":"string","description":"The error log reference."},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"An error kept on the item it stopped (docs/23)."},{"type":"null"}]},"apps":{"type":"array","items":{"type":"object","properties":{"address_id":{"type":"string","format":"uuid","description":"The app’s channel address: assign it to a space (`POST /v1/spaces/{space_id}/channels` with `channel_address_id`) to route its reviews."},"app_id":{"type":"string","description":"Apple’s app id."},"name":{"type":"string"},"bundle_id":{"type":["string","null"]},"sku":{"type":["string","null"]},"polled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"polled_ok_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_poll_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"The catalog code, e.g. `APS-3701` or `GBP-3806`."},"reference":{"type":"string","description":"The error log reference."},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"An error kept on the item it stopped (docs/23)."},{"type":"null"}]}},"required":["address_id","app_id","name","bundle_id","sku","polled_at","polled_ok_at","last_poll_error"],"additionalProperties":false}},"reply_rules":{"$ref":"#/components/schemas/ReviewReplyRules"},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","issuer_id","key_id","status","status_changed_at","last_error","apps","reply_rules","last_inbound_at","connected_at","disconnected_at"],"additionalProperties":false},"AppStoreChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AppStoreChannel"}}},"required":["data"],"additionalProperties":false},"AskTheTeam":{"type":"object","properties":{"ticket_id":{"type":"string","format":"uuid","description":"The ticket to ask about (attached as a card)."},"room_id":{"description":"One of your rooms, e.g. a space group.","type":"string","format":"uuid"},"membership_id":{"description":"Or a colleague: the direct message with them.","type":"string","format":"uuid"},"body":{"default":"","type":"string","maxLength":10000},"client_message_id":{"type":"string","minLength":1,"maxLength":100}},"required":["ticket_id"],"additionalProperties":false},"AskTheTeamResult":{"type":"object","properties":{"room":{"$ref":"#/components/schemas/ChatRoom"},"message":{"$ref":"#/components/schemas/ChatMessage"}},"required":["room","message"],"additionalProperties":false},"AssignPhoneNumber":{"type":"object","properties":{"inventory_id":{"type":"string","format":"uuid","description":"The id of an available number (listAvailable)."}},"required":["inventory_id"],"additionalProperties":false},"AssignSpaceChannel":{"type":"object","properties":{"channel_id":{"description":"A connected channel (a WhatsApp number, a page, an account, a widget).","type":"string","format":"uuid"},"channel_address_id":{"description":"An email address (an alias of a mailbox).","type":"string","format":"uuid"},"phone_number_id":{"description":"A phone number (voice; SMS never creates tickets).","type":"string","format":"uuid"}},"additionalProperties":false,"description":"Exactly one channel, email address or phone number; each belongs to one space at a time."},"AssignStockNumber":{"type":"object","properties":{"organization_id":{"type":"string","format":"uuid","description":"The organization that gets the number."},"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Why (the platform audit log)."}},"required":["organization_id","reason"],"additionalProperties":false},"AssignTicket":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid","description":"The member to assign."}},"required":["membership_id"],"additionalProperties":false},"AttachedError":{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["name"],"additionalProperties":false},"occurred_at":{"type":"string","format":"date-time"}},"required":["code","reference","retryable","occurred_at"],"additionalProperties":false,"description":"Why an item failed (docs/23): the catalog code, reference and the provider’s own error."},"Attachment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ticket_id":{"type":"string","format":"uuid"},"message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"file_name":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upload_status":{"type":"string","enum":["pending","stored"]},"scan_status":{"type":"string","enum":["pending","clean","infected","failed","not_scanned"],"description":"The malware scan: served only when `clean` or `not_scanned` (no scanner configured)."},"scan_detail":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The blocked file's signature, or the scan error's `code` and `reference`."},"created_at":{"type":"string","format":"date-time"}},"required":["id","ticket_id","message_id","file_name","mime_type","size","upload_status","scan_status","scan_detail","created_at"],"additionalProperties":false},"AttachmentDownload":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}},"required":["url","expires_at"],"additionalProperties":false,"description":"A download link valid for 5 minutes."},"AttachmentUpload":{"type":"object","properties":{"attachment":{"$ref":"#/components/schemas/Attachment"},"upload":{"type":"object","properties":{"method":{"type":"string","enum":["PUT"]},"url":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"type":"string","format":"date-time"}},"required":["method","url","headers","expires_at"],"additionalProperties":false}},"required":["attachment","upload"],"additionalProperties":false,"description":"Upload the file with exactly this request (the size is part of its signature), then complete it."},"AuditEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"action":{"type":"string","example":"membership.role_changed"},"actor":{"anyOf":[{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["membership_id","name"],"additionalProperties":false},{"type":"null"}],"description":"Null for actions of the system or of someone not a member."},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["api_key","oauth_app"]},"id":{"type":"string","format":"uuid","description":"The API key, or the installed app (its grant)."},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The API key or OAuth app the member acted through (docs/16); null for their own session."},"target_type":{"type":["string","null"]},"target_id":{"type":["string","null"]},"before":{"description":"The state before (JSON), when it applies."},"after":{"description":"The state after (JSON), when it applies."},"reason":{"type":["string","null"]},"ip":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","action","actor","via","target_type","target_id","before","after","reason","ip","created_at"],"additionalProperties":false},"AuditLogPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditEntry"},"description":"Newest first."},"next_cursor":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Pass as `cursor` for older entries; null on the last page."}},"required":["data","next_cursor"],"additionalProperties":false,"description":"A page of the audit log (docs/08)."},"AuthorizationAnswer":{"type":"object","properties":{"redirect_to":{"type":"string","description":"Where to send the browser: the app, with a code or an error."}},"required":["redirect_to"],"additionalProperties":false},"AuthorizationRequest":{"type":"object","properties":{"id":{"type":"string"},"client":{"type":"object","properties":{"client_id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["registered","metadata_document"]},"uri":{"type":["string","null"]}},"required":["client_id","name","kind","uri"],"additionalProperties":false},"redirect_uri":{"type":"string"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"resource":{"type":"string"},"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"can_approve":{"type":"boolean"}},"required":["id","name","can_approve"],"additionalProperties":false},"description":"The organizations of the signed-in person; `can_approve` needs `api.manage` and an active seat there."}},"required":["id","client","redirect_uri","scopes","resource","organizations"],"additionalProperties":false,"description":"What the consent screen shows."},"AutoTopUp":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"amount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"max_per_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_per_month":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"failures":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Failed tries in a row."},"retry_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"disabled":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"code":{"type":"string"}},"required":["at","code"],"additionalProperties":false},{"type":"null"}],"description":"Turned off after repeated failures, until the card is updated (WAL-1212)."},"saved_card":{"anyOf":[{"$ref":"#/components/schemas/SavedCard"},{"type":"null"}]},"today":{"type":"integer","minimum":0,"maximum":9007199254740991},"this_month":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["enabled","threshold","amount","max_per_day","max_per_month","failures","retry_at","disabled","saved_card","today","this_month"],"additionalProperties":false,"description":"Auto top-up settings and state (docs/10)."},"AutoTopUpUpdate":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}],"description":"Top up when the total balance falls below this (halalas)."},"amount":{"anyOf":[{"type":"integer","minimum":5000,"maximum":999999999999999,"description":"Halalas (SAR minor units), at least 5000 (SAR 50). Rabt sets no maximum: the schema's maximum is only the largest amount the payment provider can be sent exactly. The card's bank or the payment provider may refuse an amount above its own limits (`WAL-1204`, `WAL-1203`, or `WAL-1999` with the provider's own code and message).","example":50000},{"type":"null"}],"description":"How much each auto top-up adds (halalas)."},"max_per_day":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}],"description":"Optional cap: successful auto top-ups per day (Asia/Riyadh)."},"max_per_month":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}],"description":"Optional cap: successful auto top-ups per month (Asia/Riyadh)."}},"required":["enabled","threshold","amount","max_per_day","max_per_month"],"additionalProperties":false,"description":"Turning it on needs a threshold, an amount and a saved card."},"Availability":{"type":"string","enum":["available","unavailable"],"description":"Two statuses only (docs/17)."},"AvailabilityLog":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"time_zone":{"type":"string"},"periods":{"type":"array","items":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/Availability"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"source":{"anyOf":[{"type":"string","enum":["manual","auto_disconnect"]},{"type":"null"}]}},"required":["status","from","to","source"],"additionalProperties":false}},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"The local date (YYYY-MM-DD)."},"available_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","available_seconds"],"additionalProperties":false}},"total_available_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["membership_id","from","to","time_zone","periods","days","total_available_seconds"],"additionalProperties":false},"AvailabilityTotals":{"type":"object","properties":{"from_date":{"type":"string"},"to_date":{"type":"string"},"from":{"type":"string","format":"date-time","description":"When the first date starts."},"to":{"type":"string","format":"date-time","description":"When the last date ends."},"time_zone":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"The local date (YYYY-MM-DD)."},"available_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","available_seconds"],"additionalProperties":false}},"total_available_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["membership_id","days","total_available_seconds"],"additionalProperties":false},"description":"Every member with `members.view_availability`, otherwise yours only; in the order they joined."}},"required":["from_date","to_date","from","to","time_zone","data"],"additionalProperties":false},"AvailableNumberList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"e164":{"type":"string","description":"E.164, e.g. `+966112345678`."},"type":{"type":"string","enum":["geographic","unified_9200","toll_free_800","mobile"]},"monthly_price":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The monthly rental in halalas; null when it has no price yet."},"price_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"}},"required":["code","reference"],"additionalProperties":false},{"type":"null"}],"description":"Why there is no price (`WAL-1101`, `WAL-1102`)."}},"required":["id","e164","type","monthly_price","price_error"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false},"BeginWhatsappSignup":{"type":"object","properties":{"coexistence":{"default":false,"description":"Onboard a number that stays on the WhatsApp Business app (coexistence): its chats are imported and messages sent from the app appear in Rabt.","type":"boolean"}},"additionalProperties":false},"BeginXConnect":{"type":"object","properties":{"channel_id":{"description":"Reconnect this channel (after X refused its tokens: `needs_reauth`); omit to connect a new account.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"additionalProperties":false},"BilingualMessage":{"type":"object","properties":{"ar":{"type":"string","minLength":1,"maxLength":4000},"en":{"type":"string","minLength":1,"maxLength":4000}},"required":["ar","en"],"additionalProperties":false},"BilingualText":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}},"required":["ar","en"],"additionalProperties":false,"description":"A text in Arabic and English."},"BillingParty":{"type":"object","properties":{"organization_name":{"type":"string"},"legal_name":{"type":"string"},"vat_number":{"type":["string","null"]},"cr_number":{"type":["string","null"]},"national_address":{"anyOf":[{"$ref":"#/components/schemas/NationalAddressView"},{"type":"null"}]},"email":{"type":["string","null"]}},"required":["organization_name","legal_name","vat_number","cr_number","national_address","email"],"additionalProperties":false,"description":"A seller or buyer as copied onto a billing document when it was issued."},"BillingProfile":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"legal_name":{"type":"string"},"vat_number":{"type":["string","null"]},"cr_number":{"type":["string","null"]},"national_address":{"anyOf":[{"$ref":"#/components/schemas/NationalAddressView"},{"type":"null"}]},"billing_email":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","legal_name","vat_number","cr_number","national_address","billing_email","created_at","updated_at"],"additionalProperties":false,"description":"The organization's billing profile (docs/10)."},"BillingProfileInput":{"type":"object","properties":{"legal_name":{"type":"string","minLength":1,"maxLength":200},"vat_number":{"default":null,"description":"The VAT registration number: 15 digits, starting and ending with 3.","anyOf":[{"type":"string","pattern":"^3\\d{13}3$"},{"type":"null"}]},"cr_number":{"default":null,"description":"The commercial registration number: 10 digits.","anyOf":[{"type":"string","pattern":"^\\d{10}$"},{"type":"null"}]},"national_address":{"default":null,"anyOf":[{"$ref":"#/components/schemas/NationalAddress"},{"type":"null"}]},"billing_email":{"default":null,"description":"Receives the invoice PDFs (a billing document, not a notification).","anyOf":[{"type":"string","maxLength":254,"format":"email"},{"type":"null"}]}},"required":["legal_name"],"additionalProperties":false,"description":"The whole billing profile: every field is replaced (omitted optional fields become null)."},"BillingProfileResponse":{"type":"object","properties":{"billing_profile":{"anyOf":[{"$ref":"#/components/schemas/BillingProfile"},{"type":"null"}]}},"required":["billing_profile"],"additionalProperties":false,"description":"Null until the profile is first saved."},"Call":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["connecting","ringing","answered","transferring","voicemail_recording","completed","voicemail","missed","rejected","no_answer","busy","failed","abandoned"]},"phone_number_id":{"type":"string","format":"uuid"},"from_number":{"description":"Null when the caller withheld it.","type":["string","null"]},"to_number":{"type":"string"},"contact_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"ticket_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"space_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The member on the call."},"started_at":{"type":"string","format":"date-time"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"duration_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Talk time, from the answer."},"end_reason":{"anyOf":[{"type":"string","enum":["caller","callee","member","balance","timeout","rejected","error","system"]},{"type":"null"}]},"sip_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"billed_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"charged_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas charged for the call."},"recording":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["recording","uploading","stored","failed"]}},"required":["status"],"additionalProperties":false},{"type":"null"}],"description":"Play it with `getCallRecording` once `stored`."},"voicemail":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["recording","uploading","stored","failed"]},"duration_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["status","duration_sec"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"What went wrong (catalog code and reference, docs/23)."},{"type":"null"}]},"quality":{"type":"object","properties":{"post_dial_delay_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"mos":{"description":"Mean opinion score, 1 to 5.","type":["number","null"]},"jitter_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"packet_loss_permille":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rtt_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["post_dial_delay_ms","mos","jitter_ms","packet_loss_permille","rtt_ms"],"additionalProperties":false},"legs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["member","customer"]},"membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"status":{"type":"string","enum":["waking","ringing","answered","ended","no_answer","busy","declined","unreachable","failed","canceled"]},"transfer":{"type":"boolean"},"push_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When a sleeping mobile app was woken with a push for this leg."},"started_at":{"type":"string","format":"date-time"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"What went wrong (catalog code and reference, docs/23)."},{"type":"null"}]}},"required":["id","kind","membership_id","status","transfer","push_sent_at","started_at","answered_at","ended_at","error"],"additionalProperties":false}}},"required":["id","direction","status","phone_number_id","from_number","to_number","contact_id","ticket_id","space_id","membership_id","started_at","answered_at","ended_at","duration_sec","end_reason","sip_code","billed_minutes","charged_amount","recording","voicemail","error","quality","legs"],"additionalProperties":false},"CallMediaLink":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"A short-lived download link (WAV)."},"expires_at":{"type":"string","format":"date-time"}},"required":["url","expires_at"],"additionalProperties":false},"CallPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Call"}},"next_cursor":{"description":"Older calls; null at the end.","type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"Campaign":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"channel_type":{"type":"string","enum":["whatsapp","sms","voice"]},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"sender_name_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"segment_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"content":{"$ref":"#/components/schemas/CampaignContent"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"status":{"type":"string","enum":["draft","scheduled","sending","paused","paused_no_balance","completed","cancelled"],"description":"`draft`, `scheduled`, `sending`, `paused` (`pause_reason`), `paused_no_balance` (resumes after a top-up), `completed` or `cancelled`."},"status_changed_at":{"type":"string","format":"date-time"},"pause_reason":{"anyOf":[{"type":"string","enum":["member","sending_hours","channel"]},{"type":"null"}]},"resume_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false},{"type":"null"}],"description":"What went wrong: the catalog code and reference (docs/23)."},"estimate":{"anyOf":[{"$ref":"#/components/schemas/CampaignEstimate"},{"type":"null"}]},"launched_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"launched_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"cancelled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"results":{"$ref":"#/components/schemas/CampaignResults"}},"required":["id","name","channel_type","channel_id","phone_number_id","sender_name_id","segment_id","content","scheduled_at","status","status_changed_at","pause_reason","resume_at","error","estimate","launched_at","launched_by_membership_id","started_at","completed_at","cancelled_at","created_by_membership_id","created_at","updated_at","results"],"additionalProperties":false},"CampaignAudioLink":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}},"required":["url","expires_at"],"additionalProperties":false},"CampaignContent":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["whatsapp"]},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["header","body","button"]},"index":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sub_type":{"anyOf":[{"type":"string","enum":["quick_reply","url","copy_code"]},{"type":"null"}]},"parameters":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"value":{"type":"string"},"name":{"type":["string","null"]},"currency":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"amount_1000":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","amount_1000"],"additionalProperties":false},{"type":"null"}]}},"required":["type","value","name","currency"],"additionalProperties":false}}},"required":["type","index","sub_type","parameters"],"additionalProperties":false}}},"required":["type","template_id","components"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["sms"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["voice"]},"audio":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","enum":["recording","speech"]},"duration_sec":{"type":"number"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"text":{"type":["string","null"]},"voice":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["source","duration_sec","size_bytes","text","voice","created_at"],"additionalProperties":false},{"type":"null"}],"description":"The message played: a recording or speech; listen through `getCampaignAudioLink`."},"speech_text":{"type":["string","null"]},"speech_voice":{"type":["string","null"]},"agent_option":{"type":"boolean"},"max_concurrent_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","audio","speech_text","speech_voice","agent_option","max_concurrent_calls"],"additionalProperties":false}],"description":"What the campaign sends on its channel."},"CampaignEstimate":{"type":"object","properties":{"recipients":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"excluded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The estimated cost in halalas."},"currency":{"type":"string","enum":["SAR"]},"fingerprint":{"description":"Send it back as `confirmed_fingerprint` when launching.","type":["string","null"]},"at":{"type":"string"}},"required":["recipients","excluded","total_minor","currency","fingerprint","at"],"additionalProperties":false,"description":"The estimated cost, priced from the rate card; nothing is reserved."},"CampaignOptOutPage":{"type":"object","properties":{"sender":{"type":"string","description":"The sender name the SMS came under."},"opted_out":{"type":"boolean"},"locale":{"type":"string","enum":["ar","en"],"description":"The organization’s language."}},"required":["sender","opted_out","locale"],"additionalProperties":false},"CampaignPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"CampaignRecipient":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"campaign_id":{"type":"string","format":"uuid"},"contact_id":{"type":"string","format":"uuid"},"address":{"description":"The phone (E.164) or WhatsApp id it is sent to.","type":["string","null"]},"country":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Its place in the sending order."},"status":{"type":"string","enum":["pending","excluded","sending","sent","delivered","read","failed","replied","opted_out"]},"status_changed_at":{"type":"string","format":"date-time"},"exclusion_reason":{"anyOf":[{"type":"string","enum":["no_consent","opted_out","no_address","duplicate","suppressed","destination_not_allowed"]},{"type":"null"}]},"sms_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"call_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"reply_ticket_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The ticket their reply opened."},"key_press":{"anyOf":[{"type":"string","enum":["agent","stop"]},{"type":"null"}]},"cost_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false},{"type":"null"}],"description":"What went wrong: the catalog code and reference (docs/23)."},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"replied_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"opted_out_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","campaign_id","contact_id","address","country","position","status","status_changed_at","exclusion_reason","sms_message_id","call_id","reply_ticket_id","key_press","cost_minor","error","sent_at","delivered_at","read_at","failed_at","replied_at","opted_out_at"],"additionalProperties":false},"CampaignRecipientPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CampaignRecipient"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"CampaignResults":{"type":"object","properties":{"targeted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"excluded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"agent_key_presses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stop_key_presses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What it cost so far, in halalas."}},"required":["targeted","excluded","pending","sending","sent","delivered","read","failed","replied","opted_out","answered","agent_key_presses","stop_key_presses","cost_minor"],"additionalProperties":false},"CampaignReview":{"type":"object","properties":{"campaign_id":{"type":"string","format":"uuid"},"recipients":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Contacts it would send to."},"excluded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exclusions":{"type":"object","properties":{"no_consent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"no_address":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destination_not_allowed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["no_consent","opted_out","no_address","duplicate","suppressed","destination_not_allowed"],"additionalProperties":false,"description":"Contacts left out, by reason."},"estimate":{"$ref":"#/components/schemas/CampaignEstimate"},"checks":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["consent","opt_out_option","sending_hours","classification","content","channel"]},"ok":{"type":"boolean"},"code":{"description":"The catalog code of a failed check or a warning (`CAMP-6314`: waits).","type":["string","null"]},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["key","ok","code","params"],"additionalProperties":false},"description":"The compliance checks (docs/14)."},"starts_at":{"type":"string","format":"date-time","description":"When sending would start: now, its time, or the next allowed sending hour."},"ready":{"type":"boolean","description":"Every check passed: it can be launched."}},"required":["campaign_id","recipients","excluded","exclusions","estimate","checks","starts_at","ready"],"additionalProperties":false},"CampaignSmsContentInput":{"type":"object","properties":{"text":{"description":"The SMS text; Rabt adds the opt-out link. Text values may use the variables `{{name}}`, `{{first_name}}` and `{{phone}}`, filled per contact (`CAMP-6324` for another).","type":"string","maxLength":1000}},"additionalProperties":false,"description":"An SMS campaign’s content."},"CampaignSources":{"type":"object","properties":{"whatsapp":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The channel id (`channel_id` of a campaign)."},"name":{"type":"string"},"phone_number":{"type":"string"},"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The `template_id` of a campaign’s content."},"name":{"type":"string"},"language":{"type":"string"},"parameter_format":{"type":"string","description":"`positional` or `named`."},"components":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The template’s components as Meta holds them."},"quality_score":{"type":["string","null"]},"pause_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","language","parameter_format","components","quality_score","pause_count"],"additionalProperties":false},"description":"Its approved marketing templates."}},"required":["id","name","phone_number","templates"],"additionalProperties":false},"description":"The active WhatsApp numbers."},"sms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"description":"The approved promotional sender names (`-AD`) not suspended."},"voice":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"e164":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","e164","name"],"additionalProperties":false},"description":"The active phone numbers."}},"required":["whatsapp","sms","voice"],"additionalProperties":false},"CampaignVoiceContentInput":{"type":"object","properties":{"speech_text":{"description":"The text to turn into speech (`createCampaignSpeech`); changing it drops speech made from another text.","anyOf":[{"type":"string","maxLength":4096},{"type":"null"}]},"speech_voice":{"description":"The voice of the speech (default `alloy`).","anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer","verse"]},{"type":"null"}]},"agent_option":{"description":"“Press 1 to talk to an agent”: the number’s destination is rung.","type":"boolean"},"max_concurrent_calls":{"description":"Calls at once, at most the organization’s cap (`CAMP-6322`).","type":"integer","minimum":1,"maximum":1000}},"additionalProperties":false,"description":"A voice campaign’s content."},"CampaignWhatsappContentInput":{"type":"object","properties":{"template_id":{"description":"An approved marketing template of the campaign’s WhatsApp number.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"components":{"description":"The values of the template’s parameters, per component. Text values may use the variables `{{name}}`, `{{first_name}}` and `{{phone}}`, filled per contact (`CAMP-6324` for another).","maxItems":10,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["header","body","button"]},"sub_type":{"type":"string","enum":["quick_reply","url","copy_code"]},"index":{"type":"integer","minimum":0,"maximum":9},"parameters":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","currency","date_time","image","video","document","payload","coupon_code"]},"value":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","pattern":"^[a-z0-9_]{1,100}$"},"currency":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z]{3}$"},"amount_1000":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","amount_1000"],"additionalProperties":false}},"required":["type","value"],"additionalProperties":false}}},"required":["type","parameters"],"additionalProperties":false}}},"additionalProperties":false,"description":"A WhatsApp campaign’s content."},"CannedReply":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"scope":{"$ref":"#/components/schemas/CannedReplyScope"},"space_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The space of a space reply."},"owner_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The member of a personal reply."},"title":{"type":"string"},"body":{"type":"string","description":"The text inserted in the composer."},"editable":{"type":"boolean","description":"You may change or delete it."},"created_by_membership_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","scope","space_id","owner_membership_id","title","body","editable","created_by_membership_id","created_at","updated_at"],"additionalProperties":false,"description":"A canned reply (docs/05, docs/06)."},"CannedReplyPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CannedReply"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false,"description":"Canned replies by title."},"CannedReplyScope":{"type":"string","enum":["organization","space","personal"],"description":"`organization` (every member uses it; `settings.manage` manages it), `space` (the members of a department space; `space_replies.manage` in the space, or `settings.manage`), `personal` (only its owner)."},"ChangeIncident":{"type":"object","properties":{"title":{"type":"object","properties":{"ar":{"type":"string","minLength":1,"maxLength":200},"en":{"type":"string","minLength":1,"maxLength":200}},"required":["ar","en"],"additionalProperties":false},"impact":{"type":"string","enum":["degraded_performance","partial_outage","major_outage","maintenance"]},"severity":{"type":"string","enum":["sev1","sev2","sev3","sev4"]},"components":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","enum":["web_app","api","realtime","inbound_webhooks","email","webchat","notifications","payments"]}},"show_in_app":{"type":"boolean"},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["reason"],"additionalProperties":false},"ChangeProblemStatus":{"type":"object","properties":{"status":{"type":"string","enum":["new","investigating","resolved"]},"note":{"description":"Why (optional), written to the platform audit log.","type":"string","minLength":1,"maxLength":1000}},"required":["status"],"additionalProperties":false},"ChangeTicketStatus":{"type":"object","properties":{"status":{"type":"string","enum":["in_progress","closed"],"description":"`in_progress`: pick it up (unassigned: it becomes yours). `closed`: final."}},"required":["status"],"additionalProperties":false},"ChannelCapabilities":{"type":"object","properties":{"channel_type":{"type":"string","enum":["whatsapp","facebook","instagram","x","tiktok","email","voice","sms","webchat","app_store","google_business","google_play"]},"kinds":{"type":"array","items":{"type":"string","enum":["private","public"]}},"composer":{"type":"string","enum":["chat","email","none"]},"send":{"type":"object","properties":{"text":{"type":"boolean"},"media":{"type":"array","items":{"type":"string","enum":["image","video","audio","document","sticker"]}},"location":{"type":"boolean"},"interactive":{"type":"boolean"},"reaction":{"type":"boolean","description":"The business can react to a customer's message, change the reaction and remove it (`POST /v1/tickets/{id}/messages/{message_id}/reaction`)."},"quote":{"type":"boolean","description":"A reply can quote a specific earlier message (`reply_to_message_id` is sent to the channel)."},"template":{"type":"boolean"},"email":{"type":"boolean"}},"required":["text","media","location","interactive","reaction","quote","template","email"],"additionalProperties":false},"max_text_length":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_attachment_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reply_window":{"anyOf":[{"type":"object","properties":{"hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outside":{"type":"string","enum":["template","human_agent_tag","none"]}},"required":["hours","outside"],"additionalProperties":false},{"type":"null"}]},"public_actions":{"type":"array","items":{"type":"string","enum":["reply","private_reply","hide","unhide","delete","like"]}},"statuses":{"type":"array","items":{"type":"string","enum":["sent","delivered","read","failed"]}}},"required":["channel_type","kinds","composer","send","max_text_length","max_attachment_bytes","reply_window","public_actions","statuses"],"additionalProperties":false,"description":"What a channel supports (its capability matrix in docs/channels): the composer offers only this."},"ChannelCapabilitiesList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChannelCapabilities"}}},"required":["data"],"additionalProperties":false},"ChannelError":{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"Why the channel stopped working (docs/23)."},"ChannelStatus":{"type":"string","enum":["pending","active","needs_reauth","disconnected"],"description":"`pending` (an email forwarding channel until its forwarding is verified), `active`, `needs_reauth` (the provider refused the credentials: reconnect), `disconnected`."},"ChannelType":{"type":"string","enum":["whatsapp","facebook","instagram","x","tiktok","email","voice","sms","webchat","app_store","google_business","google_play"],"description":"A channel type (docs/02)."},"ChatAttachment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"room_id":{"type":"string","format":"uuid"},"message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"file_name":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upload_status":{"type":"string","enum":["pending","stored"]},"scan_status":{"type":"string","enum":["pending","clean","infected","failed","not_scanned"],"description":"The malware scan: served only when `clean` or `not_scanned`."},"created_at":{"type":"string","format":"date-time"}},"required":["id","room_id","message_id","file_name","mime_type","size","upload_status","scan_status","created_at"],"additionalProperties":false},"ChatAttachmentDownload":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}},"required":["url","expires_at"],"additionalProperties":false,"description":"A download link valid for 5 minutes."},"ChatAttachmentUpload":{"type":"object","properties":{"attachment":{"$ref":"#/components/schemas/ChatAttachment"},"upload":{"type":"object","properties":{"method":{"type":"string","enum":["PUT"]},"url":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"type":"string","format":"date-time"}},"required":["method","url","headers","expires_at"],"additionalProperties":false}},"required":["attachment","upload"],"additionalProperties":false,"description":"Upload the file with this request (valid 15 minutes), then complete the upload. A lost upload is renewed with a new request."},"ChatMessage":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"room_id":{"type":"string","format":"uuid"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The message number in its room (cursors)."},"author":{"$ref":"#/components/schemas/ChatPerson"},"client_message_id":{"type":["string","null"]},"body_markdown":{"description":"Null when deleted.","type":["string","null"]},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/ChatPerson"}},"mentions_all":{"type":"boolean"},"tickets":{"type":"array","items":{"$ref":"#/components/schemas/ChatTicketCard"}},"quote":{"anyOf":[{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"author":{"$ref":"#/components/schemas/ChatPerson"},"excerpt":{"type":["string","null"]},"deleted":{"type":"boolean"}},"required":["message_id","seq","author","excerpt","deleted"],"additionalProperties":false},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"membership_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"mine":{"type":"boolean"}},"required":["emoji","count","membership_ids","mine"],"additionalProperties":false}},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/ChatAttachment"}},"edited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pinned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pinned_by":{"anyOf":[{"$ref":"#/components/schemas/ChatPerson"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","room_id","seq","author","client_message_id","body_markdown","mentions","mentions_all","tickets","quote","reactions","attachments","edited_at","deleted_at","pinned_at","pinned_by","created_at"],"additionalProperties":false},"ChatMessageEditList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"previous_body":{"type":"string"},"edited_at":{"type":"string","format":"date-time"}},"required":["previous_body","edited_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false,"description":"Earlier texts, newest first."},"ChatMessageList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}},"required":["data"],"additionalProperties":false},"ChatMessagePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"},"description":"Oldest first."},"has_older":{"type":"boolean"},"has_newer":{"type":"boolean"}},"required":["data","has_older","has_newer"],"additionalProperties":false},"ChatNotifySetting":{"type":"string","enum":["all","mentions","mute"],"description":"All messages, mentions only, or mute."},"ChatPerson":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"availability":{"type":"string","enum":["available","unavailable"],"description":"Presence in chat is the availability (docs/20)."},"removed":{"type":"boolean","description":"They left the organization."}},"required":["membership_id","name","availability","removed"],"additionalProperties":false},"ChatReactionInput":{"type":"object","properties":{"emoji":{"type":"string","minLength":1,"maxLength":32}},"required":["emoji"],"additionalProperties":false},"ChatRoom":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["space","all","group","direct"]},"name":{"description":"A space group or private group name; null for All and direct messages.","type":["string","null"]},"space_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"direct_with":{"anyOf":[{"$ref":"#/components/schemas/ChatPerson"},{"type":"null"}]},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_message_seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Archived rooms are read-only."},"created_at":{"type":"string","format":"date-time"},"role":{"type":"string","enum":["member","manager"]},"notify":{"$ref":"#/components/schemas/ChatNotifySetting"},"last_read_seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Unread messages of others (at most 100)."},"unread_mention_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"can_manage":{"type":"boolean"}},"required":["id","type","name","space_id","direct_with","member_count","last_message_seq","last_message_at","archived_at","created_at","role","notify","last_read_seq","unread_count","unread_mention_count","can_manage"],"additionalProperties":false},"ChatRoomList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatRoom"}}},"required":["data"],"additionalProperties":false},"ChatRoomMember":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"availability":{"type":"string","enum":["available","unavailable"],"description":"Presence in chat is the availability (docs/20)."},"removed":{"type":"boolean","description":"They left the organization."},"role":{"type":"string","enum":["member","manager"]},"joined_at":{"type":"string","format":"date-time"}},"required":["membership_id","name","availability","removed","role","joined_at"],"additionalProperties":false},"ChatRoomMemberList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatRoomMember"}}},"required":["data"],"additionalProperties":false},"ChatSearchPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"room_id":{"type":"string","format":"uuid"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"author":{"$ref":"#/components/schemas/ChatPerson"},"excerpt":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["message_id","room_id","seq","author","excerpt","created_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false},"ChatTicketCard":{"anyOf":[{"type":"object","properties":{"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accessible":{"type":"boolean","enum":[true]},"ticket_id":{"type":"string","format":"uuid"},"subject":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/TicketStatus"},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"contact_name":{"type":["string","null"]},"assignee_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["number","accessible","ticket_id","subject","status","channel_type","contact_name","assignee_membership_id"],"additionalProperties":false},{"type":"object","properties":{"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accessible":{"type":"boolean","enum":[false]}},"required":["number","accessible"],"additionalProperties":false}],"description":"A ticket card, per viewer: the number only when you cannot see the ticket."},"ChatTyping":{"type":"object","properties":{"active":{"type":"boolean","description":"True while typing; false when stopped."}},"required":["active"],"additionalProperties":false},"ClientErrorReceipt":{"type":"object","properties":{"recorded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Reports recorded in the error log."}},"required":["recorded"],"additionalProperties":false},"ClientErrorReports":{"type":"object","properties":{"reports":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z]{1,5}-\\d{4}$","description":"The error code the member saw, e.g. `SYS-1300`."},"reference":{"type":"string","pattern":"^ref_[0-9a-f]{32}$","description":"The reference the member saw (`ref_` and 32 hexadecimal digits)."},"release":{"type":"string","pattern":"^[0-9A-Za-z.+_-]{1,100}$","description":"The release of the app that raised it, e.g. `v1.4.2+a1b2c3d`."},"app":{"type":"string","enum":["web","admin"]},"page":{"type":"string","minLength":1,"maxLength":500,"description":"The page path (identifiers are replaced before it is kept)."},"cause":{"description":"The browser error (`TypeError: …`); values are removed before it is kept.","type":"string","maxLength":1000}},"required":["code","reference","release","app","page"],"additionalProperties":false}}},"required":["reports"],"additionalProperties":false},"CodeOccurrences":{"type":"object","properties":{"code":{"type":"string"},"since":{"type":"string","format":"date-time"},"until":{"type":"string","format":"date-time"},"release":{"type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"first_seen":{"type":"string","format":"date-time"},"last_seen":{"type":"string","format":"date-time"}},"required":["id","name","count","first_seen","last_seen"],"additionalProperties":false}},"releases":{"type":"array","items":{"type":"object","properties":{"release":{"type":["string","null"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"first_seen":{"type":"string","format":"date-time"},"last_seen":{"type":"string","format":"date-time"}},"required":["release","count","first_seen","last_seen"],"additionalProperties":false}},"services":{"type":"array","items":{"type":"object","properties":{"service":{"type":["string","null"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"first_seen":{"type":"string","format":"date-time"},"last_seen":{"type":"string","format":"date-time"}},"required":["service","count","first_seen","last_seen"],"additionalProperties":false}},"samples":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"organization_id":{"type":["string","null"]},"occurred_at":{"type":"string","format":"date-time"}},"required":["reference","organization_id","occurred_at"],"additionalProperties":false}}},"required":["code","since","until","release","total","organizations","releases","services","samples"],"additionalProperties":false},"CommentAction":{"type":"object","properties":{"action":{"type":"string","enum":["hide","unhide","delete","like"]}},"required":["action"],"additionalProperties":false,"description":"`hide` or `unhide` the comment on Facebook or Instagram, `delete` it there (Rabt keeps its copy in the ticket), or `like` it as the Page (Facebook only: Instagram has no like, `IG-2027`)."},"CommentState":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"ticket_id":{"type":"string","format":"uuid"},"hidden":{"type":"boolean"},"deleted":{"type":"boolean"},"liked":{"type":"boolean"}},"required":["message_id","ticket_id","hidden","deleted","liked"],"additionalProperties":false,"description":"The comment’s state on Facebook or Instagram as Rabt last saw it."},"CommunicationHistory":{"type":"object","properties":{"data":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket"]},"occurred_at":{"type":"string","format":"date-time"},"ticket":{"$ref":"#/components/schemas/HistoryTicket"}},"required":["type","occurred_at","ticket"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["call"]},"occurred_at":{"type":"string","format":"date-time"},"ticket":{"$ref":"#/components/schemas/HistoryTicket"},"call":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["inbound","outbound"]},"duration_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"answered":{"type":["boolean","null"]}},"required":["direction","duration_sec","answered"],"additionalProperties":false},{"type":"null"}]}},"required":["type","occurred_at","ticket","call"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["campaign_message"]},"id":{"type":"string","format":"uuid"},"occurred_at":{"type":"string","format":"date-time"},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"What the entry shows, e.g. a campaign message: `campaign_id`, `campaign_name`, `status`, `key_press`, `reply_ticket_id`."}},"required":["type","id","occurred_at","channel_type","details"],"additionalProperties":false}]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false,"description":"Newest first (docs/13 side panel)."},"Company":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"logo_url":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"anyOf":[{"$ref":"#/components/schemas/CompanyAddressDocument"},{"type":"null"}]},"industry":{"type":["string","null"]},"owner_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"domains":{"type":"array","items":{"$ref":"#/components/schemas/CompanyDomain"}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagRef"}},"custom_fields":{"$ref":"#/components/schemas/CustomFieldValues"},"contact_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","logo_url","phone","website","address","industry","owner_membership_id","domains","tags","custom_fields","contact_count","created_at","updated_at"],"additionalProperties":false,"description":"A company (docs/12). The id of a merged company gives the company it was merged into."},"CompanyAddress":{"type":"object","properties":{"line1":{"type":"string","maxLength":200},"line2":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":100},"region":{"type":"string","maxLength":100},"postal_code":{"type":"string","maxLength":20},"country":{"description":"ISO 3166-1 alpha-2.","type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"CompanyAddressDocument":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal_code":{"type":"string"},"country":{"type":"string"}},"additionalProperties":false},"CompanyDomain":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"CompanyDomainInput":{"type":"object","properties":{"domain":{"type":"string","maxLength":260,"description":"An email domain of the company, e.g. `acme.com` (never a public email provider)."}},"required":["domain"],"additionalProperties":false},"CompanyMergeResult":{"type":"object","properties":{"merge":{"$ref":"#/components/schemas/Merge"},"company":{"$ref":"#/components/schemas/Company"}},"required":["merge","company"],"additionalProperties":false},"CompanyPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Company"}},"next_cursor":{"description":"Pass as `cursor`; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"CompleteFacebookConnect":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":256},"code":{"type":"string","minLength":1,"maxLength":2048},"error":{"type":"string","maxLength":200},"error_reason":{"type":"string","maxLength":200},"error_description":{"type":"string","maxLength":1000}},"required":["state"],"additionalProperties":false,"description":"What Facebook sent back to the callback page, as received: `state` with `code`, or `error`, `error_reason` and `error_description` when the person cancelled."},"CompleteGmailConnection":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":300,"description":"The `state` Google sent back."},"code":{"type":"string","minLength":1,"maxLength":2048,"description":"The `code` Google sent back."},"scope":{"type":"string","maxLength":4000}},"required":["state","code"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":300},"error":{"type":"string","minLength":1,"maxLength":200,"description":"Google’s `error`, e.g. `access_denied` when the member declined."},"error_description":{"type":"string","maxLength":2000}},"required":["state","error"],"additionalProperties":false}],"description":"What Google sent the member back with to the redirect URI (query parameters `state` and `code`, or `state` and `error`)."},"CompleteGoogleBusinessConnection":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":300,"description":"The `state` Google sent back."},"code":{"type":"string","minLength":1,"maxLength":2048,"description":"The `code` Google sent back."},"scope":{"type":"string","maxLength":4000}},"required":["state","code"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":300},"error":{"type":"string","minLength":1,"maxLength":200,"description":"Google’s `error`, e.g. `access_denied` when the member declined."},"error_description":{"type":"string","maxLength":2000}},"required":["state","error"],"additionalProperties":false}],"description":"What Google sent the member back with to the redirect URI (query parameters `state` and `code`, or `state` and `error`)."},"CompleteInstagramConnect":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":256},"code":{"type":"string","minLength":1,"maxLength":2048},"error":{"type":"string","maxLength":200},"error_reason":{"type":"string","maxLength":200},"error_description":{"type":"string","maxLength":1000}},"required":["state"],"additionalProperties":false,"description":"What Meta sent back to the callback page, as received: `state` with `code`, or `error`, `error_reason` and `error_description` when the person cancelled."},"CompleteIntegrationConnection":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":300,"description":"The `state` the platform sent back."}},"required":["state"],"additionalProperties":{"type":"string","maxLength":4096},"description":"Every query parameter the platform sent the member back with to the redirect URI, as received (`state` and `code`, plus what the platform signs, e.g. Shopify’s `shop`, `timestamp` and `hmac`; or `state` and `error` when the owner declined)."},"CompleteTikTokConnect":{"type":"object","properties":{"state":{"type":"string","minLength":16,"maxLength":256,"description":"The `state` TikTok sent back."},"code":{"description":"The `code` TikTok sent back.","type":"string","minLength":1,"maxLength":2000},"error":{"description":"TikTok’s `error` when declined.","type":"string","maxLength":200},"error_description":{"type":"string","maxLength":2000}},"required":["state"],"additionalProperties":false},"CompleteXConnect":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":500},"code":{"type":"string","minLength":1,"maxLength":2000},"error":{"type":"string","minLength":1,"maxLength":200},"error_description":{"type":"string","maxLength":2000}},"required":["state"],"additionalProperties":false,"description":"X's answer on the callback, as it came: `state` with `code` (the member approved; the code is valid 30 seconds) or `error` (the member declined: X-3011). Only the member who started the connection can finish it."},"ConnectAppStoreChannel":{"type":"object","properties":{"name":{"description":"What members call the channel; default \"App Store\".","anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"issuer_id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"The issuer ID of your App Store Connect team (Users and Access › Integrations), e.g. `57246542-96fe-1a63-e053-0824d011072a`."},"key_id":{"type":"string","pattern":"^[A-Z0-9]{10}$","description":"The ID of a team API key with the Customer Support or Admin role, e.g. `2X9R4HXF34`."},"private_key":{"type":"string","minLength":1,"maxLength":4096,"description":"The text of the key’s `.p8` file (`-----BEGIN PRIVATE KEY-----` …). Kept in the token vault, never returned."}},"required":["issuer_id","key_id","private_key"],"additionalProperties":false},"ConnectedChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"source":{"type":"string","enum":["channel","widget"]},"type":{"$ref":"#/components/schemas/ChannelType"},"provider":{"type":"string"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/ConnectedChannelStatus"},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"}},"required":["code","reference","occurred_at"],"additionalProperties":false},{"type":"null"}],"description":"Why it needs a reconnection or failed its last check (docs/23)."},"paused_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"phone_number":{"description":"The number it is (E.164), if any.","type":["string","null"]},"addresses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["email","account","app","location"]},"address":{"type":"string"},"display_name":{"description":"The sender name, or its name.","type":["string","null"]},"is_default_from":{"type":"boolean"}},"required":["id","kind","address","display_name","is_default_from"],"additionalProperties":false}},"ai_switch_kinds":{"type":"array","items":{"type":"string","enum":["private","public"]},"description":"The AI auto-reply switches that apply to it: private conversations, public comments, both, or none (docs/15)."},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","source","type","provider","name","status","status_changed_at","last_error","paused_at","phone_number","addresses","ai_switch_kinds","last_inbound_at","connected_at","disconnected_at"],"additionalProperties":false},"ConnectedChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConnectedChannel"}}},"required":["data"],"additionalProperties":false},"ConnectedChannelStatus":{"type":"string","enum":["pending","active","needs_reauth","disconnected","disabled"],"description":"`pending` (connected, not yet proven), `active`, `needs_reauth` (reconnect), `disconnected` (final); a widget is `active` or `disabled`."},"ConnectEmailChannel":{"type":"object","properties":{"address":{"type":"string","maxLength":254,"description":"The address that forwards to Rabt."},"display_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The sender name replies carry, e.g. \"Acme Support\"."},"smtp_host":{"type":"string","minLength":1,"maxLength":253,"description":"The SMTP server's host name, e.g. `smtp.yourprovider.com`."},"smtp_port":{"type":"integer","minimum":1,"maximum":65535,"description":"The SMTP port: 587 (STARTTLS), 465 (TLS), 25 or 2525."},"smtp_security":{"$ref":"#/components/schemas/SmtpSecurity"},"smtp_username":{"type":"string","minLength":1,"maxLength":320},"smtp_password":{"type":"string","minLength":1,"maxLength":1024,"description":"Kept in the token vault, never returned."}},"required":["address","smtp_host","smtp_port","smtp_security","smtp_username","smtp_password"],"additionalProperties":false},"ConnectGooglePlayChannel":{"type":"object","properties":{"name":{"description":"What members call the channel; default \"Google Play\".","anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"service_account_key":{"type":"string","minLength":1,"maxLength":16384,"description":"The text of the service account’s JSON key file (Google Cloud › IAM & Admin › Service accounts › Keys › Create new key › JSON). Kept in the token vault, never returned."},"package_names":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200,"pattern":"^[A-Za-z][A-Za-z0-9_]*(\\.[A-Za-z][A-Za-z0-9_]*)+$","description":"A package name, e.g. `com.example.app`."},"description":"Apps to add by package name, besides the ones Google’s Reporting API lists for the service account (for when that API is not enabled)."}},"required":["service_account_key"],"additionalProperties":false},"ConnectWhatsappChannel":{"type":"object","properties":{"state":{"type":"string","minLength":20,"maxLength":2048,"description":"The `state` of the signup you began."},"code":{"type":"string","minLength":10,"maxLength":2048,"description":"The code Embedded Signup returned (`FB.login`), valid for 30 seconds."},"waba_id":{"type":"string","pattern":"^\\d{1,32}$","description":"The WhatsApp Business Account id the flow returned."},"phone_number_id":{"type":"string","pattern":"^\\d{1,32}$","description":"The phone number id the flow returned."},"business_id":{"anyOf":[{"type":"string","pattern":"^\\d{1,32}$"},{"type":"null"}]},"coexistence":{"type":"boolean"},"pin":{"description":"The number's two-step verification PIN, if it has one; otherwise Rabt sets a random one (kept in the token vault).","anyOf":[{"type":"string","pattern":"^\\d{6}$"},{"type":"null"}]}},"required":["state","code","waba_id","phone_number_id"],"additionalProperties":false},"Consent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"contact_id":{"type":"string","format":"uuid"},"channel_type":{"type":"string","enum":["whatsapp","sms","voice"]},"purpose":{"type":"string","enum":["marketing"]},"status":{"type":"string","enum":["opted_in","opted_out"]},"source":{"type":"string","enum":["member","api","recipient_reply","recipient_link","recipient_key"],"description":"`member`, `api`, or the contact through a campaign: `recipient_reply` (WhatsApp stop), `recipient_link` (SMS link), `recipient_key` (the stop key of a call)."},"proof":{"type":"object","properties":{"method":{"type":"string"},"text":{"type":["string","null"]},"url":{"type":["string","null"]},"reference":{"type":["string","null"]},"captured_at":{"type":["string","null"]}},"required":["method","text","url","reference","captured_at"],"additionalProperties":false},"changed_at":{"type":"string","format":"date-time"},"recorded_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","contact_id","channel_type","purpose","status","source","proof","changed_at","recorded_by_membership_id","campaign_id","created_at"],"additionalProperties":false},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"primary_phone":{"type":["string","null"]},"primary_email":{"type":["string","null"]},"phones":{"type":"array","items":{"$ref":"#/components/schemas/ContactPhone"}},"emails":{"type":"array","items":{"$ref":"#/components/schemas/ContactEmail"}},"identities":{"type":"array","items":{"$ref":"#/components/schemas/ContactIdentity"}},"companies":{"type":"array","items":{"$ref":"#/components/schemas/ContactCompanyRef"}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagRef"}},"custom_fields":{"$ref":"#/components/schemas/CustomFieldValues"},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_channel_type":{"anyOf":[{"$ref":"#/components/schemas/ChannelType"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","avatar_url","primary_phone","primary_email","phones","emails","identities","companies","tags","custom_fields","last_activity_at","last_channel_type","created_at","updated_at"],"additionalProperties":false,"description":"A contact (docs/12). The id of a merged contact gives the contact it was merged into."},"ContactCompanyLink":{"type":"object","properties":{"job_title":{"description":"The job title at the company.","anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"is_primary":{"description":"The contact's primary company.","type":"boolean"}},"additionalProperties":false},"ContactCompanyRef":{"type":"object","properties":{"company_id":{"type":"string","format":"uuid"},"company_name":{"type":"string"},"job_title":{"type":["string","null"]},"is_primary":{"type":"boolean"}},"required":["company_id","company_name","job_title","is_primary"],"additionalProperties":false},"ContactConsents":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid"},"current":{"type":"object","properties":{"whatsapp":{"anyOf":[{"type":"string","enum":["opted_in","opted_out"]},{"type":"null"}]},"sms":{"anyOf":[{"type":"string","enum":["opted_in","opted_out"]},{"type":"null"}]},"voice":{"anyOf":[{"type":"string","enum":["opted_in","opted_out"]},{"type":"null"}]}},"required":["whatsapp","sms","voice"],"additionalProperties":false,"description":"The consent on each channel now (null: never recorded)."},"history":{"type":"array","items":{"$ref":"#/components/schemas/Consent"},"description":"Every change, newest first."}},"required":["contact_id","current","history"],"additionalProperties":false},"ContactDetailUpdate":{"type":"object","properties":{"label":{"description":"A label such as \"mobile\" or \"work\".","anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"is_primary":{"type":"boolean"}},"additionalProperties":false},"ContactEmail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"value":{"type":"string"},"label":{"type":["string","null"]},"is_primary":{"type":"boolean"}},"required":["id","value","label","is_primary"],"additionalProperties":false},"ContactEmailInput":{"type":"object","properties":{"value":{"type":"string","maxLength":320,"description":"An email address."},"label":{"description":"A label such as \"mobile\" or \"work\".","anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"is_primary":{"type":"boolean"}},"required":["value"],"additionalProperties":false},"ContactIdentity":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"external_id":{"type":"string","description":"The identity key on the channel: E.164, a WhatsApp business-scoped user id, an address, or the platform's id."},"display_name":{"type":["string","null"]},"username":{"type":["string","null"]},"verified":{"type":"boolean"},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"}},"required":["id","channel_type","channel_id","external_id","display_name","username","verified","first_seen_at","last_seen_at"],"additionalProperties":false},"ContactMergeResult":{"type":"object","properties":{"merge":{"$ref":"#/components/schemas/Merge"},"contact":{"$ref":"#/components/schemas/Contact"}},"required":["merge","contact"],"additionalProperties":false},"ContactPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"},"description":"Best match first, then newest first."},"next_cursor":{"description":"Pass as `cursor`; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"ContactPhone":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"value":{"type":"string"},"label":{"type":["string","null"]},"is_primary":{"type":"boolean"}},"required":["id","value","label","is_primary"],"additionalProperties":false,"description":"A phone number (E.164)."},"ContactPhoneInput":{"type":"object","properties":{"value":{"type":"string","maxLength":40,"description":"A phone number: international (`+966…`, `00966…`) or local to the organization's default country (`05…`). Read as E.164.","example":"+966 50 123 4567"},"label":{"description":"A label such as \"mobile\" or \"work\".","anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"is_primary":{"type":"boolean"}},"required":["value"],"additionalProperties":false},"ContactStoreRecords":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid"},"customers":{"type":"array","items":{"$ref":"#/components/schemas/StoreCustomer"}},"orders":{"type":"array","items":{"$ref":"#/components/schemas/StoreOrder"},"description":"The latest orders, newest first."}},"required":["contact_id","customers","orders"],"additionalProperties":false},"CreateAiBlock":{"type":"object","properties":{"level":{"$ref":"#/components/schemas/AiLevel"},"channel_id":{"description":"The channel (or web chat widget): for `channel` and `kind`, and for `address` with a phone number.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"kind":{"description":"For `kind` only.","anyOf":[{"$ref":"#/components/schemas/AiKind"},{"type":"null"}]},"channel_address_id":{"description":"For `address`: an email address, account, app or location of the channel.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"description":"For `address`: a phone number of the channel (instead of an address).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":200},"content_markdown":{"type":"string","maxLength":50000,"description":"Markdown: knowledge (facts, prices, policies) or instructions."},"always_include":{"description":"Always sent in full, even when the blocks are large and only relevant parts are sent (default false).","type":"boolean"},"active":{"description":"Sent to the AI agent (default true).","type":"boolean"},"sort_order":{"type":"integer","minimum":0,"maximum":100000,"description":"The block's place in its level, lowest first."}},"required":["level","title","content_markdown"],"additionalProperties":false},"CreateApiKey":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"minItems":1,"maxItems":58,"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"expires_at":{"description":"When the key stops working; absent or null: until it is revoked.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["name","scopes"],"additionalProperties":false},"CreateCampaign":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"channel_type":{"type":"string","enum":["whatsapp","sms","voice"]},"segment_id":{"description":"The audience: a segment of contacts (docs/14).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"channel_id":{"description":"WhatsApp: the channel of the WhatsApp number it sends from.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"description":"Voice: the number it calls from.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"sender_name_id":{"description":"SMS: an approved promotional sender name (ending in `-AD`).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"scheduled_at":{"description":"When to send (in the future, `CAMP-6309`); null sends at launch. KSA sending hours still apply.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"content":{"anyOf":[{"$ref":"#/components/schemas/CampaignWhatsappContentInput"},{"$ref":"#/components/schemas/CampaignSmsContentInput"},{"$ref":"#/components/schemas/CampaignVoiceContentInput"}],"description":"The content of the campaign’s channel (the fields of another channel are refused with `API-8001`)."},"client_key":{"type":"string","pattern":"^[A-Za-z0-9._~-]{1,100}$","description":"Your key for this campaign (letters, digits, `. _ ~ -`, up to 100): creating again with it returns the campaign it made."}},"required":["name","channel_type"],"additionalProperties":false},"CreateCannedReply":{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/CannedReplyScope"},"space_id":{"description":"Required for a space reply.","type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["scope","title","body"],"additionalProperties":false},"CreateChatGroup":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"member_ids":{"default":[],"description":"The members invited with you (you are added as its manager).","maxItems":500,"type":"array","items":{"type":"string","format":"uuid"}}},"required":["name"],"additionalProperties":false},"CreateCompany":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"logo_url":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri","description":"An https URL.","example":"https://cdn.example.com/avatar.png"},{"type":"null"}]},"phone":{"description":"The company's phone number, read as E.164 like contacts' numbers.","anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri","description":"The website, http or https.","example":"https://acme.sa"},{"type":"null"}]},"address":{"anyOf":[{"$ref":"#/components/schemas/CompanyAddress"},{"type":"null"}]},"industry":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"owner_membership_id":{"description":"The account owner: the member responsible for this company.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"tags":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"},"description":"The tag ids (the whole list; tags are defined in the settings)."},"custom_fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$","description":"The key of a custom field: lower-case letters, digits and underscores."},"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom field values by key (fields are defined in the settings); a key set to null is removed, keys left out are kept."},"domains":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":260,"description":"An email domain of the company, e.g. `acme.com` (never a public email provider)."}}},"required":["name"],"additionalProperties":false},"CreateContact":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri","description":"An https URL.","example":"https://cdn.example.com/avatar.png"},{"type":"null"}]},"phones":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/ContactPhoneInput"}},"emails":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/ContactEmailInput"}},"tags":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"},"description":"The tag ids (the whole list; tags are defined in the settings)."},"custom_fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$","description":"The key of a custom field: lower-case letters, digits and underscores."},"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom field values by key (fields are defined in the settings); a key set to null is removed, keys left out are kept."}},"additionalProperties":false,"description":"A new contact needs at least a name, a phone number or an email address."},"CreateCustomField":{"type":"object","properties":{"entity":{"type":"string","enum":["contact","company","ticket"]},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$","description":"The key of a custom field: lower-case letters, digits and underscores."},"label":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["text","number","date","list"]},"options":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"description":"The options of a list field (none for other types)."},"position":{"type":"integer","minimum":0,"maximum":10000}},"required":["entity","key","label","type"],"additionalProperties":false,"description":"The entity, key and type never change (stored values keep their meaning)."},"CreateExport":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/CrmListEntity"},"segment_id":{"description":"Export what this segment lists.","type":"string","format":"uuid"},"filter":{"description":"Export what this filter lists (not with `segment_id`).","$ref":"#/components/schemas/SegmentFilter"}},"required":["entity"],"additionalProperties":false,"description":"Without `segment_id` or `filter`, every live record of the entity."},"CreateImport":{"type":"object","properties":{"file_name":{"type":"string","minLength":1,"maxLength":255,"description":"The file name (no folders).","example":"contacts.csv"},"content":{"type":"string","minLength":1,"description":"The CSV file (UTF-8, comma-separated, header row first; at most 10 MB and 50,000 rows). Columns: `name`, `phone`, `email` (several separated by `;`, the first one primary), `tags` (tag names separated by `;`), `company` (a company name: linked, or created when none has it), and `custom.<key>` for custom fields. Columns an export writes (`id`, `channels`, `last_activity_at`, `created_at`) are read past."}},"required":["file_name","content"],"additionalProperties":false},"CreateInvitation":{"type":"object","properties":{"identifier":{"description":"An email address or a phone number, detected from the text: a first digit, `+` or `(` starts a phone number (international form with `+` or `00` and the calling code, or a Saudi number such as `05X XXX XXXX`; read as E.164) unless a letter or `@` follows; anything else is an email address (read lower-cased). Arabic-Indic digits are accepted.","type":"string","maxLength":254},"email":{"description":"An email address (or use `identifier`).","format":"email","type":"string","maxLength":320},"phone":{"description":"A phone number (or use `identifier`).","type":"string","maxLength":32},"role_id":{"type":"string","format":"uuid","description":"The role the person gets (not the Owner role)."}},"required":["role_id"],"additionalProperties":false,"description":"Exactly one of `identifier` (an email address or a phone number, read like the sign-in field), `email` and `phone` (`AUTH-1059` otherwise)."},"CreateManualWalletEntry":{"type":"object","properties":{"direction":{"type":"string","enum":["credit","debit"],"description":"`credit` adds to the balance, `debit` takes from it (never below zero)."},"amount_minor":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The amount in halalas (SAR minor units), more than 0."},"description":{"type":"string","minLength":1,"maxLength":500,"description":"Shown to the customer in the organization's wallet history."},"external_reference":{"description":"Optional, e.g. a bank transfer number; shown to the customer.","type":"string","minLength":1,"maxLength":200},"internal_note":{"type":"string","minLength":1,"maxLength":1000,"description":"Why the entry is made: platform only (the platform audit log reason), never shown to the customer."},"corrects_entry_id":{"description":"To correct an entry: its id. The correction goes the opposite direction, for at most what is not yet corrected of it.","type":"string","format":"uuid"}},"required":["direction","amount_minor","description","internal_note"],"additionalProperties":false},"CreateNote":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000},"mentioned_membership_ids":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"},"description":"The members (membership ids) mentioned in the note."}},"required":["body"],"additionalProperties":false},"CreateOAuthApp":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"homepage_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"redirect_uris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"description":"Exact redirect URIs: https, http on a loopback address (any port), or a reverse domain name scheme of a native app."},"client_type":{"type":"string","enum":["public","confidential"],"description":"`public`: an app that cannot keep a secret (native, browser, MCP client), PKCE only. `confidential`: a server app with a secret."}},"required":["name","redirect_uris","client_type"],"additionalProperties":false},"CreateOrganization":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"slug":{"description":"A unique short name: lower-case letters, digits and hyphens, 3 to 40 characters. Generated from the name when left out.","type":"string","pattern":"^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){2,39}$"},"default_locale":{"type":"string","enum":["ar","en"]},"timezone":{"type":"string","maxLength":64,"description":"An IANA time zone; times are shown in it.","example":"Asia/Riyadh"},"default_country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2, upper case: the default country of phone numbers.","example":"SA"}},"required":["name"],"additionalProperties":false},"CreatePlatformRole":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"permissions":{"maxItems":7,"type":"array","items":{"$ref":"#/components/schemas/PlatformPermission"}},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["name","permissions","reason"],"additionalProperties":false},"CreateRateCardDraft":{"type":"object","properties":{"based_on_version_id":{"description":"Copy from this version (default: the latest published; null: empty).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"settings":{"$ref":"#/components/schemas/RateCardSettings"},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"additionalProperties":false},"CreateRole":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"permissions":{"maxItems":38,"type":"array","items":{"$ref":"#/components/schemas/PermissionKey"},"description":"The permission keys of the role (docs/18); platform keys are refused."}},"required":["name","permissions"],"additionalProperties":false},"CreateSegment":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"entity":{"$ref":"#/components/schemas/CrmListEntity"},"filter":{"$ref":"#/components/schemas/SegmentFilter"}},"required":["name","entity","filter"],"additionalProperties":false},"CreateSmsOptOut":{"type":"object","properties":{"phone":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$","description":"A mobile number in E.164, e.g. `+966500000000`."},"source":{"description":"`recipient_request` (the recipient asked, by any channel), `member` (the default for members) or `api`.","type":"string","enum":["recipient_request","member","api"]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["phone"],"additionalProperties":false},"CreateSpace":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":2000,"description":"What the space handles; the AI agent routes by name and description."},"returning_customer_days":{"type":"integer","minimum":1,"maximum":365,"description":"A returning customer goes to the member of their last ticket within these days (default 30)."},"no_agent_message":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"description":"The automatic reply when a ticket enters the queue and nobody is available; null or empty: none."}},"required":["name"],"additionalProperties":false},"CreateTicket":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid"},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"channel_address_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"description":"The phone number it is on (voice); with the channel and address, it picks the space.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"type_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"priority":{"$ref":"#/components/schemas/TicketPriority"},"custom_fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":1000},{"type":"number"},{"type":"null"}]},"description":"Custom field values by key; a key set to null is removed."},"recipient":{"description":"Whom it goes to (a start option, `GET /v1/tickets/start-options`): one of the contact’s email addresses (email), phone numbers (WhatsApp, SMS, voice) or channel identities (other channels). Replies go there until the customer writes from elsewhere; `TKT-6140` when it is not the contact’s or not on this channel.","anyOf":[{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"}},"required":["email"],"additionalProperties":false},{"type":"object","properties":{"phone":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"}},"required":["phone"],"additionalProperties":false},{"type":"object","properties":{"identity_id":{"type":"string","format":"uuid"}},"required":["identity_id"],"additionalProperties":false}]}},"required":["contact_id","channel_type"],"additionalProperties":false,"description":"A ticket a member starts for a contact on a channel."},"CreateTopUp":{"type":"object","properties":{"amount":{"type":"integer","minimum":5000,"maximum":999999999999999,"description":"Halalas (SAR minor units), at least 5000 (SAR 50). Rabt sets no maximum: the schema's maximum is only the largest amount the payment provider can be sent exactly. The card's bank or the payment provider may refuse an amount above its own limits (`WAL-1204`, `WAL-1203`, or `WAL-1999` with the provider's own code and message).","example":50000},"payment":{"oneOf":[{"$ref":"#/components/schemas/TopUpCardToken"},{"$ref":"#/components/schemas/TopUpSavedCard"}],"description":"How the top-up is paid."}},"required":["amount","payment"],"additionalProperties":false},"CreateVoiceTrunk":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,62}$","description":"The trunk’s name: letters, digits, `_` or `-`, up to 63; it cannot change."},"host":{"type":"string","pattern":"^[A-Za-z0-9]([A-Za-z0-9.-]{0,251}[A-Za-z0-9])?$","description":"The operator’s signaling host: an IPv4 address or a host name."},"port":{"description":"Default 5060 (5061 for `tls`).","type":"integer","minimum":1,"maximum":65535},"transport":{"default":"tcp","type":"string","enum":["udp","tcp","tls"],"description":"The signaling transport: `tcp` (Zain requires it), `udp` or `tls`."},"priority":{"default":1,"type":"integer","minimum":0,"maximum":9999,"description":"Failover order: the lowest priority is tried first."},"signaling_addresses":{"description":"The operator’s signaling source addresses (IPv4 or CIDR): only they may send calls on this trunk. Empty: the host’s addresses.","maxItems":32,"type":"array","items":{"anyOf":[{"type":"string","format":"ipv4"},{"type":"string","format":"cidrv4","pattern":"^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$"}]}},"media_addresses":{"description":"The operator’s media (RTP) source addresses (IPv4 or CIDR), allowed on this trunk’s calls and opened in the firewall.","maxItems":32,"type":"array","items":{"anyOf":[{"type":"string","format":"ipv4"},{"type":"string","format":"cidrv4","pattern":"^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$"}]}},"authentication":{"default":"ip","type":"string","enum":["ip","digest"],"description":"`ip`: the operator authenticates Rabt by its static addresses; `digest`: also by credentials, set on the voice nodes (SIP_TRUNK_CREDENTIALS)."},"codecs":{"default":["PCMA","PCMU"],"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["PCMA","PCMU","G722"]},"description":"The codecs offered to the operator, in order (default `PCMA`, `PCMU`)."},"caller_id_format":{"default":"e164","type":"string","enum":["e164","national"],"description":"How the caller ID is written on this trunk: `e164` (+9665…) or `national` (05…; other countries with the international prefix). Numbers received are read either way."},"dialed_number_format":{"default":"e164","type":"string","enum":["e164","national"],"description":"How the dialed number is written on this trunk: `e164` (+9665…) or `national` (05…; other countries with the international prefix). Numbers received are read either way."},"country":{"default":"SA","type":"string","pattern":"^[A-Z]{2}$","description":"The country of national numbers on this trunk (ISO 3166-1 alpha-2, e.g. `SA`)."},"max_channels":{"type":"integer","minimum":1,"maximum":10000,"description":"The concurrent calls the operator allows on this trunk: past it, calls go to the next trunk (outbound) or are refused (inbound, VOI-4542)."},"note":{"type":"string","maxLength":500},"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Why (platform audit log)."}},"required":["name","host","max_channels","reason"],"additionalProperties":false},"CreateWebchatWidget":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"business_name":{"type":"string","minLength":1,"maxLength":100,"description":"The name visitors see in the widget header."},"allowed_domains":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":300},"description":"Where the widget may load: host names such as `example.com`, `shop.example.com`, or `*.example.com` for every subdomain (a port only when the site runs on one). Checked against the page’s Origin; `WEB-4016` for one that is not valid."},"greeting":{"type":"object","properties":{"ar":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"en":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"additionalProperties":false},"default_locale":{"type":"string","enum":["ar","en"]},"position":{"type":"string","enum":["left","right"]},"header_color":{"type":"string","enum":["sidebar","teal","plum","sand"]},"pre_chat":{"type":"object","properties":{"enabled":{"type":"boolean"},"name":{"type":"string","enum":["hidden","optional","required"]},"email":{"type":"string","enum":["hidden","optional","required"]},"phone":{"type":"string","enum":["hidden","optional","required"]}},"additionalProperties":false}},"required":["name","business_name","allowed_domains"],"additionalProperties":false},"CreateWebhookEndpoint":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address."},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"event_types":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["url","event_types"],"additionalProperties":false},"CreateWhatsappTemplate":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9_]{1,512}$"},"language":{"type":"string","pattern":"^[a-z]{2,3}(_[A-Za-z]{2,4})?$"},"category":{"type":"string","enum":["marketing","utility","authentication"]},"parameter_format":{"default":"positional","type":"string","enum":["positional","named"]},"components":{"minItems":1,"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["HEADER"]},"format":{"type":"string","enum":["TEXT","IMAGE","VIDEO","DOCUMENT","LOCATION"]},"text":{"type":"string","maxLength":60},"example":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type","format"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["BODY"]},"text":{"type":"string","maxLength":1024},"add_security_recommendation":{"type":"boolean"},"example":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["FOOTER"]},"text":{"type":"string","maxLength":60},"code_expiration_minutes":{"type":"integer","minimum":1,"maximum":90}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["BUTTONS"]},"buttons":{"minItems":1,"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["QUICK_REPLY"]},"text":{"type":"string","minLength":1,"maxLength":25}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["URL"]},"text":{"type":"string","minLength":1,"maxLength":25},"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/"},"example":{"maxItems":1,"type":"array","items":{"type":"string","maxLength":2000}}},"required":["type","text","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["PHONE_NUMBER"]},"text":{"type":"string","minLength":1,"maxLength":25},"phone_number":{"type":"string","pattern":"^\\+?[1-9]\\d{6,14}$"}},"required":["type","text","phone_number"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["COPY_CODE"]},"example":{"type":"string","maxLength":15}},"required":["type","example"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["OTP"]},"otp_type":{"type":"string","enum":["COPY_CODE","ONE_TAP","ZERO_TAP"]},"text":{"type":"string","maxLength":25},"autofill_text":{"type":"string","maxLength":25},"package_name":{"type":"string","maxLength":200},"signature_hash":{"type":"string","maxLength":40}},"required":["type","otp_type"],"additionalProperties":false}]}}},"required":["type","buttons"],"additionalProperties":false}]}}},"required":["name","language","category","components"],"additionalProperties":false,"description":"A template in Meta's component format (HEADER, BODY, FOOTER, BUTTONS). Buttons: quick reply, URL, phone number, copy code, one-time password; interactive Flow and catalog buttons are not offered."},"CrmListEntity":{"type":"string","enum":["contacts","companies"],"description":"What a segment or a transfer lists."},"CrmSettings":{"type":"object","properties":{"auto_link_companies_by_domain":{"type":"boolean"}},"required":["auto_link_companies_by_domain"],"additionalProperties":false},"CrmSettingsInput":{"type":"object","properties":{"auto_link_companies_by_domain":{"type":"boolean","description":"Link new contacts to the company that owns their email domain (public email providers never)."}},"required":["auto_link_companies_by_domain"],"additionalProperties":false},"CrmTransfer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["import","export"]},"entity":{"$ref":"#/components/schemas/CrmListEntity"},"status":{"type":"string","enum":["validating","validated","importing","exporting","completed","failed"],"description":"An import: `validating` (its rows are being checked), `validated` (checked: start it when `error_count` is 0), `importing`, `completed` or `failed`. An export: `exporting`, `completed` or `failed`."},"file_name":{"type":"string"},"filter":{"anyOf":[{"$ref":"#/components/schemas/SegmentFilter"},{"type":"null"}],"description":"An export's filter."},"total_rows":{"type":"integer","minimum":0,"maximum":9007199254740991},"processed_rows":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Progress of the current step."},"created_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Records created (after the check of an import: records it would create)."},"updated_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Contacts completed by an import, matched by phone or email (after the check: that it would update)."},"error_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Rows with errors (see `/errors`)."},"failure":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":["string","null"]}},"required":["code","reference"],"additionalProperties":false},{"type":"null"}],"description":"Why it failed: the error code and its reference."},"requested_by_membership_id":{"type":"string","format":"uuid"},"confirmed_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"confirmed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","kind","entity","status","file_name","filter","total_rows","processed_rows","created_count","updated_count","error_count","failure","requested_by_membership_id","confirmed_by_membership_id","created_at","confirmed_at","finished_at"],"additionalProperties":false,"description":"A CSV import or export (docs/12)."},"CrmTransferPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CrmTransfer"},"description":"Newest first."},"next_cursor":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Pass as `cursor`; null on the last page."}},"required":["data","next_cursor"],"additionalProperties":false},"CsvFile":{"type":"object","properties":{"file_name":{"type":"string"},"content_type":{"type":"string","enum":["text/csv; charset=utf-8"]},"content":{"type":"string","description":"The CSV file (UTF-8 with a byte order mark)."}},"required":["file_name","content_type","content"],"additionalProperties":false},"CurrentSession":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/Account"},"session":{"$ref":"#/components/schemas/Session"},"verified_until":{"type":"string","format":"date-time","description":"Sensitive actions are allowed until then without a new code (10 minutes after the last code); after it they answer `AUTH-1013`."}},"required":["account","session","verified_until"],"additionalProperties":false,"description":"Who is signed in, and in which session."},"CustomersListState":{"type":"object","properties":{"tab":{"type":"string","enum":["contacts","companies","segments"],"description":"The open tab."},"tag_id":{"description":"The tag the list is filtered by.","type":"string","format":"uuid"},"channel_type":{"description":"Contacts only: the channel the list is filtered by.","$ref":"#/components/schemas/ChannelType"},"segment_id":{"description":"The open segment.","type":"string","format":"uuid"}},"required":["tab"],"additionalProperties":false,"description":"How the member left the customers list: its tab, its filters, the open segment."},"CustomField":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"entity":{"type":"string","enum":["contact","company","ticket"]},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","list"]},"options":{"type":"array","items":{"type":"string"}},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time"}},"required":["id","entity","key","label","type","options","position","created_at"],"additionalProperties":false},"CustomFieldList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}}},"required":["data"],"additionalProperties":false},"CustomFieldValue":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"null"}],"description":"A text, a number, a date (`YYYY-MM-DD`) or one option of a list field; null removes the value."},"CustomFieldValues":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number"]},"description":"Values of the live custom fields, by key."},"DegradedMode":{"type":"object","properties":{"mode":{"type":"string","enum":["read_only","outbound_hold","non_essential_off"]},"active":{"type":"boolean"},"source":{"anyOf":[{"type":"string","enum":["switch","environment"]},{"type":"null"}]},"feature":{"type":"string"}},"required":["mode","active","source","feature"],"additionalProperties":false},"DegradedModeList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DegradedMode"}}},"required":["data"],"additionalProperties":false},"DiscardRateCardDraft":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["reason"],"additionalProperties":false},"Draft":{"type":"object","properties":{"mode":{"type":"string","enum":["reply","note"]},"body":{"type":"string"},"attachment_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"mentioned_membership_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"reply_to_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"base_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"updated_at":{"type":"string","format":"date-time"}},"required":["mode","body","attachment_ids","mentioned_membership_ids","reply_to_message_id","base_message_id","updated_at"],"additionalProperties":false,"description":"Your draft on the ticket (kept on the server)."},"DraftInput":{"type":"object","properties":{"mode":{"type":"string","enum":["reply","note"]},"body":{"type":"string","maxLength":100000},"attachment_ids":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"},"description":"Uploaded files kept with the draft."},"mentioned_membership_ids":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"},"description":"Members mentioned in a note draft."},"reply_to_message_id":{"default":null,"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"base_message_id":{"default":null,"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["mode","body"],"additionalProperties":false},"DraftResult":{"type":"object","properties":{"draft":{"anyOf":[{"$ref":"#/components/schemas/Draft"},{"type":"null"}]}},"required":["draft"],"additionalProperties":false},"DuplicateSuggestion":{"type":"object","properties":{"contact":{"$ref":"#/components/schemas/Contact"},"reasons":{"type":"array","items":{"type":"string","enum":["detail_in_field","similar_name"]},"description":"`detail_in_field`: a custom field of one holds a phone number or email address of the other; `similar_name`: similar names and activity within 30 days of each other."}},"required":["contact","reasons"],"additionalProperties":false},"DuplicateSuggestionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DuplicateSuggestion"}}},"required":["data"],"additionalProperties":false},"EditChatMessage":{"type":"object","properties":{"body":{"type":"string","maxLength":10000}},"required":["body"],"additionalProperties":false},"EditWhatsappTemplate":{"type":"object","properties":{"components":{"minItems":1,"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["HEADER"]},"format":{"type":"string","enum":["TEXT","IMAGE","VIDEO","DOCUMENT","LOCATION"]},"text":{"type":"string","maxLength":60},"example":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type","format"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["BODY"]},"text":{"type":"string","maxLength":1024},"add_security_recommendation":{"type":"boolean"},"example":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["FOOTER"]},"text":{"type":"string","maxLength":60},"code_expiration_minutes":{"type":"integer","minimum":1,"maximum":90}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["BUTTONS"]},"buttons":{"minItems":1,"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["QUICK_REPLY"]},"text":{"type":"string","minLength":1,"maxLength":25}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["URL"]},"text":{"type":"string","minLength":1,"maxLength":25},"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/"},"example":{"maxItems":1,"type":"array","items":{"type":"string","maxLength":2000}}},"required":["type","text","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["PHONE_NUMBER"]},"text":{"type":"string","minLength":1,"maxLength":25},"phone_number":{"type":"string","pattern":"^\\+?[1-9]\\d{6,14}$"}},"required":["type","text","phone_number"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["COPY_CODE"]},"example":{"type":"string","maxLength":15}},"required":["type","example"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["OTP"]},"otp_type":{"type":"string","enum":["COPY_CODE","ONE_TAP","ZERO_TAP"]},"text":{"type":"string","maxLength":25},"autofill_text":{"type":"string","maxLength":25},"package_name":{"type":"string","maxLength":200},"signature_hash":{"type":"string","maxLength":40}},"required":["type","otp_type"],"additionalProperties":false}]}}},"required":["type","buttons"],"additionalProperties":false}]}},"category":{"type":"string","enum":["marketing","utility","authentication"]}},"additionalProperties":false},"EffectiveAiSettings":{"type":"object","properties":{"enabled":{"type":"object","properties":{"value":{"type":"boolean"},"source":{"type":"string","enum":["organization","channel","kind","address","default"],"description":"The level that decided it; `default` when no level set it."}},"required":["value","source"],"additionalProperties":false},"only_when_no_member_available":{"type":"object","properties":{"value":{"type":"boolean"},"source":{"type":"string","enum":["organization","channel","kind","address","default"],"description":"The level that decided it; `default` when no level set it."}},"required":["value","source"],"additionalProperties":false},"route_between_spaces":{"type":"object","properties":{"value":{"type":"boolean"},"source":{"type":"string","enum":["organization","channel","kind","address","default"],"description":"The level that decided it; `default` when no level set it."}},"required":["value","source"],"additionalProperties":false}},"required":["enabled","only_when_no_member_available","route_between_spaces"],"additionalProperties":false},"EInvoiceSubmission":{"type":"object","properties":{"provider":{"type":"string","description":"`none`: no e-invoicing system (yet)."},"status":{"anyOf":[{"type":"string","enum":["pending","submitted","accepted","rejected"]},{"type":"null"}]},"reference":{"type":["string","null"]},"uuid":{"type":["string","null"]},"qr_code":{"type":["string","null"]},"document_url":{"type":["string","null"]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["provider","status","reference","uuid","qr_code","document_url","updated_at"],"additionalProperties":false,"description":"The submission to the e-invoicing system."},"EmailChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"address":{"type":"string"},"address_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Its channel address (spaces take its tickets through it); null once disconnected."},"display_name":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/ChannelStatus"},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"$ref":"#/components/schemas/ChannelError"},{"type":"null"}]},"inbound_address":{"description":"Where the mailbox forwards to; null when inbound email is not configured.","type":["string","null"]},"smtp":{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"security":{"$ref":"#/components/schemas/SmtpSecurity"},"username":{"type":"string"}},"required":["host","port","security","username"],"additionalProperties":false},"forwarding":{"type":"object","properties":{"verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"check_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"A check message on its way back (sent, not received yet)."}},"required":["verified_at","check_sent_at"],"additionalProperties":false},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"domain_check":{"anyOf":[{"$ref":"#/components/schemas/SenderDomainCheck"},{"type":"null"}]},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","address","address_id","display_name","status","status_changed_at","last_error","inbound_address","smtp","forwarding","last_inbound_at","domain_check","connected_at","disconnected_at"],"additionalProperties":false},"EmailChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmailChannel"}}},"required":["data"],"additionalProperties":false},"EmailCode":{"type":"object","properties":{"email":{"description":"An email address.","format":"email","type":"string","maxLength":320},"code":{"description":"The 6-digit code from the message.","type":"string","maxLength":32}},"required":["email","code"],"additionalProperties":false},"EmailCodeRequest":{"type":"object","properties":{"email":{"description":"An email address.","format":"email","type":"string","maxLength":320}},"required":["email"],"additionalProperties":false},"EmailSignature":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"space_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Null: the organization’s template."},"body":{"type":"string"},"updated_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"updated_at":{"type":"string","format":"date-time"}},"required":["id","space_id","body","updated_by_membership_id","updated_at"],"additionalProperties":false},"EmailSignatureInput":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":5000,"description":"CommonMark, as the email composer writes, with the variables `{member.name}`, `{member.title}` and `{space.name}`."}},"required":["body"],"additionalProperties":false},"EmailSignatureList":{"type":"object","properties":{"organization":{"anyOf":[{"$ref":"#/components/schemas/EmailSignature"},{"type":"null"}]},"spaces":{"type":"array","items":{"$ref":"#/components/schemas/EmailSignature"}}},"required":["organization","spaces"],"additionalProperties":false},"EmailSignaturePreview":{"type":"object","properties":{"signature":{"description":"CommonMark, filled in (null: none).","type":["string","null"]},"text":{"description":"How it reads in the reply (plain text).","type":["string","null"]}},"required":["signature","text"],"additionalProperties":false},"ErrorCode":{"type":"object","properties":{"code":{"type":"string","example":"WA-2047"},"module":{"type":"object","properties":{"prefix":{"type":"string","example":"WA"},"name":{"type":"string","example":"WhatsApp"}},"required":["prefix","name"],"additionalProperties":false},"http_status":{"type":"integer","minimum":400,"maximum":599,"description":"HTTP status of API responses with this error."},"retryable":{"type":"boolean","description":"Whether the failed action can succeed if tried again."},"fallback":{"type":"boolean","description":"True for the module's fallback code, used when a provider returns an error Rabt has no specific code for yet."},"params":{"type":"array","items":{"type":"string"},"description":"Names used in the texts as `{name}`: each occurrence fills them with its own details."},"text":{"type":"object","properties":{"ar":{"type":"object","properties":{"title":{"type":"string","description":"The reason, in one line."},"cause":{"type":"string","description":"The full explanation."},"fix":{"type":"string","description":"What to do next."}},"required":["title","cause","fix"],"additionalProperties":false},"en":{"type":"object","properties":{"title":{"type":"string","description":"The reason, in one line."},"cause":{"type":"string","description":"The full explanation."},"fix":{"type":"string","description":"What to do next."}},"required":["title","cause","fix"],"additionalProperties":false}},"required":["ar","en"],"additionalProperties":false,"description":"The texts in Arabic and English, with their `{name}` fields."},"provider_codes":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","example":"meta"},"code":{"type":"string","example":"131047"},"subcode":{"type":["string","null"]}},"required":["provider","code","subcode"],"additionalProperties":false},"description":"Provider error codes that map to this code (the provider's own code is shown with it)."},"docs_url":{"type":"string","format":"uri","description":"The public documentation page of the code."}},"required":["code","module","http_status","retryable","fallback","params","text","provider_codes","docs_url"],"additionalProperties":false,"description":"An error code of the Rabt error catalog."},"ErrorLogEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reference":{"type":"string","description":"The reference shown with the error (the trace ID): several errors of one action share it.","example":"ref_4bf92f3577b34da6a3ce929d0e0e4736"},"code":{"type":"string","example":"WA-2047"},"title":{"type":"string","description":"The reason, in one line, in the request language."},"cause":{"type":"string","description":"The full explanation."},"fix":{"type":"string","description":"What to do."},"where":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","example":"ticket"},"id":{"type":"string"},"label":{"type":["string","null"]}},"required":["type","id","label"],"additionalProperties":false},{"type":"null"}],"description":"The affected item, when the error names one."},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"subcode":{"type":["string","null"]},"message":{"type":"string","description":"As received from the provider."},"http_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["name","code","subcode","message","http_status"],"additionalProperties":false},{"type":"null"}],"description":"The provider's own error, exactly as received (docs/23 rule 4)."},"http_status":{"type":"integer","minimum":400,"maximum":599},"retryable":{"type":"boolean","description":"Whether the failed action can succeed again."},"member":{"anyOf":[{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["membership_id","name"],"additionalProperties":false},{"type":"null"}],"description":"The member whose action failed; null for background work."},"occurred_at":{"type":"string","format":"date-time"},"docs_url":{"type":"string","format":"uri","description":"The public documentation page of the code."}},"required":["id","reference","code","title","cause","fix","where","provider","http_status","retryable","member","occurred_at","docs_url"],"additionalProperties":false,"description":"An error recorded for the organization (docs/23)."},"ErrorLogPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ErrorLogEntry"},"description":"Newest first."},"next_cursor":{"description":"Pass as `cursor` for older entries; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false,"description":"A page of the organization's error log."},"ErrorSummary":{"type":"object","properties":{"since":{"type":"string","format":"date-time"},"until":{"type":"string","format":"date-time"},"release":{"type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"codes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"organizations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"first_seen":{"type":"string","format":"date-time"},"last_seen":{"type":"string","format":"date-time"}},"required":["code","organizations","count","first_seen","last_seen"],"additionalProperties":false}}},"required":["since","until","release","total","codes"],"additionalProperties":false},"ExtendedTrial":{"type":"object","properties":{"organization_id":{"type":"string","format":"uuid"},"previous_trial_ends_at":{"type":"string","format":"date-time"},"trial_ends_at":{"type":"string","format":"date-time"}},"required":["organization_id","previous_trial_ends_at","trial_ends_at"],"additionalProperties":false},"ExtendTrial":{"type":"object","properties":{"trial_ends_at":{"type":"string","format":"date-time","description":"The new end: after the current end and now."},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["trial_ends_at","reason"],"additionalProperties":false},"FacebookChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"page_id":{"type":"string"},"page_name":{"type":"string"},"category":{"type":["string","null"]},"status":{"type":"string","enum":["pending","active","needs_reauth","disconnected"],"description":"`pending` until the Page is subscribed to Rabt’s webhooks, `active`, `needs_reauth` (Meta refused the Page token: reconnect), `disconnected`."},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"$ref":"#/components/schemas/FacebookChannelError"},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string"},"description":"The permissions granted at Meta."},"connected_by_name":{"description":"Who connected it, by their Facebook name; null once Meta asked it erased.","type":["string","null"]},"connected_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"subscribed_fields":{"type":"array","items":{"type":"string"}},"subscribed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"policy_enforcement":{"anyOf":[{"type":"object","properties":{"action":{"type":"string"},"reason":{"type":["string","null"]},"at":{"type":"string","format":"date-time"}},"required":["action","reason","at"],"additionalProperties":false},{"type":"null"}],"description":"Meta’s last policy action on the Page (a block or warning)."},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"api_version":{"type":["string","null"]},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","page_id","page_name","category","status","status_changed_at","last_error","scopes","connected_by_name","connected_by_membership_id","subscribed_fields","subscribed_at","policy_enforcement","last_inbound_at","api_version","connected_at","disconnected_at"],"additionalProperties":false},"FacebookChannelError":{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"Why the channel needs attention (docs/23)."},"FacebookChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FacebookChannel"}}},"required":["data"],"additionalProperties":false},"FacebookConnectResult":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FacebookChannel"},"description":"The Pages connected or reconnected, with the permissions granted."},"refused":{"type":"array","items":{"type":"object","properties":{"page_id":{"type":"string"},"page_name":{"type":"string"},"code":{"type":"string"},"reference":{"type":"string"}},"required":["page_id","page_name","code","reference"],"additionalProperties":false},"description":"Pages chosen but not connected (`FB-2005`: live in another organization)."}},"required":["data","refused"],"additionalProperties":false},"FacebookConnectStart":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Facebook's login dialog: open it in the person's browser. Facebook sends them back to Rabt's callback page, which completes the connection."},"expires_at":{"type":"string","format":"date-time","description":"The flow must be completed before then."}},"required":["url","expires_at"],"additionalProperties":false},"FullContext":{"type":"object","properties":{"data":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket_start"]},"occurred_at":{"type":"string","format":"date-time"},"ticket":{"$ref":"#/components/schemas/HistoryTicket"}},"required":["type","occurred_at","ticket"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["message"]},"occurred_at":{"type":"string","format":"date-time"},"ticket":{"$ref":"#/components/schemas/HistoryTicket"},"message":{"$ref":"#/components/schemas/Message"}},"required":["type","occurred_at","ticket","message"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["campaign_message"]},"id":{"type":"string","format":"uuid"},"occurred_at":{"type":"string","format":"date-time"},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"What the entry shows, e.g. a campaign message: `campaign_id`, `campaign_name`, `status`, `key_press`, `reply_ticket_id`."}},"required":["type","id","occurred_at","channel_type","details"],"additionalProperties":false}]}},"next_cursor":{"description":"Older items; null at the start.","type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false,"description":"Every message, call, campaign message and (on request) internal note with the contact, across channels, tickets and merged identities: newest first (show them in time order). Each ticket starts with a divider; tickets you cannot access show only their divider's number, channel and date."},"GmailAuthorization":{"type":"object","properties":{"authorization_url":{"type":"string","format":"uri","description":"Where the member signs in with Google."},"state":{"type":"string","description":"The sign-in’s `state` (it starts with the organization id); Google sends it back with the code."},"expires_at":{"type":"string","format":"date-time","description":"The sign-in must be finished before this time."}},"required":["authorization_url","state","expires_at"],"additionalProperties":false},"GmailChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"address":{"type":"string","description":"The mailbox (its primary address)."},"hosted_domain":{"description":"The Google Workspace domain; null for a consumer Gmail account.","type":["string","null"]},"status":{"type":"string","enum":["pending","active","needs_reauth","disconnected"],"description":"`active`, `needs_reauth` (Google refused the saved access: reconnect), or `disconnected`."},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string"},"description":"The permissions Google granted."},"addresses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"address":{"type":"string"},"display_name":{"type":["string","null"]},"is_default":{"type":"boolean"},"send_as_verified":{"type":"boolean","description":"Gmail may send as it (primary, or a verified “Send mail as”)."}},"required":["id","address","display_name","is_default","send_as_verified"],"additionalProperties":false}},"watch":{"type":"object","properties":{"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"renewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["expires_at","renewed_at"],"additionalProperties":false},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_full_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"domain_check":{"anyOf":[{"type":"object","properties":{"domain":{"type":"string"},"checked_at":{"type":"string","format":"date-time"},"checks":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["spf","dkim","dmarc","reverse_dns"]},"status":{"type":"string","enum":["pass","warning","fail","unknown"]},"finding":{"type":"string","enum":["spf_found","spf_missing","spf_multiple","spf_allows_all","dkim_aligned","dkim_unaligned","dkim_key_missing","dkim_not_signed","dkim_not_checked","dmarc_enforced","dmarc_monitor_only","dmarc_missing","reverse_dns_confirmed","reverse_dns_missing","reverse_dns_mismatch","lookup_failed"]},"name":{"type":"string"},"record":{"type":["string","null"]}},"required":["key","status","finding","name","record"],"additionalProperties":false}}},"required":["domain","checked_at","checks"],"additionalProperties":false},{"type":"null"}]},"sending":{"type":"object","properties":{"last_24_hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Replies sent from the channel in 24 hours."},"daily_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Google’s daily sending limit per user."}},"required":["last_24_hours","daily_limit"],"additionalProperties":false},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","address","hosted_domain","status","status_changed_at","last_error","scopes","addresses","watch","last_sync_at","last_full_sync_at","last_inbound_at","domain_check","sending","connected_at","disconnected_at"],"additionalProperties":false},"GmailChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GmailChannel"}}},"required":["data"],"additionalProperties":false},"GoogleBusinessAuthorization":{"type":"object","properties":{"authorization_url":{"type":"string","format":"uri","description":"Where the member signs in with Google."},"state":{"type":"string","description":"The sign-in’s `state` (it starts with the organization id); Google sends it back with the code."},"expires_at":{"type":"string","format":"date-time","description":"The sign-in must be finished before this time."}},"required":["authorization_url","state","expires_at"],"additionalProperties":false},"GoogleBusinessAvailableLocations":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Google’s business account id."},"name":{"type":"string"},"type":{"description":"`PERSONAL`, `LOCATION_GROUP`, `USER_GROUP` or `ORGANIZATION`.","type":["string","null"]},"role":{"description":"The Google account’s role on it: `PRIMARY_OWNER`, `OWNER`, `MANAGER`, `SITE_MANAGER`.","type":["string","null"]},"locations":{"type":"array","items":{"type":"object","properties":{"location_id":{"type":"string"},"name":{"type":"string"},"address":{"type":["string","null"]},"place_id":{"type":["string","null"]},"maps_uri":{"type":["string","null"]},"selected":{"type":"boolean","description":"Chosen on this channel."},"other_channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Another channel of the organization carries it (it cannot be chosen)."}},"required":["location_id","name","address","place_id","maps_uri","selected","other_channel_id"],"additionalProperties":false}}},"required":["id","name","type","role","locations"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false,"description":"The business accounts and locations the channel’s Google account manages."},"GoogleBusinessChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"google_account":{"type":"string","description":"The Google account signed in with."},"status":{"type":"string","enum":["pending","active","needs_reauth","disconnected"],"description":"`active`, `needs_reauth` (Google refused the saved access: reconnect), or `disconnected`."},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"The catalog code, e.g. `APS-3701` or `GBP-3806`."},"reference":{"type":"string","description":"The error log reference."},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"An error kept on the item it stopped (docs/23)."},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string"},"description":"The permissions Google granted."},"api_version":{"type":["string","null"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Google’s business account id (`accounts/{id}`)."},"name":{"type":"string"},"notifications":{"type":"string","enum":["on","off","failed","not_configured"],"description":"Real-time review notifications: `on` (to Rabt’s Pub/Sub topic), `failed` (Google refused; retried at every reconciliation), `not_configured` (Rabt has no topic: new reviews come with the reconciliation every few minutes), `off`."},"notifications_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"notifications_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"The catalog code, e.g. `APS-3701` or `GBP-3806`."},"reference":{"type":"string","description":"The error log reference."},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"An error kept on the item it stopped (docs/23)."},{"type":"null"}]}},"required":["id","name","notifications","notifications_checked_at","notifications_error"],"additionalProperties":false},"description":"The business accounts of the chosen locations."},"locations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The location’s review source id."},"address_id":{"type":"string","format":"uuid","description":"The location’s channel address: assign it to a space (`POST /v1/spaces/{space_id}/channels` with `channel_address_id`) or route it on the address routing page (docs/17)."},"location_id":{"type":"string","description":"Google’s location id."},"name":{"type":"string"},"account_id":{"type":"string"},"account_name":{"type":["string","null"]},"address":{"type":["string","null"]},"place_id":{"type":["string","null"]},"maps_uri":{"type":["string","null"]},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"The last reading of its reviews."},"read_ok_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"The catalog code, e.g. `APS-3701` or `GBP-3806`."},"reference":{"type":"string","description":"The error log reference."},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"An error kept on the item it stopped (docs/23)."},{"type":"null"}],"description":"Why the last reading failed; null after a good one."}},"required":["id","address_id","location_id","name","account_id","account_name","address","place_id","maps_uri","read_at","read_ok_at","last_error"],"additionalProperties":false},"description":"The chosen locations, by name."},"reply_rules":{"$ref":"#/components/schemas/ReviewReplyRules"},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_reconcile_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"locations_changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","google_account","status","status_changed_at","last_error","scopes","api_version","accounts","locations","reply_rules","last_inbound_at","last_reconcile_at","locations_changed_at","connected_at","disconnected_at"],"additionalProperties":false},"GoogleBusinessChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GoogleBusinessChannel"}}},"required":["data"],"additionalProperties":false},"GooglePlayChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"client_email":{"type":"string","description":"The service account’s address."},"project_id":{"type":"string"},"key_id":{"type":"string","description":"The key’s id (`private_key_id`)."},"package_names":{"type":"array","items":{"type":"string"},"description":"Package names added by hand."},"status":{"type":"string","enum":["pending","active","needs_reauth","disconnected"],"description":"`active`, `needs_reauth` (Google refused the key, a permission or an API: check again or reconnect) or `disconnected`."},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"The catalog code, e.g. `APS-3701` or `GBP-3806`."},"reference":{"type":"string","description":"The error log reference."},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"An error kept on the item it stopped (docs/23)."},{"type":"null"}]},"apps":{"type":"array","items":{"type":"object","properties":{"address_id":{"type":"string","format":"uuid","description":"The app’s channel address: assign it to a space (`POST /v1/spaces/{space_id}/channels` with `channel_address_id`) to route its reviews."},"package_name":{"type":"string"},"name":{"type":"string"},"added_by_hand":{"type":"boolean"},"polled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"polled_ok_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_poll_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"The catalog code, e.g. `APS-3701` or `GBP-3806`."},"reference":{"type":"string","description":"The error log reference."},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"An error kept on the item it stopped (docs/23)."},{"type":"null"}]},"covered_through":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Every review written or changed up to this time was read."},"reviews_lost_after":{"type":"string","format":"date-time","description":"Google lists reviews for 7 days: reviews are missed unless polling reads the app again before this time."},"coverage":{"type":"string","enum":["current","delayed","stalled"],"description":"`current`; `delayed` (more than an hour behind); `stalled` (more than a day behind: alerted)."},"coverage_gap":{"anyOf":[{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"until":{"type":"string","format":"date-time"},"detected_at":{"type":"string","format":"date-time"},"code":{"type":"string"},"reference":{"type":"string"}},"required":["from","until","detected_at","code","reference"],"additionalProperties":false,"description":"The last stretch polling did not read: reviews written or changed between `from` and `until` may be missing (see them in Play Console)."},{"type":"null"}]}},"required":["address_id","package_name","name","added_by_hand","polled_at","polled_ok_at","last_poll_error","covered_through","reviews_lost_after","coverage","coverage_gap"],"additionalProperties":false}},"reply_rules":{"$ref":"#/components/schemas/ReviewReplyRules"},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","client_email","project_id","key_id","package_names","status","status_changed_at","last_error","apps","reply_rules","last_inbound_at","connected_at","disconnected_at"],"additionalProperties":false},"GooglePlayChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GooglePlayChannel"}}},"required":["data"],"additionalProperties":false},"Health":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"],"additionalProperties":false},"HighlightedText":{"type":"object","properties":{"text":{"type":"string"},"highlights":{"type":"array","items":{"type":"object","properties":{"start":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Offset in UTF-16 code units (JavaScript string index)."},"length":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["start","length"],"additionalProperties":false},"description":"The parts of `text` that matched."}},"required":["text","highlights"],"additionalProperties":false},"HistoryTicket":{"anyOf":[{"type":"object","properties":{"restricted":{"type":"boolean","enum":[false]},"id":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"subject":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/TicketStatus"},"created_at":{"type":"string","format":"date-time"}},"required":["restricted","id","number","channel_type","subject","status","created_at"],"additionalProperties":false},{"type":"object","properties":{"restricted":{"type":"boolean","enum":[true]},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"created_at":{"type":"string","format":"date-time"}},"required":["restricted","number","channel_type","created_at"],"additionalProperties":false}],"description":"A ticket of the history; in a space you cannot access: number, channel and date only."},"Incident":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}},"required":["ar","en"],"additionalProperties":false},"impact":{"type":"string","enum":["degraded_performance","partial_outage","major_outage","maintenance"]},"severity":{"type":"string","enum":["sev1","sev2","sev3","sev4"]},"status":{"type":"string","enum":["investigating","identified","monitoring","resolved"]},"components":{"type":"array","items":{"type":"string"}},"show_in_app":{"type":"boolean"},"started_at":{"type":"string","format":"date-time"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_by_membership_id":{"type":"string","format":"uuid"},"updates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["investigating","identified","monitoring","resolved"]},"message":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}},"required":["ar","en"],"additionalProperties":false},"membership_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"}},"required":["id","status","message","membership_id","created_at"],"additionalProperties":false}}},"required":["id","title","impact","severity","status","components","show_in_app","started_at","resolved_at","created_by_membership_id","updates"],"additionalProperties":false},"IncidentPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Incident"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"InstagramChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"account_id":{"type":"string","description":"The Instagram professional account id."},"username":{"type":"string"},"account_name":{"type":["string","null"]},"login":{"type":"string","enum":["facebook","instagram"],"description":"How it was connected: through its Facebook Page, or with Instagram Login."},"page_id":{"description":"Facebook Login: the linked Page.","type":["string","null"]},"page_name":{"type":["string","null"]},"status":{"type":"string","enum":["pending","active","needs_reauth","disconnected"],"description":"`pending` until the account is subscribed to Rabt’s webhooks, `active`, `needs_reauth` (Meta refused the token: reconnect), `disconnected`."},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"$ref":"#/components/schemas/InstagramChannelError"},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string"},"description":"The permissions granted at Meta."},"connected_by_name":{"description":"Who connected it, by their name at Meta; null once Meta asked it erased.","type":["string","null"]},"connected_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"subscribed_fields":{"type":"array","items":{"type":"string"}},"subscribed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"token_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Instagram Login: when the token expires (Rabt refreshes it 10 days ahead); null for a Page token, which does not expire."},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"api_version":{"type":["string","null"]},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","account_id","username","account_name","login","page_id","page_name","status","status_changed_at","last_error","scopes","connected_by_name","connected_by_membership_id","subscribed_fields","subscribed_at","token_expires_at","last_inbound_at","api_version","connected_at","disconnected_at"],"additionalProperties":false},"InstagramChannelError":{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"Why the channel needs attention (docs/23)."},"InstagramChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InstagramChannel"}},"logins":{"$ref":"#/components/schemas/InstagramLoginOptions"}},"required":["data","logins"],"additionalProperties":false},"InstagramConnectResult":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InstagramChannel"},"description":"The accounts connected or reconnected, with the permissions granted."},"refused":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"username":{"type":"string"},"code":{"type":"string"},"reference":{"type":"string"}},"required":["account_id","username","code","reference"],"additionalProperties":false},"description":"Accounts not connected (`IG-2005`: live in another organization)."},"pages_without_account":{"type":"array","items":{"type":"object","properties":{"page_id":{"type":"string"},"page_name":{"type":"string"}},"required":["page_id","page_name"],"additionalProperties":false},"description":"Facebook Login: Pages chosen that are linked to no Instagram professional account."}},"required":["data","refused","pages_without_account"],"additionalProperties":false},"InstagramConnectStart":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Meta's sign-in window (Facebook's or Instagram's): open it in the person's browser. Meta sends them back to Rabt's callback page, which completes the connection."},"expires_at":{"type":"string","format":"date-time","description":"The flow must be completed before then."}},"required":["url","expires_at"],"additionalProperties":false},"InstagramLoginOptions":{"type":"object","properties":{"facebook":{"type":"boolean","description":"Facebook Login is offered: the account is reached through the Facebook Page it is linked to."},"instagram":{"type":"boolean","description":"Instagram Login is offered: the professional account signs in itself, no Page needed."}},"required":["facebook","instagram"],"additionalProperties":false,"description":"The ways to connect this Rabt offers (both false: Instagram is not set up)."},"InstagramMedia":{"type":"object","properties":{"id":{"type":"string","description":"The Instagram media id (`media_id` of a post share)."},"caption":{"type":["string","null"]},"media_type":{"type":"string","description":"Meta’s `media_type`: IMAGE, VIDEO or CAROUSEL_ALBUM."},"media_product_type":{"description":"Meta’s `media_product_type`: FEED, REELS or STORY.","type":["string","null"]},"preview_url":{"description":"The image, or a video’s cover, on Instagram’s CDN (it expires).","type":["string","null"]},"permalink":{"type":["string","null"]},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","caption","media_type","media_product_type","preview_url","permalink","posted_at"],"additionalProperties":false},"InstagramMediaList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InstagramMedia"}}},"required":["data"],"additionalProperties":false},"InstagramSentMessage":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean","description":"The client key was used before: its message."}},"required":["message_id","duplicate"],"additionalProperties":false},"InstalledApp":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"client_id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["registered","metadata_document"],"description":"`registered`: an app registered in Rabt. `metadata_document`: a client identified by its Client ID Metadata Document URL (MCP clients)."},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"resource":{"type":"string","description":"The REST API or the MCP server (RFC 8707)."},"status":{"type":"string","enum":["active","revoked"]},"member":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["membership_id","name"],"additionalProperties":false,"description":"The member who installed it: its tokens act as them."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","client_id","name","kind","scopes","resource","status","member","created_at","updated_at","revoked_at"],"additionalProperties":false,"description":"An OAuth app installed in this organization."},"InstalledAppList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InstalledApp"}}},"required":["data"],"additionalProperties":false},"Integration":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"adapter":{"type":"string","description":"`salla`, `zid` or `shopify`."},"label":{"type":"string","description":"The platform’s name."},"name":{"type":"string","description":"The store’s name."},"external_account_id":{"type":"string","description":"The platform’s id of the store."},"status":{"type":"string","enum":["active","needs_reauth","disconnected"],"description":"`active`, `needs_reauth` (the platform refused the saved access: reconnect), or `disconnected`."},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"$ref":"#/components/schemas/IntegrationError"},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string"},"description":"The permissions the store granted."},"api_version":{"type":"string"},"configured":{"type":"boolean","description":"Whether its platform is set up on this Rabt (otherwise it waits: `SYS-1001`)."},"token_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"webhooks":{"type":"object","properties":{"managed":{"type":"boolean","description":"Rabt creates the store’s webhook subscriptions (the platform needs it)."},"subscribed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["managed","subscribed_at"],"additionalProperties":false},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_webhook_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"latest_sync_run":{"anyOf":[{"$ref":"#/components/schemas/IntegrationSyncRun"},{"type":"null"}]},"counts":{"type":"object","properties":{"customers":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"orders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["customers","orders"],"additionalProperties":false},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","adapter","label","name","external_account_id","status","status_changed_at","last_error","scopes","api_version","configured","token_expires_at","webhooks","last_synced_at","last_webhook_at","latest_sync_run","counts","connected_at","disconnected_at"],"additionalProperties":false},"IntegrationAuthorization":{"type":"object","properties":{"authorization_url":{"type":"string","format":"uri","description":"Where the member signs in to the platform."},"state":{"type":"string","description":"The sign-in’s `state` (it starts with the organization id); the platform sends it back with the code."},"expires_at":{"type":"string","format":"date-time","description":"The sign-in must be finished before this time."}},"required":["authorization_url","state","expires_at"],"additionalProperties":false},"IntegrationError":{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false},"IntegrationList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Integration"}}},"required":["data"],"additionalProperties":false},"IntegrationPlatform":{"type":"object","properties":{"adapter":{"type":"string","description":"`salla`, `zid` or `shopify`."},"label":{"type":"string","description":"The platform’s name."},"configured":{"type":"boolean","description":"Whether it can be connected on this Rabt; connecting one that is not answers `SYS-1001`."},"account_hint":{"anyOf":[{"type":"string","enum":["none","shop_domain"]},{"type":"null"}],"description":"What the member types before signing in (`shop_domain`: the store’s address)."}},"required":["adapter","label","configured","account_hint"],"additionalProperties":false},"IntegrationPlatformList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationPlatform"}}},"required":["data"],"additionalProperties":false},"IntegrationSyncRun":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"trigger":{"type":"string","enum":["connect","reconnect","schedule","member"]},"status":{"type":"string","enum":["queued","running","succeeded","failed"],"description":"`queued`, `running`, `succeeded`, or `failed` with its `error` (a new sync tries again)."},"customers_synced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"orders_synced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"error":{"anyOf":[{"$ref":"#/components/schemas/IntegrationError"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","trigger","status","customers_synced","orders_synced","started_at","finished_at","error","created_at"],"additionalProperties":false},"IntegrationSyncRunList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationSyncRun"}}},"required":["data"],"additionalProperties":false},"Invitation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":["string","null"]},"phone":{"description":"E.164.","type":["string","null"]},"role":{"$ref":"#/components/schemas/RoleRef"},"invited_by":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["membership_id","name"],"additionalProperties":false},"status":{"type":"string","enum":["pending","expired","accepted","declined","revoked"]},"expires_at":{"type":"string","format":"date-time"},"sent_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"declined_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","email","phone","role","invited_by","status","expires_at","sent_at","created_at","accepted_at","declined_at"],"additionalProperties":false,"description":"An invitation to the organization (docs/05)."},"InvitationList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"},"description":"Invitations not answered and not withdrawn, newest first."}},"required":["data"],"additionalProperties":false},"InvitationPreview":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"role":{"$ref":"#/components/schemas/RoleRef"},"invited_by_name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"status":{"type":"string","enum":["pending","expired","accepted","declined","revoked"]},"expires_at":{"type":"string","format":"date-time"},"for_this_account":{"type":"boolean","description":"Whether it was sent to the signed-in account's email or verified phone (only then can it be accepted)."}},"required":["organization","role","invited_by_name","email","phone","status","expires_at","for_this_account"],"additionalProperties":false,"description":"An invitation, as the invited person sees it."},"InvitationToken":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":200,"description":"The token of the invitation link (after `#token=`)."}},"required":["token"],"additionalProperties":false},"Invoice":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"state":{"type":"string","enum":["open","draft","finalized","empty"],"description":"`open`: the running month so far; `draft`: the month ended and is not closed yet; `finalized`: the tax invoice; `empty`: closed with nothing billed."},"number":{"type":["string","null"],"example":"RB-2026-000123"},"period_month":{"type":"string","example":"2026-09-01"},"period_start":{"type":"string","format":"date-time"},"period_end":{"type":"string","format":"date-time"},"totals":{"anyOf":[{"$ref":"#/components/schemas/InvoiceTotals"},{"type":"null"}]},"finalized_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"einvoice":{"anyOf":[{"$ref":"#/components/schemas/EInvoiceSubmission"},{"type":"null"}]},"email":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["sent","failed"]},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"error_code":{"type":["string","null"]},"error_reference":{"type":["string","null"]}},"required":["status","sent_at","error_code","error_reference"],"additionalProperties":false},{"type":"null"}],"description":"The PDF sent to the billing email."},"sections":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceSection"}},"seller":{"anyOf":[{"$ref":"#/components/schemas/BillingParty"},{"type":"null"}]},"buyer":{"anyOf":[{"$ref":"#/components/schemas/BillingParty"},{"type":"null"}]}},"required":["id","state","number","period_month","period_start","period_end","totals","finalized_at","einvoice","email","sections","seller","buyer"],"additionalProperties":false,"description":"A monthly invoice grouped per resource (docs/10); a draft or the running month is laid out live."},"InvoiceLine":{"type":"object","properties":{"metric":{"type":"string"},"item_key":{"type":["string","null"]},"dimensions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"description":{"$ref":"#/components/schemas/BilingualText"},"quantity":{"type":"string","description":"Base units (messages, tokens, seats), decimal text."},"unit":{"type":"string"},"unit_size":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The unit price is for this many base units."},"unit_price":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["metric","item_key","dimensions","description","quantity","unit","unit_size","unit_price","amount"],"additionalProperties":false},"InvoiceList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceSummary"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false,"description":"Months that ended, newest first."},"InvoiceNote":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"invoice_id":{"type":"string","format":"uuid"},"invoice_number":{"type":"string"},"type":{"type":"string","enum":["credit","debit"]},"number":{"type":"string","example":"CN-2026-000012"},"reason":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"string"},"unit_price":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["description","quantity","unit_price","amount"],"additionalProperties":false}},"totals":{"$ref":"#/components/schemas/InvoiceTotals"},"seller":{"$ref":"#/components/schemas/BillingParty"},"buyer":{"$ref":"#/components/schemas/BillingParty"},"issued_at":{"type":"string","format":"date-time"},"einvoice":{"$ref":"#/components/schemas/EInvoiceSubmission"}},"required":["id","invoice_id","invoice_number","type","number","reason","lines","totals","seller","buyer","issued_at","einvoice"],"additionalProperties":false,"description":"A credit or debit note correcting an invoice."},"InvoiceNoteList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceNote"}}},"required":["data"],"additionalProperties":false,"description":"Oldest first."},"InvoiceSection":{"type":"object","properties":{"resource_type":{"type":"string","enum":["seat","channel","channel_address","phone_number","sender_name","ai"]},"resource_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"service":{"type":["string","null"]},"label":{"type":"string"},"title":{"$ref":"#/components/schemas/BilingualText"},"subtotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"lines":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLine"}}},"required":["resource_type","resource_id","service","label","title","subtotal","lines"],"additionalProperties":false},"InvoiceSummary":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"state":{"type":"string","enum":["open","draft","finalized","empty"],"description":"`open`: the running month so far; `draft`: the month ended and is not closed yet; `finalized`: the tax invoice; `empty`: closed with nothing billed."},"number":{"type":["string","null"],"example":"RB-2026-000123"},"period_month":{"type":"string","example":"2026-09-01"},"period_start":{"type":"string","format":"date-time"},"period_end":{"type":"string","format":"date-time"},"totals":{"anyOf":[{"$ref":"#/components/schemas/InvoiceTotals"},{"type":"null"}]},"finalized_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"einvoice":{"anyOf":[{"$ref":"#/components/schemas/EInvoiceSubmission"},{"type":"null"}]},"email":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["sent","failed"]},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"error_code":{"type":["string","null"]},"error_reference":{"type":["string","null"]}},"required":["status","sent_at","error_code","error_reference"],"additionalProperties":false},{"type":"null"}],"description":"The PDF sent to the billing email."}},"required":["id","state","number","period_month","period_start","period_end","totals","finalized_at","einvoice","email"],"additionalProperties":false},"InvoiceTotals":{"type":"object","properties":{"subtotal":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Without VAT."},"tax":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The VAT included in the total."},"total":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"What the wallet was charged, VAT included."},"vat_rate":{"type":"string","description":"The VAT rate, a percentage.","example":"15"}},"required":["subtotal","tax","total","vat_rate"],"additionalProperties":false},"IssuedApiKey":{"type":"object","properties":{"api_key":{"$ref":"#/components/schemas/ApiKey"},"key":{"type":"string","description":"The key: send it as `Authorization: Bearer <key>`. Shown only now; Rabt keeps only its hash."}},"required":["api_key","key"],"additionalProperties":false},"IssuedInvitation":{"type":"object","properties":{"invitation":{"$ref":"#/components/schemas/Invitation"},"link":{"type":"string","format":"uri","description":"The link that accepts the invitation, shown once (only a hash of its token is kept). Share it with the person; a new link replaces it when the invitation is sent again."},"emailed":{"type":"boolean","description":"Whether Rabt emailed it (invitations by phone are shared by link)."}},"required":["invitation","link","emailed"],"additionalProperties":false},"LaunchCampaign":{"type":"object","properties":{"confirmed_fingerprint":{"description":"The `estimate.fingerprint` of the review you confirmed: `WAL-1113` when the prices changed since.","type":"string","minLength":1,"maxLength":200}},"additionalProperties":false},"LiftSmsOptOut":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500,"description":"Why the number may get SMS again (the recipient asked)."}},"required":["reason"],"additionalProperties":false},"LinkPreviewResult":{"type":"object","properties":{"preview":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","description":"The link."},"title":{"type":["string","null"]},"description":{"type":["string","null"]},"site_name":{"type":["string","null"]},"image_url":{"description":"A signed link (one hour) to the page’s image as Rabt keeps it; the site itself is never loaded by the reader.","type":["string","null"]},"source":{"type":"string","enum":["channel","fetched"],"description":"`channel`: the preview the channel sent; `fetched`: read by Rabt."},"fetched_at":{"type":"string","format":"date-time"}},"required":["url","title","description","site_name","image_url","source","fetched_at"],"additionalProperties":false},{"type":"null"}],"description":"Null when the message has no link, or its page could not be read (tried again after an hour)."}},"required":["preview"],"additionalProperties":false,"description":"The preview of a message’s first link: the page’s title, description, site name and image (docs/13, build section U)."},"LogSmsComplaint":{"type":"object","properties":{"source":{"type":"string","enum":["regulator","operator","recipient"]},"description":{"type":"string","minLength":1,"maxLength":2000},"external_reference":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"recipient_phone":{"anyOf":[{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$","description":"A mobile number in E.164, e.g. `+966500000000`."},{"type":"null"}]},"received_at":{"type":"string","format":"date-time"}},"required":["source","description","received_at"],"additionalProperties":false},"ManualWalletEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","format":"uuid"},"number":{"type":"string","description":"`MN-YYYY-NNNNNN`, from its own gap-free sequence."},"direction":{"type":"string","enum":["credit","debit"],"description":"`credit` adds to the balance, `debit` takes from it (never below zero)."},"amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"description":{"type":"string"},"external_reference":{"type":["string","null"]},"internal_note":{"type":"string","description":"Platform only."},"balance_before_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"balance_after_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"wallet_transaction_id":{"type":"string","format":"uuid","description":"Its `adjustment` wallet transaction."},"corrects_entry_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"corrected_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How much of it later entries corrected."},"created_by_membership_id":{"type":"string","format":"uuid"},"created_by_account_id":{"type":"string","format":"uuid"},"api_key_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","number","direction","amount_minor","description","external_reference","internal_note","balance_before_minor","balance_after_minor","wallet_transaction_id","corrects_entry_id","corrected_minor","created_by_membership_id","created_by_account_id","api_key_id","created_at"],"additionalProperties":false,"description":"A manual entry of the Rabt team in an organization's wallet (docs/10)."},"ManualWalletEntryPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ManualWalletEntry"},"description":"Newest first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"MarkAllNotificationsRead":{"type":"object","properties":{"up_to_id":{"description":"The newest notification the member saw: it and older ones are marked read, newer ones stay unread. Left out: every notification up to now.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"additionalProperties":false},"MarkChatRead":{"type":"object","properties":{"seq":{"description":"Read up to this message number; the room's last when absent.","type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"MarkTicketRead":{"type":"object","properties":{"message_id":{"description":"Read through this item of the timeline; without it, through the newest item.","type":"string","format":"uuid"}},"additionalProperties":false},"MarkupOverride":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","format":"uuid"},"service":{"type":"string","enum":["whatsapp","x","sms","voice","ai","email"]},"markup_percent":{"description":"Null: this entry removed the override.","type":["string","null"]},"reason":{"type":"string"},"created_by_membership_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time","description":"New events of the service are priced with it from then on."}},"required":["id","organization_id","service","markup_percent","reason","created_by_membership_id","created_at"],"additionalProperties":false},"MarkupOverrides":{"type":"object","properties":{"current":{"type":"array","items":{"$ref":"#/components/schemas/MarkupOverride"},"description":"The override in force per service."},"history":{"type":"array","items":{"$ref":"#/components/schemas/MarkupOverride"},"description":"Every entry, newest first."}},"required":["current","history"],"additionalProperties":false},"Member":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The membership id."},"account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"},"avatar_url":{"type":["string","null"]}},"required":["id","name","email","avatar_url"],"additionalProperties":false},"role":{"$ref":"#/components/schemas/RoleRef"},"platform_role":{"anyOf":[{"$ref":"#/components/schemas/RoleRef"},{"type":"null"}]},"is_owner":{"type":"boolean"},"job_title":{"type":["string","null"]},"seat_state":{"type":"string","enum":["active","inactive"]},"availability":{"type":"string","enum":["available","unavailable"]},"joined_at":{"type":"string","format":"date-time"}},"required":["id","account","role","platform_role","is_owner","job_title","seat_state","availability","joined_at"],"additionalProperties":false,"description":"A member of the organization (docs/05 \"Membership\")."},"MemberList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Member"},"description":"In the order they joined."}},"required":["data"],"additionalProperties":false},"MemberListView":{"type":"string","enum":["customers","tickets"],"description":"The list: `customers` or `tickets`."},"MemberListViewDocument":{"type":"object","properties":{"view":{"$ref":"#/components/schemas/MemberListView"},"state":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/CustomersListState"},{"$ref":"#/components/schemas/TicketsListState"}]},{"type":"null"}],"description":"Null: the member has not changed this list; it opens as for everyone."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["view","state","updated_at"],"additionalProperties":false},"MemberRoleChange":{"type":"object","properties":{"role_id":{"type":"string","format":"uuid"}},"required":["role_id"],"additionalProperties":false},"MemberRoutingLimit":{"type":"object","properties":{"max_open_tickets":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"null"}],"description":"The member’s own limit; null: the organization default."}},"required":["max_open_tickets"],"additionalProperties":false},"MemberSeatChange":{"type":"object","properties":{"seat_state":{"type":"string","enum":["active","inactive"]}},"required":["seat_state"],"additionalProperties":false},"MembershipContext":{"type":"object","properties":{"organization":{"$ref":"#/components/schemas/Organization"},"membership_id":{"type":"string","format":"uuid"},"role":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"is_owner":{"type":"boolean"}},"required":["id","name","is_owner"],"additionalProperties":false},"platform_role":{"anyOf":[{"$ref":"#/components/schemas/RoleRef"},{"type":"null"}],"description":"The platform role, in the platform organization only (docs/22)."},"is_owner":{"type":"boolean"},"seat_state":{"type":"string","enum":["active","inactive"],"description":"An inactive seat can view but not change anything (docs/18)."},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionKey"},"description":"What the member may do; the owner has every key."},"platform_permissions":{"type":"array","items":{"$ref":"#/components/schemas/PlatformPermissionKey"}}},"required":["organization","membership_id","role","platform_role","is_owner","seat_state","permissions","platform_permissions"],"additionalProperties":false,"description":"The active organization and what the signed-in member may do in it."},"Merge":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"primary_id":{"type":"string","format":"uuid"},"secondary_id":{"type":"string","format":"uuid"},"secondary_name":{"type":["string","null"]},"moved":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"How many records of each kind moved to the primary."},"merged_by_membership_id":{"type":"string","format":"uuid"},"merged_at":{"type":"string","format":"date-time"},"unmerged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"unmerged_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["id","primary_id","secondary_id","secondary_name","moved","merged_by_membership_id","merged_at","unmerged_at","unmerged_by_membership_id"],"additionalProperties":false,"description":"A merge of two contacts or companies; undone when unmerged."},"MergeCompanies":{"type":"object","properties":{"secondary_company_id":{"type":"string","format":"uuid","description":"The company merged into this one (it is kept, pointing to this one)."},"choices":{"description":"Which value to keep where both companies have one (default: this company). Empty fields are filled from the secondary.","type":"object","properties":{"name":{"$ref":"#/components/schemas/MergeSide"},"logo_url":{"$ref":"#/components/schemas/MergeSide"},"phone":{"$ref":"#/components/schemas/MergeSide"},"website":{"$ref":"#/components/schemas/MergeSide"},"address":{"$ref":"#/components/schemas/MergeSide"},"industry":{"$ref":"#/components/schemas/MergeSide"},"owner_membership_id":{"$ref":"#/components/schemas/MergeSide"},"custom_fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$","description":"The key of a custom field: lower-case letters, digits and underscores."},"additionalProperties":{"$ref":"#/components/schemas/MergeSide"}}},"additionalProperties":false}},"required":["secondary_company_id"],"additionalProperties":false},"MergeContacts":{"type":"object","properties":{"secondary_contact_id":{"type":"string","format":"uuid","description":"The contact merged into this one (it is kept, pointing to this one)."},"choices":{"description":"Which value to keep where both contacts have one (default: this contact). Empty fields are filled from the secondary.","type":"object","properties":{"name":{"$ref":"#/components/schemas/MergeSide"},"avatar_url":{"$ref":"#/components/schemas/MergeSide"},"primary_phone":{"$ref":"#/components/schemas/MergeSide"},"primary_email":{"$ref":"#/components/schemas/MergeSide"},"custom_fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$","description":"The key of a custom field: lower-case letters, digits and underscores."},"additionalProperties":{"$ref":"#/components/schemas/MergeSide"}}},"additionalProperties":false}},"required":["secondary_contact_id"],"additionalProperties":false},"MergeList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Merge"},"description":"Newest first."}},"required":["data"],"additionalProperties":false},"MergeSide":{"type":"string","enum":["primary","secondary"],"description":"Which record's value the merged record keeps."},"MergeTickets":{"type":"object","properties":{"secondary_ticket_id":{"type":"string","format":"uuid","description":"The ticket merged into this one (its messages move here; it is closed)."}},"required":["secondary_ticket_id"],"additionalProperties":false},"Message":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","description":"The message in the app (a stable, copyable link)."},"ticket_id":{"type":"string","format":"uuid"},"original_ticket_id":{"type":"string","format":"uuid","description":"Where it was before a ticket merge."},"kind":{"type":"string","enum":["message","note","system","call"]},"direction":{"type":"string","enum":["inbound","outbound"]},"sender_type":{"type":"string","enum":["contact","member","bot","system"]},"sender_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"sender_contact_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"channel_type":{"anyOf":[{"$ref":"#/components/schemas/ChannelType"},{"type":"null"}]},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"content_type":{"type":"string","enum":["text","image","video","audio","voice","document","sticker","location","contacts","template","event","call"]},"body":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"status":{"anyOf":[{"type":"string","enum":["received","queued","sending","sent","delivered","read","failed"]},{"type":"null"}],"description":"Messages to the customer: queued → sending → sent → delivered → read, or failed."},"is_internal_note":{"type":"boolean"},"mentioned_membership_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"reply_to":{"anyOf":[{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"sender_type":{"type":"string","enum":["contact","member","bot","system"]},"excerpt":{"type":["string","null"]}},"required":["message_id","sender_type","excerpt"],"additionalProperties":false},{"type":"null"}]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"anyOf":[{"$ref":"#/components/schemas/AttachedError"},{"type":"null"}]},"status_changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"occurred_at":{"type":"string","format":"date-time"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}},"reactions":{"type":"array","items":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid"},"emoji":{"type":"string"},"reacted_at":{"type":"string","format":"date-time"}},"required":["contact_id","emoji","reacted_at"],"additionalProperties":false}}},"required":["id","url","ticket_id","original_ticket_id","kind","direction","sender_type","sender_membership_id","sender_contact_id","channel_type","channel_id","content_type","body","metadata","status","is_internal_note","mentioned_membership_ids","reply_to","attempt","error","status_changed_at","sent_at","delivered_at","read_at","failed_at","occurred_at","attachments","reactions"],"additionalProperties":false,"description":"An item of a ticket timeline (docs/13)."},"MessageLookup":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/Message"},"ticket_number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["message","ticket_number"],"additionalProperties":false,"description":"A message and the number of its current ticket."},"MessagePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"},"description":"Newest first (show them in time order)."},"next_cursor":{"description":"Older items; null at the start.","type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"MessageReaction":{"type":"object","properties":{"emoji":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}],"description":"One emoji to react with (sending another one changes the reaction), or null to remove the reaction of the Page or Instagram account.","example":"❤️"}},"required":["emoji"],"additionalProperties":false,"description":"The business’s reaction to a customer’s Messenger or Instagram message."},"MetaDataDeletionStatus":{"type":"object","properties":{"confirmation_code":{"type":"string"},"status":{"type":"string","enum":["pending","completed"],"description":"`completed` once Rabt handled the request; `pending` before (requests are handled within minutes)."},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"channels":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Channels disconnected and erased for it."}},"required":["confirmation_code","status","completed_at","channels"],"additionalProperties":false},"MicrosoftAddress":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"address":{"type":"string"},"display_name":{"type":["string","null"]},"is_default":{"type":"boolean"},"manual":{"type":"boolean","description":"Added by a member (not listed by Microsoft)."},"send_as_verified":{"type":"boolean"},"send_as":{"type":"object","properties":{"status":{"type":"string","enum":["unchecked","pending","verified","rewritten","refused","failed"],"description":"`verified`: mail leaves from the address; `rewritten`: Microsoft sends it from the primary address (the tenant needs SendFromAliasEnabled); `refused`: Microsoft refused to send from it (EM-3109: the account needs the Send As right); `failed`: the check could not be sent (see `error`; Rabt tries again); `pending`: a check message is on its way."},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"}},"required":["code","reference","occurred_at"],"additionalProperties":false},{"type":"null"}],"description":"Why the last check could not be sent (`refused`, `failed`)."}},"required":["status","sent_at","checked_at","error"],"additionalProperties":false},"assigned_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"space_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The space its tickets go to (C04)."},"space_assignment_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"That assignment (`DELETE /v1/spaces/{space_id}/channels/{id}` releases it)."}},"required":["id","address","display_name","is_default","manual","send_as_verified","send_as","assigned_membership_id","space_id","space_assignment_id"],"additionalProperties":false},"MicrosoftChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"provider":{"type":"string","enum":["microsoft"]},"mailbox":{"type":"object","properties":{"kind":{"type":"string","enum":["own","shared"]},"address":{"type":"string"},"display_name":{"type":["string","null"]},"signed_in_as":{"type":"string","description":"The account whose access Rabt uses."}},"required":["kind","address","display_name","signed_in_as"],"additionalProperties":false},"status":{"type":"string","enum":["pending","active","needs_reauth","disconnected"]},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false},{"type":"null"}]},"granted_scopes":{"type":"array","items":{"type":"string"}},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/MicrosoftAddress"}},"receiving":{"type":"object","properties":{"subscribed":{"type":"boolean"},"subscription_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"}},"required":["code","reference","occurred_at"],"additionalProperties":false},{"type":"null"}]},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sync_requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["subscribed","subscription_expires_at","last_error","last_sync_at","sync_requested_at","last_inbound_at"],"additionalProperties":false},"send_limit":{"type":"object","properties":{"daily_recipients":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recipients_last_24h":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warning":{"type":"boolean","description":"At 80 % of Microsoft’s daily limit or more."}},"required":["daily_recipients","recipients_last_24h","warning"],"additionalProperties":false},"domain_check":{"anyOf":[{"$ref":"#/components/schemas/SenderDomainCheck"},{"type":"null"}]},"messages_missing_files":{"type":"array","items":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"ticket_id":{"type":"string","format":"uuid"},"ticket_number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subject":{"type":["string","null"]},"received_at":{"type":"string","format":"date-time"},"error":{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"`EM-3128` with its reference."}},"required":["message_id","ticket_id","ticket_number","subject","received_at","error"],"additionalProperties":false},"description":"Customers’ messages whose files were not all downloaded (newest 20); `POST …/messages/{message_id}/download-files` downloads them again."},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","provider","mailbox","status","status_changed_at","last_error","granted_scopes","addresses","receiving","send_limit","domain_check","messages_missing_files","connected_at","disconnected_at"],"additionalProperties":false},"MicrosoftChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MicrosoftChannel"}}},"required":["data"],"additionalProperties":false},"MicrosoftConnect":{"type":"object","properties":{"kind":{"default":"own","description":"`own`: the mailbox of the account that signs in; `shared`: a shared mailbox that account has Full Access to.","type":"string","enum":["own","shared"]},"shared_address":{"default":null,"description":"The shared mailbox’s address, for `kind: shared`.","anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"channel_id":{"default":null,"description":"Reconnect this channel (its access ended: `needs_reauth`) instead of connecting a new mailbox. The same mailbox must sign in (EM-3129).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"additionalProperties":false},"MicrosoftConnectStart":{"type":"object","properties":{"authorization_url":{"type":"string","format":"uri","description":"Microsoft’s sign-in page. Open it in the browser of the person who signs in; Microsoft returns to Rabt, which connects the mailbox and sends the browser to the email settings."},"expires_at":{"type":"string","format":"date-time","description":"The sign-in must finish before this time."}},"required":["authorization_url","expires_at"],"additionalProperties":false},"MicrosoftSetup":{"type":"object","properties":{"configured":{"type":"boolean","description":"Microsoft 365 is set up on this Rabt."},"redirect_uri":{"type":"string","description":"The redirect URI of Rabt’s Entra app."},"admin_consent_url":{"description":"Where a Microsoft 365 administrator approves Rabt for the whole organization (EM-3102).","type":["string","null"]}},"required":["configured","redirect_uri","admin_consent_url"],"additionalProperties":false},"ModerateXMessage":{"type":"object","properties":{"action":{"type":"string","enum":["hide","unhide","delete"],"description":"`hide` or `unhide` a customer's reply to the account's post; `delete` the account's own reply or direct message on X. The message stays in Rabt, marked."}},"required":["action"],"additionalProperties":false},"MoveTicket":{"type":"object","properties":{"space_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The department space, or null for the All space. The ticket is handed over: its assignee is cleared and it waits in the space’s queue for the automatic distribution."}},"required":["space_id"],"additionalProperties":false},"MyOrganization":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"is_platform":{"type":"boolean","description":"The Rabt platform organization (docs/22)."},"billing_state":{"type":"string","enum":["trial","active","seats_inactive"]}},"required":["id","name","slug","is_platform","billing_state"],"additionalProperties":false},"membership_id":{"type":"string","format":"uuid"},"role":{"$ref":"#/components/schemas/RoleRef"},"platform_role":{"anyOf":[{"$ref":"#/components/schemas/RoleRef"},{"type":"null"}],"description":"Set in the platform organization for members with a platform role: the console entry."},"is_owner":{"type":"boolean"},"seat_state":{"type":"string","enum":["active","inactive"]},"joined_at":{"type":"string","format":"date-time"},"last_active_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the account last switched to it."}},"required":["organization","membership_id","role","platform_role","is_owner","seat_state","joined_at","last_active_at"],"additionalProperties":false,"description":"An organization the account is a member of."},"MyOrganizationList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MyOrganization"},"description":"The most recently used first, then by name."}},"required":["data"],"additionalProperties":false,"description":"The organization switcher."},"NationalAddress":{"type":"object","properties":{"building_number":{"type":"string","pattern":"^\\d{4}$"},"street":{"type":"string","minLength":1,"maxLength":100},"district":{"type":"string","minLength":1,"maxLength":100},"city":{"type":"string","minLength":1,"maxLength":100},"postal_code":{"type":"string","pattern":"^\\d{5}$"},"additional_number":{"default":null,"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"country_code":{"default":"SA","type":"string","pattern":"^[A-Z]{2}$"}},"required":["building_number","street","district","city","postal_code"],"additionalProperties":false,"description":"The Saudi national address: 4-digit building number, street, district, city, 5-digit postal code and the optional 4-digit additional number."},"NationalAddressView":{"type":"object","properties":{"building_number":{"type":"string"},"street":{"type":"string"},"district":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"additional_number":{"type":["string","null"]},"country_code":{"type":"string"}},"required":["building_number","street","district","city","postal_code","additional_number","country_code"],"additionalProperties":false},"Note":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"author_membership_id":{"type":"string","format":"uuid"},"body":{"type":"string"},"mentioned_membership_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","author_membership_id","body","mentioned_membership_ids","created_at","updated_at"],"additionalProperties":false,"description":"An internal note."},"NotePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Note"},"description":"Newest first."},"next_cursor":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false},"Notification":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","description":"The notification type (`NotificationType`); a type added by a newer release may appear before clients know it."},"title":{"type":"string","description":"In the request's language."},"body":{"type":"string"},"link":{"type":"string","description":"The deep link in the organization app, e.g. `/billing`."},"tag":{"type":"string","description":"Notifications with the same tag replace each other on a device."},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]},"description":"The facts behind the text (ids, names, amounts in halalas)."},"created_at":{"type":"string","format":"date-time"},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","type","title","body","link","tag","data","created_at","read_at"],"additionalProperties":false,"description":"A notification of the member (docs/21)."},"NotificationPage":{"type":"object","properties":{"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"next_cursor":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"unread_count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["notifications","next_cursor","unread_count"],"additionalProperties":false},"NotificationPreferences":{"type":"object","properties":{"push_when_unavailable":{"type":"boolean"},"types":{"type":"array","items":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/NotificationType"},"push":{"type":"boolean","description":"Browser push (in-app is always on)."},"sound":{"type":"boolean","description":"A sound in the open app."},"default_push":{"type":"boolean"},"default_sound":{"type":"boolean"},"while_unavailable":{"type":"boolean","description":"Pushed while Unavailable (direct messages, mentions, billing events)."}},"required":["type","push","sound","default_push","default_sound","while_unavailable"],"additionalProperties":false}}},"required":["push_when_unavailable","types"],"additionalProperties":false},"NotificationPreferencesUpdate":{"type":"object","properties":{"push_when_unavailable":{"description":"While Unavailable, browser push is limited to direct messages, mentions and billing events; false turns that off too.","type":"boolean"},"types":{"description":"Choices per type; what is left out stays as it is.","maxItems":100,"type":"array","items":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/NotificationType"},"push":{"type":"boolean"},"sound":{"type":"boolean"}},"required":["type"],"additionalProperties":false}}},"additionalProperties":false},"NotificationsMarkedRead":{"type":"object","properties":{"marked":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Notifications marked read."}},"required":["marked"],"additionalProperties":false},"NotificationType":{"type":"string","enum":["ticket.assigned","ticket.queued","ticket.moved_to_space","ticket.customer_replied","note.mentioned","chat.direct_message","chat.mentioned","chat.message","billing.low_balance","billing.balance_zero","billing.auto_top_up_failed","billing.card_expiring","billing.seats_inactive","membership.seat_deactivated","call.ringing","call.missed","phone_number.suspended","voice.velocity_alert","sms.sender_name_approved","sms.sender_name_rejected","sms.sender_name_suspended","sms.sender_name_suspension_lifted","channel.sending_stopped","channel.needs_reauth","channel.reviews_at_risk","ai.knowledge_embedding_failed","ai.agent_failed","campaign.completed","campaign.paused","problem.new","problem.spike","problem.reopened","problems.digest"],"description":"A notification type of the catalog (docs/21)."},"NotificationUnreadCount":{"type":"object","properties":{"unread_count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["unread_count"],"additionalProperties":false},"OAuthApp":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"client_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"homepage_url":{"type":["string","null"]},"redirect_uris":{"type":"array","items":{"type":"string"}},"client_type":{"type":"string","enum":["public","confidential"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","client_id","name","description","homepage_url","redirect_uris","client_type","created_at","updated_at"],"additionalProperties":false,"description":"An OAuth app registered by this organization."},"OAuthAppList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OAuthApp"}}},"required":["data"],"additionalProperties":false},"OpenDirectMessage":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid","description":"The colleague (membership id)."}},"required":["membership_id"],"additionalProperties":false},"OpenIncident":{"type":"object","properties":{"title":{"type":"object","properties":{"ar":{"type":"string","minLength":1,"maxLength":200},"en":{"type":"string","minLength":1,"maxLength":200}},"required":["ar","en"],"additionalProperties":false},"impact":{"type":"string","enum":["degraded_performance","partial_outage","major_outage","maintenance"]},"severity":{"type":"string","enum":["sev1","sev2","sev3","sev4"]},"status":{"default":"investigating","type":"string","enum":["investigating","identified","monitoring"]},"components":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","enum":["web_app","api","realtime","inbound_webhooks","email","webchat","notifications","payments"]}},"show_in_app":{"default":true,"type":"boolean"},"started_at":{"type":"string","format":"date-time"},"message":{"$ref":"#/components/schemas/BilingualMessage"}},"required":["title","impact","severity","components","message"],"additionalProperties":false},"OrderLookupResult":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StoreOrder"}},"failures":{"type":"array","items":{"type":"object","properties":{"integration_id":{"type":"string","format":"uuid"},"adapter":{"type":"string"},"integration_name":{"type":"string"},"error":{"$ref":"#/components/schemas/IntegrationError"}},"required":["integration_id","adapter","integration_name","error"],"additionalProperties":false},"description":"The stores that could not answer, each with its error."}},"required":["data","failures"],"additionalProperties":false},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"is_platform":{"type":"boolean","description":"The Rabt platform organization (docs/22)."},"default_locale":{"type":"string","enum":["ar","en"]},"timezone":{"type":"string"},"default_country":{"type":"string"},"billing_state":{"type":"string","enum":["trial","active","seats_inactive"]},"owner_account_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","slug","is_platform","default_locale","timezone","default_country","billing_state","owner_account_id","created_at"],"additionalProperties":false,"description":"An organization (docs/05)."},"OrganizationLimits":{"type":"object","properties":{"organization_id":{"type":"string","format":"uuid"},"max_concurrent_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_sms_per_minute":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_auto_topups_per_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_default":{"type":"boolean","description":"True while the platform team never set them: the defaults apply."},"reason":{"type":["string","null"]},"updated_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["organization_id","max_concurrent_calls","max_sms_per_minute","max_auto_topups_per_day","is_default","reason","updated_by_membership_id","updated_at"],"additionalProperties":false,"description":"Abuse limits (docs/22)."},"OwnMembershipUpdate":{"type":"object","properties":{"job_title":{"description":"Your job title in this organization (email signatures); null clears it.","anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}},"required":["job_title"],"additionalProperties":false},"PageReaction":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"ticket_id":{"type":"string","format":"uuid"},"emoji":{"description":"Null when the business has no reaction.","type":["string","null"]},"by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The member who reacted."},"reacted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["message_id","ticket_id","emoji","by_membership_id","reacted_at"],"additionalProperties":false,"description":"The business’s reaction to the message as Rabt last set it."},"PermissionKey":{"type":"string","enum":["tickets.reply","tickets.assign","tickets.view_all","contacts.edit","contacts.merge","contacts.import_export","contacts.delete","campaigns.manage","campaigns.send","ai.manage","channels.manage","spaces.manage","members.manage","members.view_availability","billing.manage","settings.manage","space_replies.manage","api.manage","audit.view"],"description":"An organization permission key (docs/18)."},"PhoneCode":{"type":"object","properties":{"phone":{"description":"A phone number: in international form (`+` or `00` and the calling code), or a Saudi number (`05X XXX XXXX`). Read as E.164.","type":"string","maxLength":32},"code":{"description":"The 6-digit code from the message.","type":"string","maxLength":32}},"required":["phone","code"],"additionalProperties":false},"PhoneCodeRequest":{"type":"object","properties":{"phone":{"description":"A phone number: in international form (`+` or `00` and the calling code), or a Saudi number (`05X XXX XXXX`). Read as E.164.","type":"string","maxLength":32}},"required":["phone"],"additionalProperties":false},"PhoneNumber":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"e164":{"type":"string","description":"E.164, e.g. `+966112345678`."},"type":{"type":"string","enum":["geographic","unified_9200","toll_free_800","mobile"]},"name":{"type":["string","null"]},"status":{"type":"string","enum":["active","suspended","released"],"description":"`active`, `suspended` (calls refused, see `suspension_reason`) or `released`."},"suspension_reason":{"anyOf":[{"type":"string","enum":["rental_unpaid","platform"]},{"type":"null"}],"description":"`rental_unpaid` (works again after a top-up) or `platform` (the Rabt team)."},"suspended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"destination":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["all"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["space"]},"space_id":{"type":"string","format":"uuid"},"space_name":{"type":"string"}},"required":["type","space_id","space_name"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["member"]},"membership_id":{"type":"string","format":"uuid"}},"required":["type","membership_id"],"additionalProperties":false}]},"record_calls":{"type":"boolean"},"recording_notice":{"type":"boolean"},"voicemail_enabled":{"type":"boolean"},"ring_timeout_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queue_timeout_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rental_paid_until":{"type":"string","format":"date-time","description":"The monthly rental is paid until then."},"assigned_at":{"type":"string","format":"date-time"},"released_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"channel_id":{"type":"string","format":"uuid","description":"The organization’s voice channel."}},"required":["id","e164","type","name","status","suspension_reason","suspended_at","destination","record_calls","recording_notice","voicemail_enabled","ring_timeout_sec","queue_timeout_sec","rental_paid_until","assigned_at","released_at","channel_id"],"additionalProperties":false},"PhoneNumberList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PhoneNumber"}}},"required":["data"],"additionalProperties":false},"Plan":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"name":{"type":"string"},"seat_price":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"One seat for one calendar month, in halalas."},"trial_months":{"type":"integer","minimum":1,"maximum":9007199254740991},"trial_member_limit":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["id","code","version","name","seat_price","trial_months","trial_member_limit"],"additionalProperties":false,"description":"The seat price (docs/10 \"Plans are data\"): the latest version of the plan charged. No feature depends on it."},"PlatformAccess":{"type":"object","properties":{"organization_id":{"type":"string","format":"uuid","description":"The Rabt platform organization."},"membership_id":{"type":"string","format":"uuid"},"platform_role":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"is_platform_owner":{"type":"boolean"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PlatformPermission"}},"via":{"type":"string","enum":["session","api_key"]},"verified_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Sensitive actions are allowed until then (a code entered within the last 10 minutes); null: re-authenticate first."}},"required":["organization_id","membership_id","platform_role","is_platform_owner","permissions","via","verified_until"],"additionalProperties":false,"description":"What the caller may do on the platform API."},"PlatformAuditEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"action":{"type":"string","description":"e.g. `organization.limits_set`."},"actor":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"},"api_key_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The API key used (platform API or MCP); null for the console."}},"required":["membership_id","name","email","api_key_id"],"additionalProperties":false},"target_type":{"type":["string","null"]},"target_id":{"type":["string","null"]},"before":{},"after":{},"reason":{"type":["string","null"]},"ip":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","action","actor","target_type","target_id","before","after","reason","ip","created_at"],"additionalProperties":false},"PlatformAuditPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformAuditEntry"},"description":"Newest first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"PlatformDeadLetter":{"type":"object","properties":{"queue":{"type":"string"},"job_id":{"type":"string"},"name":{"type":"string","description":"The job's name."},"organization_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempts_made":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed_reason":{"type":"string","description":"The last error: `<code> <reference>: <message>` for Rabt jobs."},"failed_at":{"type":"string","format":"date-time"},"enqueued_at":{"type":"string","format":"date-time"}},"required":["queue","job_id","name","organization_id","attempts_made","failed_reason","failed_at","enqueued_at"],"additionalProperties":false,"description":"A dead job; never its payload."},"PlatformDeadLetterPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformDeadLetter"},"description":"Most recent failure first."},"next_start":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"`start` of the next page; null at the end."}},"required":["data","next_start"],"additionalProperties":false},"PlatformFailedTopUp":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"kind":{"type":"string","enum":["manual","auto"]},"amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"gateway":{"type":"string"},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error_code":{"type":["string","null"]},"error_reference":{"type":["string","null"]},"provider_code":{"type":["string","null"]},"provider_message":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","organization","kind","amount_minor","gateway","attempt","error_code","error_reference","provider_code","provider_message","created_at"],"additionalProperties":false},"PlatformFailedTopUpPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformFailedTopUp"},"description":"Newest first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"PlatformInvoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"month":{"type":"string","description":"The month billed, `YYYY-MM`."},"status":{"type":"string","enum":["draft","finalized","empty"]},"number":{"type":["string","null"]},"subtotal_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},{"type":"null"}]},"tax_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},{"type":"null"}]},"total_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},{"type":"null"}]},"reconciliation_status":{"anyOf":[{"type":"string","enum":["matched","mismatch"]},{"type":"null"}]},"einvoice_provider":{"type":["string","null"]},"einvoice_status":{"anyOf":[{"type":"string","enum":["pending","submitted","accepted","rejected"]},{"type":"null"}]},"einvoice_ref":{"type":["string","null"]},"einvoice_updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"email_status":{"anyOf":[{"type":"string","enum":["sent","failed"]},{"type":"null"}]},"email_error_code":{"type":["string","null"]},"email_error_reference":{"type":["string","null"]},"finalized_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","organization","month","status","number","subtotal_minor","tax_minor","total_minor","reconciliation_status","einvoice_provider","einvoice_status","einvoice_ref","einvoice_updated_at","email_status","email_error_code","email_error_reference","finalized_at","created_at"],"additionalProperties":false},"PlatformInvoicePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformInvoice"},"description":"Newest month first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"PlatformOrganization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"is_platform":{"type":"boolean"},"billing_state":{"type":"string","enum":["trial","active","seats_inactive"]},"owner":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"}},"required":["account_id","name","email"],"additionalProperties":false},"seats":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inactive":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","inactive"],"additionalProperties":false},"trial_ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"balance_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The wallet balance (what Rabt owes the customer)."},"held_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"usage_this_month_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Usage sold this calendar month (Asia/Riyadh)."},"created_at":{"type":"string","format":"date-time"},"subscription":{"anyOf":[{"type":"object","properties":{"seats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"current_period_start":{"type":"string","format":"date-time"},"current_period_end":{"type":"string","format":"date-time"},"trial_ends_at":{"type":"string","format":"date-time"},"trial_member_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["seats","current_period_start","current_period_end","trial_ends_at","trial_member_limit"],"additionalProperties":false},{"type":"null"}]},"channels":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"status":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","status","count"],"additionalProperties":false},"description":"Channel counts by type and status (no channel content)."},"usage_by_section":{"type":"array","items":{"type":"object","properties":{"service":{"type":"string","enum":["whatsapp","x","sms","voice","ai","email"]},"events":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"cost_sar":{"type":"string","description":"What it cost Rabt, SAR (decimal text)."}},"required":["service","events","amount_minor","cost_sar"],"additionalProperties":false}},"limits":{"$ref":"#/components/schemas/OrganizationLimits"}},"required":["id","name","slug","is_platform","billing_state","owner","seats","trial_ends_at","balance_minor","held_minor","usage_this_month_minor","created_at","subscription","channels","usage_by_section","limits"],"additionalProperties":false},"PlatformOrganizationPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformOrganizationSummary"},"description":"Newest first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"PlatformOrganizationSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"is_platform":{"type":"boolean"},"billing_state":{"type":"string","enum":["trial","active","seats_inactive"]},"owner":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"}},"required":["account_id","name","email"],"additionalProperties":false},"seats":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inactive":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","inactive"],"additionalProperties":false},"trial_ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"balance_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The wallet balance (what Rabt owes the customer)."},"held_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"usage_this_month_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Usage sold this calendar month (Asia/Riyadh)."},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","slug","is_platform","billing_state","owner","seats","trial_ends_at","balance_minor","held_minor","usage_this_month_minor","created_at"],"additionalProperties":false},"PlatformOverview":{"type":"object","properties":{"month_start":{"type":"string","format":"date-time","description":"The month the sums cover (Asia/Riyadh)."},"organizations":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trial":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"seats_inactive":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","trial","seats_inactive"],"additionalProperties":false},"paid_seats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Active seats of organizations in the active state."},"seat_revenue_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"usage":{"type":"object","properties":{"sales_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"cost_sar_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"SAR micro-units (millionths of a riyal)."},"profit_sar_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"SAR micro-units (millionths of a riyal)."},"margin_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Profit over sales in basis points; null without sales."}},"required":["sales_minor","cost_sar_micros","profit_sar_micros","margin_bps"],"additionalProperties":false},"wallet_balances_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Every wallet balance together: what Rabt owes its customers."},"attention":{"type":"object","properties":{"since":{"type":"string","format":"date-time"},"reconciliation_mismatches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed_auto_top_ups":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sender_names_waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed_webhook_events":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gateway_refunds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Refunds the payment gateway reported (made outside Rabt, `WAL-1215`); the wallet was not changed."}},"required":["since","reconciliation_mismatches","failed_auto_top_ups","sender_names_waiting","failed_webhook_events","gateway_refunds"],"additionalProperties":false}},"required":["month_start","organizations","paid_seats","seat_revenue_minor","usage","wallet_balances_minor","attention"],"additionalProperties":false,"description":"The platform overview (docs/22 page 1)."},"PlatformPermission":{"type":"string","enum":["platform.orgs.view","platform.orgs.manage","platform.pricing.manage","platform.billing.view","platform.numbers.manage","platform.ops.manage","platform.audit.view"],"description":"A platform permission key (docs/22)."},"PlatformPermissionKey":{"type":"string","enum":["platform.orgs.view","platform.orgs.manage","platform.pricing.manage","platform.billing.view","platform.numbers.manage","platform.ops.manage","platform.audit.view"],"description":"A platform permission key (docs/22), only in the Rabt platform organization."},"PlatformPlan":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"seat_price_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Per seat per calendar month."},"trial_months":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trial_member_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_public":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}},"required":["id","code","version","name","seat_price_minor","trial_months","trial_member_limit","is_public","created_at"],"additionalProperties":false,"description":"A version of a plan (docs/22 \"Fixed prices\")."},"PlatformPlanList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformPlan"}}},"required":["data"],"additionalProperties":false},"PlatformQueue":{"type":"object","properties":{"name":{"type":"string"},"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delayed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Dead jobs (failed for good), which can be replayed."},"lag_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How long the next job has waited, milliseconds."}},"required":["name","waiting","active","delayed","failed","lag_ms"],"additionalProperties":false},"PlatformQueueList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformQueue"},"description":"By name."}},"required":["data"],"additionalProperties":false},"PlatformReauthentication":{"type":"object","properties":{"channel":{"type":"string","enum":["email","sms"],"description":"Where the code goes: the account's email or its verified phone."},"code":{"type":"string","pattern":"^\\d{6}$","description":"The 6-digit code."}},"required":["channel","code"],"additionalProperties":false},"PlatformReauthenticationCodeRequest":{"type":"object","properties":{"channel":{"type":"string","enum":["email","sms"],"description":"Where the code goes: the account's email or its verified phone."}},"required":["channel"],"additionalProperties":false},"PlatformReceiptVoucher":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"number":{"type":"string","description":"`RC-YYYY-NNNNNN`."},"amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"card_brand":{"type":"string"},"gateway":{"type":"string"},"gateway_charge_id":{"type":"string"},"balance_after_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"issued_at":{"type":"string","format":"date-time"}},"required":["id","organization","number","amount_minor","card_brand","gateway","gateway_charge_id","balance_after_minor","issued_at"],"additionalProperties":false},"PlatformReceiptVoucherPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformReceiptVoucher"},"description":"Newest first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"PlatformReplay":{"type":"object","properties":{"outcome":{"type":"string","enum":["replayed","not_found","not_dead","already_replayed"],"description":"`replayed`: back in its queue with all its tries; `not_dead`: it was replayed already; `already_replayed`: another replay of this failure ran."}},"required":["outcome"],"additionalProperties":false},"PlatformRole":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PlatformPermission"}},"is_owner":{"type":"boolean","description":"The fixed platform owner role."},"is_default":{"type":"boolean"},"holders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Members holding it."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","permissions","is_owner","is_default","holders","created_at","updated_at"],"additionalProperties":false},"PlatformRoleList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformRole"}}},"required":["data"],"additionalProperties":false},"PlatformSentCode":{"type":"object","properties":{"channel":{"type":"string","enum":["email","sms"],"description":"Where the code goes: the account's email or its verified phone."},"expires_at":{"type":"string","format":"date-time","description":"The code is valid until then."},"resend_after":{"type":"string","format":"date-time","description":"Another code can be requested from then on."}},"required":["channel","expires_at","resend_after"],"additionalProperties":false,"description":"A code was sent; it is only in the message."},"PlatformSmsSenderName":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"classification":{"type":"string","enum":["service","promotional","awareness"]},"status":{"type":"string","enum":["pending","approved","rejected"]},"status_changed_at":{"type":"string","format":"date-time"},"rejection_reason":{"type":["string","null"]},"purpose":{"type":"string"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When Rabt submitted it to the operators."},"is_default":{"type":"boolean"},"suspension":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"reason":{"type":"string"}},"required":["at","reason"],"additionalProperties":false},{"type":"null"}],"description":"Suspended by the Rabt platform team: SMS under it are refused (`SMS-4022`)."},"requested_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"organization_id":{"type":"string","format":"uuid"},"organization_name":{"type":"string"}},"required":["id","name","classification","status","status_changed_at","rejection_reason","purpose","submitted_at","is_default","suspension","requested_by_membership_id","created_at","updated_at","organization_id","organization_name"],"additionalProperties":false},"PlatformSmsSenderNameDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"classification":{"type":"string","enum":["service","promotional","awareness"]},"status":{"type":"string","enum":["pending","approved","rejected"]},"status_changed_at":{"type":"string","format":"date-time"},"rejection_reason":{"type":["string","null"]},"purpose":{"type":"string"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When Rabt submitted it to the operators."},"is_default":{"type":"boolean"},"suspension":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"reason":{"type":"string"}},"required":["at","reason"],"additionalProperties":false},{"type":"null"}],"description":"Suspended by the Rabt platform team: SMS under it are refused (`SMS-4022`)."},"requested_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"documents":{"type":"array","items":{"$ref":"#/components/schemas/SmsSenderNameDocument"}},"complaints":{"type":"array","items":{"$ref":"#/components/schemas/SmsSenderNameComplaint"}},"organization_id":{"type":"string","format":"uuid"},"organization_name":{"type":"string"}},"required":["id","name","classification","status","status_changed_at","rejection_reason","purpose","submitted_at","is_default","suspension","requested_by_membership_id","created_at","updated_at","documents","complaints","organization_id","organization_name"],"additionalProperties":false},"PlatformSmsSenderNamePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformSmsSenderName"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"PlatformStockNumber":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"e164":{"type":"string","description":"E.164, e.g. `+966112345678`."},"type":{"type":"string","enum":["geographic","unified_9200","toll_free_800","mobile"]},"status":{"type":"string","enum":["available","assigned","porting","retired"],"description":"`available` (organizations may pick it), `porting` (being ported in), `assigned` (an organization holds it) or `retired`."},"note":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"holder":{"anyOf":[{"type":"object","properties":{"organization_id":{"type":"string","format":"uuid"},"organization_name":{"type":"string"},"phone_number_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","suspended"]},"suspension_reason":{"anyOf":[{"type":"string","enum":["rental_unpaid","platform"]},{"type":"null"}]},"rental_paid_until":{"type":"string","format":"date-time"}},"required":["organization_id","organization_name","phone_number_id","status","suspension_reason","rental_paid_until"],"additionalProperties":false},{"type":"null"}],"description":"The organization holding it and its number’s state; null otherwise."}},"required":["id","e164","type","status","note","created_at","holder"],"additionalProperties":false},"PlatformStockNumberList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformStockNumber"}}},"required":["data"],"additionalProperties":false},"PlatformStockNumberPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformStockNumber"}},"next_cursor":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Pass as `after` for the next page; null on the last one."}},"required":["data","next_cursor"],"additionalProperties":false},"PlatformSwitch":{"type":"object","properties":{"name":{"type":"string","enum":["calls_ksa_only"],"description":"`calls_ksa_only`: Calls only inside Saudi Arabia (docs/22)."},"on":{"type":"boolean"},"default":{"type":"boolean","description":"The state when never changed."},"warning":{"type":"boolean","description":"The console shows a permanent warning banner: the switch is off and turning it off is flagged as a risk."},"feature":{"type":"string","description":"The platform feature switch that holds it."},"changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"reason":{"type":["string","null"]},"changed_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["name","on","default","warning","feature","changed_at","reason","changed_by_membership_id"],"additionalProperties":false},"PlatformSwitchList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformSwitch"}}},"required":["data"],"additionalProperties":false},"PlatformTeam":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformTeamMember"}}},"required":["data"],"additionalProperties":false},"PlatformTeamMember":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"account_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"},"seat_state":{"type":"string","enum":["active","inactive"]},"platform_role":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"Null: no access to the platform console."},"is_platform_owner":{"type":"boolean"},"joined_at":{"type":"string","format":"date-time"}},"required":["membership_id","account_id","name","email","seat_state","platform_role","is_platform_owner","joined_at"],"additionalProperties":false},"PlatformVerified":{"type":"object","properties":{"verified_until":{"type":"string","format":"date-time","description":"Sensitive actions are allowed until then."}},"required":["verified_until"],"additionalProperties":false},"PostChatMessage":{"type":"object","properties":{"body":{"default":"","description":"Light Markdown. `<@membership-id>` mentions a member, `@all` everyone in the room, `#1291` references a ticket.","type":"string","maxLength":10000},"client_message_id":{"description":"Your id for this message: a retry with the same id never adds another.","type":"string","minLength":1,"maxLength":100},"quote_message_id":{"description":"A message of the room to quote.","type":"string","format":"uuid"},"ticket_ids":{"default":[],"description":"Tickets attached as cards (\"Ask the team\"); you must see each.","maxItems":50,"type":"array","items":{"type":"string","format":"uuid"}},"attachment_ids":{"default":[],"description":"Files you uploaded to this room and have not sent yet.","maxItems":20,"type":"array","items":{"type":"string","format":"uuid"}}},"additionalProperties":false},"PostIncidentUpdate":{"type":"object","properties":{"status":{"type":"string","enum":["investigating","identified","monitoring","resolved"]},"message":{"$ref":"#/components/schemas/BilingualMessage"}},"required":["status","message"],"additionalProperties":false},"PreviewSms":{"type":"object","properties":{"to":{"anyOf":[{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$","description":"A mobile number in E.164, e.g. `+966500000000`."},{"type":"null"}]},"body":{"type":"string","minLength":1,"maxLength":1600,"description":"The text: at most 10 parts (1,530 GSM-7 or 670 UCS-2 characters; Arabic is UCS-2). KSA rules apply: no phone numbers or WhatsApp links, links only to allowed domains."},"category":{"type":"string","enum":["service","otp"],"description":"`service` or `otp` (a one-time code: the text must state its purpose). Promotional SMS go through campaigns (`SMS-4038`)."},"sender_name_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["body"],"additionalProperties":false},"PriceList":{"type":"object","properties":{"currency":{"type":"string","enum":["SAR"]},"at":{"type":"string","format":"date-time","description":"The time the prices are in effect at (now)."},"seat":{"type":"object","properties":{"seat_price_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},{"type":"null"}],"description":"One seat for one calendar month; null while no plan is published."},"trial_months":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trial_member_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["seat_price_minor","trial_months","trial_member_limit"],"additionalProperties":false},"rate_card":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The published rate card version number."},"effective_from":{"type":"string","format":"date-time"},"items":{"type":"array","items":{"type":"object","properties":{"service":{"type":"string","enum":["whatsapp","x","sms","voice","ai","email"]},"metric":{"type":"string"},"dimensions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"item_key":{"type":"string"},"unit":{"type":"string","enum":["message","request","event","segment","minute","month","token","character","quota_unit"]},"unit_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_price_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Price of `unit_size` units, in halalas."}},"required":["service","metric","dimensions","item_key","unit","unit_size","unit_price_minor"],"additionalProperties":false}}},"required":["version","effective_from","items"],"additionalProperties":false},{"type":"null"}],"description":"The rate card in effect; null while none is published."}},"required":["currency","at","seat","rate_card"],"additionalProperties":false,"description":"The public price list (docs/10): the seat price and trial of new organizations, and the usage prices of the rate card in effect."},"PriceQuote":{"type":"object","properties":{"currency":{"type":"string","enum":["SAR"]},"at":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","properties":{"service":{"type":"string","enum":["whatsapp","x","sms","voice","ai","email"]},"metric":{"type":"string"},"dimensions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"item_key":{"type":"string"},"unit":{"type":"string","enum":["message","request","event","segment","minute","month","token","character","quota_unit"]},"unit_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_price_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Price of `unit_size` units, in halalas."},"amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."}},"required":["service","metric","dimensions","item_key","unit","unit_size","quantity","unit_price_minor","amount_minor"],"additionalProperties":false}},"total_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"fingerprint":{"type":"string","description":"Equal for equal prices, whenever quoted."}},"required":["currency","at","lines","total_minor","fingerprint"],"additionalProperties":false,"description":"A price quote at the current prices (docs/10)."},"PricingRow":{"type":"object","properties":{"item_id":{"type":"string","format":"uuid"},"service":{"type":"string","enum":["whatsapp","x","sms","voice","ai","email"]},"metric":{"type":"string"},"dimensions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"item_key":{"type":"string"},"unit":{"type":"string","enum":["message","request","event","segment","minute","month","token","character","quota_unit"]},"unit_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost":{"type":"string","description":"Provider cost per unit, in its currency."},"currency":{"type":"string","enum":["USD","SAR"]},"cost_sar":{"type":"string"},"markup_percent":{"description":"Null for a fixed price.","type":["string","null"]},"markup_source":{"type":"string","enum":["fixed","organization","item","default"]},"selling_price_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"profit_per_unit":{"type":"string","description":"Selling price − cost in SAR (SAR)."}},"required":["item_id","service","metric","dimensions","item_key","unit","unit_size","cost","currency","cost_sar","markup_percent","markup_source","selling_price_minor","profit_per_unit"],"additionalProperties":false,"description":"One row of the pricing page (docs/22)."},"Problem":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["server","provider","browser"],"description":"`server`: Rabt's servers; `provider`: a provider's rejection; `browser`: a member's browser."},"code":{"type":"string","description":"The error code, e.g. `WA-2047`."},"title":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}},"required":["ar","en"],"additionalProperties":false,"description":"The code's title in both languages (parameters shown as —)."},"place":{"type":"string","description":"Where in Rabt: the API route (`POST /v1/tickets/:id/messages`), the job (`job:channels.send`), the page (`/tickets/:id`) or the affected item (`item:message`)."},"cause":{"description":"The provider's code, or the normalized underlying error (no values).","type":["string","null"]},"provider_name":{"type":["string","null"]},"status":{"type":"string","enum":["new","investigating","resolved"]},"occurrences":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"organizations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Distinct organizations that saw it."},"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Distinct members that saw it."},"last_24_hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"previous_24_hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The 24 hours before (the trend)."},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"},"first_release":{"type":["string","null"]},"last_release":{"type":["string","null"]},"status_changed_at":{"type":"string","format":"date-time"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"resolved_release":{"description":"The release that fixed it (resolved automatically).","type":["string","null"]},"resolved_automatically":{"type":"boolean"},"reopened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"reopen_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How often it came back after being resolved."},"docs_url":{"type":"string","format":"uri"}},"required":["id","kind","code","title","place","cause","provider_name","status","occurrences","organizations","members","last_24_hours","previous_24_hours","first_seen_at","last_seen_at","first_release","last_release","status_changed_at","resolved_at","resolved_release","resolved_automatically","reopened_at","reopen_count","docs_url"],"additionalProperties":false},"ProblemDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["server","provider","browser"],"description":"`server`: Rabt's servers; `provider`: a provider's rejection; `browser`: a member's browser."},"code":{"type":"string","description":"The error code, e.g. `WA-2047`."},"title":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}},"required":["ar","en"],"additionalProperties":false,"description":"The code's title in both languages (parameters shown as —)."},"place":{"type":"string","description":"Where in Rabt: the API route (`POST /v1/tickets/:id/messages`), the job (`job:channels.send`), the page (`/tickets/:id`) or the affected item (`item:message`)."},"cause":{"description":"The provider's code, or the normalized underlying error (no values).","type":["string","null"]},"provider_name":{"type":["string","null"]},"status":{"type":"string","enum":["new","investigating","resolved"]},"occurrences":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"organizations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Distinct organizations that saw it."},"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Distinct members that saw it."},"last_24_hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"previous_24_hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The 24 hours before (the trend)."},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"},"first_release":{"type":["string","null"]},"last_release":{"type":["string","null"]},"status_changed_at":{"type":"string","format":"date-time"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"resolved_release":{"description":"The release that fixed it (resolved automatically).","type":["string","null"]},"resolved_automatically":{"type":"boolean"},"reopened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"reopen_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How often it came back after being resolved."},"docs_url":{"type":"string","format":"uri"},"status_changed_by":{"anyOf":[{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["membership_id","name"],"additionalProperties":false},{"type":"null"}],"description":"Null when it changed automatically."},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"occurrences":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","occurrences"],"additionalProperties":false},"description":"Occurrences per day (Asia/Riyadh) of each of the last 30 days, oldest first; days without any are 0."},"releases":{"type":"array","items":{"type":"object","properties":{"release":{"type":["string","null"]},"occurrences":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"}},"required":["release","occurrences","first_seen_at","last_seen_at"],"additionalProperties":false}},"top_organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"occurrences":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_seen_at":{"type":"string","format":"date-time"}},"required":["id","name","occurrences","last_seen_at"],"additionalProperties":false}},"without_organization":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Occurrences outside any organization (e.g. before sign-in)."},"samples":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"},"release":{"type":["string","null"]},"organization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["reference","occurred_at","release","organization"],"additionalProperties":false},"description":"The latest references: search them in logs, traces and Sentry."}},"required":["id","kind","code","title","place","cause","provider_name","status","occurrences","organizations","members","last_24_hours","previous_24_hours","first_seen_at","last_seen_at","first_release","last_release","status_changed_at","resolved_at","resolved_release","resolved_automatically","reopened_at","reopen_count","docs_url","status_changed_by","daily","releases","top_organizations","without_organization","samples"],"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","format":"uri","description":"The error code's documentation page."},"title":{"type":"string","description":"The reason, in one line."},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string","description":"The full cause."},"instance":{"type":"string","description":"This occurrence: the request path."},"code":{"type":"string","pattern":"^([A-Z]{1,5})-(\\d{4})$","description":"The stable error code, e.g. `API-8001`.","example":"API-8001"},"reference":{"type":"string","pattern":"^ref_[0-9a-f]{32}$","description":"Unique to this occurrence: the trace ID, which finds it in Rabt's logs, traces and error log.","example":"ref_4bf92f3577b34da6a3ce929d0e0e4736"},"details":{"type":"object","properties":{"fix":{"type":"string","description":"What to do next."},"occurred_at":{"type":"string","format":"date-time","description":"When it happened (UTC)."},"where":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","description":"Kind of the affected item, e.g. `ticket`, `message`."},"id":{"type":"string","description":"ID of the affected item."},"label":{"description":"What the user sees, e.g. \"Ticket #1283 · WhatsApp +966 55 000 3344\".","type":"string"}},"required":["type","id"],"additionalProperties":false,"description":"The item the error happened on."},{"type":"null"}]},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"Where the invalid value is: `body`, `query`, `path` or `header`, then the field, e.g. `body.contact.phones.0`."},"code":{"type":"string","description":"The field error's own code, e.g. `API-8002`."},"message":{"type":"string","description":"What is wrong, in the language of the response."}},"required":["path","code","message"],"additionalProperties":false},"description":"Invalid fields (validation errors), at most 100, each with its own code."}},"required":["fix","occurred_at","where","fields"],"additionalProperties":false},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The provider, e.g. `Meta`."},"code":{"type":"string","description":"The provider's own error code, as received."},"subcode":{"type":["string","null"]},"message":{"type":"string","description":"The provider's message, as received."},"http_status":{"anyOf":[{"type":"integer","minimum":100,"maximum":599},{"type":"null"}]}},"required":["name","code","subcode","message","http_status"],"additionalProperties":false,"description":"The provider's own error, when a provider rejected the action."},{"type":"null"}]},"retryable":{"type":"boolean","description":"Whether trying again later can succeed."},"docs_url":{"type":"string","format":"uri","description":"The error code's documentation page."},"release":{"description":"The release of the Rabt service that answered: its version and the commit it was built from. Error screens show it with the code and the reference.","type":"string","pattern":"^v\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?\\+(?:[0-9a-f]{7}|local)$","example":"v1.4.2+a1b2c3d"}},"required":["type","title","status","detail","instance","code","reference","details","provider","retryable","docs_url"],"additionalProperties":{},"description":"An error (RFC 9457 problem details), with the Rabt error code, the reference of this occurrence and what to do. Texts are in the language of `Accept-Language` (`ar` by default, or `en`)."},"ProblemInvestigation":{"type":"object","properties":{"text":{"type":"string","description":"Code, title, place, cause, counts, releases, sample references and runbooks as text, ready to paste into Claude Code."}},"required":["text"],"additionalProperties":false},"ProblemPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Problem"},"description":"Most recently seen first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"ProviderHealth":{"type":"object","properties":{"provider":{"type":"string","description":"e.g. `meta`, `x`, `tiktok`, `tap`, `openai`, `smpp`, `sip`."},"kind":{"type":"string","enum":["channel","payment","einvoicing","ai","integration","notification"]},"adapters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"paused":{"type":"boolean","description":"Switched off platform-wide (kill switch)."}},"required":["key","label","paused"],"additionalProperties":false}},"errors_last_hour":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errors_last_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"}},"required":["code","reference","occurred_at"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string","enum":["operational","errors","paused"]}},"required":["provider","kind","adapters","errors_last_hour","errors_last_day","last_error","status"],"additionalProperties":false},"ProviderHealthList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProviderHealth"}}},"required":["data"],"additionalProperties":false},"PublicStatus":{"type":"object","properties":{"generated_at":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["operational","maintenance","degraded_performance","partial_outage","major_outage"]},"components":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["web_app","api","realtime","inbound_webhooks","email","webchat","notifications","payments"]},"name":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}},"required":["ar","en"],"additionalProperties":false},"status":{"type":"string","enum":["operational","maintenance","degraded_performance","partial_outage","major_outage"]}},"required":["key","name","status"],"additionalProperties":false}},"degraded_modes":{"type":"array","items":{"type":"string","enum":["read_only","outbound_hold","non_essential_off"]}},"incidents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}},"required":["ar","en"],"additionalProperties":false},"impact":{"type":"string","enum":["degraded_performance","partial_outage","major_outage","maintenance"]},"status":{"type":"string","enum":["investigating","identified","monitoring","resolved"]},"components":{"type":"array","items":{"type":"string"}},"show_in_app":{"type":"boolean"},"started_at":{"type":"string","format":"date-time"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updates":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["investigating","identified","monitoring","resolved"]},"message":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}},"required":["ar","en"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time"}},"required":["status","message","created_at"],"additionalProperties":false}}},"required":["id","title","impact","status","components","show_in_app","started_at","resolved_at","updates"],"additionalProperties":false}},"status_page_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]}},"required":["generated_at","status","components","degraded_modes","incidents","status_page_url"],"additionalProperties":false},"PublishPlatformPlan":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"name":{"type":"string","minLength":1,"maxLength":100},"seat_price_minor":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"trial_months":{"type":"integer","minimum":1,"maximum":12},"trial_member_limit":{"type":"integer","minimum":1,"maximum":100000},"is_public":{"type":"boolean"},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["code","name","seat_price_minor","reason"],"additionalProperties":false},"PublishRateCardDraft":{"type":"object","properties":{"effective_from":{"type":"string","description":"\"now\", or a future ISO 8601 time (UTC)."},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["effective_from","reason"],"additionalProperties":false},"PushKey":{"type":"object","properties":{"application_server_key":{"type":"string","description":"Rabt's VAPID public key (base64url): the `applicationServerKey` to subscribe with."}},"required":["application_server_key"],"additionalProperties":false},"PushSubscription":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"user_agent":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"last_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","user_agent","created_at","last_success_at","failed_at"],"additionalProperties":false,"description":"One of the account's browsers receiving push notifications."},"PushSubscriptionCreate":{"type":"object","properties":{"endpoint":{"type":"string","maxLength":2048,"format":"uri","description":"The push service URL of the browser (`PushSubscription.endpoint`). Only browser push services are accepted (`NTF-8203`)."},"keys":{"type":"object","properties":{"p256dh":{"type":"string","minLength":87,"maxLength":87,"pattern":"^[A-Za-z0-9_-]+$","description":"The browser's P-256 public key (65 bytes, base64url)."},"auth":{"type":"string","minLength":22,"maxLength":22,"pattern":"^[A-Za-z0-9_-]+$","description":"The browser's authentication secret (16 bytes, base64url)."}},"required":["p256dh","auth"],"additionalProperties":false},"user_agent":{"description":"The browser, to tell the devices apart.","anyOf":[{"type":"string","maxLength":512},{"type":"null"}]}},"required":["endpoint","keys"],"additionalProperties":false},"PushSubscriptionList":{"type":"object","properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/PushSubscription"}}},"required":["subscriptions"],"additionalProperties":false},"PutRateCardItem":{"type":"object","properties":{"metric":{"type":"string","minLength":1,"maxLength":100,"description":"e.g. whatsapp.template_message."},"dimensions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"unit":{"type":"string","enum":["message","request","event","segment","minute","month","token","character","quota_unit"]},"unit_size":{"type":"integer","minimum":1,"maximum":1000000000},"cost":{"type":"string","maxLength":20,"description":"Provider cost per unit, at most 6 decimals, e.g. 0.0455."},"currency":{"type":"string","enum":["USD","SAR"]},"markup_percent":{"anyOf":[{"type":"string","maxLength":20,"description":"The item's own markup %; null: the version default."},{"type":"null"}]},"fixed_price_minor":{"description":"A fixed selling price per unit in halalas (no markup).","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["metric","unit","cost","currency"],"additionalProperties":false},"QuoteRequest":{"type":"object","properties":{"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","minLength":3,"maxLength":200,"description":"The usage metric, e.g. `whatsapp.message` (rate cards, docs/10)."},"quantity":{"type":"integer","minimum":1,"maximum":1000000000000},"dimensions":{"description":"The rate card dimensions, e.g. `{ \"category\": \"marketing\" }`.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1,"maxLength":200}}},"required":["metric","quantity"],"additionalProperties":false}},"at":{"description":"When the usage happens (default now; a future time is an estimate).","type":"string","format":"date-time"}},"required":["items"],"additionalProperties":false},"RateCard":{"type":"object","properties":{"version":{"$ref":"#/components/schemas/RateCardVersion"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/PricingRow"}}},"required":["version","rows"],"additionalProperties":false},"RateCardSettings":{"type":"object","properties":{"fx_rate":{"type":"string","maxLength":20,"description":"SAR per USD, at most 6 decimals, e.g. 3.75."},"fx_buffer_percent":{"type":"string","maxLength":20,"description":"FX buffer %, at most 2 decimals."},"default_markup_percent":{"type":"string","maxLength":20,"description":"Default markup %, at most 2 decimals."}},"required":["fx_rate","fx_buffer_percent","default_markup_percent"],"additionalProperties":false},"RateCardVersion":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","published"]},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Given at publication; null for a draft."},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"fx_rate":{"type":"string","description":"SAR per USD, e.g. 3.75."},"fx_buffer_percent":{"type":"string"},"default_markup_percent":{"type":"string"},"note":{"type":["string","null"]},"based_on_version_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_by_membership_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"published_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"discarded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","status","number","effective_from","fx_rate","fx_buffer_percent","default_markup_percent","note","based_on_version_id","created_by_membership_id","created_at","published_by_membership_id","published_at","discarded_at"],"additionalProperties":false},"RateCardVersionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RateCardVersion"},"description":"Newest first."},"in_effect_version_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["data","in_effect_version_id"],"additionalProperties":false},"ReadinessChecks":{"type":"object","properties":{"database":{"type":"object","properties":{"status":{"type":"string","enum":["up","down"]},"code":{"description":"Why the dependency is down (an error code), when it is.","type":"string"},"duration_ms":{"type":"number","description":"How long the check took."}},"required":["status","duration_ms"],"additionalProperties":false},"redis":{"type":"object","properties":{"status":{"type":"string","enum":["up","down"]},"code":{"description":"Why the dependency is down (an error code), when it is.","type":"string"},"duration_ms":{"type":"number","description":"How long the check took."}},"required":["status","duration_ms"],"additionalProperties":false}},"required":["database","redis"],"additionalProperties":false,"description":"The result of each dependency check."},"ReadinessProblem":{"description":"A readiness failure (problem details) with the result of each check.","allOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"type":"object","properties":{"checks":{"$ref":"#/components/schemas/ReadinessChecks"}},"required":["checks"]}]},"Ready":{"type":"object","properties":{"status":{"type":"string","enum":["ready"]},"checks":{"$ref":"#/components/schemas/ReadinessChecks"}},"required":["status","checks"],"additionalProperties":false},"Reauthenticated":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"verified_until":{"type":"string","format":"date-time"}},"required":["session","verified_until"],"additionalProperties":false,"description":"The session was replaced by a new one, verified now: its cookie is set."},"Reauthentication":{"type":"object","properties":{"channel":{"type":"string","enum":["email","sms"],"description":"Where the code goes: `email`, the account email; `sms`, its verified phone."},"code":{"description":"The 6-digit code from the message.","type":"string","maxLength":32}},"required":["channel","code"],"additionalProperties":false},"ReauthenticationCodeRequest":{"type":"object","properties":{"channel":{"type":"string","enum":["email","sms"],"description":"Where the code goes: `email`, the account email; `sms`, its verified phone."}},"required":["channel"],"additionalProperties":false},"ReceiptVoucher":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string","example":"RC-2026-000123"},"issued_at":{"type":"string","format":"date-time"},"top_up_id":{"type":"string","format":"uuid"},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","enum":["SAR"]},"payment_method":{"type":"object","properties":{"brand":{"type":"string"},"last4":{"type":"string"}},"required":["brand","last4"],"additionalProperties":false},"gateway_charge_id":{"type":"string"},"balance_after":{"type":"integer","minimum":0,"maximum":9007199254740991},"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"billing_profile":{"anyOf":[{"$ref":"#/components/schemas/BillingParty"},{"type":"null"}],"description":"The billing profile when the voucher was issued; null when there was none (and for vouchers issued before billing profiles existed)."}},"required":["id","name","billing_profile"],"additionalProperties":false}},"required":["id","number","issued_at","top_up_id","amount","currency","payment_method","gateway_charge_id","balance_after","organization"],"additionalProperties":false,"description":"The payment document of a top-up (not a tax invoice, docs/10)."},"ReceiptVoucherList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReceiptVoucher"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false,"description":"Newest first."},"ReconciliationMismatch":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","description":"WAL-1007 … WAL-1011."},"reference":{"type":"string"},"organization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"location":{},"occurred_at":{"type":"string","format":"date-time"}},"required":["id","code","reference","organization","params","location","occurred_at"],"additionalProperties":false},"ReconciliationMismatchPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationMismatch"},"description":"Newest first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"ReconnectAppStoreChannel":{"type":"object","properties":{"key_id":{"type":"string","pattern":"^[A-Z0-9]{10}$","description":"The ID of a team API key with the Customer Support or Admin role, e.g. `2X9R4HXF34`."},"private_key":{"type":"string","minLength":1,"maxLength":4096,"description":"The text of the key’s `.p8` file (`-----BEGIN PRIVATE KEY-----` …). Kept in the token vault, never returned."}},"required":["key_id","private_key"],"additionalProperties":false},"ReconnectEmailChannel":{"type":"object","properties":{"smtp_password":{"type":"string","minLength":1,"maxLength":1024,"description":"Kept in the token vault, never returned."},"smtp_username":{"type":"string","minLength":1,"maxLength":320}},"required":["smtp_password"],"additionalProperties":false},"ReconnectGooglePlayChannel":{"type":"object","properties":{"service_account_key":{"description":"A new key of the same service account. Leave it out to check the saved key again after fixing a permission in Play Console or enabling an API in Google Cloud.","type":"string","minLength":1,"maxLength":16384}},"additionalProperties":false},"RecordConsent":{"type":"object","properties":{"channel_type":{"type":"string","enum":["whatsapp","sms","voice"]},"status":{"type":"string","enum":["opted_in","opted_out"]},"proof":{"type":"object","properties":{"method":{"type":"string","minLength":1,"maxLength":200,"description":"How it was given or asked: a signed form, a website checkbox, a call…"},"text":{"description":"What the person agreed to or asked, as they saw or said it.","type":"string","minLength":1,"maxLength":2000},"url":{"description":"Where it can be checked.","type":"string","maxLength":2000,"format":"uri"},"reference":{"type":"string","minLength":1,"maxLength":200},"captured_at":{"description":"When the person gave it.","type":"string","format":"date-time"}},"required":["method"],"additionalProperties":false,"description":"The proof (docs/14 \"proof required\")."},"changed_at":{"description":"When it changed (default: now; never in the future).","type":"string","format":"date-time"}},"required":["channel_type","status","proof"],"additionalProperties":false},"ReferenceTrace":{"type":"object","properties":{"reference":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"http_status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"organization_id":{"type":["string","null"]},"membership_id":{"type":["string","null"]},"title_params":{},"where":{},"provider":{},"retryable":{"type":"boolean"},"alert":{"type":["string","null"]},"release":{"type":["string","null"]},"service":{"type":["string","null"]},"trace_id":{"type":["string","null"]},"occurred_at":{"type":"string","format":"date-time"}},"required":["id","code","http_status","organization_id","membership_id","title_params","where","provider","retryable","alert","release","service","trace_id","occurred_at"],"additionalProperties":false}},"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"],"additionalProperties":false}},"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"endpoint":{"type":"string"},"delivery_id":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"received_at":{"type":"string","format":"date-time"},"failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_error_code":{"type":["string","null"]}},"required":["id","endpoint","delivery_id","status","attempts","replays","received_at","failed_at","last_error_code"],"additionalProperties":false}},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"ticket_id":{"type":"string"},"channel_type":{"type":["string","null"]},"status":{"type":["string","null"]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{},"status_changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","organization_id","ticket_id","channel_type","status","attempt","error","status_changed_at"],"additionalProperties":false}},"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"delivery_id":{"type":"string"},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string"},"response_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error_code":{"type":["string","null"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","delivery_id","attempt","status","response_status","error_code","duration_ms","created_at"],"additionalProperties":false}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"type":{"type":"string"},"aggregate_type":{"type":"string"},"aggregate_id":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","organization_id","type","aggregate_type","aggregate_id","occurred_at","published_at"],"additionalProperties":false}},"synthetic_runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"check_key":{"type":"string"},"outcome":{"type":"string"},"error_code":{"type":["string","null"]},"started_at":{"type":"string","format":"date-time"}},"required":["id","check_key","outcome","error_code","started_at"],"additionalProperties":false}},"system_emails":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"type":{"type":"string"},"category":{"type":["string","null"]},"occurred_at":{"type":"string","format":"date-time"}},"required":["id","provider","type","category","occurred_at"],"additionalProperties":false}}},"required":["reference","errors","organizations","webhooks","messages","deliveries","events","synthetic_runs","system_emails"],"additionalProperties":false},"RegisteredOAuthApp":{"type":"object","properties":{"app":{"$ref":"#/components/schemas/OAuthApp"},"client_secret":{"description":"Confidential apps: the secret, shown only now. Null for public apps.","type":["string","null"]}},"required":["app","client_secret"],"additionalProperties":false},"RegisterVoiceDevice":{"type":"object","properties":{"platform":{"type":"string","enum":["apns_voip","fcm"],"description":"`apns_voip` (iOS VoIP push, CallKit) or `fcm` (Android high-priority)."},"token":{"type":"string","minLength":8,"maxLength":4096,"description":"The push token of the app install."},"environment":{"description":"APNs only (required for it).","type":"string","enum":["production","sandbox"]},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["platform","token"],"additionalProperties":false},"RegisterWhatsappNumber":{"type":"object","properties":{"pin":{"description":"A new two-step verification PIN; the saved one when absent.","type":"string","pattern":"^\\d{6}$"}},"additionalProperties":false},"RemovePlatformRole":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["reason"],"additionalProperties":false},"RemoveRateCardItem":{"type":"object","properties":{"item_key":{"type":"string","minLength":1,"maxLength":600},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["item_key"],"additionalProperties":false},"RenameChatGroup":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"],"additionalProperties":false},"ReplayDeadLetter":{"type":"object","properties":{"queue":{"type":"string","pattern":"^[a-z][a-z0-9.-]{0,99}$","description":"A queue name, e.g. `jobs.standard` or `events.billing-seat-reactivation`."},"job_id":{"type":"string","minLength":1,"maxLength":200,"description":"The job id."},"failed_at":{"type":"string","format":"date-time","description":"The failure being replayed (`failed_at` of the dead job): a job that failed again since is not replayed twice."},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["queue","job_id","failed_at","reason"]},"ReplyWindow":{"anyOf":[{"type":"object","properties":{"hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Free replies this many hours after the customer wrote."},"human_agent_hours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"A member's reply may still go out with the platform's human agent tag this many hours after (Messenger: 168)."},"max_messages":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Business messages allowed in the window until the customer writes again (TikTok: 10); null when not counted."},"outside":{"type":"string","enum":["human_agent_tag","template","none"],"description":"What may still go out after `open_until`: a member's reply with the human agent tag (Messenger, Instagram), an approved template (WhatsApp), or nothing (TikTok)."},"open_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"human_agent_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["hours","human_agent_hours","max_messages","outside","open_until","human_agent_until"],"additionalProperties":false},{"type":"null"}],"description":"The platform's reply window of a private conversation (docs/24 #24), the same policy every send path enforces: free replies until `open_until`. After it, Messenger and Instagram: a member's reply goes out with the human agent tag until `human_agent_until` (`FB-2010`/`IG-2010` for automatic replies, `FB-2011`/`IG-2011` for members after); WhatsApp: templates only (`WA-2047`); TikTok: refused (`TT-3007`), and over `max_messages` in the window `TT-3008`. Null when the channel has none."},"RequestSmsSenderName":{"type":"object","properties":{"name":{"type":"string","minLength":3,"maxLength":11,"description":"3 to 11 English letters or digits (space `.` `-` `_` `&` allowed), not only digits. A promotional name ends in `-AD`."},"classification":{"type":"string","enum":["service","promotional","awareness"],"description":"`service` (customer service and codes), `promotional` (campaigns, name ending in `-AD`) or `awareness`."},"purpose":{"type":"string","minLength":1,"maxLength":1000,"description":"What the name is for, for the registration with the operators."}},"required":["name","classification","purpose"],"additionalProperties":false},"ResolveTicketReferences":{"type":"object","properties":{"numbers":{"maxItems":50,"type":"array","items":{"type":"integer","minimum":1,"maximum":9007199254740991}},"text":{"description":"A text whose `#<number>` references are resolved (a note being shown).","type":"string","maxLength":20000}},"additionalProperties":false},"Review":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channel_type":{"type":"string","description":"`app_store`, `google_play` or `google_business`."},"channel_id":{"type":"string","format":"uuid"},"external_id":{"type":"string","description":"The store’s review id."},"ticket_id":{"type":"string","format":"uuid","description":"The ticket the review lives in now."},"message_id":{"type":"string","format":"uuid","description":"The ticket message with its current content."},"app":{"anyOf":[{"type":"object","properties":{"address_id":{"type":"string","format":"uuid","description":"Its channel address: assign it to a space (`POST /v1/spaces/{space_id}/channels` with `channel_address_id`) to route its reviews."},"external_id":{"type":"string","description":"The store’s id (Apple’s app id, the Google Play package name, Google’s location id)."},"name":{"type":"string"}},"required":["address_id","external_id","name"],"additionalProperties":false},{"type":"null"}],"description":"The app reviewed (app stores); null for a location’s review."},"location":{"anyOf":[{"type":"object","properties":{"address_id":{"type":"string","format":"uuid","description":"Its channel address: assign it to a space (`POST /v1/spaces/{space_id}/channels` with `channel_address_id`) to route its reviews."},"external_id":{"type":"string","description":"The store’s id (Apple’s app id, the Google Play package name, Google’s location id)."},"name":{"type":"string"}},"required":["address_id","external_id","name"],"additionalProperties":false},{"type":"null"}],"description":"The business location reviewed (Google Maps); null otherwise."},"rating":{"type":"integer","minimum":1,"maximum":5},"title":{"type":["string","null"]},"body":{"type":["string","null"]},"reviewer_name":{"description":"The author’s public name; null for an anonymous Google reviewer.","type":["string","null"]},"territory":{"description":"The store’s country or region (App Store: ISO 3166-1 alpha-3, e.g. `SAU`); null on Google Play.","type":["string","null"]},"app_version":{"description":"The app version reviewed, when the store ties the review to a version.","type":["string","null"]},"device":{"anyOf":[{"type":"object","properties":{"language":{"description":"The reviewer’s language, e.g. `ar`.","type":["string","null"]},"name":{"description":"The device, e.g. `Galaxy A52s 5G`.","type":["string","null"]},"manufacturer":{"type":["string","null"]},"android_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The Android API level."},"app_version_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["language","name","manufacturer","android_version","app_version_code"],"additionalProperties":false},{"type":"null"}],"description":"Google Play’s device facts of the review; null on other stores."},"reply_rules":{"$ref":"#/components/schemas/ReviewReplyRules"},"reviewed_at":{"type":"string","format":"date-time","description":"When the review was written (Google Play: when it was last changed)."},"content_changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"reply":{"type":"object","properties":{"state":{"type":"string","enum":["none","pending","published","deleted"],"description":"`pending`: sent, waiting for the store to publish it (Apple); `published`; `deleted` by a member, or on the store (its console)."},"author":{"anyOf":[{"type":"string","enum":["member","bot","external"]},{"type":"null"}],"description":"`member`, `bot` (the AI agent) or `external` (written on the store itself: App Store Connect, Play Console, Google Business Profile)."},"external_id":{"type":["string","null"]},"body":{"type":["string","null"]},"message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"state_changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When Rabt last asked the store whether a `pending` reply is published."},"check_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"The catalog code, e.g. `APS-3701` or `GBP-3806`."},"reference":{"type":"string","description":"The error log reference."},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"An error kept on the item it stopped (docs/23)."},{"type":"null"}],"description":"Why that question failed (code and reference); Rabt asks again later. Null after a good answer."}},"required":["state","author","external_id","body","message_id","updated_at","state_changed_at","checked_at","check_error"],"additionalProperties":false}},"required":["id","channel_type","channel_id","external_id","ticket_id","message_id","app","location","rating","title","body","reviewer_name","territory","app_version","device","reply_rules","reviewed_at","content_changed_at","reply"],"additionalProperties":false,"description":"A store review and its one public reply (docs/02 §8)."},"ReviewReplyRules":{"type":"object","properties":{"max_length":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The longest reply in Unicode characters, shown with a counter in the composer (Google Play: 350); null when the store counts none (Apple documents no limit)."},"max_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The longest reply in UTF-8 bytes (Google Maps: 4,095; an Arabic letter takes two); null when the store counts none."},"moderated_by_store":{"type":"boolean","description":"The store reviews each reply before it appears (Apple: up to 24 hours, `pending` until then); false: published at once (Google Play, Google Maps)."},"deletable":{"type":"boolean","description":"A member may delete the published reply through Rabt (App Store, Google Maps); false: only in the store’s console (Google Play)."}},"required":["max_length","max_bytes","moderated_by_store","deletable"],"additionalProperties":false,"description":"What the composer shows (docs/02 §8): one public text reply per review, a new one replaces it, no files; the AI agent never writes personal data and never replaces a person’s reply."},"Role":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionKey"}},"is_default":{"type":"boolean","description":"Owner, Admin, Supervisor or Agent (docs/18)."},"is_owner":{"type":"boolean","description":"The fixed Owner role: every permission, never edited or given."},"member_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","permissions","is_default","is_owner","member_count","created_at","updated_at"],"additionalProperties":false,"description":"A role and its permissions (docs/18)."},"RoleList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Role"},"description":"Owner and default roles first."}},"required":["data"],"additionalProperties":false},"RoleRef":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"RoutingDestination":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["all"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["space"]},"space_id":{"type":"string","format":"uuid"},"space_name":{"type":"string"}},"required":["type","space_id","space_name"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["member"]},"membership_id":{"type":"string","format":"uuid"},"member_name":{"type":"string"}},"required":["type","membership_id","member_name"],"additionalProperties":false}],"description":"Where new tickets go: the All space (`all`, the default), one department space, or one specific member (assigned to them in the All space). Never several."},"RoutingItem":{"type":"object","properties":{"target":{"$ref":"#/components/schemas/RoutingTargetType"},"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["email","account","app","location","channel","widget"],"description":"How it is connected: an address of kind `email`, `account`, `app` or `location`; a `channel` without addresses; a web chat `widget`."},"channel_id":{"type":"string","format":"uuid"},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"provider":{"type":"string"},"channel_name":{"type":"string"},"channel_status":{"type":"string","description":"The channel’s status (`pending`, `active`, `needs_reauth`), or the widget’s."},"label":{"type":"string","description":"The address, or the channel’s or widget’s name."},"display_name":{"type":["string","null"]},"destination":{"$ref":"#/components/schemas/RoutingDestination"},"effective":{"description":"Where its new tickets go now: its own destination, else its channel’s space (set on the Spaces page), else the All space.","$ref":"#/components/schemas/RoutingDestination"},"routed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["target","id","kind","channel_id","channel_type","provider","channel_name","channel_status","label","display_name","destination","effective","routed_at"],"additionalProperties":false},"RoutingItemPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RoutingItem"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"RoutingSettings":{"type":"object","properties":{"max_open_tickets":{"type":"integer","minimum":0,"maximum":1000,"description":"The organization default of open tickets per member, across all spaces (docs/17 step 5)."}},"required":["max_open_tickets"],"additionalProperties":false},"RoutingTargetType":{"type":"string","enum":["address","channel"],"description":"`address`: a channel address (an email address or alias, an account, an app, a location); `channel`: a channel or web chat widget that carries no address (a WhatsApp number, an X account, a page, a widget)."},"SavedCard":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"brand":{"type":"string","example":"visa"},"last4":{"type":"string"},"expiry_month":{"type":"integer","minimum":1,"maximum":12},"expiry_year":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"saved_at":{"type":"string","format":"date-time"}},"required":["id","brand","last4","expiry_month","expiry_year","saved_at"],"additionalProperties":false,"description":"Tap's saved card: its brand, last 4 digits and expiry only."},"SavedCardResponse":{"type":"object","properties":{"card":{"anyOf":[{"$ref":"#/components/schemas/SavedCard"},{"type":"null"}]}},"required":["card"],"additionalProperties":false},"SaveListViewRequest":{"type":"object","properties":{"state":{"anyOf":[{"$ref":"#/components/schemas/CustomersListState"},{"$ref":"#/components/schemas/TicketsListState"}],"description":"The state of the list named in the path: a customers state (`tab`) or a tickets state (`space`)."}},"required":["state"],"additionalProperties":false},"Scope":{"type":"string","enum":["organization:read","organization:write","members:read","members:write","contacts:read","contacts:write","segments:read","segments:write","imports_exports:read","imports_exports:write","companies:read","companies:write","tickets:read","tickets:write","replies:read","replies:write","audit:read","error_log:read","billing:read","billing:write","wallet:read","wallet:write","pricing:read","notifications:read","notifications:write","chat:read","chat:write","search:read","spaces:read","spaces:write","ai:read","ai:write","channels:read","channels:write","sms:read","sms:write","campaigns:read","campaigns:write","platform_sms:read","platform_sms:write","voice:read","voice:write","integrations:read","integrations:write","webhooks:read","webhooks:write","platform_operations:read","platform_operations:write","platform_organizations:read","platform_organizations:write","platform_pricing:read","platform_pricing:write","platform_team:read","platform_team:write","platform_audit:read","platform_billing:read","platform_problems:read","platform_problems:write"],"description":"A module scope (docs/16): `organization:read` Read the organization's settings (name, language, time zone, country), its tags and custom fields, the CRM settings, the ticket types, the ticket settings and the email signatures. `organization:write` Change the organization's settings, its tags and custom fields, the CRM settings, the ticket types, the ticket settings and the email signatures. `members:read` Read the members, the roles and their permissions, and the invitations. `members:write` Invite people, change roles and seats, remove members, and manage custom roles (only within the permissions of the member who granted access). `contacts:read` Read and search the contacts, their notes, their merge history and a contact's communication history. `contacts:write` Create, edit and delete contacts, their phone numbers, email addresses, company links and notes, and merge or unmerge contacts. `segments:read` Read the segments (saved filters of contacts and companies) and how many records each lists. `segments:write` Create, change and delete segments. `imports_exports:read` Read the CSV imports and exports of contacts and companies, their progress and errors, and download exported files. `imports_exports:write` Import contacts from CSV files and export contacts and companies to CSV files. `companies:read` Read and search the companies, their notes and their merge history. `companies:write` Create, edit and delete companies, their email domains and notes, and merge or unmerge companies. `tickets:read` Read the tickets the member may see, their timelines (messages, internal notes, files), their followers, and the store reviews they hold with their public replies. `tickets:write` Start, edit, pick up, close, assign and merge tickets, reply to customers (on WhatsApp also with templates, locations, contact cards, reactions and the typing indicator; and to store reviews), delete a public reply to a store review, add internal notes and files, retry failed messages, and follow tickets. `replies:read` Read the canned replies (the organization's, the spaces' and the connected member's own). `replies:write` Create, change and delete canned replies (only within the permissions of the member who granted access). `audit:read` Read the audit log. `error_log:read` Read the organization's error log (every recorded error with its code and reference). `billing:read` Read the seats and their billing (the subscription, the seat log), price one more seat, and read the monthly invoices (with their PDF and CSV), their credit and debit notes and the billing profile. `billing:write` Save the billing profile copied onto invoices. `wallet:read` Read the prepaid wallet's balance and its transactions, the top-ups, the saved card, the auto top-up settings and the receipt vouchers. `wallet:write` Change the auto top-up settings. `pricing:read` Get price quotes for usage (messages, calls, AI) at the current prices. `notifications:read` Read your notifications and your notification preferences. `notifications:write` Mark your notifications as read and change your notification preferences. `chat:read` Read the connected member's internal chat rooms, their members, messages, pinned messages, files and read positions, and search their messages. `chat:write` Post, edit, delete, react to and pin messages in the connected member's rooms, send files, create and manage private groups, start direct messages, and set their read positions and notifications. `search:read` Search everything the connected member may see in one query: tickets, messages and internal notes, contacts, companies and their notes, and their chat rooms. Each kind of result also needs its own module's read scope. `spaces:read` Read the spaces, their members and channels, who is available, the availability log, the routing limits and the address routing page (every connected item with its destination). `spaces:write` Create, change and archive spaces, manage their members and channels, set the routing limits, set the destination of every connected address, account, channel and widget, and set the connected member's own availability. `ai:read` Read the AI agent's Markdown blocks of every level (organization, channel, private/public and address), the AI switches of every level and which apply to a channel, and what the AI agent receives for a ticket on a channel. `ai:write` Add, edit, reorder, switch off and archive the AI agent's blocks, and set the AI switches of every level. `channels:read` Read the channels: the web chat widgets with their settings, allowed domains and status, the email channels with their status and settings (never their credentials), inbound address and sender domain checks, the Microsoft 365 mailboxes with their addresses and receiving state, and the WhatsApp numbers with their status, quality, messaging limit, health, templates and the account events Meta reported, the App Store channels with their status, key IDs (never the private key) and apps, the Google Maps review channels with their status, locations and the business locations their Google account can connect, and the Google Play channels with their status, service account, key id (never the key), apps and how current their reviews are. `channels:write` Create, change, switch off and remove web chat widgets and rotate a widget's identity-verification secret; connect, change, reconnect and disconnect email channels, send forwarding check messages and run the sender domain checks; connect Microsoft 365 mailboxes, manage their addresses, check sending from them, sync and disconnect them; connect WhatsApp numbers with Embedded Signup, rename, register, check health, ask for the WhatsApp Business app history, create, edit and sync templates, and disconnect; connect, rename, reconnect and disconnect App Store channels and refresh their apps; connect, rename, reconnect and disconnect Google Maps review channels, choose their locations and read their reviews again; connect, rename, change the package names of, reconnect or check again, read now and disconnect Google Play channels and refresh their apps. `sms:read` Read SMS: the sender names with their registration status, documents and complaints, the opt-out list, the SMS settings, and every SMS sent with its delivery status. `sms:write` Request sender names and upload their registration documents, choose the default sender name, add and lift opt-outs, change the SMS settings, send SMS (service messages and one-time codes, paid from the wallet) and report one-time codes as used. `campaigns:read` Read the campaigns on WhatsApp, SMS and voice with their results, their review before launch (recipients, estimated cost, compliance checks), their recipients with each one’s status, and listen to a voice campaign’s audio. `campaigns:write` Create, change and remove draft campaigns, add a voice campaign’s recording, create its speech (paid from the wallet), and launch, pause, resume and cancel campaigns (they spend from the wallet). `platform_sms:read` Rabt platform team only: read every organization’s SMS sender names with their registration documents and spam complaints, and Rabt’s stock of phone numbers with who holds each. `platform_sms:write` Rabt platform team only: record the registration of SMS sender names (submitted, approved, rejected), log spam complaints, and suspend or lift a sender name with a mandatory reason; add phone numbers to Rabt’s stock, mark them porting, on sale or retired, give one to an organization, and suspend or lift an organization’s number with a reason. `voice:read` Read the phone numbers with their settings and destinations, the numbers available to pick, the voice settings, the calls with their recordings and voicemail, and your registered devices. `voice:write` Pick, change and release phone numbers, change the voice settings, call customers from tickets, transfer and end calls, get your softphone credentials, and register or remove your devices. `integrations:read` Read the connected stores and systems with their status and sync runs (never their credentials), a contact's customer records and orders in them, and look up orders by number, phone or email. `integrations:write` Connect stores and systems by signing in to their platform, reconnect and disconnect them, and ask for a sync of their customers and orders. `webhooks:read` Read the webhook endpoints, the event types and the delivery log. `webhooks:write` Create, change and delete webhook endpoints, rotate their secrets and redeliver events. `platform_operations:read` Read the platform's operations: the queues with their dead jobs, provider health, the wallet reconciliation results, the SMS operator routes, the voice operator trunks, degraded modes, status page incidents, SLOs, synthetic check runs and the API version calendar (Rabt team only). `platform_operations:write` Replay dead jobs, add, change, disable and enable voice operator trunks, switch degraded modes and open, update and resolve status page incidents (Rabt team only). `platform_organizations:read` Platform: read every organization's summary (owner, status, seats), wallet balance and history, usage, abuse limits, markup overrides and trial. `platform_organizations:write` Platform: set organizations' abuse limits and markup overrides, and extend trials. `platform_pricing:read` Platform: read the rate-card versions and drafts with their pricing table, and the fixed prices (plans). `platform_pricing:write` Platform: create and edit rate-card drafts, publish or discard them, and publish new fixed prices (plans). `platform_team:read` Platform: read the key's own platform access, the platform team (members of the Rabt organization) and the platform roles, and re-authenticate the key with a code for sensitive actions. `platform_team:write` Platform: create, edit and remove platform roles, and give or take members' platform roles. `platform_audit:read` Platform: read the platform audit log. `platform_billing:read` Platform: read every organization's monthly invoices with their e-invoicing status, every receipt voucher and the failed payments, and export them as CSV. `platform_problems:read` Platform: read the Problems log: every error or rejection users saw, grouped into problems with counts, affected organizations, trend, releases, sample references and the text for investigation. `platform_problems:write` Platform: change a problem's status (new, investigating, resolved). A module's write scope includes its read scope."},"SearchResult":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/SearchResultType"},"id":{"type":"string","format":"uuid","description":"The id of what was found (ticket, message, note, contact…)."},"title":{"description":"Its name or heading.","$ref":"#/components/schemas/HighlightedText"},"subtitle":{"description":"A context line (phone, room, contact).","type":["string","null"]},"snippet":{"anyOf":[{"$ref":"#/components/schemas/HighlightedText"},{"type":"null"}],"description":"The matching text around the match; null when the title shows it."},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"path":{"type":"string","description":"Where the web app opens it, exactly there (e.g. `/tickets/1283?message=<id>`)."},"ticket":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subject":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/TicketStatus"}},"required":["id","number","subject","status"],"additionalProperties":false},{"type":"null"}]},"contact_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"room":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["space","all","group","direct"]},"name":{"type":["string","null"]}},"required":["id","type","name"],"additionalProperties":false},{"type":"null"}]},"message_seq":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"A chat message’s number in its room (open the room at it)."}},"required":["type","id","title","subtitle","snippet","occurred_at","path","ticket","contact_id","company_id","room","message_seq"],"additionalProperties":false},"SearchResults":{"type":"object","properties":{"query":{"type":"string"},"groups":{"type":"array","items":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/SearchResultType"},"results":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}},"required":["type","results"],"additionalProperties":false}}},"required":["query","groups"],"additionalProperties":false,"description":"One group per kind searched (in a fixed order, empty ones included); kinds your API key or app has no read scope for are left out."},"SearchResultType":{"type":"string","enum":["ticket","message","note","contact","company","contact_note","company_note","chat_message"],"description":"ticket (number, subject, custom fields), message (message texts on every channel), note (internal notes of tickets), contact, company, contact_note, company_note, chat_message (only your rooms)."},"SeatEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"membership_id":{"type":"string","format":"uuid"},"member_name":{"type":"string"},"action":{"type":"string","enum":["added","deactivated","reactivated","removed"]},"occurred_at":{"type":"string","format":"date-time"},"charge":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"SAR in halalas (1 SAR = 100 halalas)."},"days":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["id","amount","days"],"additionalProperties":false},{"type":"null"}],"description":"The prorated seat charge it caused."}},"required":["id","membership_id","member_name","action","occurred_at","charge"],"additionalProperties":false,"description":"A change of a seat (docs/05 \"SeatEvent\")."},"SeatEventPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SeatEvent"},"description":"Newest first."},"next_cursor":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Pass as `cursor` for older entries; null on the last page."}},"required":["data","next_cursor"],"additionalProperties":false,"description":"A page of the seat log (docs/10)."},"SeatQuote":{"type":"object","properties":{"billing_state":{"type":"string","enum":["trial","active","seats_inactive"]},"basis":{"type":"string","enum":["prorated","trial","seats_inactive","already_paid"],"description":"`prorated`: charged now from the wallet for the rest of the month; `trial`: free during the trial; `seats_inactive`: nothing now, paid with every seat when a payment ends SeatsInactive; `already_paid`: this seat is paid for this month."},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"What adding or reactivating the seat takes now."},"days":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Days left in the month, today included."},"period_days":{"type":"integer","minimum":28,"maximum":31},"period_start":{"type":"string","format":"date-time"},"period_end":{"type":"string","format":"date-time"},"seat_price":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"SAR in halalas (1 SAR = 100 halalas)."},{"type":"null"}]},"members":{"type":"integer","minimum":0,"maximum":9007199254740991},"trial_member_limit":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["billing_state","basis","amount","days","period_days","period_start","period_end","seat_price","members","trial_member_limit"],"additionalProperties":false,"description":"The price of one more seat before paying it (docs/10 \"Proration\"; refused with WAL-1001 when the wallet cannot pay it)."},"Segment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"entity":{"$ref":"#/components/schemas/CrmListEntity"},"filter":{"$ref":"#/components/schemas/SegmentFilter"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records it lists now (at most 100000)."},"count_capped":{"type":"boolean","description":"True when it lists more than `count` records."},"created_by_membership_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","entity","filter","count","count_capped","created_by_membership_id","created_at","updated_at"],"additionalProperties":false,"description":"A saved filter of contacts or companies (docs/14)."},"SegmentFilter":{"type":"object","properties":{"q":{"description":"Free text, searched like the list of contacts or companies.","type":"string","maxLength":200},"tag_ids":{"description":"Records with every one of these tags.","maxItems":20,"type":"array","items":{"type":"string","format":"uuid"}},"company_id":{"description":"Contacts of this company.","type":"string","format":"uuid"},"channel_type":{"description":"Contacts with an identity on this channel.","$ref":"#/components/schemas/ChannelType"},"active_within_days":{"description":"Contacts active in the last N days (with `channel_type`: seen on that channel in the last N days).","type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false,"description":"A filter of contacts (every part) or companies (`q` and `tag_ids` only). Parts left out do not filter."},"SegmentList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}}},"required":["data"],"additionalProperties":false},"SelectGoogleBusinessLocations":{"type":"object","properties":{"location_ids":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"description":"Google’s location ids (`locations/{id}` or the id alone, from `listGoogleBusinessAvailableLocations`) the channel carries from now on; locations left out are removed (their reviews and tickets stay). An empty list removes every location."}},"required":["location_ids"],"additionalProperties":false},"SenderDomainCheck":{"type":"object","properties":{"domain":{"type":"string"},"checked_at":{"type":"string","format":"date-time"},"checks":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["spf","dkim","dmarc","reverse_dns"]},"status":{"type":"string","enum":["pass","warning","fail","unknown"]},"finding":{"type":"string","enum":["spf_found","spf_missing","spf_multiple","spf_allows_all","dkim_aligned","dkim_unaligned","dkim_key_missing","dkim_not_signed","dkim_not_checked","dmarc_enforced","dmarc_monitor_only","dmarc_missing","reverse_dns_confirmed","reverse_dns_missing","reverse_dns_mismatch","lookup_failed"]},"name":{"type":"string","description":"The DNS name looked up."},"record":{"description":"The record found, as published.","type":["string","null"]}},"required":["key","status","finding","name","record"],"additionalProperties":false}}},"required":["domain","checked_at","checks"],"additionalProperties":false,"description":"SPF, DKIM, DMARC and reverse DNS of the sender domain (docs/02 §4); Microsoft 365 mailboxes have no reverse DNS check (Microsoft’s servers send)."},"SendInstagramMessage":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["post_share"]},"media_id":{"type":"string","pattern":"^\\d{1,40}$"},"client_key":{"type":"string","pattern":"^[A-Za-z0-9._~-]{1,100}$"}},"required":["type","media_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["heart"]},"client_key":{"type":"string","pattern":"^[A-Za-z0-9._~-]{1,100}$"}},"required":["type"],"additionalProperties":false}],"description":"`post_share`: one of the account’s own recent posts, reels or stories (`media_id` from `GET /v1/channels/instagram/tickets/{ticketId}/media`). `heart`: the heart sticker. `client_key`: your key for this send; the same key never creates a second message."},"SendMessage":{"type":"object","properties":{"mode":{"type":"string","enum":["reply","note"],"description":"`reply`: to the customer on the ticket channel. `note`: an internal note."},"body":{"anyOf":[{"type":"string","maxLength":100000},{"type":"null"}],"description":"The text (null: files only)."},"content_type":{"type":"string","enum":["text","image","video","audio","voice","document","sticker","location","contacts","template","event","call"]},"attachment_ids":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"},"description":"Uploaded files of this ticket to send with it."},"mentioned_membership_ids":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"},"description":"Members mentioned in a note (@mentions)."},"reply_to_message_id":{"description":"The message of this ticket it replies to (reply context).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"client_key":{"description":"Your key for this send: the same key never creates a second message.","type":"string","pattern":"^[A-Za-z0-9._~-]{1,100}$"},"base_message_id":{"description":"The newest item you had seen; the answer tells what arrived since (the send-time warning).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"email":{"description":"An email reply’s recipients, subject and signature as the member set them (the email composer, C05); without them the reply answers the customer’s last email, keeps its Cc, uses the ticket’s subject with `[#number]` and carries the signature. Ignored on other channels.","type":"object","properties":{"to":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","maxLength":254,"format":"email"}},"cc":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":254,"format":"email"}},"subject":{"type":"string","minLength":1,"maxLength":998},"signature":{"description":"False leaves out the email signature Rabt adds under a member’s reply (`GET /v1/email-signatures/preview` shows it); by default the reply carries it.","type":"boolean"}},"additionalProperties":false},"private_reply":{"description":"A `reply` sent privately to the customer who wrote a public comment (Facebook comment tickets): to `reply_to_message_id`, else the thread’s newest customer comment. Text only, once per comment (`FB-2017`), within 7 days of the comment (`FB-2018`); on any other ticket `FB-2027`. The customer’s answer arrives as a Messenger conversation.","type":"boolean"}},"required":["mode","body"],"additionalProperties":false},"SendResult":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/Message"},"duplicate":{"type":"boolean","description":"Your `client_key` was already used: its message."},"warnings":{"$ref":"#/components/schemas/SendWarnings"}},"required":["message","duplicate","warnings"],"additionalProperties":false},"SendSms":{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$","description":"A mobile number in E.164, e.g. `+966500000000`."},"body":{"type":"string","minLength":1,"maxLength":1600,"description":"The text: at most 10 parts (1,530 GSM-7 or 670 UCS-2 characters; Arabic is UCS-2). KSA rules apply: no phone numbers or WhatsApp links, links only to allowed domains."},"category":{"type":"string","enum":["service","otp"],"description":"`service` or `otp` (a one-time code: the text must state its purpose). Promotional SMS go through campaigns (`SMS-4038`)."},"sender_name_id":{"description":"Default: the default sender name (or the only approved service name).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"client_key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$","description":"Your key for this send (letters, digits, `. _ : -`, up to 100): repeating it never sends a second SMS."}},"required":["to","body","category"],"additionalProperties":false},"SendTicketSms":{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$","description":"One of the contact's mobile numbers (`SMS-4039` otherwise)."},"body":{"type":"string","minLength":1,"maxLength":1600,"description":"The text: at most 10 parts (1,530 GSM-7 or 670 UCS-2 characters; Arabic is UCS-2). KSA rules apply: no phone numbers or WhatsApp links, links only to allowed domains."},"sender_name_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"client_key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$","description":"Your key for this send (letters, digits, `. _ : -`, up to 100): repeating it never sends a second SMS."}},"required":["to","body"],"additionalProperties":false},"SendWarnings":{"type":"object","properties":{"customer_messages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Messages from the customer since your base."},"teammate_replies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Replies other members sent since your base."}},"required":["customer_messages","teammate_replies"],"additionalProperties":false,"description":"The send-time warning."},"SendWhatsappMessage":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["template"]},"template_id":{"type":"string","format":"uuid"},"components":{"default":[],"maxItems":12,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["header","body","button"]},"sub_type":{"type":"string","enum":["quick_reply","url","copy_code"]},"index":{"type":"integer","minimum":0,"maximum":9},"parameters":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","currency","date_time","image","video","document","payload","coupon_code"]},"value":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","pattern":"^[a-z0-9_]{1,100}$"},"currency":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z]{3}$"},"amount_1000":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","amount_1000"],"additionalProperties":false}},"required":["type","value"],"additionalProperties":false}}},"required":["type","parameters"],"additionalProperties":false}},"reply_to_message_id":{"description":"The message of this ticket it replies to (reply context).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"client_key":{"description":"Your key for this send: the same key never creates a second message.","type":"string","pattern":"^[A-Za-z0-9._~-]{1,100}$"}},"required":["type","template_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["location"]},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"name":{"default":null,"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"address":{"default":null,"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"reply_to_message_id":{"description":"The message of this ticket it replies to (reply context).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"client_key":{"description":"Your key for this send: the same key never creates a second message.","type":"string","pattern":"^[A-Za-z0-9._~-]{1,100}$"}},"required":["type","latitude","longitude"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["contacts"]},"contacts":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"phones":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","minLength":3,"maxLength":40}},"emails":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","maxLength":254,"format":"email"}},"organization":{"default":null,"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["name"],"additionalProperties":false}},"reply_to_message_id":{"description":"The message of this ticket it replies to (reply context).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"client_key":{"description":"Your key for this send: the same key never creates a second message.","type":"string","pattern":"^[A-Za-z0-9._~-]{1,100}$"}},"required":["type","contacts"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["reaction"]},"message_id":{"type":"string","format":"uuid","description":"The customer's message of this ticket."},"emoji":{"type":"string","maxLength":16,"description":"One emoji; empty removes the reaction."},"client_key":{"description":"Your key for this send: the same key never creates a second message.","type":"string","pattern":"^[A-Za-z0-9._~-]{1,100}$"}},"required":["type","message_id","emoji"],"additionalProperties":false}],"description":"A reply that is more than text and files: an approved template (the only content outside the 24-hour window), a location, contact cards or a reaction. Text, media and voice notes use `POST /v1/tickets/{ticketId}/messages`."},"SentCode":{"type":"object","properties":{"channel":{"type":"string","enum":["email","sms"]},"expires_at":{"type":"string","format":"date-time","description":"The code is valid until then (5 minutes)."},"resend_after":{"type":"string","format":"date-time","description":"Another code can be requested for the same email or phone from then on."}},"required":["channel","expires_at","resend_after"],"additionalProperties":false,"description":"A code was sent. The code itself is only in the message."},"SentSms":{"type":"object","properties":{"sms":{"$ref":"#/components/schemas/Sms"},"duplicate":{"type":"boolean"}},"required":["sms","duplicate"],"additionalProperties":false},"Session":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"current":{"type":"boolean","description":"True for the session of this request."},"created_at":{"type":"string","format":"date-time","description":"When the session signed in."},"expires_at":{"type":"string","format":"date-time","description":"When it ends unless used: 14 days after its last use, and never later than 30 days after the code that started it."},"last_seen_at":{"type":"string","format":"date-time","description":"When it was last used (to within 5 minutes)."},"verified_at":{"type":"string","format":"date-time","description":"When a code was last entered in it (sign-in or re-authentication)."},"ip_address":{"description":"The address it signed in from (or re-authenticated from).","type":["string","null"]},"user_agent":{"type":["string","null"]},"browser":{"description":"Read from the user agent, e.g. `Chrome`.","type":["string","null"]},"os":{"description":"Read from the user agent, e.g. `iOS`.","type":["string","null"]},"device_type":{"anyOf":[{"type":"string","enum":["desktop","mobile","tablet","tv","bot"]},{"type":"null"}]}},"required":["id","current","created_at","expires_at","last_seen_at","verified_at","ip_address","user_agent","browser","os","device_type"],"additionalProperties":false,"description":"A signed-in device (sign-in session)."},"SessionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Session"},"description":"Newest first."}},"required":["data"],"additionalProperties":false,"description":"The account's signed-in devices."},"SessionsEnded":{"type":"object","properties":{"ended_sessions":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many other sessions were ended."}},"required":["ended_sessions"],"additionalProperties":false,"description":"Every other device was signed out."},"SetAiAgentSwitch":{"type":"object","properties":{"stopped":{"type":"boolean","description":"True stops the AI agent everywhere and hands every conversation it replies in to the members; false starts it again."}},"required":["stopped"],"additionalProperties":false},"SetAiSettings":{"type":"object","properties":{"level":{"$ref":"#/components/schemas/AiLevel"},"channel_id":{"description":"The channel (or web chat widget): for `channel` and `kind`, and for `address` with a phone number.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"kind":{"description":"For `kind` only.","anyOf":[{"$ref":"#/components/schemas/AiKind"},{"type":"null"}]},"channel_address_id":{"description":"For `address`: an email address, account, app or location of the channel.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"description":"For `address`: a phone number of the channel (instead of an address).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"enabled":{"description":"The AI agent replies automatically; null inherits the wider level.","type":["boolean","null"]},"only_when_no_member_available":{"description":"It replies only when no member of the ticket's space is available.","type":["boolean","null"]},"route_between_spaces":{"description":"It moves tickets to the right space by the spaces' names and descriptions.","type":["boolean","null"]}},"required":["level"],"additionalProperties":false,"description":"The switches of one level. Omitted: unchanged; null: inherited from the wider level (not at the organization level)."},"SetAvailability":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/Availability"}},"required":["status"],"additionalProperties":false},"SetChatNotify":{"type":"object","properties":{"notify":{"$ref":"#/components/schemas/ChatNotifySetting"}},"required":["notify"],"additionalProperties":false},"SetDegradedMode":{"type":"object","properties":{"active":{"type":"boolean"},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["active","reason"],"additionalProperties":false},"SetMarkupOverride":{"type":"object","properties":{"markup_percent":{"anyOf":[{"type":"string","pattern":"^\\d{1,5}(\\.\\d{1,2})?$","description":"A percentage with at most 2 decimals, e.g. 30 or 12.5."},{"type":"null"}],"description":"Null removes the override (the rate card applies again)."},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["markup_percent","reason"],"additionalProperties":false},"SetOrganizationLimits":{"type":"object","properties":{"max_concurrent_calls":{"type":"integer","minimum":0,"maximum":1000000},"max_sms_per_minute":{"type":"integer","minimum":0,"maximum":1000000},"max_auto_topups_per_day":{"type":"integer","minimum":0,"maximum":1000000},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["max_concurrent_calls","max_sms_per_minute","max_auto_topups_per_day","reason"],"additionalProperties":false},"SetPlatformRole":{"type":"object","properties":{"platform_role_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The platform role to give; null takes the member's away."},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["platform_role_id","reason"],"additionalProperties":false},"SetPlatformSwitch":{"type":"object","properties":{"on":{"type":"boolean"},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["on","reason"],"additionalProperties":false},"SetRoutingDestination":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["all"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["space"]},"space_id":{"type":"string","format":"uuid"}},"required":["type","space_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["member"]},"membership_id":{"type":"string","format":"uuid"}},"required":["type","membership_id"],"additionalProperties":false}],"description":"Exactly one destination: `all` (the All space), a live space (`space_id`, SPC-6201 otherwise) or a member who can receive tickets (`membership_id`; TKT-6107 removed, TKT-6122 inactive seat). It applies to the next new ticket and replaces the previous destination."},"SetStockNumberStatus":{"type":"object","properties":{"status":{"type":"string","enum":["available","porting","retired"],"description":"`porting` (an available number being ported in), `available` (a porting number put on sale) or `retired` (an available number, final)."},"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Why (the platform audit log)."}},"required":["status","reason"],"additionalProperties":false},"SignedIn":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/Account"},"session":{"$ref":"#/components/schemas/Session"},"account_created":{"type":"boolean","description":"True when this code created the account (sign-up)."}},"required":["account","session","account_created"],"additionalProperties":false,"description":"Signed in: the session cookie is set."},"SignInCode":{"type":"object","properties":{"identifier":{"description":"An email address or a phone number, detected from the text: a first digit, `+` or `(` starts a phone number (international form with `+` or `00` and the calling code, or a Saudi number such as `05X XXX XXXX`; read as E.164) unless a letter or `@` follows; anything else is an email address (read lower-cased). Arabic-Indic digits are accepted.","type":"string","maxLength":254},"code":{"description":"The 6-digit code from the message.","type":"string","maxLength":32}},"required":["identifier","code"],"additionalProperties":false},"SignInCodeRequest":{"type":"object","properties":{"identifier":{"description":"An email address or a phone number, detected from the text: a first digit, `+` or `(` starts a phone number (international form with `+` or `00` and the calling code, or a Saudi number such as `05X XXX XXXX`; read as E.164) unless a letter or `@` follows; anything else is an email address (read lower-cased). Arabic-Indic digits are accepted.","type":"string","maxLength":254}},"required":["identifier"],"additionalProperties":false},"Slo":{"type":"object","properties":{"slo":{"type":"string","enum":["api_availability","inbound_visible","outbound_accepted"]},"description":{"type":"string"},"objective":{"type":"number"},"period_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"object","properties":{"good":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"budget_remaining":{"type":"number"}},"required":["good","total","budget_remaining"],"additionalProperties":false},"windows":{"type":"array","items":{"type":"object","properties":{"tier":{"type":"string","enum":["page","ticket"]},"window":{"type":"string"},"threshold":{"type":"number"},"long_burn_rate":{"type":"number"},"short_burn_rate":{"type":"number"},"firing":{"type":"boolean"}},"required":["tier","window","threshold","long_burn_rate","short_burn_rate","firing"],"additionalProperties":false}}},"required":["slo","description","objective","period_days","period","windows"],"additionalProperties":false},"SloList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Slo"}}},"required":["data"],"additionalProperties":false},"Sms":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender_name_id":{"type":"string","format":"uuid"},"sender_name":{"type":"string"},"to":{"type":"string"},"country":{"type":"string"},"body":{"type":"string"},"category":{"type":"string","enum":["service","otp","promotional","awareness"]},"source":{"type":"string","enum":["ticket","api","system","campaign"]},"encoding":{"type":"string","enum":["gsm7","ucs2"]},"segments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["queued","submitting","submitted","delivered","failed","unknown"],"description":"`queued`, `submitting`, `submitted` (an operator accepted it), `delivered`, `failed` or `unknown` (no delivery report in time)."},"status_changed_at":{"type":"string","format":"date-time"},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["name"],"additionalProperties":false},"occurred_at":{"type":"string","format":"date-time"}},"required":["code","reference","retryable","occurred_at"],"additionalProperties":false},{"type":"null"}],"description":"Why it failed, or why its status is unknown: the catalog code, reference and the operator’s own error (docs/23)."},"ticket_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"not_before":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"valid_until":{"type":"string","format":"date-time"},"amount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Halalas charged (null until submitted)."},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","sender_name_id","sender_name","to","country","body","category","source","encoding","segments","status","status_changed_at","error","ticket_id","message_id","campaign_id","membership_id","not_before","valid_until","amount","submitted_at","delivered_at","failed_at","verified_at","created_at"],"additionalProperties":false},"SmsDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender_name_id":{"type":"string","format":"uuid"},"sender_name":{"type":"string"},"to":{"type":"string"},"country":{"type":"string"},"body":{"type":"string"},"category":{"type":"string","enum":["service","otp","promotional","awareness"]},"source":{"type":"string","enum":["ticket","api","system","campaign"]},"encoding":{"type":"string","enum":["gsm7","ucs2"]},"segments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["queued","submitting","submitted","delivered","failed","unknown"],"description":"`queued`, `submitting`, `submitted` (an operator accepted it), `delivered`, `failed` or `unknown` (no delivery report in time)."},"status_changed_at":{"type":"string","format":"date-time"},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["name"],"additionalProperties":false},"occurred_at":{"type":"string","format":"date-time"}},"required":["code","reference","retryable","occurred_at"],"additionalProperties":false},{"type":"null"}],"description":"Why it failed, or why its status is unknown: the catalog code, reference and the operator’s own error (docs/23)."},"ticket_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"not_before":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"valid_until":{"type":"string","format":"date-time"},"amount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Halalas charged (null until submitted)."},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/SmsPart"}}},"required":["id","sender_name_id","sender_name","to","country","body","category","source","encoding","segments","status","status_changed_at","error","ticket_id","message_id","campaign_id","membership_id","not_before","valid_until","amount","submitted_at","delivered_at","failed_at","verified_at","created_at","parts"],"additionalProperties":false},"SmsDocumentDownload":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}},"required":["url","expires_at"],"additionalProperties":false},"SmsGatewayRoutes":{"type":"object","properties":{"reported":{"type":"boolean","description":"False when the SMS gateway has not reported in the last 30 seconds (not running, or SMPP_ROUTES not set)."},"reported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"running":{"type":"boolean"},"routes":{"type":"array","items":{"type":"object","properties":{"operator":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Lower is tried first; the next is the failover."},"ready":{"type":"boolean"},"rate":{"type":"number","description":"Messages per second being sent now."},"sessions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"state":{"type":"string"},"in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","state","in_flight"],"additionalProperties":false}}},"required":["operator","priority","ready","rate","sessions"],"additionalProperties":false}}},"required":["reported","reported_at","running","routes"],"additionalProperties":false,"description":"The SMS operator routes and their failover order."},"SmsOptOut":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"phone":{"type":"string"},"source":{"type":"string","enum":["recipient_request","member","api"]},"note":{"type":["string","null"]},"created_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"lifted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lifted_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"lift_reason":{"type":["string","null"]}},"required":["id","phone","source","note","created_by_membership_id","created_at","lifted_at","lifted_by_membership_id","lift_reason"],"additionalProperties":false},"SmsOptOutPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SmsOptOut"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"SmsPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Sms"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"SmsPart":{"type":"object","properties":{"part_number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"route":{"type":"string"},"operator_message_id":{"type":"string"},"status":{"type":"string","enum":["submitted","delivered","failed","unknown"]},"report_state":{"type":["string","null"]},"network_error_code":{"type":["string","null"]},"submitted_at":{"type":"string","format":"date-time"},"done_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["part_number","route","operator_message_id","status","report_state","network_error_code","submitted_at","done_at"],"additionalProperties":false},"SmsPlatformReason":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Mandatory: shown to the organization and kept in the platform audit log."}},"required":["reason"],"additionalProperties":false},"SmsPreview":{"type":"object","properties":{"encoding":{"type":"string","enum":["gsm7","ucs2"]},"segments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sender_name":{"type":"string"}},"required":["encoding","segments","units","remaining","sender_name"],"additionalProperties":false},"SmsSenderName":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"classification":{"type":"string","enum":["service","promotional","awareness"]},"status":{"type":"string","enum":["pending","approved","rejected"]},"status_changed_at":{"type":"string","format":"date-time"},"rejection_reason":{"type":["string","null"]},"purpose":{"type":"string"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When Rabt submitted it to the operators."},"is_default":{"type":"boolean"},"suspension":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"reason":{"type":"string"}},"required":["at","reason"],"additionalProperties":false},{"type":"null"}],"description":"Suspended by the Rabt platform team: SMS under it are refused (`SMS-4022`)."},"requested_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","classification","status","status_changed_at","rejection_reason","purpose","submitted_at","is_default","suspension","requested_by_membership_id","created_at","updated_at"],"additionalProperties":false},"SmsSenderNameComplaint":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender_name_id":{"type":"string","format":"uuid"},"source":{"type":"string","enum":["regulator","operator","recipient"]},"external_reference":{"type":["string","null"]},"description":{"type":"string"},"recipient_phone":{"type":["string","null"]},"received_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","sender_name_id","source","external_reference","description","recipient_phone","received_at","created_at"],"additionalProperties":false},"SmsSenderNameDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"classification":{"type":"string","enum":["service","promotional","awareness"]},"status":{"type":"string","enum":["pending","approved","rejected"]},"status_changed_at":{"type":"string","format":"date-time"},"rejection_reason":{"type":["string","null"]},"purpose":{"type":"string"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When Rabt submitted it to the operators."},"is_default":{"type":"boolean"},"suspension":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"reason":{"type":"string"}},"required":["at","reason"],"additionalProperties":false},{"type":"null"}],"description":"Suspended by the Rabt platform team: SMS under it are refused (`SMS-4022`)."},"requested_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"documents":{"type":"array","items":{"$ref":"#/components/schemas/SmsSenderNameDocument"}},"complaints":{"type":"array","items":{"$ref":"#/components/schemas/SmsSenderNameComplaint"}}},"required":["id","name","classification","status","status_changed_at","rejection_reason","purpose","submitted_at","is_default","suspension","requested_by_membership_id","created_at","updated_at","documents","complaints"],"additionalProperties":false},"SmsSenderNameDocument":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["commercial_registration","authorization_letter","trademark","other"]},"file_name":{"type":"string"},"mime_type":{"type":"string","enum":["application/pdf","image/png","image/jpeg"]},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sha256":{"type":"string"},"uploaded_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","kind","file_name","mime_type","size","sha256","uploaded_by_membership_id","created_at"],"additionalProperties":false},"SmsSenderNameList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SmsSenderName"}}},"required":["data"],"additionalProperties":false},"SmsSettings":{"type":"object","properties":{"allowed_countries":{"type":"array","items":{"type":"string"}},"allowed_link_domains":{"type":"array","items":{"type":"string"}},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["allowed_countries","allowed_link_domains","updated_at"],"additionalProperties":false},"SmtpSecurity":{"type":"string","enum":["tls","starttls"],"description":"`starttls` (STARTTLS required) or `tls` (implicit TLS). Rabt never sends unencrypted."},"SoftphoneCredentials":{"type":"object","properties":{"wss_url":{"type":"string","description":"The SIP over WebSocket (TLS) server."},"sip_uri":{"type":"string","description":"The member’s SIP address of record."},"username":{"type":"string"},"password":{"type":"string","description":"Time-limited; ask again before `expires_at`."},"expires_at":{"type":"string","format":"date-time"},"ice_servers":{"type":"array","items":{"type":"object","properties":{"urls":{"type":"array","items":{"type":"string"}},"username":{"type":"string"},"credential":{"type":"string"}},"required":["urls","username","credential"],"additionalProperties":false}}},"required":["wss_url","sip_uri","username","password","expires_at","ice_servers"],"additionalProperties":false},"Space":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["department"]},"returning_customer_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"no_agent_message":{"type":["string","null"]},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Members available now (docs/13)."},"is_member":{"type":"boolean","description":"You belong to this space."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","description","type","returning_customer_days","no_agent_message","member_count","available_count","is_member","created_at","updated_at"],"additionalProperties":false},"SpaceChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"space_id":{"type":"string","format":"uuid"},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"channel_address_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","space_id","channel_id","channel_address_id","phone_number_id","created_at"],"additionalProperties":false},"SpaceChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SpaceChannel"}}},"required":["data"],"additionalProperties":false},"SpaceList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Space"}}},"required":["data"],"additionalProperties":false},"SpaceMember":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"availability":{"$ref":"#/components/schemas/Availability"},"added_at":{"type":"string","format":"date-time"}},"required":["membership_id","availability","added_at"],"additionalProperties":false},"SpaceMemberList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SpaceMember"}}},"required":["data"],"additionalProperties":false},"StartCall":{"type":"object","properties":{"ticket_id":{"type":"string","format":"uuid","description":"The ticket the call belongs to (its contact)."},"to":{"description":"One of the contact’s numbers; default: their primary number.","type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"phone_number_id":{"description":"The organization’s number to call from; default: the ticket’s number, else the default one.","type":"string","format":"uuid"},"client_key":{"description":"The client’s key: the same key never places a second call.","type":"string","pattern":"^[A-Za-z0-9._~-]{1,100}$"}},"required":["ticket_id"],"additionalProperties":false},"StartedCall":{"type":"object","properties":{"call":{"$ref":"#/components/schemas/Call"},"dial_target":{"type":"string","description":"What the member’s own SIP client dials to join the call when it was not rung (`call-<id>`)."}},"required":["call","dial_target"],"additionalProperties":false},"StartFacebookConnect":{"type":"object","properties":{"reconnect_channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"additionalProperties":false,"description":"Starts Facebook Login for Business. `reconnect_channel_id` reconnects a channel waiting for it (`needs_reauth`), asking again for declined permissions."},"StartInstagramConnect":{"type":"object","properties":{"login":{"type":"string","enum":["facebook","instagram"]},"reconnect_channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["login"],"additionalProperties":false,"description":"`login`: `facebook` (Facebook Login for Business, the account’s Page) or `instagram` (Instagram Login). `reconnect_channel_id` reconnects a channel waiting for it (`needs_reauth`), through either login."},"StartIntegrationConnection":{"type":"object","properties":{"adapter":{"type":"string","minLength":1,"maxLength":32,"description":"The platform: `salla`, `zid` or `shopify`."},"account_hint":{"description":"The store’s address, for platforms whose sign-in starts from the store (`account_hint: shop_domain`, e.g. `my-store.myshopify.com`).","type":"string","minLength":1,"maxLength":255}},"required":["adapter"],"additionalProperties":false},"StartTikTokConnect":{"type":"object","properties":{"reconnect_channel_id":{"description":"A channel to reconnect (after `needs_reauth`); omit to connect a new account.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"additionalProperties":false},"StockNumberReason":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Why (the platform audit log; the organization is told the number was suspended by the Rabt team)."}},"required":["reason"],"additionalProperties":false},"StoreCustomer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"integration_id":{"type":"string","format":"uuid"},"adapter":{"type":"string"},"integration_name":{"type":"string"},"external_id":{"type":"string"},"name":{"type":["string","null"]},"phones":{"type":"array","items":{"type":"string"},"description":"E.164."},"emails":{"type":"array","items":{"type":"string"}},"orders_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total_spent":{"anyOf":[{"$ref":"#/components/schemas/StoreMoney"},{"type":"null"}]},"url":{"description":"The customer in the store’s admin.","type":["string","null"]},"external_updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"synced_at":{"type":"string","format":"date-time"}},"required":["id","integration_id","adapter","integration_name","external_id","name","phones","emails","orders_count","total_spent","url","external_updated_at","synced_at"],"additionalProperties":false},"StoreMoney":{"type":"object","properties":{"amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In minor units of the currency."},"currency":{"type":"string","description":"ISO 4217 (the store’s own currency)."}},"required":["amount_minor","currency"],"additionalProperties":false},"StoreOrder":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Rabt’s copy of the order; null for an order read live (order lookup)."},"integration_id":{"type":"string","format":"uuid"},"adapter":{"type":"string"},"integration_name":{"type":"string"},"external_id":{"type":"string"},"number":{"type":"string","description":"The number the customer knows."},"status":{"type":"string","enum":["pending","processing","shipped","delivered","completed","cancelled","refunded","other"]},"provider_status":{"type":"string","description":"The store’s own status label."},"payment_status":{"type":["string","null"]},"total":{"$ref":"#/components/schemas/StoreMoney"},"placed_at":{"type":"string","format":"date-time"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"customer":{"type":"object","properties":{"external_id":{"type":["string","null"]},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["external_id","name","phone","email"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sku":{"type":["string","null"]}},"required":["name","quantity","sku"],"additionalProperties":false}},"shipments":{"type":"array","items":{"type":"object","properties":{"carrier":{"type":["string","null"]},"tracking_number":{"type":["string","null"]},"tracking_url":{"type":["string","null"]},"status":{"type":["string","null"]}},"required":["carrier","tracking_number","tracking_url","status"],"additionalProperties":false}},"url":{"description":"The order in the store’s admin.","type":["string","null"]},"synced_at":{"type":"string","format":"date-time"}},"required":["id","integration_id","adapter","integration_name","external_id","number","status","provider_status","payment_status","total","placed_at","updated_at","customer","items","shipments","url","synced_at"],"additionalProperties":false},"Subscription":{"type":"object","properties":{"billing_state":{"type":"string","enum":["trial","active","seats_inactive"],"description":"`trial`: seats free (up to the member limit); `active`: seats paid; `seats_inactive`: the seat charge could not be paid, every seat is view only until a payment (docs/10)."},"plan":{"anyOf":[{"$ref":"#/components/schemas/Plan"},{"type":"null"}],"description":"Null before a seat price is published."},"trial_ends_at":{"type":"string","format":"date-time"},"trial_member_limit":{"type":"integer","minimum":1,"maximum":9007199254740991},"current_period_start":{"type":"string","format":"date-time","description":"The time paid for (the trial, then the month or its rest), from."},"current_period_end":{"type":"string","format":"date-time","description":"Until (00:00 on the 1st, Asia/Riyadh)."},"paid_seats":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seats paid for the current period."},"active_seats":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Active memberships: every one is a seat."},"members":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Members not removed (the trial counts them)."},"next_charge":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"SAR in halalas (1 SAR = 100 halalas)."},"seats":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["at","amount","seats"],"additionalProperties":false},{"type":"null"}],"description":"Trial: the charge when it ends (the rest of that month). Active: the next renewal (on the 1st). SeatsInactive: what reactivates the seats now. An estimate from today's seats; null before a seat price is published."}},"required":["billing_state","plan","trial_ends_at","trial_member_limit","current_period_start","current_period_end","paid_seats","active_seats","members","next_charge"],"additionalProperties":false,"description":"The organization's seats and their billing (docs/10)."},"SyntheticCheck":{"type":"object","properties":{"check":{"type":"string"},"label":{"type":"string"},"component":{"type":"string"},"latest":{"anyOf":[{"type":"object","properties":{"outcome":{"type":"string","enum":["passed","failed","not_configured"]},"started_at":{"type":"string","format":"date-time"},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error_code":{"type":["string","null"]},"error_reference":{"type":["string","null"]}},"required":["outcome","started_at","duration_ms","error_code","error_reference"],"additionalProperties":false},{"type":"null"}]},"last_24h":{"type":"object","properties":{"passed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"not_configured":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["passed","failed","not_configured"],"additionalProperties":false}},"required":["check","label","component","latest","last_24h"],"additionalProperties":false},"SyntheticCheckList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SyntheticCheck"}}},"required":["data"],"additionalProperties":false},"Tag":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","created_at"],"additionalProperties":false},"TagInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60}},"required":["name"],"additionalProperties":false},"TagList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}}},"required":["data"],"additionalProperties":false},"TagRef":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"TeamAvailability":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TeamMember"}}},"required":["data"],"additionalProperties":false},"TeamBoard":{"type":"object","properties":{"summary":{"type":"object","properties":{"available_members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Available, with an active seat."},"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued_tickets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Tickets waiting in a space’s queue."},"oldest_queued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Since when the oldest waiting ticket waits."},"open_tickets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Tickets not closed, assigned or not."}},"required":["available_members","members","queued_tickets","oldest_queued_at","open_tickets"],"additionalProperties":false},"spaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available_members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued_tickets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"oldest_queued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","members","available_members","queued_tickets","oldest_queued_at"],"additionalProperties":false},"description":"The spaces you see, by name, with their queues."},"members":{"type":"array","items":{"$ref":"#/components/schemas/TeamMember"},"description":"Every member, in the order they joined."},"queue":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subject":{"type":["string","null"]},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"priority":{"$ref":"#/components/schemas/TicketPriority"},"status":{"$ref":"#/components/schemas/TicketStatus"},"space_id":{"type":"string","format":"uuid"},"contact_id":{"type":"string","format":"uuid"},"contact_name":{"type":["string","null"]},"queued_at":{"type":"string","format":"date-time"}},"required":["id","number","subject","channel_type","priority","status","space_id","contact_id","contact_name","queued_at"],"additionalProperties":false},"description":"The waiting tickets you may see, oldest first (at most 100)."}},"required":["summary","spaces","members","queue"],"additionalProperties":false},"TeamMember":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid"},"availability":{"$ref":"#/components/schemas/Availability"},"availability_changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"open_tickets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Assigned tickets not closed, in every space."},"max_open_tickets":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The member’s own limit; null: the organization default."},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The limit that applies."},"last_assigned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"space_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"oldest_open_ticket_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the oldest of their open tickets was created; null when they hold none."},"on_call":{"type":"boolean","description":"On a call now (answered, not ended)."}},"required":["membership_id","availability","availability_changed_at","open_tickets","max_open_tickets","limit","last_assigned_at","space_ids","oldest_open_ticket_at","on_call"],"additionalProperties":false},"ThemeMode":{"type":"string","enum":["light","dark","system"],"description":"The appearance of the apps, the same on every device: `light`, `dark`, or `system` (follows the device)."},"Ticket":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string","description":"The ticket in the app (a stable, copyable link)."},"contact_id":{"type":"string","format":"uuid"},"contact_name":{"description":"The contact's name (null when it has none).","type":["string","null"]},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"channel_address_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"kind":{"type":"string","enum":["private","public"]},"source_ref":{"type":["string","null"]},"subject":{"type":["string","null"]},"type_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"priority":{"$ref":"#/components/schemas/TicketPriority"},"status":{"$ref":"#/components/schemas/TicketStatus"},"space_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"assignee_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"assignment_reason":{"anyOf":[{"type":"string","enum":["returning_customer","fewest_open_tickets","queue","manual","email_address","address_route"]},{"type":"null"}]},"assigned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"queued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Waiting in its space’s queue for the automatic distribution since then (oldest first); null when not waiting."},"previous_ticket_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"merged_into_ticket_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"last_customer_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_member_reply_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_message_at":{"type":"string","format":"date-time"},"window_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"recipient":{"description":"Whom a ticket a member started goes to (the address, number or identity chosen); null for tickets the customer started.","type":["string","null"]},"reply_window":{"$ref":"#/components/schemas/ReplyWindow"},"first_responded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"close_reason":{"anyOf":[{"type":"string","enum":["member","auto"]},{"type":"null"}]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number"]}},"ai_enabled":{"type":"boolean"},"ai":{"anyOf":[{"$ref":"#/components/schemas/TicketAi"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Send it with an edit (`TKT-6104` when stale)."},"following":{"type":"boolean","description":"You follow this ticket."},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"The time of the newest timeline item you have seen (`POST /v1/tickets/{ticketId}/read`); null when you never opened it."},"unread":{"type":"boolean","description":"A customer message you have not seen yet (never for a closed ticket): the unread marker."},"created_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","number","url","contact_id","contact_name","company_id","channel_type","channel_id","channel_address_id","kind","source_ref","subject","type_id","priority","status","space_id","assignee_membership_id","assignment_reason","assigned_at","queued_at","previous_ticket_id","merged_into_ticket_id","last_customer_message_at","last_member_reply_at","last_message_at","window_expires_at","recipient","reply_window","first_responded_at","closed_at","close_reason","custom_fields","ai_enabled","ai","version","following","read_at","unread","created_by_membership_id","created_at","updated_at"],"additionalProperties":false,"description":"A ticket (docs/13)."},"TicketAi":{"type":"object","properties":{"status":{"type":"string","enum":["replying","handed_off","stopped"],"description":"`replying`: the AI agent answers the customer; `handed_off`: it gave the conversation to the members; `stopped`: a member replied, the ticket was assigned, or the AI was switched off here."},"reason":{"type":"string","enum":["engaged","switched_on","customer_asked","negative_sentiment","no_answer","failed","balance","kill_switch","disabled","human_replied","assigned","switched_off"],"description":"Why the status changed."},"changed_at":{"type":"string","format":"date-time"},"holds_queue":{"type":"boolean","description":"The AI agent replies first: the automatic distribution waits until it hands off (docs/17 step 2)."},"error":{"anyOf":[{"$ref":"#/components/schemas/AttachedError"},{"type":"null"}],"description":"Why the AI agent last failed here (docs/23), if it did."}},"required":["status","reason","changed_at","holds_queue","error"],"additionalProperties":false,"description":"The AI agent in this conversation (docs/15); null until it first takes part. Turn it on again with `POST /v1/tickets/{ticketId}/ai/resume`."},"TicketCounts":{"type":"object","properties":{"open":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"in_progress":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"in_queue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Open and unassigned."},"closed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"new_today":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Created since midnight in the organization's time zone."}},"required":["open","in_progress","in_queue","closed","new_today"],"additionalProperties":false,"description":"The live counters of the tickets you may see."},"TicketFollowers":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Membership ids."}},"required":["data"],"additionalProperties":false},"TicketPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Ticket"},"description":"Newest activity first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"TicketPriority":{"type":"string","enum":["low","normal","high"]},"TicketReferences":{"type":"object","properties":{"data":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accessible":{"type":"boolean","enum":[true]},"ticket_id":{"type":"string","format":"uuid"},"subject":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/TicketStatus"},"channel_type":{"$ref":"#/components/schemas/ChannelType"},"url":{"type":"string"}},"required":["number","accessible","ticket_id","subject","status","channel_type","url"],"additionalProperties":false},{"type":"object","properties":{"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accessible":{"type":"boolean","enum":[false]}},"required":["number","accessible"],"additionalProperties":false}]}}},"required":["data"],"additionalProperties":false,"description":"`#<number>` references: the tickets you may see link to them; others (or none) say only `accessible: false`."},"TicketSettings":{"type":"object","properties":{"auto_close_days":{"type":"integer","minimum":1,"maximum":365,"description":"Days without a customer reply after the last member reply before an in-progress ticket closes automatically (docs/13)."}},"required":["auto_close_days"],"additionalProperties":false},"TicketsListState":{"type":"object","properties":{"space":{"type":"string","pattern":"^(personal|all|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"The space chip: `personal`, `all`, or a department space’s id."},"status":{"description":"The status counter the list is filtered by.","type":"string","enum":["open","in_progress","in_queue","closed"]},"channel_type":{"description":"The channel the list is filtered by.","$ref":"#/components/schemas/ChannelType"},"assignee_membership_id":{"description":"The assignee the list is filtered by.","type":"string","format":"uuid"}},"required":["space"],"additionalProperties":false,"description":"How the member left the tickets list: its space chip, status counter, channel and assignee filters (C05)."},"TicketSmsResult":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid","description":"The ticket's timeline item that shows the SMS."},"ticket_id":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean"}},"required":["message_id","ticket_id","duplicate"],"additionalProperties":false},"TicketSpaceCounts":{"type":"object","properties":{"personal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Live tickets assigned to you (the Personal space)."},"all":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Every live ticket you may see (the All space)."},"spaces":{"type":"array","items":{"type":"object","properties":{"space_id":{"type":"string","format":"uuid"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["space_id","count"],"additionalProperties":false},"description":"Per department space; spaces without live tickets are left out."},"none":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Live tickets in no department space."}},"required":["personal","all","spaces","none"],"additionalProperties":false,"description":"The non-closed tickets of each space chip of the overview (docs/13)."},"TicketStartOptions":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"channel_type":{"$ref":"#/components/schemas/ChannelType"},"to":{"type":"string","description":"Whom it reaches: an email address, a phone number or the identity’s handle."},"identity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The contact’s channel identity it reaches; null for emails and phone numbers."},"state":{"type":"string","enum":["ready","not_connected","customer_starts"],"description":"`ready`: a connected channel can open the conversation (start it with `createTicket` and the channel below); `not_connected`: no channel of this type is connected; `customer_starts`: the customer opens these conversations (web chat)."},"first_message":{"type":"string","enum":["any","template"],"description":"`template`: the conversation opens only with an approved template (WhatsApp)."},"channels":{"type":"array","items":{"type":"object","properties":{"channel_id":{"type":"string","format":"uuid"},"channel_address_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"name":{"type":"string"},"address":{"type":["string","null"]}},"required":["channel_id","channel_address_id","name","address"],"additionalProperties":false}}},"required":["channel_type","to","identity_id","state","first_message","channels"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false,"description":"Where a ticket can be started for a contact: each of its email addresses, phone numbers (WhatsApp, SMS, voice) and channel identities, with the connected channels that reach it (docs/12, docs/13)."},"TicketStatus":{"type":"string","enum":["open","in_progress","closed"],"description":"open, in progress, closed (final) (docs/13)."},"TicketType":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","position","created_at","updated_at"],"additionalProperties":false},"TicketTypeInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"position":{"default":0,"type":"integer","minimum":0,"maximum":10000}},"required":["name"],"additionalProperties":false},"TicketTypeList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TicketType"}}},"required":["data"],"additionalProperties":false},"TicketTypeUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"position":{"type":"integer","minimum":0,"maximum":10000}},"additionalProperties":false},"TikTokCapabilities":{"type":"object","properties":{"kinds":{"type":"array","items":{"type":"string","enum":["private","public"]}},"composer":{"type":"string","enum":["chat","email","none"]},"send":{"type":"object","properties":{"text":{"type":"boolean"},"media":{"type":"array","items":{"type":"string"}},"location":{"type":"boolean"},"interactive":{"type":"boolean"},"reaction":{"type":"boolean"},"template":{"type":"boolean"}},"required":["text","media","location","interactive","reaction","template"],"additionalProperties":false},"max_text_length":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_comment_length":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attachment_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"image_types":{"type":"array","items":{"type":"string"}},"reply_window":{"type":"object","properties":{"hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"messages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["hours","messages"],"additionalProperties":false},"public_actions":{"type":"array","items":{"type":"string"}},"statuses":{"type":"array","items":{"type":"string"}}},"required":["kinds","composer","send","max_text_length","max_comment_length","max_attachment_bytes","image_types","reply_window","public_actions","statuses"],"additionalProperties":false,"description":"What TikTok supports (docs/channels/tiktok.md); the composer offers only this."},"TikTokChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/ChannelStatus"},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"$ref":"#/components/schemas/ChannelError"},{"type":"null"}]},"open_id":{"type":"string","description":"The account holder’s TikTok `open_id`."},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"},"description":"The permissions the account holder granted."},"api_version":{"type":["string","null"]},"token_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the access token expires (a day; Rabt renews it before)."},"refresh_token_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When Rabt’s access ends unless it is reconnected (a year after connecting)."},"address_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The account’s channel address (docs/17: spaces take its tickets through it); null once disconnected."},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"comments_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the comments on the account’s videos were last read."},"connected_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","status","status_changed_at","last_error","open_id","username","display_name","scopes","api_version","token_expires_at","refresh_token_expires_at","address_id","last_inbound_at","comments_synced_at","connected_by_membership_id","connected_at","disconnected_at"],"additionalProperties":false},"TikTokChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TikTokChannel"}},"configured":{"type":"boolean"}},"required":["data","configured"],"additionalProperties":false},"TikTokCommentAction":{"type":"object","properties":{"action":{"type":"string","enum":["hide","unhide","delete"],"description":"`hide` or `unhide` the comment on TikTok, or `delete` it there. Rabt keeps its copy in the ticket either way."}},"required":["action"],"additionalProperties":false},"TikTokCommentActionResult":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"ticket_id":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["hide","unhide","delete"]}},"required":["message_id","ticket_id","action"],"additionalProperties":false},"TikTokConnectStart":{"type":"object","properties":{"authorization_url":{"type":"string","format":"uri","description":"TikTok’s page where the account holder signs in and approves Rabt; TikTok then sends them to Rabt’s callback page with `code` and `state`."},"expires_at":{"type":"string","format":"date-time","description":"The flow must finish before this time (10 minutes)."}},"required":["authorization_url","expires_at"],"additionalProperties":false},"TikTokFileFetch":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"ticket_id":{"type":"string","format":"uuid"},"queued":{"type":"boolean","description":"The fetch is queued: the file arrives as `attachment.stored`, or the new failure is attached to the message (`metadata.fileError`).","enum":[true]}},"required":["message_id","ticket_id","queued"],"additionalProperties":false},"TikTokReplyRules":{"type":"object","properties":{"applies":{"type":"boolean","description":"False for tickets of other channels (no rules)."},"open":{"type":"boolean","description":"Whether a reply may be sent now."},"window_open_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Private conversations: replies until then (48 hours after the customer’s last message)."},"messages_left":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_messages":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_text_length":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_files":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"file_types":{"type":"array","items":{"type":"string"}}},"required":["applies","open","window_open_until","messages_left","max_messages","max_text_length","max_files","file_types"],"additionalProperties":false},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refresh_token":{"type":"string"},"scope":{"type":"string"}},"required":["access_token","token_type","expires_in","refresh_token","scope"],"additionalProperties":false,"description":"RFC 6749 section 5.1."},"TopUp":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["manual","auto"]},"status":{"type":"string","enum":["pending","requires_action","succeeded","failed"],"description":"`requires_action`: send the member to `action_url` (3-D Secure). `succeeded`: the wallet was credited, after Tap confirmed the charge."},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","enum":["SAR"]},"action_url":{"type":["string","null"]},"save_card":{"type":"boolean"},"gateway_charge_id":{"type":["string","null"]},"gateway_status":{"type":["string","null"]},"error":{"anyOf":[{"$ref":"#/components/schemas/TopUpError"},{"type":"null"}]},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"requested_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"receipt_voucher_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","kind","status","amount","currency","action_url","save_card","gateway_charge_id","gateway_status","error","attempt","requested_by_membership_id","receipt_voucher_id","created_at","completed_at"],"additionalProperties":false,"description":"A card top-up of the wallet (docs/10)."},"TopUpCardToken":{"type":"object","properties":{"type":{"type":"string","enum":["card_token"]},"token":{"type":"string","minLength":1,"maxLength":200,"description":"The single-use token from Tap's card form (`tok_…`)."},"save_card":{"default":true,"description":"Save the card for later top-ups and auto top-up (the first top-up does; default true).","type":"boolean"}},"required":["type","token"],"additionalProperties":false,"description":"A card entered in the card form."},"TopUpCheckout":{"type":"object","properties":{"public_key":{"type":"string","description":"Tap's publishable key for the card form."},"merchant_id":{"type":"string"},"customer_id":{"type":"string","description":"The organization's Tap customer."},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","enum":["SAR"]},"locale":{"type":"string","enum":["ar","en"]},"supported_brands":{"type":"array","items":{"type":"string","enum":["visa","mastercard","mada"]}}},"required":["public_key","merchant_id","customer_id","amount","currency","locale","supported_brands"],"additionalProperties":false,"description":"The settings of Tap's card form (Web Card SDK v2); the card becomes a single-use token in the browser and never reaches Rabt."},"TopUpCheckoutRequest":{"type":"object","properties":{"amount":{"type":"integer","minimum":5000,"maximum":999999999999999,"description":"Halalas (SAR minor units), at least 5000 (SAR 50). Rabt sets no maximum: the schema's maximum is only the largest amount the payment provider can be sent exactly. The card's bank or the payment provider may refuse an amount above its own limits (`WAL-1204`, `WAL-1203`, or `WAL-1999` with the provider's own code and message).","example":50000}},"required":["amount"],"additionalProperties":false},"TopUpError":{"type":"object","properties":{"code":{"type":"string","description":"The error code (docs/23), e.g. `WAL-1204`."},"reference":{"type":"string"},"provider_code":{"description":"Tap's own code, as received.","type":["string","null"]},"provider_message":{"type":["string","null"]}},"required":["code","reference","provider_code","provider_message"],"additionalProperties":false},"TopUpList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TopUp"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false,"description":"Newest first."},"TopUpSavedCard":{"type":"object","properties":{"type":{"type":"string","enum":["saved_card"]}},"required":["type"],"additionalProperties":false,"description":"The organization's saved card."},"TransferCall":{"type":"object","properties":{"space_id":{"type":"string","format":"uuid"},"membership_id":{"type":"string","format":"uuid"}},"additionalProperties":false,"description":"Exactly one of `space_id` and `membership_id`."},"TransferOwnership":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid","description":"The member who becomes the owner."}},"required":["membership_id"],"additionalProperties":false},"UpdateAiBlock":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"content_markdown":{"type":"string","maxLength":50000,"description":"Markdown: knowledge (facts, prices, policies) or instructions."},"always_include":{"type":"boolean"},"active":{"type":"boolean"},"sort_order":{"type":"integer","minimum":0,"maximum":100000,"description":"The block's place in its level, lowest first."}},"additionalProperties":false},"UpdateAppStoreChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false},"UpdateCampaign":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"segment_id":{"description":"The audience: a segment of contacts (docs/14).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"channel_id":{"description":"WhatsApp: the channel of the WhatsApp number it sends from.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number_id":{"description":"Voice: the number it calls from.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"sender_name_id":{"description":"SMS: an approved promotional sender name (ending in `-AD`).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"scheduled_at":{"description":"When to send (in the future, `CAMP-6309`); null sends at launch. KSA sending hours still apply.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"content":{"anyOf":[{"$ref":"#/components/schemas/CampaignWhatsappContentInput"},{"$ref":"#/components/schemas/CampaignSmsContentInput"},{"$ref":"#/components/schemas/CampaignVoiceContentInput"}],"description":"The content of the campaign’s channel (the fields of another channel are refused with `API-8001`)."}},"additionalProperties":false},"UpdateCannedReply":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","minLength":1,"maxLength":10000}},"additionalProperties":false},"UpdateCompany":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"logo_url":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri","description":"An https URL.","example":"https://cdn.example.com/avatar.png"},{"type":"null"}]},"phone":{"description":"The company's phone number, read as E.164 like contacts' numbers.","anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri","description":"The website, http or https.","example":"https://acme.sa"},{"type":"null"}]},"address":{"anyOf":[{"$ref":"#/components/schemas/CompanyAddress"},{"type":"null"}]},"industry":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"owner_membership_id":{"description":"The account owner: the member responsible for this company.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"tags":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"},"description":"The tag ids (the whole list; tags are defined in the settings)."},"custom_fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$","description":"The key of a custom field: lower-case letters, digits and underscores."},"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom field values by key (fields are defined in the settings); a key set to null is removed, keys left out are kept."}},"additionalProperties":false,"description":"Only the fields sent change."},"UpdateContact":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"avatar_url":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri","description":"An https URL.","example":"https://cdn.example.com/avatar.png"},{"type":"null"}]},"tags":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"},"description":"The tag ids (the whole list; tags are defined in the settings)."},"custom_fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$","description":"The key of a custom field: lower-case letters, digits and underscores."},"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom field values by key (fields are defined in the settings); a key set to null is removed, keys left out are kept."}},"additionalProperties":false,"description":"Only the fields sent change."},"UpdateCustomField":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":100},"options":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"description":"The options of a list field (none for other types)."},"position":{"type":"integer","minimum":0,"maximum":10000}},"additionalProperties":false},"UpdateEmailChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"display_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The sender name replies carry, e.g. \"Acme Support\"."},"smtp_host":{"type":"string","minLength":1,"maxLength":253,"description":"The SMTP server's host name, e.g. `smtp.yourprovider.com`."},"smtp_port":{"type":"integer","minimum":1,"maximum":65535,"description":"The SMTP port: 587 (STARTTLS), 465 (TLS), 25 or 2525."},"smtp_security":{"$ref":"#/components/schemas/SmtpSecurity"},"smtp_username":{"type":"string","minLength":1,"maxLength":320},"smtp_password":{"type":"string","minLength":1,"maxLength":1024,"description":"Kept in the token vault, never returned."}},"additionalProperties":false},"UpdateFacebookChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false},"UpdateGmailAddress":{"type":"object","properties":{"display_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The sender name replies from this address carry."}},"required":["display_name"],"additionalProperties":false},"UpdateGmailChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"default_address_id":{"description":"The address replies leave from when the ticket has none of its own; it must be one Gmail may send as.","type":"string","format":"uuid"}},"additionalProperties":false},"UpdateGoogleBusinessChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false},"UpdateGooglePlayChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"package_names":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200,"pattern":"^[A-Za-z][A-Za-z0-9_]*(\\.[A-Za-z][A-Za-z0-9_]*)+$","description":"A package name, e.g. `com.example.app`."},"description":"Apps to add by package name, besides the ones Google’s Reporting API lists for the service account (for when that API is not enabled)."}},"additionalProperties":false},"UpdateInstagramChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false},"UpdateMicrosoftAddress":{"type":"object","properties":{"display_name":{"description":"The sender name replies from this address carry.","anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"assigned_membership_id":{"description":"The member whose tickets the address’s new mail becomes (null: none).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"additionalProperties":false},"UpdateMicrosoftChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"default_address_id":{"description":"The address replies without one of their own leave from.","type":"string","format":"uuid"}},"additionalProperties":false},"UpdateNote":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000},"mentioned_membership_ids":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid"},"description":"The members (membership ids) mentioned in the note."}},"additionalProperties":false},"UpdateOAuthApp":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"homepage_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"redirect_uris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"description":"Exact redirect URIs: https, http on a loopback address (any port), or a reverse domain name scheme of a native app."}},"additionalProperties":false},"UpdateOrganization":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"default_locale":{"type":"string","enum":["ar","en"]},"timezone":{"type":"string","maxLength":64,"description":"An IANA time zone; times are shown in it.","example":"Asia/Riyadh"},"default_country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2, upper case: the default country of phone numbers.","example":"SA"}},"additionalProperties":false},"UpdatePhoneNumber":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"destination":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["all"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["space"]},"space_id":{"type":"string","format":"uuid"}},"required":["type","space_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["member"]},"membership_id":{"type":"string","format":"uuid"}},"required":["type","membership_id"],"additionalProperties":false}],"description":"Where calls go: `all` (every member who can take calls, the default), one `space`, or one `member` (exactly one destination)."},"record_calls":{"type":"boolean"},"recording_notice":{"description":"Play “this call is recorded” to callers before ringing.","type":"boolean"},"voicemail_enabled":{"type":"boolean"},"ring_timeout_sec":{"description":"How long each member rings (seconds).","type":"integer","minimum":10,"maximum":60},"queue_timeout_sec":{"description":"How long a caller waits for a member before voicemail or a missed call.","type":"integer","minimum":0,"maximum":600}},"additionalProperties":false},"UpdatePlatformRole":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"permissions":{"maxItems":7,"type":"array","items":{"$ref":"#/components/schemas/PlatformPermission"}},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"required":["reason"],"additionalProperties":false},"UpdateRateCardDraft":{"type":"object","properties":{"settings":{"type":"object","properties":{"fx_rate":{"type":"string","maxLength":20,"description":"SAR per USD, at most 6 decimals, e.g. 3.75."},"fx_buffer_percent":{"type":"string","maxLength":20,"description":"FX buffer %, at most 2 decimals."},"default_markup_percent":{"type":"string","maxLength":20,"description":"Default markup %, at most 2 decimals."}},"additionalProperties":false},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"reason":{"type":"string","minLength":1,"maxLength":1000,"description":"Why (mandatory for platform actions; written to the platform audit log)."}},"additionalProperties":false},"UpdateRole":{"type":"object","properties":{"name":{"description":"Custom roles only.","type":"string","minLength":1,"maxLength":60},"permissions":{"maxItems":38,"type":"array","items":{"$ref":"#/components/schemas/PermissionKey"},"description":"The permission keys of the role (docs/18); platform keys are refused."}},"additionalProperties":false},"UpdateSegment":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"filter":{"$ref":"#/components/schemas/SegmentFilter"}},"additionalProperties":false,"description":"The parts to change; the filter is replaced whole."},"UpdateSmsSenderName":{"type":"object","properties":{"purpose":{"description":"Only while the name is pending (`SMS-4042` otherwise).","type":"string","minLength":1,"maxLength":1000},"is_default":{"description":"The default sender name of SMS from tickets and the API: an approved service name (`SMS-4023` otherwise).","type":"boolean"}},"additionalProperties":false},"UpdateSmsSettings":{"type":"object","properties":{"allowed_countries":{"description":"ISO 3166-1 alpha-2 countries SMS may go to (the destination allowlist against SMS pumping; `SMS-4033` for others).","minItems":1,"maxItems":250,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"allowed_link_domains":{"description":"Domains links in SMS may point to, subdomains included (`SMS-4030` for others; `SMS-4044` for an invalid one).","maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":253}}},"additionalProperties":false},"UpdateSpace":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":2000,"description":"What the space handles; the AI agent routes by name and description."},"returning_customer_days":{"type":"integer","minimum":1,"maximum":365,"description":"A returning customer goes to the member of their last ticket within these days (default 30)."},"no_agent_message":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"description":"The automatic reply when a ticket enters the queue and nobody is available; null or empty: none."}},"additionalProperties":false},"UpdateTicket":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version of the ticket the member edited: a newer one (a teammate changed it) answers `TKT-6104`."},"subject":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"type_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"priority":{"$ref":"#/components/schemas/TicketPriority"},"custom_fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":1000},{"type":"number"},{"type":"null"}]},"description":"Custom field values by key; a key set to null is removed."},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"ai_enabled":{"description":"Whether the AI agent may answer this conversation (on by default).","type":"boolean"}},"required":["version"],"additionalProperties":false,"description":"Only the fields sent change."},"UpdateTikTokChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false},"UpdateVoiceSettings":{"type":"object","properties":{"international_calling_enabled":{"description":"Outbound calls abroad (off by default; premium ranges are always blocked).","type":"boolean"},"international_countries":{"description":"ISO 3166-1 alpha-2 countries allowed when international calling is on.","maxItems":250,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"default_number_id":{"description":"The number outbound calls leave from when the ticket has none.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"additionalProperties":false},"UpdateVoiceTrunk":{"type":"object","properties":{"host":{"type":"string","pattern":"^[A-Za-z0-9]([A-Za-z0-9.-]{0,251}[A-Za-z0-9])?$","description":"The operator’s signaling host: an IPv4 address or a host name."},"port":{"type":"integer","minimum":1,"maximum":65535,"description":"The operator’s signaling port."},"transport":{"type":"string","enum":["udp","tcp","tls"],"description":"The signaling transport: `tcp` (Zain requires it), `udp` or `tls`."},"priority":{"type":"integer","minimum":0,"maximum":9999,"description":"Failover order: the lowest priority is tried first."},"signaling_addresses":{"description":"The operator’s signaling source addresses (IPv4 or CIDR): only they may send calls on this trunk. Empty: the host’s addresses.","maxItems":32,"type":"array","items":{"anyOf":[{"type":"string","format":"ipv4"},{"type":"string","format":"cidrv4","pattern":"^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$"}]}},"media_addresses":{"description":"The operator’s media (RTP) source addresses (IPv4 or CIDR), allowed on this trunk’s calls and opened in the firewall.","maxItems":32,"type":"array","items":{"anyOf":[{"type":"string","format":"ipv4"},{"type":"string","format":"cidrv4","pattern":"^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$"}]}},"authentication":{"type":"string","enum":["ip","digest"],"description":"`ip`: the operator authenticates Rabt by its static addresses; `digest`: also by credentials, set on the voice nodes (SIP_TRUNK_CREDENTIALS)."},"codecs":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["PCMA","PCMU","G722"]},"description":"The codecs offered to the operator, in order (default `PCMA`, `PCMU`)."},"caller_id_format":{"type":"string","enum":["e164","national"],"description":"How the caller ID is written on this trunk: `e164` (+9665…) or `national` (05…; other countries with the international prefix). Numbers received are read either way."},"dialed_number_format":{"type":"string","enum":["e164","national"],"description":"How the dialed number is written on this trunk: `e164` (+9665…) or `national` (05…; other countries with the international prefix). Numbers received are read either way."},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of national numbers on this trunk (ISO 3166-1 alpha-2, e.g. `SA`)."},"max_channels":{"type":"integer","minimum":1,"maximum":10000,"description":"The concurrent calls the operator allows on this trunk: past it, calls go to the next trunk (outbound) or are refused (inbound, VOI-4542)."},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Why (platform audit log)."}},"required":["reason"],"additionalProperties":false},"UpdateWebchatWidget":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"status":{"description":"`disabled` switches the widget off on every website.","type":"string","enum":["active","disabled"]},"business_name":{"type":"string","minLength":1,"maxLength":100},"allowed_domains":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":300},"description":"Where the widget may load: host names such as `example.com`, `shop.example.com`, or `*.example.com` for every subdomain (a port only when the site runs on one). Checked against the page’s Origin; `WEB-4016` for one that is not valid."},"greeting":{"type":"object","properties":{"ar":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"en":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"additionalProperties":false},"default_locale":{"type":"string","enum":["ar","en"]},"position":{"type":"string","enum":["left","right"]},"header_color":{"type":"string","enum":["sidebar","teal","plum","sand"]},"pre_chat":{"type":"object","properties":{"enabled":{"type":"boolean"},"name":{"type":"string","enum":["hidden","optional","required"]},"email":{"type":"string","enum":["hidden","optional","required"]},"phone":{"type":"string","enum":["hidden","optional","required"]}},"additionalProperties":false}},"additionalProperties":false},"UpdateWebhookEndpoint":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"event_types":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"enabled":{"description":"Disable or enable it; enabling also clears its count of failures.","type":"boolean"}},"additionalProperties":false},"UpdateWhatsappChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false},"UpdateXChannel":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false},"UploadCampaignAudio":{"type":"object","properties":{"file_name":{"type":"string","minLength":1,"maxLength":255},"content_base64":{"type":"string","minLength":4,"maxLength":6990515,"pattern":"^[A-Za-z0-9+/]+={0,2}$","description":"The recording: a WAV file (PCM, at most 5 MB and five minutes), base64 (`CAMP-6311` otherwise)."}},"required":["file_name","content_base64"],"additionalProperties":false},"UploadRequest":{"type":"object","properties":{"file_name":{"type":"string","minLength":1,"maxLength":255},"mime_type":{"type":"string","maxLength":255,"pattern":"^[a-z0-9!#$&^_.+-]+\\/[a-z0-9!#$&^_.+-]+$"},"size":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Bytes."}},"required":["file_name","mime_type","size"],"additionalProperties":false},"UploadSmsSenderNameDocument":{"type":"object","properties":{"sender_name_id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["commercial_registration","authorization_letter","trademark","other"]},"file_name":{"type":"string","minLength":1,"maxLength":255},"mime_type":{"type":"string","enum":["application/pdf","image/png","image/jpeg"]},"data":{"type":"string","maxLength":6990508,"format":"base64","contentEncoding":"base64","pattern":"^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$","description":"The file, base64 (PDF, PNG or JPEG, at most 5 MB)."}},"required":["sender_name_id","kind","file_name","mime_type","data"],"additionalProperties":false},"VoiceDevice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"membership_id":{"type":"string","format":"uuid"},"platform":{"type":"string","enum":["apns_voip","fcm"]},"environment":{"anyOf":[{"type":"string","enum":["production","sandbox"]},{"type":"null"}]},"label":{"type":["string","null"]},"last_woken_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","membership_id","platform","environment","label","last_woken_at","created_at"],"additionalProperties":false},"VoiceDeviceList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VoiceDevice"}}},"required":["data"],"additionalProperties":false},"VoiceSettings":{"type":"object","properties":{"international_calling_enabled":{"type":"boolean"},"international_countries":{"type":"array","items":{"type":"string"}},"default_number_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"inbound_stopped":{"type":"boolean","description":"Inbound calls are refused before answer because the wallet ran out (until a top-up)."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["international_calling_enabled","international_countries","default_number_id","inbound_stopped","updated_at"],"additionalProperties":false},"VoiceTrunk":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"host":{"type":"string"},"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"transport":{"type":"string","enum":["udp","tcp","tls"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"signaling_addresses":{"type":"array","items":{"type":"string"}},"media_addresses":{"type":"array","items":{"type":"string"}},"authentication":{"type":"string","enum":["ip","digest"]},"codecs":{"type":"array","items":{"type":"string","enum":["PCMA","PCMU","G722"]}},"dtmf":{"type":"string","enum":["rfc2833"]},"caller_id_format":{"type":"string","enum":["e164","national"]},"dialed_number_format":{"type":"string","enum":["e164","national"]},"country":{"type":"string"},"max_channels":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"note":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","host","port","transport","priority","signaling_addresses","media_addresses","authentication","codecs","dtmf","caller_id_format","dialed_number_format","country","max_channels","enabled","note","created_at","updated_at"],"additionalProperties":false},"VoiceTrunkList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VoiceTrunk"}}},"required":["data"],"additionalProperties":false},"VoiceTrunkReason":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Why (platform audit log)."}},"required":["reason"],"additionalProperties":false},"WalletBalance":{"type":"object","properties":{"currency":{"type":"string","enum":["SAR"]},"available_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The ledger balance: can be spent now."},"held_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Set aside in active holds (a call in progress, the usage allowance)."},"total_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"available + held: all of the organization's money."},"sequence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The number of transactions in the ledger."}},"required":["currency","available_minor","held_minor","total_minor","sequence"],"additionalProperties":false,"description":"The prepaid wallet (docs/10)."},"WalletTransaction":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sequence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Position in the organization's ledger: 1, 2, 3…"},"type":{"type":"string","enum":["top_up","usage_debit","seat_charge","adjustment","hold","hold_release"]},"amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Credits positive, debits negative."},"balance_after_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Halalas (SAR minor units)."},"reference":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"}},"required":["type","id"],"additionalProperties":false},{"type":"null"}],"description":"What it is for, e.g. a usage record or a top-up."},"hold_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"actor":{"type":"object","properties":{"type":{"type":"string","enum":["system","member","platform"]},"membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["type","membership_id"],"additionalProperties":false},"reason":{"description":"A manual entry's description (shown to the customer).","type":["string","null"]},"manual_entry":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string","description":"`MN-YYYY-NNNNNN`."},"direction":{"type":"string","enum":["credit","debit"]},"description":{"type":"string"},"external_reference":{"description":"E.g. a bank transfer number.","type":["string","null"]},"corrects_entry_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The entry this one corrects."}},"required":["id","number","direction","description","external_reference","corrects_entry_id"],"additionalProperties":false},{"type":"null"}],"description":"For an `adjustment`: the manual entry of the Rabt team it records (docs/10); null otherwise."},"occurred_at":{"type":"string","format":"date-time","description":"When the charged event happened."},"created_at":{"type":"string","format":"date-time"}},"required":["id","sequence","type","amount_minor","balance_after_minor","reference","hold_id","actor","reason","manual_entry","occurred_at","created_at"],"additionalProperties":false,"description":"One ledger row (docs/05 WalletTransaction)."},"WalletTransactionPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WalletTransaction"},"description":"Newest first."},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"WebchatWidget":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string","description":"The public key the embed snippet names (`rbw_…`)."},"name":{"type":"string"},"status":{"type":"string","enum":["active","disabled"]},"allowed_domains":{"type":"array","items":{"type":"string"}},"business_name":{"type":"string"},"greeting":{"type":"object","properties":{"ar":{"type":["string","null"]},"en":{"type":["string","null"]}},"required":["ar","en"],"additionalProperties":false},"default_locale":{"type":"string","enum":["ar","en"]},"position":{"type":"string","enum":["left","right"]},"header_color":{"type":"string","enum":["sidebar","teal","plum","sand"]},"pre_chat":{"type":"object","properties":{"enabled":{"type":"boolean"},"name":{"type":"string","enum":["hidden","optional","required"]},"email":{"type":"string","enum":["hidden","optional","required"]},"phone":{"type":"string","enum":["hidden","optional","required"]}},"required":["enabled","name","email","phone"],"additionalProperties":false},"logo":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"url":{"type":"string"}},"required":["type","url"],"additionalProperties":false},{"type":"null"}],"description":"Null: the business’s initials are shown."},"embed_snippet":{"type":"string","description":"The HTML to paste into the website."},"connection":{"type":"string","enum":["connected","not_connected"],"description":"`connected`: the widget is on and has at least one allowed domain; `not_connected`: it is off or loads nowhere yet."},"last_visitor_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","key","name","status","allowed_domains","business_name","greeting","default_locale","position","header_color","pre_chat","logo","embed_snippet","connection","last_visitor_at","created_at","updated_at"],"additionalProperties":false},"WebchatWidgetList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebchatWidget"}}},"required":["data"],"additionalProperties":false},"WebchatWidgetLogo":{"type":"object","properties":{"type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"data":{"type":"string","maxLength":174764,"format":"base64","contentEncoding":"base64","pattern":"^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$","description":"The image, base64 (PNG, JPEG or WebP, at most 128 KB)."}},"required":["type","data"],"additionalProperties":false},"WebchatWidgetWithSecret":{"type":"object","properties":{"widget":{"$ref":"#/components/schemas/WebchatWidget"},"identity_secret":{"type":"string","description":"The identity-verification secret (`rbwis_…`), shown only now. Your server signs a signed-in user’s id with it: `userHash` = hex HMAC-SHA256(secret, userId), passed as `rabt(\"identify\", { userId, userHash })` on the page."}},"required":["widget","identity_secret"],"additionalProperties":false},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Also the `webhook-id` header: `msg_<id>`."},"endpoint_id":{"type":"string","format":"uuid"},"event_id":{"type":"string","format":"uuid"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_response_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_error_code":{"type":["string","null"]},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","endpoint_id","event_id","event_type","status","attempts","last_attempt_at","last_response_status","last_error_code","delivered_at","created_at"],"additionalProperties":false},"WebhookDeliveryDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Also the `webhook-id` header: `msg_<id>`."},"endpoint_id":{"type":"string","format":"uuid"},"event_id":{"type":"string","format":"uuid"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_response_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_error_code":{"type":["string","null"]},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"payload":{"description":"The body sent on every attempt."},"attempt_log":{"type":"array","items":{"type":"object","properties":{"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger":{"type":"string","enum":["automatic","manual"]},"status":{"type":"string","enum":["succeeded","failed"]},"response_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"response_body":{"description":"The start of the endpoint's answer (2 KiB).","type":["string","null"]},"error_code":{"type":["string","null"]},"error_reference":{"type":["string","null"]},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attempted_at":{"type":"string","format":"date-time"}},"required":["attempt","trigger","status","response_status","response_body","error_code","error_reference","duration_ms","attempted_at"],"additionalProperties":false}}},"required":["id","endpoint_id","event_id","event_type","status","attempts","last_attempt_at","last_response_status","last_error_code","delivered_at","created_at","payload","attempt_log"],"additionalProperties":false},"WebhookDeliveryPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"},"description":"Newest first."},"next_cursor":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["data","next_cursor"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"description":{"type":["string","null"]},"event_types":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["enabled","disabled"]},"disabled_reason":{"anyOf":[{"type":"string","enum":["manual","failing"]},{"type":"null"}],"description":"`failing`: Rabt disabled it after repeated failed deliveries."},"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"consecutive_failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","url","description","event_types","status","disabled_reason","disabled_at","consecutive_failures","created_at","updated_at"],"additionalProperties":false},"WebhookEndpointList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"required":["data"],"additionalProperties":false},"WebhookEndpointWithSecret":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"secret":{"type":"string","description":"The signing secret (`whsec_…`), shown only now: verify `webhook-signature` with it (Standard Webhooks)."}},"required":["endpoint","secret"],"additionalProperties":false},"WebhookEventType":{"type":"object","properties":{"type":{"type":"string"},"module":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":{"type":"string"},"data_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The JSON Schema of `data` in the delivered body."}},"required":["type","module","version","description","data_schema"],"additionalProperties":false},"WebhookEventTypeList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}}},"required":["data"],"additionalProperties":false},"WhatsappAccountEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channel_id":{"type":"string","format":"uuid"},"topic":{"type":"string","description":"`quality`, `messaging_limit`, `account`, `capability`, `template_status`, `template_quality`, `template_category`, `health` or `history`."},"event":{"type":"string","description":"Meta's event name, e.g. `FLAGGED`, `UPGRADE`."},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"occurred_at":{"type":"string","format":"date-time"}},"required":["id","channel_id","topic","event","data","occurred_at"],"additionalProperties":false},"WhatsappAccountEventList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WhatsappAccountEvent"}}},"required":["data"],"additionalProperties":false},"WhatsappChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["pending","active","needs_reauth","disconnected"]},"status_changed_at":{"type":"string","format":"date-time"},"last_error":{"anyOf":[{"$ref":"#/components/schemas/ChannelError"},{"type":"null"}]},"phone_number":{"type":"string","description":"E.164."},"display_phone_number":{"type":"string"},"phone_number_id":{"type":"string"},"waba_id":{"type":"string"},"business_id":{"type":["string","null"]},"verified_name":{"type":["string","null"]},"name_status":{"type":["string","null"]},"quality_rating":{"description":"`GREEN`, `YELLOW`, `RED` or `UNKNOWN`.","type":["string","null"]},"messaging_limit":{"description":"The business portfolio's messaging limit, e.g. `TIER_1K`.","type":["string","null"]},"throughput_level":{"type":["string","null"]},"coexistence":{"type":"boolean"},"registered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"registration_error_code":{"type":["string","null"]},"credit_line_attached_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"health":{"anyOf":[{"$ref":"#/components/schemas/WhatsappHealth"},{"type":"null"}]},"sending_stopped":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"since":{"type":"string","format":"date-time"},"until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Meta's end of the restriction or its retry time; null: none given."},"reference":{"description":"The recorded error's reference, to look it up in the error log.","type":["string","null"]}},"required":["code","since","until","reference"],"additionalProperties":false},{"type":"null"}],"description":"Sending stopped after WhatsApp flagged spam or restricted the account. It resumes at `until`, when Meta lifts the restriction, when a health check finds the number available, or with `resumeWhatsappSending`."},"history":{"type":"object","properties":{"status":{"type":"string","enum":["not_requested","importing","imported","declined","failed"]},"progress":{"type":"number"},"imported_messages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"error_code":{"type":["string","null"]}},"required":["status","progress","imported_messages","updated_at","error_code"],"additionalProperties":false},"templates_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"granted_scopes":{"type":"array","items":{"type":"string"}},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","status","status_changed_at","last_error","phone_number","display_phone_number","phone_number_id","waba_id","business_id","verified_name","name_status","quality_rating","messaging_limit","throughput_level","coexistence","registered_at","registration_error_code","credit_line_attached_at","health","sending_stopped","history","templates_synced_at","granted_scopes","last_inbound_at","connected_at","disconnected_at"],"additionalProperties":false},"WhatsappChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WhatsappChannel"}}},"required":["data"],"additionalProperties":false},"WhatsappComposer":{"type":"object","properties":{"channel_type":{"type":"string","enum":["whatsapp"]},"channel_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"channel_status":{"type":["string","null"]},"composer":{"type":"string","enum":["chat"]},"window":{"type":"object","properties":{"open":{"type":"boolean","description":"The 24-hour customer service window is open."},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it closes: 24 hours after Meta's timestamp of the customer's last message."},"free_entry_point_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["open","expires_at","free_entry_point_until"],"additionalProperties":false},"free_form":{"type":"boolean","description":"Free-form content may be sent now; otherwise only an approved template."},"send":{"type":"object","properties":{"text":{"type":"boolean"},"media":{"type":"array","items":{"type":"string"}},"voice_note":{"type":"boolean"},"location":{"type":"boolean"},"contacts":{"type":"boolean"},"reaction":{"type":"boolean"},"template":{"type":"boolean"},"reply_context":{"type":"boolean"},"typing_indicator":{"type":"boolean"}},"required":["text","media","voice_note","location","contacts","reaction","template","reply_context","typing_indicator"],"additionalProperties":false},"limits":{"type":"object","properties":{"max_text_length":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_caption_length":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"files_per_message":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"media":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"max_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mime_types":{"type":"array","items":{"type":"string"}}},"required":["max_bytes","mime_types"],"additionalProperties":false}}},"required":["max_text_length","max_caption_length","files_per_message","media"],"additionalProperties":false},"blocked_code":{"description":"Why nothing can be sent now (catalog code), e.g. `WA-2103`; null otherwise.","type":["string","null"]},"templates":{"type":"array","items":{"$ref":"#/components/schemas/WhatsappTemplate"},"description":"The approved templates."}},"required":["channel_type","channel_id","channel_status","composer","window","free_form","send","limits","blocked_code","templates"],"additionalProperties":false,"description":"What the composer offers on a WhatsApp ticket (docs/channels/whatsapp.md): interactive messages are never sent from Rabt."},"WhatsappHealth":{"type":"object","properties":{"status":{"type":"string","enum":["available","limited","blocked","unknown"]},"checked_at":{"type":"string","format":"date-time"},"reasons":{"type":"array","items":{"type":"object","properties":{"entity":{"type":"string"},"code":{"type":["string","null"]},"description":{"type":"string"}},"required":["entity","code","description"],"additionalProperties":false}}},"required":["status","checked_at","reasons"],"additionalProperties":false,"description":"Meta's health status of the number: whether it can send messages now, and why not."},"WhatsappMediaRetry":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"missing_files":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The files to download again; they appear on the message as stored."}},"required":["message_id","missing_files"],"additionalProperties":false},"WhatsappSentMessage":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean","description":"The client key was used before: its message."}},"required":["message_id","duplicate"],"additionalProperties":false},"WhatsappSignup":{"type":"object","properties":{"app_id":{"type":"string"},"config_id":{"type":"string"},"graph_api_version":{"type":"string"},"embedded_signup_version":{"type":"string"},"session_info_version":{"type":"string"},"feature_type":{"type":"string","description":"`whatsapp_business_app_onboarding` for coexistence, else empty."},"state":{"type":"string","description":"Send it back with the flow’s result (valid 30 minutes)."}},"required":["app_id","config_id","graph_api_version","embedded_signup_version","session_info_version","feature_type","state"],"additionalProperties":false,"description":"What the browser needs to run Meta's Embedded Signup v4 (`FB.login` with this configuration)."},"WhatsappTemplate":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channel_id":{"type":"string","format":"uuid"},"external_id":{"type":"string","description":"Meta's template id."},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","description":"`marketing`, `utility` or `authentication`."},"status":{"type":"string","description":"`pending`, `approved`, `rejected`, `paused`, `disabled`…; only `approved` can be sent."},"status_reason":{"type":["string","null"]},"quality_score":{"type":["string","null"]},"pause_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parameter_format":{"type":"string"},"components":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"status_changed_at":{"type":"string","format":"date-time"},"synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"created_by_membership_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["id","channel_id","external_id","name","language","category","status","status_reason","quality_score","pause_count","parameter_format","components","status_changed_at","synced_at","created_at","created_by_membership_id"],"additionalProperties":false},"WhatsappTemplateList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WhatsappTemplate"}}},"required":["data"],"additionalProperties":false},"XChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["pending","active","needs_reauth","disconnected"],"description":"`active`, `needs_reauth` (X refused the tokens or the account revoked Rabt: reconnect), `disconnected`."},"status_changed_at":{"type":"string","format":"date-time"},"account":{"type":"object","properties":{"user_id":{"type":"string","description":"The X account's user id."},"username":{"type":"string"},"display_name":{"type":"string"},"profile_image_url":{"type":["string","null"]}},"required":["user_id","username","display_name","profile_image_url"],"additionalProperties":false},"scopes":{"type":"array","items":{"type":"string"},"description":"The permissions X granted."},"delivery":{"type":"string","enum":["webhook","polling"],"description":"How events arrive: X Activity API webhooks, or polling every 2 minutes while webhooks are unavailable."},"subscribed":{"type":"boolean","description":"Subscribed to the X Activity API (false while paused or disconnected)."},"paused":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"reason":{"type":"string","enum":["balance"]}},"required":["at","reason"],"additionalProperties":false},{"type":"null"}],"description":"Paused at zero balance: nothing is received, read or sent (it would be billed) until a top-up resumes it."},"last_error":{"anyOf":[{"$ref":"#/components/schemas/XChannelError"},{"type":"null"}]},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sync_requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"capabilities":{"type":"object","properties":{"kinds":{"type":"array","items":{"type":"string","enum":["private","public"]}},"composer":{"type":"string","enum":["chat","email","none"]},"media":{"type":"array","items":{"type":"string"}},"max_attachment_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text_limits":{"type":"object","properties":{"private":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Direct messages: none documented."},"public":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Public replies: a weighted length of at most 280 (a link counts 23, CJK and emoji 2)."}},"required":["private","public"],"additionalProperties":false},"public_actions":{"type":"array","items":{"type":"string"}},"statuses":{"type":"array","items":{"type":"string"}}},"required":["kinds","composer","media","max_attachment_bytes","text_limits","public_actions","statuses"],"additionalProperties":false,"description":"What the channel can do (the composer offers only these)."},"connected_at":{"type":"string","format":"date-time"},"disconnected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","status","status_changed_at","account","scopes","delivery","subscribed","paused","last_error","last_inbound_at","sync_requested_at","synced_at","capabilities","connected_at","disconnected_at"],"additionalProperties":false},"XChannelError":{"type":"object","properties":{"code":{"type":"string"},"reference":{"type":"string"},"retryable":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["name","code","message"],"additionalProperties":false},{"type":"null"}]},"occurred_at":{"type":"string"}},"required":["code","reference","retryable","provider","occurred_at"],"additionalProperties":false,"description":"Why the channel stopped working (docs/23)."},"XChannelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/XChannel"}}},"required":["data"],"additionalProperties":false},"XChatMessage":{"type":"object","properties":{"message_id":{"type":"string","minLength":1,"maxLength":100},"encoded_message_create_event":{"type":"string","minLength":1,"maxLength":1000000},"encoded_message_event_signature":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100000},{"type":"null"}]},"conversation_token":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":10000},{"type":"null"}]},"client_key":{"type":"string","pattern":"^[A-Za-z0-9._~-]{1,100}$"}},"required":["message_id","encoded_message_create_event"],"additionalProperties":false,"description":"An X Chat message encrypted and signed on the member’s device with the X Chat XDK: Rabt relays it as is and never sees its text (X Chat keys never leave the device)."},"XChatMessageQueued":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"ticket_id":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean","description":"The same `client_key` was sent before: this is the message it created."}},"required":["message_id","ticket_id","duplicate"],"additionalProperties":false},"XConnectStart":{"type":"object","properties":{"authorization_url":{"type":"string","format":"uri","description":"X's consent page: open it in the member's browser. X sends the member back to Rabt's callback page with `state` and `code` (or `error`)."},"expires_at":{"type":"string","format":"date-time","description":"Finish connecting before this time."}},"required":["authorization_url","expires_at"],"additionalProperties":false},"XModeration":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"ticket_id":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["hide","unhide","delete"]},"moderated_at":{"type":"string","format":"date-time"}},"required":["message_id","ticket_id","action","moderated_at"],"additionalProperties":false}},"headers":{"RateLimit":{"description":"What is left of each quota this request counted against (IETF RateLimit header fields): `r` requests remaining, `t` seconds until the window ends, e.g. `\"client-ip\";r=5998;t=41, \"api-key\";r=598;t=41, \"organization\";r=2950;t=41`.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota policies this request counted against: `q` requests per window of `w` seconds. `client-ip` every request from the client address; then `api-key` per API key, `organization` per organization (all its members and keys), `account` per signed-in account outside any organization, or `anonymous` per client address for requests with none of them.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer","minimum":1}}},"responses":{"Problem":{"description":"Any other error, with its code: e.g. `API-8005` the body is not valid JSON, `API-8006` the body is too large, `API-8007` the body is not JSON, `API-8008` no such endpoint, `API-8009` the request cannot be read, `API-8010` the request took too long, `API-8022` or `API-8023` the body compression or character set is not supported, `AUTH-1014` a change sent with the session cookie (or a sign-in) that does not come from a Rabt web page, `SYS-1002` or `SYS-1011` a dependency is unreachable, `SYS-1041` the organization is using its full share of the server, `SYS-1042` the server is overloaded (retry after `Retry-After`), `SYS-1070` Rabt is in read-only mode during an incident (changes are refused; reading works), `SYS-1071` a non-essential feature (search) is paused during an incident, `SYS-9000` an unexpected error.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"RateLimited":{"description":"`API-8004`: a rate limit quota is used up (see `RateLimit`). Try again after `Retry-After` seconds.","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"ValidationFailed":{"description":"`API-8001`: some fields are missing or not valid. `details.fields` lists each invalid field with its own code (e.g. `API-8002` required, `API-8012` wrong format).","headers":{"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}