Skip to content

API documentation

The Telma REST API is served at https://api.telma.ca. This page covers the concepts (authentication, multi-domain, roles, errors). The full list of operations, with their parameters and access rules, is in the API reference, generated from the code. The same information is available as OpenAPI on /docs (Swagger UI) and /static/swagger.yaml.

URL prefixes:

Prefix Content
/auth login, registration, profile, OAuth
/api/v1 everything else (conversations, teams, organizations, domains, billing, ...)
/webhook URLs called by SMS providers (outbound webhooks are described below)
/docs Swagger UI

Authentication

JWT token

POST /auth/login returns an access token and a refresh token. Send the access token in the Authorization header:

Authorization: Bearer <access_token>

When it expires, POST /auth/refresh (with the refresh token in the same header) returns a new access token and a new refresh token, which replaces the old one (still accepted for 60 seconds). POST /auth/logout, with the refresh token, ends the session: the refresh token and the access tokens of that session that are still valid are refused at once. Changing the password or deactivating the account immediately invalidates every token issued before.

The tokens of one sign-in form a family (claim fam, kept by the rotation). A refresh token that was already replaced and is presented again after its 60 seconds of grace is a copy (stolen or replayed token): the whole family is revoked, the newest token and the access tokens included, and the user must sign in again. Other sessions of the same account are not touched. A client must therefore never replay an old refresh token: it keeps the last one it received.

Session length and the remember option

The access token lasts 1 hour. The refresh token lasts 30 days and is renewed at each POST /auth/refresh. POST /auth/login accepts remember (boolean, true by default): with "remember": false the refresh token lasts only 12 hours (adjustable with JWT_REFRESH_SHORT_HOURS on the server), still renewed at each refresh, so the session ends after 12 hours without a refresh. The choice is kept by the rotation of the token and by the new tokens of PUT /auth/me/password and PUT /auth/me/email. Without remember, nothing changes from before (30 days).

Signing in without knowing the domain (any_domain)

A client that does not know the white-label domain of the account (the mobile app, when the person did not type another domain) sends "any_domain": true to POST /auth/login. An email address has a single account on the whole platform; once the password is accepted, the answer also carries domain: {id, name, host}, the domain the account works in: the domain of X-Frontend-Host when the account works there, otherwise the only domain it works in (with several, the one of its current organization). The client then sends host as X-Frontend-Host for the rest of the session. A failed sign-in is answered exactly as without the option (same 401, same budgets, same delay): it tells nothing about whether an address has an account. The option is ignored on a request that carries X-API-Key.

User profile

GET /auth/me (and every response that carries a user: login, registration, OAuth, /api/v1/users) returns:

Field Meaning
name display name; always "first last" once either part is edited
first_name, last_name first and last name (deduced from name for an older account)
phone null, or {country, number, verified_at}: number in E.164 (+15145550123), verified_at null until the number was proven by SMS
timezone IANA name (America/Toronto), null until chosen
language fr or en
permissions former permission names (view_team_conversations, send_sms…) the user's platform permissions or profiles in the current organization amount to, then those granted to the account (support); the permissions of the profiles are in organization_permissions (see Roles and permissions)
role agent, manager, admin, domain_admin or super_admin: a copy derived from the profiles and the platform permissions, kept for older clients; it decides nothing
platform_permissions, organization_permissions, profile_ids GET /auth/me only: the account's platform permissions, the permissions in the current organization (all of them for an admin of the platform or of its domain) and the profiles of the membership there
mfa GET /auth/me only: {enabled, methods, totp, passkeys, backup_codes_left, required, reason, deadline, enforced}, the state of the account's second factor
dnd GET /auth/me only: {active, until, set_at}, the account's "Do not disturb" (as GET /auth/me/dnd)
status GET /auth/me only: {kind, text, until, set_at} or null, the manual status (as GET /auth/me/status)

PATCH /auth/me edits name, first_name, last_name, language, timezone, phone (unverified) and default_organization_id. A user can neither grant themselves permissions (403 forbidden) nor change their profiles or role. Granted permissions (support) are set with PUT /api/v1/users/<id> (permissions), reserved to super_admin and domain_admin. A phone number must belong to a country the domain accepts: Canada and the United States by default, other countries (international +... format and country required) if the domain setting settings.verification.phone_countries lists them. An invalid number gets 400 invalid_phone.

Session opened by an administrator

A member holding members.admin in the organization (the Admin profile, or a profile of the organization that gives it), an admin of its domain or a super admin may open a session as a member ("Sign in as"), without their password: POST /api/v1/organizations/<org_id>/members/<user_id>/impersonate, with a session (never an API key, never from a session itself opened that way; 20 per hour). Every organization of the member must be administered by the caller (a domain admin only by a super admin, never a super admin, never oneself: otherwise 403 forbidden or 403 member_of_other_organizations; an unknown organization or an account that is not a member of it: 404 not_found; a deactivated account: 409 user_inactive). The answer has the shape of POST /auth/login: a session of the member, short (12 hours without a refresh, like remember: false), whose user carries impersonated_by {id, name, email} (the administrator), also in GET /auth/me. It does not count as a sign-in of the member, ends when the administrator's account is deactivated, is journaled (audit_logs, impersonation_started) and may neither change the password, email or phone of the account (nor ask for a verification code), nor delete it, nor create an API key: 403 impersonation_forbidden.

Password

PUT /auth/me/password {current_password, new_password} replaces the old PATCH /auth/me {password} (deprecated, it now requires current_password too). The rule: 8 to 128 characters (72 UTF-8 bytes at most), at least 2 kinds among lower case, upper case, digits and other characters, not a very common password, not the email address or its local part, and different from the current password (400 validation_error, field: new_password). A wrong current_password gets 401 invalid_password. Every other session ends (token_version); the route returns new access_token and refresh_token that keep the current session open: the client must store them in place of the old ones. 10 attempts per hour per user.

POST /auth/forgot-password {email} always answers 200 with the same message and sends the link (valid 24 hours) after the answer, through the SMTP server of the account's domain: the time of the answer does not tell whether the address has an account. A new request does not kill the link already received: up to 5 links are valid together, the oldest goes out at the sixth. POST /auth/reset-password {token, password} follows the same password rule as PUT /auth/me/password (400 validation_error, field: password), takes the link before the password changes (two simultaneous requests cannot both succeed), ends every session and cancels the account's other links. Tokens are stored as a SHA-256 digest only.

Verification by code, email and phone

Changing the email address (the sign-in identifier) or the phone number requires proof that the user controls the new address or number:

  1. POST /auth/verifications {channel: "email"|"sms", target, purpose?, country?} sends a 6-digit code (valid 10 minutes, stored hashed) and answers 202 {verification: {id, channel, purpose, target_masked, expires_in, resend_after}}. The email goes through the SMTP server of the user's domain, the text through that domain's SMS provider, from a number of its pool that no customer holds (or the one named by the domain setting settings.verification.sms_from); with no usable number: 503 sms_unavailable. country (ISO code of the country) gives the country of an sms target; it is deduced from the area code for a North American number.
  2. POST /auth/verifications/<id>/confirm {code} answers {verification: {id, verified: true}, verified_token, expires_in}. The verified_token is single use and valid 10 minutes.
  3. PUT /auth/me/email {email, password, verified_token} or PUT /auth/me/phone {country, number, password, verified_token} apply the change. An email change ends the other sessions and returns new tokens like a password change, cancels pending reset links and warns the former address; a phone change sets phone.verified_at.

A free sign-up whose address is not proved (user.email_verified false) proves it with purpose: "email_verify" (no target, or its own address; 409 already_verified once proved) then /confirm: the answer carries email_verified: true and credit_granted when a starting credit was waiting (see Registration).

Anti-abuse: 60 seconds between two codes for one target, at most 3 codes per hour per user and target, 10 per user and 6 per mailbox (all users: the spellings of one mailbox, with a +tag or, at Gmail, with dots, count as one), 5 attempts per code. Beyond that: 429 rate_limited with retry_after. Errors specific to these routes:

HTTP code error Meaning
400 invalid_code wrong code (with attempts_left), or verified_token unknown, already used or proving another target
400 code_expired code or verified_token older than 10 minutes
400 verification_required verified_token missing
400 invalid_phone number or country not acceptable
401 invalid_password wrong current password
409 email_in_use address already belongs to another account
409 already_verified verification already confirmed (ask for a new code)
429 too_many_attempts 5 attempts used (ask for a new code)
429 rate_limited too many codes requested
502 send_failed the mail server or the SMS provider failed
503 email_unavailable no SMTP server for the domain
503 sms_unavailable no SMS number or provider to send the code with

API key

For programmatic access, an API key replaces the JWT:

X-API-Key: <key>

A key is created with POST /api/v1/keys and the JWT of a member holding the api_keys.manage permission (Admin profile): a request authenticated by a key gets 403 there, so a key never creates another one. The body must be a JSON object with a non-empty name; team_id, when given, is the identifier (a string) of a team you reach: otherwise, 400 validation_error. A key that is not limited to a team has its creator's rights: it is only created with the owner's current password (current_password: 400 validation_error when missing, 401 invalid_password when wrong; an account without a password, signed in with OAuth, gives none), 10 attempts per hour. Every key expires: expires_in_days (an integer from 1 to 365, 90 by default) sets its expiry date (expires_at), after which it gets 401; a new one must then be made. In the application, these keys are managed under Settings → Integrations → Administration keys. A personal key is revoked when its owner changes the password or the email address, resets the password or is deactivated. The secret is shown only once, at creation, in the key field of the 201 answer ({api_key, key, message, warning}: api_key describes the key, without its secret; an integration returns its own in api_key). An unknown or revoked key, the old key of an integration after regeneration, or the key of a disabled or deleted integration gets 401 {"error": "unauthorized", "message": "Invalid API key"}, except on the routes closed to every key (below), which answer 403 as soon as an X-API-Key header is present.

There are two kinds of keys:

  • a regular key (created without team_id) has the rights its creator's profiles give, judged as for their session, but never their platform permissions: the key of a platform_admin or domain_admin account only has the permissions of its own profiles in its current organization (the User profile when it is not a member there), neither the platform nor a domain (their session keeps them);
  • a restricted key is limited to one team (team_id at creation), or is the key of an integration. It only has the rights of the User profile on the teams it reaches, whatever the profiles of its creator: read conversations and send, administer nothing. Access to a team is still judged with the creator's current rights: if they lose the team, the key loses it too.

A restricted key gets 403 on every route that requires more than the permissions of the User profile (for example the list of a team's closed conversations, GET /api/v1/teams/<team_id>/archives), and on the routes that concern the whole organization or its creator's account: billing, organizations, voice, push notifications, free trial and account state, and GET /api/v1/phone-numbers/unassigned. The body is then {"error": "forbidden", "message": "API key not allowed on this route"} (a few checks specific to a route keep their own message).

Some routes refuse every key, regular or restricted, with that same body. For the integrations (/api/v1/integrations*), the billing of a domain (/api/v1/domains/<id>/billing-settings, payment-setup, promo-codes, payments, plans, billing-overview, wholesale, wholesale-settings, organizations/<org_id>/subscription, and the Telma AI price list /api/v1/domains/<id>/ai-pricing), the AI settings of the platform (/api/v1/system/ai-settings), the assistants connector (/<domain>/mcp, its OAuth routes and /api/v1/mcp/*), the profiles and platform permissions (/api/v1/permissions, /api/v1/organizations/current/profiles*, /api/v1/organizations/current/members/<user_id>/profiles, /api/v1/domains/<id>/profiles*, /api/v1/users/<id>/platform-permissions), the second factor and the passkeys (/auth/mfa*, /auth/webauthn/*) and the internal API of the voice servers (/api/v1/internal/voice/*, reserved to their service token), that 403 answers as soon as an X-API-Key header is present, even an invalid one. For the search, purchase and management of numbers (prices, release, restoration, update), the call codes of the voice service, the personal voice routes (/api/v1/voice/my-endpoints*, GET /api/v1/voice/call-info, PUT /api/v1/voice/call-info/recording*, GET /api/v1/voice/directory, POST /api/v1/voice/diagnostics) and the creation of a key, it answers a valid key; an unknown or revoked key gets 401 there, as anywhere else.

No key, not even a regular one, gives another way to sign in. That same 403 answers, as soon as an X-API-Key header is present (even an invalid one), to what would create or strengthen an access:

  • POST /api/v1/users (creating an account, with or without a password), POST /api/v1/invitations and POST /api/v1/invitations/<id>/resend (sending an invitation's email again);
  • POST /api/v1/invitations/accept (accepting an invitation: only the session of the invited account);
  • POST /api/v1/organizations/<id>/members/<user_id>/impersonate (opening a session as a member, see Session opened by an administrator);
  • PUT /api/v1/users/<id> when the body contains password, whoever the user (the key's creator included); your own password is only changed with PUT /auth/me/password anyway (403 elsewhere, even with a session);
  • a body that gives the admin role (hence the Admin profile) or a platform role: PUT /api/v1/users/<id>, PUT /api/v1/users/<id>/role, PUT /api/v1/organizations/<id>/members/<user_id>;
  • POST /api/v1/domains/<id>/admins and DELETE /api/v1/domains/<id>/admins/<user_id>;
  • changing the SMTP and OAuth settings (PUT /api/v1/domains/<id>/settings/smtp and its test POST .../settings/smtp/test, PUT /api/v1/domains/<id>/settings/oauth/<provider>, PUT /api/v1/system/smtp, PUT /api/v1/system/oauth/<provider>), which carry the password reset links and decide who may sign in, and the accounts that must have a second factor (PUT /api/v1/domains/<id>/security-settings);
  • PUT /api/v1/domains/<id> when the body contains hostnames or name: the domain's hostnames give the address of the links of its sign-in emails. display_name and capabilities can still be changed with a regular key;
  • the routes that reach the whole domain: PUT /api/v1/domains/<id>/account-settings, PUT /api/v1/domains/<id>/settings/payment-providers/<provider>, PUT /api/v1/domains/<id>/settings/default-payment-provider, PUT /api/v1/domains/<id>/sms-providers/<provider>, credit added by hand (POST /api/v1/billing/admin/add-credits, POST /api/v1/domains/<id>/organizations/<org_id>/credit) and the outbound call rules of an organization (PUT /api/v1/domains/<id>/organizations/<org_id>/voice-outbound);
  • the SMS provider accounts and the voice trunks, of the platform as of a domain (creation, update, deletion, secrets, number inventory, allowed domains: /api/v1/system/sms-accounts*, /api/v1/domains/<id>/sms-accounts*, /api/v1/system/voice-trunks*, /api/v1/domains/<id>/voice-trunks* in writing).

The exact list, route by route, is generated from the code: see API keys: closed routes in the reference.

These operations stay open to a session (JWT). A key can therefore neither create another key nor obtain a session that would create one.

A key never goes through the second factor: it is a separate secret, created by a session (which may have required the second factor). The authenticated routes of /auth (GET /auth/me included) only accept a JWT: with a key alone, they answer 401 (403 for /auth/mfa* and /auth/webauthn/*, closed to every key).

GET /api/v1/teams returns to a restricted key exactly the teams it reaches in the current domain. With any key, GET /api/v1/phone-numbers only lists the numbers assigned to a team the key reaches. For a restricted key, these two lists and GET /api/v1/phone-numbers/<id> start from the key's teams, whatever organization its creator is currently working in within the app.

Since there is no session, some routes (for example GET /api/v1/teams) accept an organization_id parameter to select the organization; with a restricted key, it only filters its teams (never a 403). With a regular key, it must be an organization the key's creator belongs to (the key never has their platform permissions); with a JWT, a domain_admin also reaches the organizations of their domains and a platform_admin all of them. Otherwise 403, whatever X-Frontend-Host. X-Frontend-Host (see Multi-domain) is optional with a key; when present, it must be the host of the web application of the organization's domain, otherwise the key sees no team (empty lists, 403 on a team).

Keep the key on your server: see Security.

Registration

By default there is no open registration: POST /auth/register requires an invitation token. A domain can open free sign-up (setting signup.enabled, closed by default): GET /auth/signup/config (public) tells whether it is open and which captcha to show, then POST /auth/signup {email, password, first_name, last_name, phone?, language, accept_terms, captcha_token?} creates the account, its organization and its default team. The email address is not proved at sign-up: the domain's starting credit (initial_credit) is therefore granted, once, only when the address is verified (purpose: "email_verify", see Verification by code) or changed to a verified one. See Account: sign-up, trial, deletion, notifications.

With an invitation: The token comes either from an organization invitation (the user joins that organization with the invitation's profiles) or from a domain administrator invitation (the user becomes domain_admin of the domain, with no organization of their own). GET /api/v1/invitations/verify/<token> shows the destination before the account is created. The password chosen follows the strength rule of PUT /auth/me/password (400 validation_error, field: password).

An invitation to an address that already has an account never adds that account to the organization: the answer of POST /api/v1/invitations is the same (no profile), and the account owner accepts it themselves, signed in, with POST /api/v1/invitations/accept {token} (the email leads to the page that does it). Only the session of the invited account accepts; a token for another address gets 404.

Sign-in emails

The emails that carry a way to sign in (password reset, organization invitation, created or sent again, and domain administrator invitation) go through the SMTP server of the domain of the account concerned, and their link leads to that domain's first hostname that is not localhost. That domain never depends on the request's X-Frontend-Host alone; when no domain fits, it is the platform:

Email Domain used
reset (POST /auth/forgot-password) of an account whose organizations (current one and memberships) are all in one domain that domain
reset of a domain_admin who administers only one domain and has organizations in that one only, requested from that domain (X-Frontend-Host) that domain
reset of a super_admin, of a domain_admin in the other cases, or of an account whose organizations span several domains, none, or an organization without domain none: the platform
organization invitation (POST /api/v1/invitations, POST /api/v1/invitations/<id>/resend) the organization's domain (the platform if it has none)
domain administrator invitation (POST /api/v1/domains/<id>/admins) the invited domain

A domain without a configured SMTP server goes through the platform's, and a domain without a production hostname gives a link to the platform's address. The platform is the environment of the Telma server: SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD, SMTP_FROM_EMAIL, SMTP_FROM_NAME, SMTP_USE_TLS for the server, and FRONTEND_URL for the address of the links. Without a configured server, nothing is sent. For a valid email address, POST /auth/forgot-password answers 200 with the same message, whether it matches an account or not, and whatever the domain chosen.

A domain's administrators set its SMTP server and hostnames: they therefore never receive the link of an account their domain does not cover entirely.

Sign-in security

  • Password guesses. POST /auth/login counts only the failures (401): 30 per 15 minutes and per email address, then 429 rate_limited with Retry-After, even with the right password (the budget bounds the guesses). When the client's address is known: 10 failures per 15 minutes per email and address pair, and 100 per address; one address can therefore neither lock an account out for the others nor spray many accounts. The 4th and later failures of an account are answered more and more slowly (0.5 s, doubling at each failure, up to 4 s). A successful sign-in never counts. An unknown account, a service account or one without a password costs the same computation as a known account.
  • OAuth (Google, Microsoft, Apple). GET /auth/oauth/<provider>?redirect_uri= returns {auth_url, state}: the state is made and signed by the server (10 minutes, single use, bound to the provider, the domain and the redirect_uri) and the URL carries a PKCE challenge (S256). The client keeps the state (sessionStorage), refuses a return whose state differs, and sends it with the code to POST /auth/oauth/<provider>/callback (without it: 400 oauth_error, nothing is sent to the provider). The account is the one linked to the provider identity (Google sub, Microsoft id, Apple sub). An address is linked to an existing account only when Google vouches for it (email_verified); Microsoft vouches for nothing, so it never links, nor applies a domain admin invitation, by address. An account is created only if the domain's free sign-up is open, in that domain. Every failure is the same 400 oauth_error with a generic message. One person may link Google, Microsoft and Apple to the same account: an identity of another provider whose address is vouched for is added next to the first one (oauth_identities); another identity of the same provider with the same address is refused. Google and Microsoft always use the platform's credentials: a domain only turns them on (PUT /api/v1/domains/<id>/settings/oauth/google|microsoft {enabled}, any other field is ignored).
  • Apple (Sign in with Apple). Same rules, with three differences: GET /auth/oauth/apple?redirect_uri= takes the web page the browser must come back to (an address of a known domain); Apple sends the browser back with a form (form_post, required to get the name and the address) to the API's POST /auth/oauth/apple/return, which sends it on (303) to that page with code, state and, the first time only, user (the name); the page sends code, state and user to POST /auth/oauth/apple/callback. What Apple says about the person is the id_token of the exchange, checked with Apple's public keys (signature, issuer, client ID, expiry and the nonce bound to the state). Apple vouches for the address, a relay address (…@privaterelay.appleid.com) included. Credentials: the domain's (PUT /api/v1/domains/<id>/settings/oauth/apple: client_id = Services ID, team_id, key_id, private_key = the .p8 key), each one missing taken from the platform's configuration; Apple is offered (GET /auth/oauth/providers) only when the domain turns it on (enabled) and all four are known. The client secret is a 5-minute ES256 token signed with the key, made at each exchange.
  • Second factor. An account may have an authenticator app (TOTP, 6 digits) and passkeys (WebAuthn: fingerprint, face, device PIN, USB or NFC security key), plus 10 single-use backup codes (given once, stored hashed). With a second factor, the right password (or OAuth) does not give the session: the answer is {mfa_required: true, mfa_token, methods, expires_in}. The mfa_token (5 minutes, single use, dead when the password changes, never a session token) goes with a code or a passkey assertion to POST /auth/mfa/verify (method = totp, backup_code or webauthn; passkey options: POST /auth/mfa/webauthn/options); 10 failures per 15 minutes per account. A TOTP code works once. The session then opened carries the claim mfa: true.
  • Sign-in with a passkey. POST /auth/webauthn/login/options then POST /auth/webauthn/login: no address nor password, the passkey tells the account; the device must have verified the person (fingerprint, face, PIN), so the sign-in counts as a second factor. A passkey is bound to the site it was created on (the Origin of the request, which must be a host of a known domain). The mobile app sends no Origin but X-Client-App: ios or android with X-Frontend-Host: the passkey is then the one of that host's site (the site declares the app in /.well-known/apple-app-site-association and /.well-known/assetlinks.json), and a passkey created on the site also works in the app. Management: GET /auth/mfa, POST /auth/mfa/totp/setup|confirm|disable, POST /auth/mfa/backup-codes, POST /auth/webauthn/register/options, POST /auth/webauthn/register, PATCH /auth/webauthn/credentials/<id>, POST /auth/webauthn/credentials/<id>/remove. Removing a factor or renewing the codes takes a code (TOTP or backup), the password only for an account with passkeys alone. Closed to API keys and to sessions opened as a member; every change is journaled (mfa_factor_added, mfa_factor_removed, mfa_backup_code_used).
  • Administrators' second factor: recommended, soon mandatory. It is expected from platform and domain admins, and from the organization admins (members.admin) of the domains that ask for it (PUT /api/v1/domains/<id>/security-settings {mfa_organization_admins}; reading it also gives mfa_enforced, false while the obligation is not turned on). Today it is only recommended: such an account signing in without a second factor gets its session with mfa_setup {required: true, reason, deadline: null} (the interface shows a "will become mandatory" banner) and nothing is ever refused. When the platform turns the obligation on, there will be a grace period of 14 days (MFA_GRACE_DAYS) from the first time the account was seen without one: during it, mfa_setup carries the deadline; after it, the password only gives an enrollment mfa_token (mfa_enrollment_required, 15 minutes), to put in the X-MFA-Token header of the routes that add a factor (/auth/mfa/totp/*, /auth/webauthn/register*): the route that adds the first factor answers with the session. A session opened without a second factor will no longer be renewed (POST /auth/refresh: 401) once the grace period is over, and the last factor of such an account will not be removable (409 mfa_required). A client should therefore already handle mfa_required and mfa_enrollment_required.
  • Headers. Every API answer carries X-Content-Type-Options: nosniff and Referrer-Policy: no-referrer; /auth/* answers also carry Cache-Control: no-store. The content security policy (CSP) of the pages belongs to the frontend's web server, not to the API.
  • CORS. The API reflects an origin only if its host name is configured: the hosts of the domains (database) or CORS_ORIGINS. localhost, 127.0.0.1, 10.x, 192.168.x, *.telma.ca and *.textos.ca (former name) are honored in development and testing only (FLASK_ENV).
  • Journal. The writes made with X-Admin-Organization are journaled one by one; the reads are journaled as one entry per administrator, organization and quarter of an hour (admin_read, with the number of reads).

The routes of the second factor and of the passkeys answer {error, message} with these codes:

HTTP code error Meaning
400 proof_required removing a factor or replacing the backup codes without code (nor password for an account that only has passkeys)
400 invalid_code wrong TOTP or backup code while managing; at POST /auth/mfa/verify, a wrong code answers 401 invalid_code
400 origin_not_allowed Origin (or, for the app, X-Frontend-Host with X-Client-App) that is not a host of a known domain
401 invalid_mfa_token mfa_token or X-MFA-Token unknown, expired, already used, or dead since the password changed
401 unknown_credential unknown passkey, or signature refused
401 invalid_password wrong password given as proof
401 unauthorized neither a session nor a valid X-MFA-Token on a management route
403 second_factor_required adding a factor to an account that already has one takes a session that proved a second factor (mfa: true)
403 impersonation_forbidden session opened as a member
404 not_found unknown passkey (rename, remove)
409 mfa_required removing the last factor of an account that must have one (only once the obligation is on)
409 already_enabled, not_started, mfa_not_enabled authenticator app already on, confirmation without setup, backup codes asked without a second factor
409 already_registered, too_many_passkeys, no_passkey passkey already registered, already 20 passkeys on the account, no passkey of the account for this site (POST /auth/mfa/webauthn/options)

Multi-domain

Every whitelabel site is a domain: app.telma.ca, other.telma.ca, ... The API resolves the domain from the X-Frontend-Host header, falling back to Host:

X-Frontend-Host: other.telma.ca

The current domain determines:

  • which organizations are visible and manageable;
  • the configuration in effect (SMTP, OAuth, SMS providers, branding, payment), except for the sign-in emails, which follow the domain of the account concerned;
  • the phone numbers and providers available.

Mobile applications must send this header.

Current and default organization

A user can belong to several organizations across several domains. GET /api/v1/organizations/current returns the active organization for the visited domain: when the user's active organization belongs to another domain, the API switches to their default organization for this domain, or else to the first organization of the domain they can access.

The default organization is set per domain with PATCH /auth/me and the default_organization_id field; the organization must belong to the visited domain, and null (or an empty string) clears the default of that domain. The user payload exposes default_organization_id (the default for the current domain) and default_organization_ids (all domains).

Roles and permissions

Since 2026-10-16, rights come from profiles and permissions (the former roles agent, manager, admin stay in the responses, deduced from the profiles, during the transition; they no longer decide anything: only permissions count, and the role of a platform account is super_admin or domain_admin after its platform permissions).

  • Platform permissions, held by the account: platform_admin (the whole system: the former super_admin), domain_admin (the domains of domain_ids: all their organizations), support. They are given with PUT /api/v1/users/<id>/platform-permissions {permissions, domain_ids?} (platform_admin only; the account's sessions end).
  • Permissions of an organization: catalogue GET /api/v1/permissions (messages.read, messages.send, messages.archive, messages.delete, teams.all, teams.manage, teams.hours, teams.provider, members.manage, members.admin, metrics.team, metrics.all, numbers.manage, numbers.buy, billing.view, billing.manage, integrations.manage, api_keys.manage, organization.settings, voice.use, voice.calls.all, voice.routing, voice.endpoints, voice.blacklist, voice.recordings, queues.manage, queues.supervise, and for the assistants mcp.use, mcp.messages.read, mcp.media.read, mcp.calls.read, mcp.call_summaries.read, mcp.transcripts.read, mcp.voicemail.read, mcp.metrics.read, mcp.billing.read, mcp.messages.send, mcp.conversations.manage, mcp.activity.read, mcp.meetings.manage, mcp.team_chat.read, mcp.team_chat.send). They come from the member's profiles, which add up.
  • Profiles: two built-in profiles never changed, builtin:admin (every permission) and builtin:user (messages.read, messages.send, metrics.team, voice.use, mcp.use, mcp.messages.read, mcp.media.read, mcp.calls.read, mcp.voicemail.read, mcp.metrics.read, mcp.team_chat.read); those of a domain (/api/v1/domains/<id>/profiles, managed by the platform and the admins of that domain, offered to its organizations) and those of the organization (/api/v1/organizations/current/profiles: read with members.manage or members.admin, write with members.admin; a profile still held by a member is not deleted, 409 profile_in_use). An organization that had managers received a « Gestionnaire » profile (French for manager) with the exact rights of the former role (named « Manager » until 2026-10-30; a migration renamed it, unless it had already been renamed). A member's profiles are set with PUT /api/v1/organizations/current/members/<user_id>/profiles (members.admin; 409 last_admin when nobody would be left with members.admin) and an invitation can carry some (profile_ids of POST /api/v1/invitations). Changing the permissions of a profile is judged the same way for everyone who holds it: 409 last_admin when an organization would have nobody left with members.admin, and nothing is changed. For a domain profile, the refusal names the organizations concerned (organizations: {id, name, error, limit, plan, upgrade, current}).
  • metrics.all opens the metrics of every team; metrics.team alone, those of the team one is placed in (another team: 403). The list of members (GET /organizations/current/members, members of GET /organizations/<id>) requires members.admin. A platform account is listed there only when it holds a membership of the organization: switching into an organization or administering it (X-Admin-Organization) does not make it a member.
  • Acting on a member (reading them, changing their team, role or profiles, removing them, their API keys, their statistics): members.admin in the organization, or members.manage for a member of one's team who has neither members.manage nor members.admin, and only when one also holds each of their permissions there: nobody acts on someone who can do more. There is no role hierarchy. Likewise, one only gives (a role, the profiles of a member or of an invitation) permissions one holds (403 forbidden, field role or profile_ids); with members.manage alone, never members.manage nor members.admin. Widgets and integrations: integrations.manage; a team's inbound secret: teams.provider.
  • GET /auth/me gives platform_permissions, organization_permissions (current organization) and profile_ids; GET /api/v1/organizations/my gives permissions for each organization.

A route judges the permission in the organization of the resource (team, conversation, message), else in the current organization. A platform_admin or domain_admin account passes these checks (the routes of a domain and the administration context bound its reach); an account without a membership in its current organization (the service account of an integration) has the User profile; a restricted API key (limited to a team, or of an integration) has the permissions of the User profile, a regular key those of its creator without their platform permissions (see API key). The routes of the platform and of the domains ask for a platform permission (domain_admin: only for their domains). Without the permission: 403 forbidden. The permission of each operation is given in the reference.

Voice (VoXoS)

The /api/v1/voice/* routes only serve organizations that carry the voxos capability (403 voice_not_enabled otherwise) and only show the resources of the current organization. Rights depend on the permissions held in the organization (profiles); the reference gives each route's:

Resource Read (GET) Write
numbers (/voice/numbers), flows (/voice/flows), groups (/voice/groups), sounds (/voice/sounds and a sound's file), standard prompts of the voice server (/voice/system-prompts*), limits and prices (/voice/limits, /voice/rating/*) voice.use (speech synthesis GET /voice/sounds/tts: voice.routing) voice.routing
calls (/voice/calls), statistics (/voice/stats, with_stats of /voice/numbers) voice.use: the calls of their own endpoints (made or rung); with voice.calls.all: every call; endpoint_id: only the calls of that endpoint, which must be the user's (404 otherwise, even with voice.calls.all) —
voicemail (/voice/voicemails) box of a number: voice.calls.all or voice.routing, and the member one of whose endpoints the number's routing rings (directly, through a call group, one of its stages or its fallback, or through a call flow, goto included); box of an endpoint: its user and voice.routing; standalone box: its members and voice.routing mark listened: whoever may hear it; delete: voice.routing, or a listener of an endpoint or standalone box
voicemail boxes (/voice/mailboxes, capability voicemail_boxes) the boxes the user listens to (all of them with voice.routing) voice.routing
SIP endpoints (/voice/endpoints, SIP passwords included) and diagnostics reports (GET, DELETE /voice/diagnostics*) voice.endpoints voice.endpoints
blacklist (/voice/blacklist) voice.blacklist voice.blacklist
recordings (/voice/calls/<id>/recording, /voice/recordings) voice.recordings voice.recordings
call queues (/voice/queues*, capability call_queues) one's own agent state (GET /voice/queues, login, logout, pause, unpause, ready): voice.use; settings and agents of a queue (GET /voice/queues/<team_id>): queues.manage or queues.supervise; live board, statistics and their CSV export, acting on an agent (/live, /stats, /stats/export, /agents/<user_id>/<action>, /overview): queues.supervise settings and agents (PUT /voice/queues/<team_id>), switching the queues on (PUT /voice/queues/enable): queues.manage
music on hold (/voice/moh, tracks /voice/moh/tracks*, playlists /voice/moh/classes*, choice /voice/moh/settings, /voice/moh/numbers/<id>) voice.use (the free library of the platform, the tracks and playlists of the organization, the choice) voice.routing
/voice/provision (the user's SIP account), /voice/my-endpoints (their endpoints: do not disturb, forwards, follow me), /voice/call-info, the recording set from the app (/voice/call-info/recording*), the directory (/voice/directory) and the upload of a diagnostics report (POST /voice/diagnostics) the user themselves (voice.use, except /voice/provision), for the endpoints assigned to them the user themselves
devices of the mobile app: POST /voice/devices (SIP account of this installation), DELETE /voice/devices/<installation_id>, GET /voice/my-devices the user themselves the user themselves
devices of an endpoint (GET /voice/endpoints/<id>/devices); disabling or enabling a device (PUT /voice/devices/<id>) voice.endpoints its user, or voice.endpoints in an organization where the user has an endpoint

Call queues. A team can also take calls (a call queue; the API says queue): GET|PUT /voice/queues/<team_id> sets settings (strategy ringall, leastrecent, fewestcalls, random, rrmemory, linear, wrandom; delays; announcements; overflow) and agents ([{user_id, penalty}]: the agents of the team, a priority per team, a member may be an agent of several teams; the member's messaging team does not change). An agent logs in (POST /voice/queues/login {endpoint_id?}), pauses (pause {reason}), resumes (unpause) or logs out (logout); their state (logged_out, available, paused, ringing, in_call, wrapup) is in GET /voice/queues. The voice server reserves one free agent per call (never two calls at once), rings them like an extension (devices of the app included), applies the wrap-up and the overflow. Supervision: GET /voice/queues/overview, GET /voice/queues/<team_id>/live, GET /voice/queues/<team_id>/stats?from&to, POST /voice/queues/<team_id>/agents/<user_id>/login|logout|pause|unpause. The routing of a number accepts action: queue with team_id; a flow step {action: "queue", team_id} too. Billing: to come (decision D25 of the Telma billing reference).

Queue by queue, wrap-up and statistics of the agents (2026-10-30). login, logout, pause and unpause accept team_id: this queue only (a queue the user serves, else 400 field: team_id). Without team_id, the action applies to all their queues, as before (the mobile app 1.6 uses it; unpause without team_id also resumes the pauses of single queues). login {team_id} of a logged out agent logs them in to this queue only; logout {team_id} of their last queue logs them out; unpause {team_id} during a general pause resumes this queue and leaves the others paused, with the same reason. Each queue of GET /voice/queues carries status and pause_reason (the user in this queue) and wrapup_seconds; the agent carries pause_requested (a pause asked during a call, applied by the voice server when the call ends, instead of the wrap-up) and wrapup_until. POST /voice/queues/ready ("Ready") ends the wrap-up at once (nothing changes outside a wrap-up). A supervisor passes scope: queue | all (default all) and reason to POST /voice/queues/<team_id>/agents/<user_id>/<action>; GET .../live carries, for each agent, queue_status, queue_pause_reason and queue_since (the agent in this queue; counts counts them). Each change of state made by the web server emits queue_agent to the agent (see the real-time events). GET /voice/queues/<team_id>/stats adds, for each agent of agents, offered, refused (BUSY), no_answer (except CANCEL, the caller hanging up while it rang), average_talk_seconds, connected_seconds (logged in to this queue, pauses included), paused_seconds, pause_by_reason, wrapup_seconds; hours (24 rows {hour, received, answered, abandoned, overflowed, average_wait_seconds}, time zone of the team), timezone, times_since (first event of the log that carries the whole state of the agent; the times before are incomplete, null: none). GET /voice/queues/<team_id>/stats/export?from&to&part=agents|hours: the same as CSV (UTF-8 with BOM, seconds as numbers, one column per pause reason).

Queue calls nobody took (2026-10-29). The queue answers the call before the wait, so the voice server writes the outcome on the call itself: queue {team_id, team_name, state, exit_reason, wait_seconds, missed} in GET /voice/calls and GET /voice/calls/<id> (null for a call that went through no queue). A call no agent took (the caller left while waiting: state: abandoned; overflow to a hang up, out when the last agent left, an overflow to a ring group, a flow or an external number nobody answered: state: overflowed) has queue.missed: true, status: missed and disposition: "NO ANSWER": it counts in the missed calls (missed_call push, status=missed filter, statistics) and in the callbacks of GET /dashboard/todo. The agents of the queue (memberships.queues) see those calls as the ones of their extensions (they are the ones who call back). An overflow to a voicemail box stays status: voicemail. The agents rung without answer are never extra calls in the lists. An agent in "do not disturb" (PUT /auth/me/dnd, or the DND of their extension) is not rung by their queues, as when paused.

Calls received while a flow is closed

2026-10-30. Outside its hours, a flow plays its closed menu (or closed_step). A call that hears it and hangs up without leaving a message and without being transferred to someone who answers is a missed call "received while closed": the voice server writes it disposition: "NO ANSWER" (the network stays counted answered for billing), and the call carries closed {flow_id, flow_name, missed: true} in GET /voice/calls and GET /voice/calls/<id> (closed is null for a call that went through no closed flow; missed: false when it left a message, status: voicemail, or was taken, status: answered). It counts in the missed calls (status=missed, statistics), the new filter status=closed keeps only them, and it is in the callbacks of GET /dashboard/todo with kinds: ["closed"]. No missed_call push while closed: one closed_digest push when the flow opens (see Team hours). The call_update event leaves at once. Why: a call received after hours is a contact to call back, even without a message. The other rows of the same call (an extension rung without answer in the closed menu) are never extra calls.

"To do" of the dashboard (2026-10-29). GET /dashboard/todo gives actions, callbacks and counts {actions, callbacks, total}; an action "call back" of a call or a voicemail message of a number to call back is in callbacks[].actions, not in actions (once); kinds may hold queue (a queue call nobody took) or closed (a call received while a flow was closed, 2026-10-30). GET /dashboard/todo/count gives counts only (the badge of the menu). POST /dashboard/callbacks/handled also marks listened the voicemail messages of that number the user hears and ticks its "call back" actions (last 30 days; voicemails_listened, actions_done in the answer); DELETE puts them back.

Colleagues in a meeting or on a pause (2026-10-29). Each colleague of GET /voice/colleagues also carries in_meeting, meeting_since (a video meeting in progress) and queue_paused, pause_reason (an agent of the queues on a pause); they stay transferable. The MCP tool live_activity gives colleagues (name, short number, state, reach, do not disturb, meeting, pause), nothing of the calls.

One presence (2026-10-30). One computation (services/presence.py) gives the state of each member, in one shape presence {state, since, until, label, reason, status}, in GET /voice/colleagues (each colleague), GET /team-chat/presence and /team-chat/members (next to the former state), GET /voice/queues/<team_id>/live (each agent, read only), GET /auth/me/presence and the event presence_update. state, by precedence: in_call (since the answer), ringing, in_meeting (video meeting), dnd (until), absent (manual status: until, reason = its kind away|meeting|travel|custom, label = its text), paused (a pause of the call queues of THIS organization, reason = the reason), unreachable (a phone account, nothing would ring, connected), free, offline. status = the manual status in every state (or null). Why this order: the facts (call, meeting) before the declarations, what changes the fate of a call (do not disturb) before what informs (status, then pause). The former fields (state, dnd, in_meeting, queue_paused…) stay for the app 1.6; the colleagues are sorted by the one presence. reach "push" only counts a token that really wakes the app for a call (PushKit on an iPhone, a live FCM token on Android).

Reception (2026-10-30).

  • A colleague's voicemail: each colleague of GET /voice/colleagues carries voicemail_target (tv<endpoint id>, null when their extension has no usable box: extension box enabled and the voicemail_boxes capability). A transfer (REFER) to this target sends the caller to the extension's box; the voice server resolves it in the organization of the transferring extension only (no box: the extension rings as by its short number).
  • Parked calls: a blind transfer to park holds the call in the first free slot of the organization (1 to 20). GET /voice/parked?organization_id (same access as GET /voice/colleagues: an extension and voice.use, never an API key) → {organization_id, parked: [{id, slot, code (\*7<slot>, to dial from a phone), state (parked, claimed, ringing, returning), caller {number, name, contact_id}, parked_by {user_id, name, extension, mine}, parked_at, parked_seconds, return_at, returns, taking {user_id, name, mine} | null}], settings {return_seconds}}; the same list is in GET /voice/colleagues (parked) and GET /live (parked). POST /voice/parked/<id>/pickup {organization_id?, web_phone?} claims the call for you (the voice server rings the web_phone tab, which answers by itself (SIP header X-Telma-Pickup: 1), else your extensions of the organization) → {parked}; 400 field: web_phone (not a tab of yours), 404 not_found, 409 parked_call_busy (someone is taking it, or it rings back the one who parked it). GET|PUT /voice/parking/settings {return_seconds} (30 to 1,800, 180 by default; voice.routing, journalled): the delay before the call rings back the one who parked it. Read again on voice_presence. GET /voice/parked?mine=1 keeps only the calls you parked (parked_by.mine), the most recent first (400 field: mine for a value other than 1, true, 0 or false). For the app: after the REFER to park, read GET /voice/parked?mine=1 again and show the first one (slot and code). The voice server writes the slot when the call reaches it, usually less than a second after the REFER is accepted, then sends voice_presence {organization_id}: read on that event, or again a second later. Still empty: the call was not parked (all 20 slots are taken, it rings you back).
  • Recorded: GET /voice/my-live-calls → calls [{id, call_id, direction, state, recording, accounts (your SIP accounts in the call, the one that places it, talks in it or rings for it:wb…a tab,dv…the app, an extension's name), started_at, answered_at, duration_seconds}]: your calls in progress and whether they are recorded now (rules of the number, the extension, the organization, a Telma AI plan). call_id is the value to pass as is in call_id of POST /team-chat/phone-messages (and wherever something is attached to the call): the id of the call record when one is written already (a part of the call that ended, one you see), else live-<id> while no record exists (the voice server writes it when the call hangs up); never null. Example: {"calls": [{"id": "3f9c0e…", "call_id": "live-3f9c0e…", "direction": "inbound", "state": "talking", "recording": true, "accounts": ["dv5c1e0a9b42"], "started_at": "2026-10-30T15:02:11Z", "answered_at": "2026-10-30T15:02:15Z", "duration_seconds": 84}]}. Each call of GET /live also carries recording; the state parked (step step.slot, step.code) joins the states. “Don't record my next call”: the routes of the app, GET /voice/call-info and PUT /voice/call-info/recording/skip-next.
  • A message taken for a colleague: POST /team-chat/phone-messages {organization_id?, for_user_id, from_name, number, text, callback, call_id, contact_id} (every member, 60 per minute; number required with callback; call_id = the id of a call record of the organization or the live-<id> of a call in progress from GET /voice/my-live-calls, or of a call that just ended; unknown = 400 field: call_id) → 201 {phone_message: {id, organization_id, for_user_id, by_user_id, by_name, from_name, number, text, callback, call_id, contact_id, thread_id, created_at, handled_at}}: the card reaches the colleague as a message of your one-to-one conversation (team_message, push), with phone_message {id, for_user_id, from_name, number, callback, contact_id, call_id} in the message (null for an ordinary message). GET /team-chat/phone-messages?box=for_me|by_me&handled&limit, PUT /team-chat/phone-messages/<id> {handled} (the recipient only). With callback, it is a callback of GET /dashboard/todo for the recipient only: kinds holds message, refs {phone_message_id, thread_id}. Event todo_update {reason} to the user when their “To do” changes so. A message taken with a live-<id> whose record is not written yet has call_id: null; the server attaches the record as soon as it exists, at the next read (GET /team-chat/phone-messages, messages of the conversation: phone_message.call_id).
  • One missed call per call: an inbound call row carries ring {taken, missed, attempt} when the call rang several phones (a group, the devices of an extension, a follow me): one row ring.missed when nobody took it, the others ring.attempt, which the API counts nowhere (lists, missed calls, callbacks, statistics), as queue.attempt and closed.attempt.

Music on hold. GET /voice/moh gives the free library of the platform (author and license of each track), the tracks and playlists of the organization, its choice and that of its numbers. An uploaded track ( POST /voice/moh/tracks, multipart) requires rights_confirmed: true (broadcast rights: who and when are kept); a playlist (/voice/moh/classes) gathers tracks of the library and of the organization. The choice (PUT /voice/moh/settings {class_id, ringing}, PUT /voice/moh/numbers/<id> for a number, null = the organization's): the playlist played when an extension holds the call and, with ringing: true, instead of the ringback tone while phones ring; without a choice, the default music of the platform. From an extension, 602 plays the music of the organization.

Audio formats. All stored audio is MP3: the sounds (uploaded as wav, mp3, m4a, ogg or webm, recorded in the browser or made by text-to-speech, converted at their creation; original_extension keeps the format received), the music on hold, the voicemail messages and the call recordings.

History of an endpoint (app). GET /voice/calls?endpoint_id=<id> only gives the calls of that endpoint (made, or that rang it); the endpoint must be assigned to the user (404 otherwise, whatever their permissions). Each call then carries mine {direction, number, name, answered}: the call as the endpoint lived it (outbound or inbound, who is at the other end, and whether this endpoint answered it).

Recording from the app. The user sets the recording of the calls their endpoint makes (PUT /voice/call-info/recording?endpoint_id= with {enabled}). The organization can impose it on outbound calls with GET|PUT /api/v1/domains/<id>/organizations/<id>/voice-recording ({outbound_always, outbound_follows_number, recording_skip_allowed}, domain or platform admin, off by default): its rules then win over the endpoint's setting. When the recording is imposed and recording_skip_allowed allows it (the default), PUT /voice/call-info/recording/skip-next?endpoint_id= with {skip} skips the recording of the next outbound call only (valid 15 minutes, used once); otherwise 403 recording_skip_not_allowed, or 409 recording_not_imposed when nothing imposes it. GET /voice/call-info gives recording_detail (endpoint, imposed_by, skip_allowed, skip_next). These changes are journaled.

Standard prompts (call flows). The play and menu steps of a flow accept, instead of a sound of the organization (sound_id, which wins when given), system_sound: 1 to 6 prompts of the voice server played one after the other, each a name of the catalogue GET /voice/system-prompts (the prompts offered with their fr and en text; another name gives 400 validation_error, field = steps[i].system_sound), fr: or en: before the name to fix its language, or an object {name, only: ["fr"]} played only when the call is in one of these languages. GET /voice/system-prompts/<name>/audio?language=fr|en plays a prompt (catalogue only). The dial and groupdial steps accept wait (ring or music: ringing or music on hold while the endpoints ring; absent, the number's setting), and the menu step extension_dial: true (the caller dials the short number of an endpoint of the organization; a key of the menu wins).

Dial by name (call flows). The step {action: "directory"} lets the caller type on the keypad the first letters of the first name or the last name of a member (2 = ABC … 9 = WXYZ, three keys at most, # to end sooner). The members found are offered one at a time, their name spoken by the text-to-speech: 1 rings the member's extension (its settings, then its voicemail box, then the on_fail step of the step when it has one), 2 the next name, * a new search. The directory = the members of the organization who have an enabled extension, one per member. After three searches that find nothing, the flow goes on with the next step. It goes in the steps of a flow or behind a key of a menu ("For the directory, press 9").

On-call lines (call flows). An on-call line (GET|POST /voice/oncall/lines, GET|PUT|DELETE /voice/oncall/lines/<id>, permission voice.routing) gathers clients (each with its access code of 4 to 10 digits, never returned by the API: code_length only), technicians called in order (attempts, ring_seconds, pause_seconds, accept_seconds), the number that sends the texts (sms_number_id) and the people to text. The step {action: "oncall", line_id, on_fail?} of a flow makes it reachable: code, name and emergency, technicians (1 takes the call, 2 passes it to the next one), else a message and a text to each one; on_fail is used when the code is refused or the line is disabled. A line a flow names cannot be deleted (409 conflict with used_by). The emergencies: rotation (calendar: every week | day, start, handover, timezone) and overrides (replacements) give the order of the technicians; the line returns on_duty and upcoming. An active line is billed at the oncall_line price of the grid ($39 a month). GET /voice/oncall/calls (filters line_id, from, to, status, client_id, technician (their number), hours = business | after), GET /voice/oncall/calls/<id> (attempts, timeline, texts), GET /voice/oncall/calls/<id>/audio/identify|message, GET /voice/oncall/stats, GET /voice/oncall/calls/export (CSV); reading with voice.routing or voice.calls.all. The answer “1 1042” of a recipient to the number that texted them takes the emergency (the first one wins) and never becomes a conversation; the link of the text (/u/<token>) opens a page without sign-in that expires after link_hours.

One SIP account per device. Each installation of the mobile app asks for a SIP account of its own with POST /voice/devices (installation_id: a stable id drawn by the app, platform: ios or android, app_version) and keeps it registered; the answer gives device {id, name, installation_id, platform, app_version, enabled, sip {server, port, transport, srtp, username, password, display_name}}. The same installation_id gets the same account back; when it changes user, the password changes. 404 no_endpoint: the user has no endpoint; 403 device_revoked: the device was disabled and only PUT /voice/devices/<id> {enabled: true} enables it again. The app also passes device_id = installation_id to POST /push/register, so that the server waits for this device after a call notification. A call to an endpoint rings its own account (when registered) and the devices of its user together; a device rings for every endpoint of its user and calls as one of them (SIP header X-Telma-Poste: SIP name of the endpoint; an endpoint that is not the user's is replaced by their first one). The history files these calls under the endpoint. Number presented (2026-10-30, as the web phone): the INVITE of a device may name the number it presents in the SIP header X-Telma-Number (the id of one of the numbers GET /contacts/<id>/reach gives under voice); the voice server applies it only when it is in the list POST /voice/devices writes on the account of the device (the numbers of the user's teams, those routed to their endpoints and the one their endpoints present, every voice number with voice.calls.all, in the organizations where they hold voice.use; computed again as soon as a team, a profile, a routing or an endpoint changes) and still a voice number of the endpoint's organization; otherwise it presents the endpoint's number. Never for a transfer. GET /contacts/<id>/reach gives voice and GET /voice/colleagues (transfer to a colleague, a group or a queue) answers as soon as the user has an endpoint and voice.use in the organization, without the webphone capability. GET /voice/my-devices and GET /voice/endpoints/<id>/devices list the devices with state: registered, push (reachable by notification), offline or disabled. DELETE /voice/devices/<installation_id> (the app signs out) disables it until the next POST /voice/devices.

Devices per endpoint. On the SIP credentials of an endpoint (desk phone, app older than device accounts), max_contacts limits the registrations at once: 3 by default (platform setting), 1 to 10 on an endpoint (POST|PUT /voice/endpoints, null = the platform's value); beyond that, the oldest registration is replaced. A call rings only one of these registrations: for several desk phones, one endpoint each, put together in a ring group.

SIP endpoints (/voice/endpoints*, /voice/my-endpoints*), provisioning and reading the diagnostics reports also need the sip capability (see Capabilities). GET /voice/call-info and POST /voice/diagnostics start from an endpoint assigned to the user, in any of their organizations (404 otherwise). All the personal routes (GET|PUT /voice/call-info*, GET /voice/directory, POST /voice/diagnostics, GET /voice/calls?endpoint_id=) start from such an endpoint (enabled, except for the history) and judge voice.use, voxos and sip in the organization of THAT endpoint, not in the current organization. The user also sets the recording of their endpoint with PUT /voice/my-endpoints/<id>/settings (recording), as from the app. The cost details of a call (billing.costing) never leave the API. API keys limited to a team and integration keys never reach /voice/*; the personal routes (/voice/my-endpoints*, /voice/call-info, POST /voice/diagnostics) refuse every key.

Voice security (anti-fraud). The voice server applies to every call to the public network (extension, forward, external member of a group, call code) the organization's limits, else the domain's: allowed countries (Canada and the United States by default), premium numbers refused, allowed hours for international calls (international_hours), loops, maximum cost of a call ($10), maximum duration (4 h), spending limit over a sliding window ($10 in 5 minutes) and 10 simultaneous calls. GET /voice/limits gives the organization what applies (limits) and outbound_suspension: null, or {reason, detail, at} when its outbound calls are suspended (reason: spend = spending limit, call_cost = a call reached the maximum cost, manual = an administrator, platform = the master switch). During a suspension, outbound calls are refused (call codes with 403 outbound_suspended); inbound calls go on. Only a domain or platform admin lifts it: POST /api/v1/domains/<id>/organizations/<id>/voice-outbound/resume (and .../suspend to suspend by hand, with an optional note; both are logged). Settings: GET|PUT /api/v1/domains/<id>/voice-limits (domain) and .../organizations/<id>/voice-limits (organization, empty = the domain's value). The events (type: outbound_suspended, call_cost_reached, call_duration_reached, refused_destination, refused_international_hours, refused_loop, refused_no_rate, refused_source, new_country, endpoint_locked, night_volume, platform_outbound_suspended, platform_outbound_resumed) are in GET /api/v1/domains/<id>/voice-security (with the suspended organizations) and, for the super admin, GET|PUT /api/v1/system/voice-security (the master switch outbound_suspended); each one is also emailed to the platform and domain admins (a suspension also to the members of the organization holding organization.settings), at most once an hour for the same organization and type. An extension may limit its outbound calls to networks (settings.allowed_networks, CIDR); after 20 wrong passwords in 10 minutes it is locked (locked {until, at, failures}) and POST /voice/endpoints/<id>/unlock frees it.

Call billing (E22; always on since 2026-10-27, F27). GET|PUT /api/v1/domains/<id>/voice-billing returns enabled always true (a stored value is ignored; default_rate, max_call_seconds, safety_margin_seconds and reserve stay adjustable). Every outbound call is rated after the call (periodic task) at the domain's rate: the longest prefix of GET|POST /api/v1/domains/<id>/voice-rates (+ /export, /import, /resolve, PUT|DELETE /<rate_id>), else default_rate, or the margin on the wholesale price (voice-pricing, mode margin). A rate carries rate_per_min, connection_fee, increment (1 to 3600 s, default 60) and min_seconds (0 to 3600: the first seconds always billed; at Telma 30 s then steps of 6 s; the whole price list downloads as a CSV file by /export and is sent back by /import): billed seconds = max(min_seconds, duration rounded up to the step). Without any price list (no rate, no default_rate, no margin), a call to a destination without a rate goes through, capped by max_call_seconds, and is not debited (billing.state not_billed, reason no_rate); once a price list exists, it is refused ( GET /voice/rating/max-duration and the call codes: allowed: false, reason: no_rate). The balance is only required for a call code (402 insufficient_balance) when the domain has a price list. The minutes included in the plan of the organization stay outside this rate (see "Plans (subscriptions)"). The negative-balance lifecycle ( GET|PUT /api/v1/domains/<id>/negative-balance) has its own switch negative_balance.enabled, false by default, and no longer depends on voice billing: off, a call the balance does not cover stays insufficient until a recharge; on, it is debited below zero and the lifecycle takes over.

Capabilities

A capability is a service a domain offers and an organization may use. An organization holds only a subset of the capabilities of its domain. A super admin or domain admin sets them with PUT /api/v1/organizations/<id>/capabilities (the list replaces the previous one); the domain's own are set with PUT /api/v1/domains/<id> (adding sip, call_codes, voicemail_boxes, transcription or mcp to a domain is reserved to the super admin). Every route that returns an organization or a domain (/organizations/current, /organizations/my, /domains/current...) shows the list.

Capability Opens
textos SMS/MMS messaging (stored name, from before Telma)
voxos the voice service (/api/v1/voice/*)
sip SIP endpoints (/voice/endpoints*) and softphone provisioning (/voice/provision); needs voxos
call_codes call codes (legacy, without interface: no app uses them any more); needs voxos
voicemail_boxes the voicemail boxes of the endpoints and the standalone boxes (/voice/mailboxes); needs voxos
transcription Telma AI: transcription and summary of the recorded calls (/voice/ai*, /voice/calls/<id>/ai*); needs voxos
call_queues the call queues (/voice/queues*, routing queue of a number, step queue of a flow); offered with voxos: every domain that has the voice has it (added by PUT /domains/<id> on its own when voxos is there, no super admin needed); the organization switches it on itself with PUT /voice/queues/enable (queues.manage); needs voxos
mcp the assistants (Claude and others) connected to the accounts of the members by the MCP connector of the domain (see Assistants); removing it disconnects every assistant of the organization (or of the domain)

An unknown name, or sip, call_codes, voicemail_boxes or transcription without voxos in the same list, is refused: 400 validation_error (field: capabilities). Without sip, the routes that need it answer 403 with {"error": "capability_required", "capability": "sip", "message": ...} (and voice_not_enabled without voxos). Removing sip from an organization disables its SIP endpoints; they are enabled again when sip comes back. The custom routing action of a number is only accepted for super admins and domain admins (403 forbidden for a member of the organization, even with voice.routing).

Administration context

POST /api/v1/organizations/switch writes the current organization on the user: it then holds for all their devices and tabs. To administer an organization without becoming a member, a super_admin or a domain_admin sends, on every request (JWT), the header

X-Admin-Organization: <organization_id>

For that request only, the user is seen as working in that organization: organization_id is the organization asked for, team_id is null, the platform permissions are kept. Nothing is written on the user, and one tab per organization is possible. The routes are the usual ones (/organizations/current, /teams, /users, /voice/*, /billing/*...). GET /auth/me, GET /organizations/current and GET /organizations/my add admin_context: true and admin_organization_id while the header is honored.

Case Answer
user who is neither super_admin nor domain_admin 403 forbidden
domain_admin and an organization outside their domains 403 forbidden
unknown organization or invalid identifier 404 not_found
request authenticated by an API key (any key) 403 forbidden
empty header, or request without a valid token ignored (the route answers as without the header)

Every write (POST, PUT, PATCH, DELETE) made with the header is journaled (collection audit_logs): user, organization, method, path, status and date, with no request body and no URL parameters. Successful reads (GET) are summed up in one entry per administrator, organization and quarter of an hour (admin_read, with the number of reads). Socket.IO has its own administration mode (auth.admin_organization, see Real time); the organization is judged with the domain of the host (X-Frontend-Host) like the rest of the API, so a super admin administering an organization of another domain sends the host of that domain.

GET /api/v1/organizations (super admin or domain admin; current domain) accepts q (free text searched in the organization name and in its owner's email address, ignoring case and accents, 100 characters at most), skip and limit (50 by default, 100 at most; an invalid value is a 400 validation_error). Sorted by name. The answer is {organizations, total, skip, limit} where total is the number of organizations after the filter. An account with platform_admin can add all_domains=true to search every domain: each organization then carries domain_id, domain_name and domain_host (without that permission: 403).

Account: sign-up, trial, deletion, notifications

Everything below is off or neutral by default and is set per domain with GET/PUT /api/v1/domains/<id>/account-settings (domain admin): the existing domains do not change.

  • Notifications: GET/PATCH /auth/me/notifications gives and changes what the account receives: email.updates, survey, purchase, login (an email at every sign-in, off by default), low_balance and its threshold low_balance_threshold (null: the organization's), push.sms, missed_call, voicemail. Security and service emails (password reset, verification codes, invitation, negative balance notices, end of trial, account deletion...) are always sent. All the code goes through should_notify(user, kind) (services/notification_preferences.py, which holds the catalogue of messages).
  • Do not disturb (the mobile app's switch): GET /auth/me/dnd gives {dnd: {active, until, set_at}}; PUT /auth/me/dnd {active, until?} turns it on or off (active a required boolean; until, with active: true, an ISO 8601 date and time with its time zone, in the future and at most 7 days away, or null / absent for no end; otherwise 400 validation_error with field active or until). JWT only. While it is on: no push for a new text message nor a missed call, the voicemail push arrives silent, and every extension of the account (in all its organizations) is in do not disturb; emails do not change. It ends by itself at until. The other sessions of the account get the Socket.IO event dnd_update. It is the same do not disturb on the web ("My state" menu of the header); the one of a single extension stays in the settings of the extension.
  • Manual status (2026-10-30): GET /auth/me/status → {status: {kind, text, until, set_at} | null}; PUT /auth/me/status {kind, text?, minutes? | until?}: kind away, meeting, travel or custom (text required, 80 characters; an optional detail otherwise), a REQUIRED end: minutes (1 to 20,160) or until (ISO 8601 with its time zone, or tomorrow_morning = 8 a.m. tomorrow in the time zone of the profile, else America/Montreal), 14 days at most (400 validation_error, field kind, text, minutes or until); DELETE /auth/me/status clears it. It clears itself at the end. It silences neither calls nor push (do not disturb does): it informs the colleagues, and the transfer warns without blocking. status in GET /auth/me; event status_update {status} to the other sessions, presence_update and voice_presence to the colleagues. A session or the assistant (MCP) of the user; never an API key; a session opened "as" the member may neither set nor clear it (403 impersonation_forbidden).
  • My state (2026-10-30, for the app): GET /auth/me/presence?organization_id=&installation_id= → presence (the one presence), dnd, status, queues (null without a queue served; else {queues, agent, pause_reasons}), extensions [{id, extension, label, enabled, registered, dnd, forwarded}], devices [{id, installation_id, platform, app_version, registered, push, can_ring, problems}] (no_push: the app rings only while open), web_phones [{id, open, opened_at}], reach, can_ring, problems (no_extension, dnd, forwarded, nothing_rings) and this_device (with installation_id: {installation_id, registered, push, can_ring, problems}, plus not_provisioned, disabled, no_push): the app shows "your calls cannot ring on this device" when can_ring is false.
  • Free preferences: GET/PATCH /auth/me/preferences, a small key/value store (50 keys, 8 KB) for the apps; a null value removes the key.
  • Deleting one's own account: DELETE /auth/me {password, confirm: true}. An account that is alone in its organization closes it with itself (refused with 409 balance_negative while the balance is negative); its numbers go back to the pool of the domain and its keys, integrations and SIP endpoints are closed. An account that shares its organization leaves it (refused with 403 last_admin for the last member holding members.admin in an organization that has other members). All sessions end. During the grace period of the domain (account_deletion.grace_days, 10 days by default, 0 to delete at once), signing in again with the password cancels the deletion; then the account is deleted for good. Refused to platform accounts and in the administration context.
  • Free sign-up: see Registration. Protections: captcha (provider set per domain), at most 5 accounts per client address and per day (only when that address is known, see Rate limits; otherwise a wide shared ceiling of at least 100 accounts per day and domain), email providers listed by the domain refused (403 email_domain_blocked), 10 attempts per hour and email address (20 per known client address). 409 email_in_use tells that an address has an account: the sign-up form needs it, the captcha and these limits bound the probing. Answers: 403 signup_disabled, 409 email_in_use, 400 captcha_failed, 503 captcha_unavailable, 429 rate_limited.
  • Free trial: GET /billing/trial gives the state, POST /billing/trial/activate {country, type?, area_code?, city?} gives the organization a number of the domain pool for trial.duration_days days (10 by default). It needs a verified phone (domain setting trial.require_verified_phone, true by default; one phone number opens one trial per domain). Four emails to the members holding billing.manage (halfway, 2 days, 1 day, end); at the end the trial numbers go back to the pool. Reaching trial.minimum_credit of balance converts the trial into a normal account. GET /organizations/current/status sums up the state of the account (active, suspended or trial).

Plans (subscriptions)

An organization holds one plan: a platform fee per month, a price per user per month, what is included and features. Nothing is blocked: what goes beyond the plan is billed, on the monthly statement or as it is used.

  • Grid of a domain. GET|PUT /api/v1/domains/<id>/plans (administrator of the domain or of the platform; no API key) returns and sets {plans [], prices {}, message_tiers []}. Until something is set, the default grid applies.
    • A plan: {key, name {fr, en}, active, platform_fee, user_price, voice (includes the phone system), included {messages, minutes_per_user, numbers, teams, widgets, queues, connectors, ai_hours_per_user, lines (calls at once of the organization), lines_per_user (one more for each user), recording_days}, features {video, team_chat, supervision, assistant}, prices {} (its own unit prices), message_tiers [] | null (its own price of a text beyond those included), wholesale {platform_fee, user_price} | null}. wholesale (what the domain pays the platform) is only read and returned for the platform administrator.
    • Default plans: essential $45 + $15 per user (500 texts, 1 team), team $45 + $25 (1,000 texts, 2 teams, 1 widget, call queues for 1 team, video, team_chat), performance $45 + $35 (1,500 texts, 3 teams, 1 widget, call queues for 3 teams, 1 connected app, 10 h of AI per user, plus supervision and assistant); all of them: 1,000 minutes per user, 2 lines plus 1 per user, 1 number, recordings kept 7 days. No plan is built in: a $0 plan is a plan like any other.
    • Default messaging plans, without the phone system (voice: false, user_price 0: unlimited users): messaging-essential $95 (1,000 texts, 1 number, 1 team), messaging-growth $195 (5,000, 2, 2), messaging-business $295 (10,000, 3, 3), messaging-enterprise $400 (15,000, 3, 3); all of them: 1 widget and 1 connected app. A plan may carry prices of its own: prices (here number and tollfree_number 10, widget 25) and message_tiers (here a single price of a text beyond those included: 0.045, 0.035, 0.030 or 0.025); they replace those of the domain for the organizations that hold the plan.
    • prices (unit prices, per month unless stated): number 5, tollfree_number 5, number_setup 0, tollfree_number_setup 20, number_port_in 20, tollfree_number_port_in 20, port_in_free_days 30, team 15, widget 35, connector 25, assistant_user 5, contact_center 35 (with contact_center_agents 3 agents included), contact_center_agent 7, fax 25, line 15, line_on_demand_day 2 (per day), extra_device 0 (a device of a user beyond the devices_per_user 3 included), minute_overage 0.02, tollfree_inbound_per_minute 0.03, call_increment_seconds 6, minutes_warn_ratio 0.8.
    • message_tiers: the price of a text by its position beyond the included texts, from $0.05 down to $0.035.
    • PUT: the plans list replaces the current one. A plan with the key of an existing plan is changed, a plan without a key is created, a plan left out is removed, unless an organization holds it or waits for it: 409 plan_in_use {plan, organizations}. active: false withdraws it, with the same refusal when it is held. Invalid value: 400 validation_error with field.
  • A subscription always exists. Every organization has a subscription, created on the cheapest active plan of its domain, over the period of its billing anniversary (from the anniversary day to the same day of the next month, brought back to the last day of a shorter month); nothing is debited before the next anniversary.
  • The organization's choice. GET /api/v1/billing/subscription (billing.view or billing.manage) returns plan (the plan held), pending_plan, since, period_start, period_end, plans (the plans offered, without wholesale), prices, message_tiers, overrides, seats (what is counted: users, numbers, teams, widgets, call queues and agents, connected apps, purchased lines...), usage {messages, messages_included, seconds, seconds_included} and lines. PUT /api/v1/billing/subscription (billing.manage) takes {plan, purchased_lines} (either or both): 400 validation_error with field (unknown or inactive plan, purchased_lines outside 0 to 1000 or under a plan without the phone system), 403 forbidden with field: burst_lines (the margin is set by the domain), 402 auto_recharge_required when what is chosen costs something a month and automatic recharge is off. Estimate: GET /api/v1/billing/subscription/estimate?plan=<key> (without plan: the plan held at the anniversary) returns {plan, lines, total, seats}.
  • Changing plan. A more expensive plan applies at once: the difference is debited pro rata of the time left in the period. A cheaper plan waits for the anniversary (pending_plan); taking the plan held again cancels the pending change.
  • User. Each active member of the organization, service accounts aside. An extension without a person costs nothing.
  • Monthly statement. On the anniversary day, the statement (invoices.kind = statement, debit subscription_monthly, once per period) counts the platform and user lines, then what is held beyond what is included: number, tollfree_number, team, widget, connector, contact_center (as soon as there are more call queues than the plan includes: the module, with its included agents) and contact_center_agent, fax (a number routed to fax is a fax service, not a number), line (purchased lines), extra_device; plus the lines of the other services: ai_plan (Telma AI plans of the extensions, "<Brand> AI — extension <name>"), retention (file retention), storage (file storage). A $0 statement is not issued. When the credit does not cover the statement, a catch-up recharge is tried first, then it is debited anyway: the balance may go below zero.
  • Text messages. Received and sent count the same: an SMS counts one unit per segment (a long SMS counts several), a text with a picture (MMS) a single one. A text sent then reported undelivered is not refunded. They are free up to included.messages for the whole organization, then debited one by one at the price of their tier (message_tiers), an SMS like an MMS. A text received beyond the included ones without credit is held until credit arrives.
  • Calls. Outbound calls to Canada and the United States are counted by slices of call_increment_seconds and free up to minutes_per_user × users (pooled), then debited at minute_overage; the members holding billing.manage are warned at minutes_warn_ratio. The minutes received on a toll-free number are debited at tollfree_inbound_per_minute; other inbound calls and internal calls are never billed. Outside the included minutes, at the domain's per-minute price like international calls: area codes 907 (Alaska), 808 (Hawaii) and 867 (Northern Canada), premium numbers and the territories of country code 1 (787 and 939, 340, 671, 684, 670). The minutes are debited after the call.
  • Telma AI. The transcript and the summary of voicemail messages are included in every plan, for every organization that has the phone system: nothing is counted nor debited. For calls, an extension takes an AI plan (PUT /api/v1/voice/ai/endpoints/<id>); an AI plan whose hours fit within included.ai_hours_per_user of the plan of the organization costs nothing (included: true in pricing.plans of GET /api/v1/voice/ai). The hours beyond those of the AI plans are debited as they are used.
  • Features of the plan. features opens video (video meetings), team_chat (messages between colleagues), supervision (live board of the call queues, supervisor actions, call listening; also opened by the advanced contact center) and assistant (connected assistant included). A route of a feature the plan does not include answers 403 plan_feature with feature. GET /api/v1/organizations/current returns plan_features.
  • Values of one customer. GET|PUT /api/v1/domains/<id>/organizations/<id>/subscription (domain administrator; automatic recharge is never required) takes {plan, overrides, purchased_lines, burst_lines}. overrides = {plans {<key>: {platform_fee, user_price, included, features, prices, message_tiers}}, prices {}}: the values given replace those of the domain for this organization only, wherever they price it; a value left out follows the domain. The plan touched carries overridden: true. Estimate: .../subscription/estimate?plan=.
  • Numbers. At the purchase (POST /api/v1/phone-numbers/acquire), only the setup fee is debited (number_setup, tollfree_number_setup); when a ported number arrives, only the port fee (number_port_in, tollfree_number_port_in; nothing for a request made during the first port_in_free_days days of the organization, counted from its billing anniversary date or else its creation: fees.free_until of GET /api/v1/phone-numbers/port/config, whose fees.port_price gives the price of a port asked afterwards). The number itself is on the statement when it goes beyond included.numbers. The prices of a number (GET /api/v1/phone-numbers/available, GET /api/v1/phone-numbers/<id>/prices) are {currency, setup, monthly}: monthly is the statement price of a number beyond those included.
  • Lines. A plan includes lines lines for the organization plus lines_per_user per user (2 and 1 by default; calls at once: an external forward counts as two). The organization may buy some (purchased_lines, 0 to 1000, line a month each on the statement; bought during a period, they are debited at once pro rata). Beyond, a margin of on-demand lines: 5 up to 10 users, 10 beyond, or the value the domain administrator sets (burst_lines). The channel limit = included + purchased + margin (source: subscription in GET /voice/limits), unless an administrator set one by hand. The on-demand lines are debited every day for the day before: min(margin, peak − included − purchased) × line_on_demand_day, subtype voice_line_on_demand; they are never on the statement.
  • Connected apps and assistant. A connected app installed when the statement is made (connected or reconnect) beyond included.connectors is a connector line. The connected assistant is included with the assistant feature; otherwise, assistant_user per user for each period in which they use it.
  • What is billed. GET /api/v1/billing/overview (billing.view or billing.manage) explains the organization's next invoice: kind always subscription, period = the anniversary period, and everything that is not debited as it is used, in dated groups (next.groups: subscription (the anniversary statement, ai_plan lines of the Telma AI plans included), ai_rounding (rounding of the extra hours), assistant (connected assistant estimated), unpaid (unpaid amounts waiting for credit); next.date null when there is nothing to count), detailed lines, usage and fixed charges already debited in the period, Telma AI hours, projection, last statement, last month; GET /api/v1/domains/<id>/billing-overview gives its summary per organization for a domain (one organization in detail: GET /api/v1/domains/<id>/organizations/<id>/billing-overview), and GET /api/v1/system/billing-overview per domain for the platform.
  • Credit position (F28, 2026-11-12). GET /api/v1/billing/credit-position (billing.view or billing.manage) tells where the organization's credit stands: state (ok, low = at zero or under the threshold of the active low-balance alert, negative = below zero or in grace, suspended = balance_state suspended, limbo or released), risk (0 suspended, 1 negative, 2 low, 3 not covering the next statement, 4 ok), balance, balance_state, low_balance, period, usage {spent, communications, projection, remaining}, next_statement {date, total} (the next of /billing/overview), covers_next (the balance, counted as zero when negative, pays the next statement), shortfall (what is missing), projected_shortfall (with the remaining projected usage of the period; never changes covers_next), auto_recharge {enabled, mode, threshold, amount, last_failure_at}, last_recharge null or {date, amount, kind} (manual = card, auto = automatic top-up, admin = credit granted; a promotional bonus is not one). For the domain (domain admin, super admin): each row of GET /api/v1/domains/<id>/billing-overview has credit (the same fields without currency, period nor usage; projected_shortfall always null) and the answer credit_states {ok, low, negative, suspended, short}; one organization in detail: GET /api/v1/domains/<id>/organizations/<id>/credit-position (404 not_found outside the domain).
  • Wholesale billing of the domains (F19, since 2026-10-27). The platform bills each reseller domain in parallel with what the domain bills its organizations. Every debit of an organization (a transaction of type usage, recurring, purchase or subscription; never a credit nor a refund) writes a wholesale charge of its domain in domain_charges {domain_id, organization_id, transaction_id (unique), subtype, retail, wholesale, at, period YYYY-MM}, without ever failing the debit. Wholesale price: a call priced by the margins (voice-pricing in mode margin) = the wholesale amount noted on the call (billing.costing.wholesale, written by the rating before the debit, wholesale_source: margin); a subscription statement (subscription_monthly) = the platform and user lines at the wholesale of the plan and each ai_plan line at the wholesale price of its AI plan, when there is one (the same fraction for a pro rata line), the other lines at the ratio; everything else (a call priced by the voice-rates table included) = retail × ratio. Domain settings settings.billing.wholesale {exempt, ratio}: exempt defaults to true for the platform's own domain (named telma), ratio from 0 to 1, 0.6 by default; an exempt domain has no charge. The task domain_statements (billing_tasks, hourly) issues once, for each non-exempt domain, the statement of the month that ended in domain_statements {domain_id, period (unique), total, retail, charges, by_subtype, status: issued}; nothing is debited anywhere. Routes: GET /api/v1/domains/<id>/wholesale (domain administrator: settings, month {period, retail, wholesale, count, by_subtype {subtype: {retail, wholesale, count}}} of the current month, statements [{id, period, total, retail, charges, status, created_at}] newest first), PUT /api/v1/domains/<id>/wholesale-settings (platform administrator; body {exempt, ratio}, the fields given only, 400 validation_error with field; journaled wholesale_settings_changed) and GET /api/v1/system/domain-billing[?period=YYYY-MM] (platform administrator: period, domains [{id, name, exempt, ratio, month {retail, wholesale, count}, last_statement}], totals {retail, wholesale}). The two domain routes are closed to every API key, like the rest of its billing.
  • Call report: cost, wholesale and retail prices (Coûts C6, since 2026-11-12). The rating writes on every priced call (debited, or free with talk time: minutes of a plan, zero rate) its three prices, billing.costing {cost, wholesale, wholesale_source, retail, trunk_id, table_id, prefix, currency}: cost = what the provider bills the platform (cost table of the outbound trunk, null when none covers the destination), wholesale = the call's wholesale charge for the domain (computed wholesale price, margin, or share of the retail price, ratio), retail = what the organization was debited. These details never go out to an organization. GET /api/v1/domains/<id>/call-costs (domain or platform administrator) sums them over a period (from, to: 366 days at most; default: since the 1st of the month) by organization (default), domain or destination country (group_by=destination), or lists them one by one (group_by=call, skip, limit), filtered by organization_id and destination (a prefix: 33, 1514): rows [{key, label, calls, billed_minutes, retail, wholesale, domain_margin, without_wholesale}], totals, truncated. The platform administrator also sees cost, platform_margin (wholesale − cost, over the calls whose cost is known), uncosted, and each call's trunk and cost table; the domain administrator never does. GET /api/v1/system/call-costs (platform administrator) gives the same report over every domain (domain_id for one; grouped by domain by default). /export on both routes returns the same report as CSV (UTF-8 with BOM; one line per group and a total line, or one line per call, 50,000 at most: 413 too_many_rows beyond). A call rated before this report counts with its retail price only (without_wholesale).
  • Billing reads (since 2026-10-25). GET /api/v1/billing, /balance, /usage*, /transactions (and /export), /invoices*, /info, /payment-methods and /payment-config require billing.view or billing.manage; POST /billing/check-balance and /billing/recharge/quote stay open to every member.

Telma AI: transcription and summary of the calls

With the transcription capability, the recorded calls of an endpoint that has a Telma AI plan are transcribed (the two voices apart when the voice server provides them), then summarized: summary, reason, actions and the organization's own criteria. "Telma AI" is the feature's name on the platform: at a reseller, the interface, the plans and the labels of the credit transactions (and the answers of the MCP connector) carry its brand name (for example "Résotel AI").

  • Plans per endpoint (PUT /api/v1/voice/ai/endpoints/<id> {plan: <key>|null}, the key of an offered (active) plan of pricing.plans of GET /api/v1/voice/ai, else 400 validation_error field: plan; an endpoint keeps a plan the domain no longer offers): debited from the credit at the start of each billing period (the organization's anniversary day, else the calendar month); given during a period, the remaining part of the price is debited and the same part of the hours opened; a dearer plan applies at once (the difference pro rata), a cheaper one or a removal takes effect at the next period (pending_plan, a key or none). Not enough credit (after the automatic recharge): 402 insufficient_credit when given; at a renewal the endpoint is suspended (its calls wait) until a credit arrives. GET /api/v1/voice/ai/endpoints/<id>/quote?plan= tells what a change would cost now.
  • Hours: the hours of the paid plans of the period make a reserve shared by the organization; each transcribed call counts its duration once; beyond it, the extra hours are debited at the price of their tier (GET /api/v1/voice/ai gives the domain's grid and the usage of the period; default grid: standard $9 for 10 h, pro $29 for 40 h, extra hour $1.50); a call whose extra hours cannot be paid waits (waiting_credit) and goes on by itself when a credit arrives. The total of extra hours of a period is rounded up to the domain's step (15 minutes by default). A call without conversation (voice menu, voicemail, silence) is not counted.
  • Context and criteria (PUT /api/v1/voice/ai/settings, and per endpoint in PUT /api/v1/voice/ai/endpoints/<id>): the endpoint's context is added to the organization's; its criteria replace those of the same key or drop them (disabled: true). A value is null when the call did not touch the subject. The vocabulary helps the transcription with names and jargon. POST /api/v1/voice/ai/preview tries unsaved settings on a call already transcribed.
  • Reading: voice.recordings (like the recording) reads everything: GET /api/v1/voice/calls/<id>/ai (transcript by segments local / remote / mixed), ai in GET /api/v1/voice/calls and its filters ai_state, ai_q, criterion. Search by meaning: ai_semantic=<a question in plain words> ("contacts unhappy about the delay") finds the calls whose summary means that, even without the same words, in any language: the closest first, each with ai_score (0 to 1), among the 5000 latest summarized calls of the period, 200 at most; 503 semantic_search_unavailable when the service does not answer. The user of an endpoint reads the summary of THEIR calls (placed by their endpoints or that rang them: ai in GET /api/v1/voice/calls, in GET /api/v1/activity, and GET /api/v1/voice/calls/<id>/ai without the transcript, transcript_allowed: false). POST /api/v1/voice/calls/<id>/ai/transcribe queues a call again, .../resummarize makes the summary again. GET /api/v1/voice/calls/last-summary?number=&endpoint_id= gives the last summarized exchange with a number (30 days): summary = the last summarized call (unchanged); since 2026-10-29 also messages (the last analyzed text conversation, teams the user reads), voicemail (the last summarized voicemail message they hear) and latest (the newest of the three, with source call|messages|voicemail); the app may show latest instead of summary.
  • Voicemail messages: a message left in the box of an endpoint that has a plan, or in the box of a number routed straight to such an endpoint, is transcribed (no summary) and counts in the hours like a call; transcript and ai_state in GET /api/v1/voice/voicemails and GET /api/v1/activity. Its notification waits for the text (90 s at most) and carries it.
  • « Summary ready » notification: push call_summary to the user of the endpoint when the summary of a conversation is ready, if they asked for it (push.call_summary of PATCH /auth/me/notifications, off by default).
  • Alerts on a criterion (alerts of PUT /api/v1/voice/ai/settings, permission voice.routing, 20 at most): a rule {criterion, value, recipients, email, push, enabled} tells chosen members when the summary of a call gives the criterion this value (yes/no and numbers compared as such, choices and dates regardless of case and accents, a text criterion when it contains the value): email (in both languages, in the name of the domain, with the criterion, the contact, the date and the link to the call, never the summary nor the transcript) and/or push and in-app notice (event call_ai_alert). Once per call and rule, even when the summary is made again. GET /api/v1/voice/ai gives the rules (settings.alerts) and, with voice.routing, the members who can receive them (members). Since 2026-10-30, a rule also watches the summaries of the voicemail messages and the analyses of the text conversations: sources (one or more of call, voicemail, conversation; a rule saved before has no such field and means all three) and when (always, or closed: only what is received while the team of the number is closed, or for a call one that reached a closed flow; a number without a team is never closed). The recipient must also be able to open the item: hear the message (rule of GET /api/v1/voice/voicemails), read the team of the conversation. The event call_ai_alert then carries kind (call, voicemail, conversation), href (the page to open) and voicemail_id or conversation_id + message_ai_id (since 2026-11-03, source fax: a received fax Telma AI read, kind: fax, fax_id, href /fax?fax=<id>; when: closed = the team of the fax number was closed when it came; the recipient must read the fax, fax.read and its team; a rule without sources covers it too); the push of a voicemail message or a conversation is data.type = "ai_alert" with kind and the same ids (the one of a call stays call_summary + alert: "1"). Why no summary in the email: it leaves the platform, may be forwarded, read on a lost device or by someone else; the text of a voicemail message or of a conversation may hold personal information. The email only says there is something to look at (criterion, contact, date, link); the details stay in the app, behind each person's rights.
  • Webhook: the call.summarized event of the integrations delivers the summary (without the transcript) to a third-party application; since 2026-10-30, voicemail.summarized and conversation.summarized do the same for the voicemail messages and the text conversations (see below).
  • After-call note (2026-10-30): note_draft {text, language} of GET /api/v1/voice/calls/<id>/ai = the note filled from the summary (reason, summary, actions with their deadline; labels in the user's language), null without a summary of a conversation. Nothing is saved: the client puts it in the note being written, the agent changes it then saves it with POST /api/v1/voice/calls/<id>/notes. Why never on its own: a note carries the name of its author, it must say what the agent checked, not what the model believed it heard.
  • Masking (option masking of the organization, on by default): card and social insurance numbers, and dates of birth (a date said about a birth or an age), replaced by « [masqué] » before anything is stored. The option health_masking (on by default since 2026-10-30: true when the organization never set it; a false set stays) also hides health information (illnesses, diagnoses, medications, treatments) and asks the summary to leave it out. Transcript and summary have the retention of the recording and go with it.
  • Email of a voicemail message (2026-10-30): the reason, the summary and the actions (with their deadlines) first, then the transcript, then the notice "Generated by … · may contain errors", the audio always attached; without a summary, the transcript alone. Both are masked with the current settings of the organization.
  • Prices of a domain: GET|PUT /api/v1/domains/<id>/ai-pricing (platform admin or admin of that domain); every price keeps a margin of at least 60 % over the platform's cost (limits in the answer, 400 validation_error otherwise). plans is a free list sorted by price [{key, name {fr, en} | null, price, hours, active, wholesale}]; on PUT it replaces the list (20 plans at most; key made of the French name when absent; name.fr required, except for standard and pro which, without a name, carry the brand label "<Brand> AI" / "<Brand> AI Pro"; active: false = no longer offered, the endpoints that have it keep it; the former shape {standard {price, hours}, pro {…}} is still accepted). A plan left out that an endpoint of the domain holds or waits for gives 409 plan_in_use {field, plan, organizations}. wholesale (wholesale price, 0 to 10,000 or null) is read and returned for the platform administrator only. GET /api/v1/voice/ai returns each plan with label (its name in the user's language, else the brand) and each endpoint with plan_label and pending_plan_label (also in GET /api/v1/voice/endpoints).

Telma AI on the texts

With the capability message_ai (included in Telma AI, nothing is billed), a conversation is analysed when it calms down (10 minutes without a message) or as soon as it is closed: ai {pending, summaries, nothing_to_summarize, failed} of GET /api/v1/conversations/<id>, each analysis {id, state, status, summary, reason, actions, actions_done, actions_due, actions_overdue, caller_name, criteria, criteria_labels, summary_language, since, until, done_at, trigger}; event conversation_ai_update to the team.

  • Failed analysis: failed {id, at} when the last analysis failed after its attempts and nothing waits; POST /api/v1/conversations/<id>/ai/<analysis_id>/retry (whoever reads the conversation) starts it again on the same messages (state: retry, 409 conflict when it has not failed).
  • Daily cap: at most message_ai_daily_limit analyses per day (UTC) and per organization (setting of the platform, PUT /api/v1/system/ai-settings, 500 by default, 0 = no cap); beyond it, the conversations of the day are not analysed (skipped, without an error for the agent) and the server log notes it once a day.
  • Draft answer: POST /api/v1/conversations/<id>/ai/draft (whoever may write in the conversation, the rule of POST /api/v1/sms/send) returns draft {text}, an answer proposed from the last messages and the last summary; nothing is sent nor kept. 409 nothing_to_answer when the contact wrote nothing, 429 rate_limited (same budget as the draft of a call), 502 provider_error / 503 unavailable when the service does not answer.

Telma AI on the faxes

With the fax_ai capability (needs fax; set on the domain by the super admin, then on the organization; included in Telma AI, nothing billed; 2026-11-03), every fax received on a fax number is read on the server (Tesseract OCR, French and English, 30 pages at most: the pages never leave the platform to be read), then summarized. Never a sent fax nor the copy printed on an adapter port.

  • ai in the fax object (GET /api/v1/fax, GET /api/v1/fax/<id>, fax event of GET /api/v1/activity): null (never taken), or {state, summary, reason, sender, fields [{label, value}], actions, actions_due, actions_done [booleans], actions_overdue, language, text_chars, error, done_at}. state: pending, processing, retry (tried again after 1, 5 then 30 minutes), done, failed (error: ocr_unavailable, ocr_failed, ocr_timeout, unreadable_tiff, no_document, provider_error), skipped (error: daily_limit, no_text, unavailable).
  • The text read is kept apart, masked like a transcript (cards, social insurance numbers, dates of birth; health when the organization asks): GET /api/v1/fax/<id>/text → {text, pages, pages_read, chars, read_at} for whoever reads the fax; never in a list, an e-mail, a webhook nor the search.
  • Actions: PUT /api/v1/fax/<id>/ai/actions/<index> {done} → {fax} (whoever reads the fax; the mark follows the text of the action); they go to actions of GET /api/v1/dashboard/todo with fax_id.
  • Real time: fax_ai_update {fax_id, ai} to the room of the team of the number.
  • E-mail of the fax: held until the summary, 120 s at most, then sent with what Telma AI read at the top (reason, sender, useful data, actions and deadlines, the "may contain errors" notice); the PDF is always attached. The push and the adapter port never wait.
  • Daily cap: fax_ai_daily_limit faxes read a day (UTC) per organization (PUT /api/v1/system/ai-settings, 200 by default, 0 = no cap); past it, skipped with error: daily_limit.
  • Also: the search in the summaries (source fax), the alerts on a criterion (source fax, see above) and the fax.summarized webhook.

Search in the summaries

GET /api/v1/ai/search (2026-10-30) searches everything Telma AI summarized in the current organization, in one list: calls, voicemail messages, text conversations, recorded meetings and (2026-11-03) received faxes, each with the rights of its own page.

  • q (words: each one must appear in the summary, the reason or the actions, regardless of case and accents; also the text of a voicemail message and, with voice.recordings, the transcript of the calls; newest first) or meaning (a question in plain words, 300 characters: the closest first, with score); sources (call,voicemail,conversation,meeting,fax, default: all the user may search), from, to, skip (500 at most), limit (50 at most).
  • Answer {results, total, sources, skipped, mode, skip, limit}; each result {source, id, at, direction, number, name, summary (excerpt), reason, actions, score?, matched_in, …} with what opens it: call_id, voicemail_id, conversation_id + message_ai_id + team_id, meeting_id + recording_id, fax_id (+ sender, pages). skipped lists the sources the capability of the organization or the rights of the user close (not_allowed).
  • Rights: calls = voice.recordings reads everything, else voice.use reads the summaries of the calls of their own endpoints; voicemail = the messages they hear; texts = the teams they read (messages.read); meetings = the host, voice.recordings, a member who took part; faxes = those of the teams of the fax numbers where they hold fax.read (the text read is never searched: the sender, the summary, the reason, the actions and the useful data). Capabilities: voxos + transcription (calls, voicemail), message_ai (texts), video (meetings), fax + fax_ai (faxes).
  • By meaning: a vector is computed when each summary is made (voicemail messages, text analyses and meetings since 2026-10-30, like the calls); those of the last 90 days made before are taken in little by little (50 a minute when the worker has nothing else to do). Same budget as ai_semantic: 30 a minute per user, 600 an hour per organization (429 rate_limited); 503 semantic_search_unavailable when the service does not answer.
  • Why one search: people look for a contact or a subject, not for a kind of exchange; the pages keep their filters (/calls by words and by meaning, GET /api/v1/video/recordings).

Video meetings

Capability video (needs voxos, granted to a domain by the super admin, then to the organization), included with the Voice. The media go through a LiveKit server, never through the API: the API keeps the meetings, their guests, chat and recordings, and hands the browsers and the app the token that lets them in (POST /api/v1/video/rooms/<id>/token: {url, token, identity}, for livekit-client, 15 minutes to connect). Without a LiveKit server configured, the routes answer 503 video_unavailable; without the capability, 403 capability_required (capability: video). Every /api/v1/video/* route is closed to API keys; a session « signed in as » a member and the « Administer » mode never get a token.

  • Meeting: instant (it starts when the host joins) or scheduled (scheduled_at, reminder 15 minutes before); an 8-character code for the guests' link (https://<host of the app>/r/<code>), a 6-digit phone_code to join by phone (a number whose routing or flow has the meeting action). States scheduled, active, ended, cancelled. Limits set by the super admin (10 participants, 3 hours, 5 meetings in progress per organization by default): 409 video_limit with limit.
  • Rights: video.host (the User profile has it) to start, schedule, invite, record and dial; a meeting is seen by its host, the members invited, those who took part and those who see every call (voice.calls.all); the host and the video.host members in the room moderate it.
  • Guests (no account): GET /api/v1/video/join/<code> (the meeting, without any internal id nor number), POST to ask to enter ({name, invite_token?, consent_recording}), then GET .../status every 2 seconds: the token only appears once admitted. A personal invitation (link with ?i=) enters without waiting, unless the meeting is locked; a recorded meeting requires the guest's consent.
  • Invitations: by text message (sent as POST /api/v1/sms/send by the member, billed, from a number of their teams, never to a contact who unsubscribed), by email (with an iCalendar invitation), by a link to share, or to a member (event video_invite and a notification of the app).
  • Chat: POST /api/v1/video/rooms/<id>/chat; each message is relayed into the room by the data messages of LiveKit (topic chat); the messages of topic room say {type: recording, on}, {type: locked, on}, {type: ending, at}.
  • Recording and Telma AI: audio only, one track per participant who consented; once stopped, Telma AI transcribes each track with the real name of the speaker, summarizes with the criteria of the organization (the chat as context), puts the actions in « À faire » (GET /api/v1/dashboard/todo, meeting_id) and emails the summary to the host; the hours are counted on the Telma AI plan of the host's endpoint (without a plan: can_record false, no recording). Retention: the one of the domain's call recordings.
  • Phone: POST /api/v1/video/rooms/<id>/dial has the meeting call a number (billed outbound call, from a number the member may present, countries allowed to the organization).
  • LiveKit webhooks: POST /api/v1/internal/video/livekit, signed by LiveKit (key and secret of the LiveKit API).
  • Activity: a meeting is a meeting event of GET /api/v1/activity; the history of a contact: GET /api/v1/video/rooms?contact_id=. Assistants: tools list_meetings, read_meeting, meeting_chat, meeting_join_info, search_meetings (through GET /api/v1/video/recordings), draft_meeting_follow_up, schedule_meeting, invite_to_meeting, reschedule_meeting and cancel_meeting (see below).

Assistants (MCP connector)

Steps for the user (claude.ai, the Claude app, Claude Code): Connect your account to Claude.

The MCP connector (Model Context Protocol) has one address for every domain, each domain under its name (domains.name): https://mcp.telma.ca/<domain>/mcp. A user connects an assistant there (Claude on claude.ai, the Claude app, Claude Code or another MCP client), which then reads their account with their rights. The connector carries the name of the domain (serverInfo, descriptions of the tools) and the consent is given on the web app of the domain, in its colours.

  • Enabling: capability mcp on the domain (super admin only) then on the organization, and permission mcp.use of the member's profile. Each function also has its mcp.* permission, on top of the usual permission (both are needed): mcp.messages.read (with messages.read), mcp.media.read, mcp.calls.read (with voice.use), mcp.call_summaries.read and mcp.transcripts.read (with voice.recordings), mcp.voicemail.read, mcp.metrics.read, mcp.billing.read (with billing.view), mcp.messages.send (with messages.send) and mcp.conversations.manage (with the permission of each action: messages.read to close, reopen or add a note, messages.send to name a contact, voice.recordings and mcp.call_summaries.read to mark an action done), mcp.meetings.manage (with video.host: schedule, invite to, move, cancel a video meeting), mcp.team_chat.read and mcp.team_chat.send (the messages between colleagues, without a usual permission: every member has them), mcp.activity.read (with activity.live: the live activity) and mcp.presence.manage (change one's status). The Admin profile has them all; the User profile has mcp.use and the reading of their own things, never writing.
  • Authorization (OAuth 2.1): every domain is its own authorization server, https://mcp.telma.ca/<domain>. The assistant finds it by itself (/.well-known/oauth-protected-resource/<domain>/mcp, /.well-known/oauth-authorization-server/<domain>), makes itself known by its metadata document (client_id_metadata_document_supported: its client_id is the https address of that document, on claude.ai or claude.com; the server fetches it, 5 KB at most, without following redirects, checks that its client_id is that address and that its redirections are allowed, then keeps it for the time of its Cache-Control, 24 hours at most) or, failing that, registers (POST /<domain>/oauth/register, public clients, redirections to claude.ai, claude.com, chatgpt.com, platform.openai.com (variable MCP_REDIRECT_HOSTS) or the local loopback; a registered client nobody connects with is forgotten after 7 days), sends the user to the /oauth/authorize page of the web app of the domain (usual sign-in, second factor included, choice of the organization, PKCE S256 required) and exchanges the code (POST /<domain>/oauth/token). Access token of one hour, refresh token of 30 days that changes at every use (an old one presented again disconnects the assistant); POST /<domain>/oauth/revoke disconnects.
  • One connection = one user, one organization, one domain. A token is only accepted on the connector of the domain that issued it. The connection only has the rights of the membership: never those of the platform (a super admin or a domain admin connects as a member), never the administration context nor a session opened as another member. It dies with the sessions of the account (password change, deactivation), when the user leaves the organization, and when the capability is removed; without mcp.use, it is refused (403 permission_required).
  • Tools: tools/list only shows the tools the connection may call (mcp.* permission, usual permission and capability of the organization: all three are needed). Every tool goes through the API, with the same filters and checks as the app; every call is logged (tool, outcome, duration, names of the arguments, never their values). The assistant never listens to the audio and never starts a transcription. The 46 tools:
  • Messages (mcp.messages.read with messages.read): list_conversations, read_conversation (without marking it read), team_hours (teams open or closed, time slots, closures, what happens to a text received after hours), conversation_actions (actions found by the AI of the texts, capability message_ai); view_media (mcp.media.read: an image of an MMS, shown to the assistant); send_message (mcp.messages.send with messages.send: SMS or MMS to one recipient, at most 20 per hour and 100 per day per connection); questionnaire_results (mcp.messages.read with numbers.manage: results of the SMS questionnaires).
  • Contacts (mcp.messages.read, each kind of content only with its permissions): contact_history (the thread of one number in the organization: SMS, calls, voicemail messages, notes, linked meetings, by date, paged by before), contact_card (name, conversations, latest exchanges, number of calls, notes; last_exchange as latest of last-summary, also on the first page of contact_history), search_contacts (address book: name, company, email, digits of a number).
  • Calls (capability voice): list_calls (mcp.calls.read with voice.use; queue {name, outcome, exit_reason, wait_seconds, missed} of a queue call, received_while_closed), list_voicemails (mcp.voicemail.read, with their text), callbacks_due (mcp.calls.read: missed calls and voicemail messages with no callback nor SMS sent since, the list of GET /dashboard/todo, services/followups.callbacks, kinds queue and closed), parked_calls (mcp.calls.read with voice.use: parked calls, pickup code, parking delay).
  • Call summaries (mcp.call_summaries.read with voice.recordings, transcription capability): search_calls (words, meaning, criteria), read_call (summary, actions, criteria, notes; transcript with mcp.transcripts.read), open_actions (without the actions done, due and overdue), call_trends (calls per value of a criterion, frequent reasons, callbacks asked for and not done, per endpoint or per number), search_summaries (one search, by words or by meaning, in the summaries of calls, voicemail messages, texts and meetings, each kind with its usual permission); draft_follow_up (mcp.messages.send and mcp.call_summaries.read: summary, actions, number of the contact, existing conversation, suggested sending number and language of a call; the assistant drafts the follow-up SMS and has it approved before send_message).
  • Management (mcp.conversations.manage and the usual permission of each action): set_conversation_state (close or reopen, messages.read), assign_conversation (take, hand over to a colleague or release, messages.send), add_note (note of a conversation, a call or a contact of the address book, never sent to the contact), name_contact (messages.send), mark_action_done (an action of the summary of a call, a voicemail message or a meeting, like PUT /api/v1/voice/calls/<id>/ai/actions/<index>, with mcp.call_summaries.read), mark_conversation_action_done (an action of the AI of the texts, capability message_ai), mark_callback_handled (voice.use: marks a callback handled, its voicemail messages listened and its « call back » actions done).
  • Video meetings (capability video): list_meetings, meeting_chat (the chat of a meeting) and meeting_join_info (link of the guests and phone code, to the host or a moderator only) with mcp.calls.read; read_meeting and search_meetings (recorded meetings by words, transcript with mcp.transcripts.read) with mcp.call_summaries.read; draft_meeting_follow_up (like draft_follow_up, for a recorded meeting and its contacts); with mcp.meetings.manage and video.host: schedule_meeting, invite_to_meeting (text, email or colleague; the text and the email count in the cap of send_message, a contact who opted out is refused), reschedule_meeting and cancel_meeting (a scheduled meeting only: DELETE /api/v1/video/rooms/<id>?scheduled_only=1).
  • Messages between colleagues (mcp.team_chat.read, mcp.team_chat.send): team_chat_threads, team_chat_read (without marking read), phone_messages (the messages taken for the user during or after a call) and team_chat_send (at most 30 per hour and 150 per day per connection).
  • Organization: statistics (mcp.metrics.read with metrics.team or metrics.all), queue_statistics (mcp.metrics.read with queues.supervise, call queue capability: per team, per agent, per hour, state of the agents), balance (mcp.billing.read with billing.view: balance, consumption, plans, Telma AI hours), live_activity (mcp.activity.read with activity.live: calls in progress, active conversations without their content, presence of the colleagues, parked calls; read only), set_status (mcp.presence.manage: the user's status and its end, never « do not disturb »).

The tools that act are announced as such (readOnlyHint: false): the client asks the user's agreement at each call. - Prompts (prompts/list, prompts/get): ready-made requests the user picks in their assistant, in their language, in the name of the domain. Each one is offered only when the connection may call the tools it needs, and its text only names those tools: callback_brief (argument number), weekly_promises and complaints_review (argument days, with the summaries of the calls), daily_recap (argument date), awaiting_reply, draft_replies (argument count; drafts, nothing is sent without the agreement of the user), meeting_follow_up (argument meeting_id; the follow-up of a recorded meeting, nothing sent without agreement). Prompts only write a request: they send nothing. Missing or invalid argument, unknown prompt: error -32602. - Resources (resources/list, resources/templates/list, resources/read): a conversation or a call to attach to a discussion, addressed as conversation://<id> and call://<id> (ids of the API). resources/list gives the recent conversations and, with the summaries of the calls, the recent summarized calls, by pages (cursor). Reading (application/json) is the one of the tools read_conversation and read_call, with the same rights; a resource that is unknown, of another organization or that the connection may not read answers -32002 ("Resource not found"). No subscription. Prompts and resource reads are logged like the tools. - Connections of the user: GET /api/v1/mcp/connections (their connected assistants, all organizations) and DELETE /api/v1/mcp/connections/<id> (disconnect). - Connections of an organization: GET /api/v1/organizations/<id>/mcp/connections (assistants connected by its members, with the member) and DELETE .../mcp/connections/<id>; members.admin in the organization (or the domain admin, the platform), never an API key. - Billing: the assistant is included for everyone when the plan of the organization has the assistant feature (Performance). Any other user pays a month (unit price assistant_user of GET|PUT /api/v1/domains/<id>/plans, $5 by default) for each billing period of the organization in which they used an assistant: debited from the credit when connecting, then at the first request of each new period; one month whatever the number of assistants or devices, nothing for a connection left unused. Never a debt: without enough credit (after the automatic recharge), the connection stays but every tool answers a payment_required error (structuredContent.error) until a credit pays the month. The consent page shows the price (price of each organization in GET /api/v1/mcp/authorize); the line « Connected assistant — user name » (subtype mcp_assistant_monthly) appears in the transaction history.

Default team

An organization works without any setup: it gets a default team (is_default: true, named "Équipe principale", or "Main team" when the language of its first user is English; the name can be changed freely) when it is created (sign-up, OAuth sign-in, POST /api/v1/organizations) or, for an older organization, when its first invitation is accepted. The account that creates the organization (sign-up, first OAuth sign-in) is placed in that team. The numbers the organization receives (POST /api/v1/domains/<id>/phone-numbers/<id>/assign) are put in that team, and a member invited without a team whose profiles do not give members.manage (the former agent role) joins it. An organization with several teams and none flagged as default keeps its numbers without team: a member holding numbers.manage assigns them with POST /api/v1/phone-numbers/<id>/assign.

Team hours, holidays and open_state

Since 2026-10-29 a team carries (GET /api/v1/teams, GET /api/v1/teams/<id>, PUT /api/v1/teams/<id>/hours, PUT /api/v1/teams/<id>):

  • business_hours: ranges {day, start, end, enabled?} (day 0 = Monday, start and end as HH:MM, end may be 24:00), several a day, 28 at most. A range whose end comes before its start runs past midnight: {day: 4, start: "22:00", end: "02:00"} is open from Friday 10 pm to Saturday 2 am. start equal to end is refused (400 validation_error, field: business_hours). The start is included, the end excluded; an older 23:59 means the end of the day. An empty list = always open (texts and the team's call queue).
  • closures: holidays and closures, the same shape as the closures of the call flows: [{start, end (YYYY-MM-DD), repeat: none|yearly|weekly, until, ranges: [["HH:MM","HH:MM"]], label}] (200 at most; 400 validation_error, field: closures). On those days the team is closed all day, or open only in ranges; a closure decides the whole date. yearly comes back every year from the year of start. Absent from a PUT = kept.
  • timezone: IANA time zone of the hours.
  • outside_hours_behavior: queue (notify the team) or reject (do not notify); either way the message received outside hours is kept and marked. The older value auto_reply is accepted and stored as queue, and a team that still has it is read as queue.
  • open_state (read only, computed by the server at each read):
"open_state": {
  "open": false,
  "always_open": false,
  "next_change_at": "2026-11-02T14:00:00Z",
  "timezone": "America/Montreal",
  "outside_hours_behavior": "queue"
}

open: open right now; always_open: no range nor closure; next_change_at: when it closes (if open) or reopens (if closed), in UTC, null when nothing changes in the next ~400 days (always open, or closed without any range). Ranges that meet at midnight make no change. The team's call queue reads the same rules on the voice server.

No push while closed, one digest at opening (2026-10-30). An SMS received while a queue team is closed ("Notify the team at opening") gets no push: it is kept, marked queued, and the Socket.IO new_message event, unread_update and the webhooks leave at once as usual. When the team opens again, each member who wants the push of texts (notifications.push.sms, not in "do not disturb") gets a single push: title = name of the team, body "3 texts received after hours" ("Marie Tremblay: 1 text received after hours" for a single conversation), data {type: "closed_digest", kind: "sms", team_id, count, conversation_id?} (conversation_id only for a single conversation). Only the messages still unread of conversations still open count. A missed call received while a flow is closed (closed.missed, see Calls) follows the same rule: no missed_call push, one closed_digest push when the flow opens (kind: "calls", count, flow_id, call_id?), to the users who see those calls and want the missed-call push. reject does not change: no push, ever. (From 2026-10-29 to 2026-10-30, the push left at once, titled "After hours · " with data.outside_hours: removed.)

Messages (GET /api/v1/conversations/<id>, webhooks) carry queued: true (received after hours, team told at opening) or rejected: true (received after hours, not notified), and automatic for a message sent on its own: welcome, outside_hours (the outside-hours reply), opt_out (STOP/START confirmation), widget (website widget), other (an older message sent by nobody), null when someone wrote it.

Person in charge, unread per member and shared calendar (2026-10-30)

Person in charge ("I'll handle it"). A conversation carries assignee_id, assignee_name and assigned_at (null when nobody handles it) in GET /api/v1/conversations, GET /api/v1/conversations/<id>, the Socket.IO events and the webhooks.

  • PUT /api/v1/conversations/<id>/assignee {"assignee_id": "me" | "<member id>" | null} → {conversation, changed}. Access = sending in the conversation (messages.send). The member must read the team of the conversation (400 validation_error, field: assignee_id); an integration's account cannot take me. Any member can take, hand over or release, even a conversation a colleague has: the person in charge informs, it never blocks. The same person again returns changed: false and announces nothing.
  • GET /api/v1/conversations?assignee=me|none|all|<id>: mine, the ones without person in charge, all (default) or those of a member.
  • GET /api/v1/teams/<team_id>/assignable → {team_id, members: [{id, name, teams [{id, name}], presence {state, since}}]}: whom a conversation of the team may be handed to (“Hand over to…”), exactly the members PUT …/assignee accepts (placed in the team or holding teams.all in its organization, active accounts, never an integration), you included, sorted by name, never the email; the same items as GET /team-chat/members. Readable by whoever reads the conversations of the team (messages.read and access to the team), no permission to manage it. 403 forbidden when you do not read the team, 404 not_found when it does not exist in your organizations.
  • Timeline: events of GET /api/v1/conversations/<id> gets type: "assigned", assignee_id, assignee_name (null = released), previous_assignee_id, previous_assignee_name, actor_name, cause (agent or reply).
  • Real time and webhooks: conversation_update / conversation.updated with change: "assigned" and assignee {id, name} (null = released), to the team room.
  • Team setting auto_assign_on_reply (boolean, PUT /api/v1/teams/<id>, false by default): a message sent by POST /api/v1/sms/send in a conversation without person in charge makes its author the person in charge (cause: "reply"), never an integration's account.
  • Closing keeps the person in charge; a reopening by a message from the contact keeps it too.
  • GET /api/v1/metrics/agents: each agent carries conversations_taken (conversations they became the person in charge of over the period).

Unread per member. Each member has their own read state. unread_count (lists, detail), GET /api/v1/conversations?unread=1, GET /api/v1/conversations/unread-count, GET /api/v1/organizations/unread-counts and the unread_update event give the user's unread messages. Reading a conversation (GET /api/v1/conversations/<id>, POST /api/v1/conversations/<id>/read, socket mark_read) marks it read for them only; the contracts of these routes do not change (POST .../read still returns {conversation} with unread_count: 0). conversation_update change: "read" goes only to the reader's user_<id> room (their other tabs and devices), with reader_id. unread_update also carries conversation_id and unread (the user's unread messages in that conversation). The conversation of new_message (team room) keeps the team counter ("read by nobody yet"): a client keeps its own unread_count and applies the one of unread_update. Pushes do not change. An integration's account reads the team counter, as before; the webhook conversation.updated read goes at the first reading, as before. A member who joins a team starts with nothing unread.

Shared calendar of a team and a flow. One source holds the hours, the other reads them:

  • Team: hours_source in PUT /api/v1/teams/<id>/hours and PUT /api/v1/teams/<id> = {"flow_id": "<id>"} (or {"kind": "flow", "id": "<id>"}), null = its own hours; absent = kept. Reading: hours_source {kind, id, name, missing} (null without link), effective_hours {business_hours, closures, timezone} (the hours followed, null without link) and hours_followers [{kind: "flow", id, name}]. open_state and the voice server read through the link. business_hours and closures stay its own, kept unused while the link exists; outside_hours_behavior and auto_reply_message stay the team's.
  • Flow: hours_source in POST|PUT /api/v1/voice/flows[/<id>] = {"team_id": "<id>"} or null. Reading: hours_source, effective_business_hours and hours_followers [{kind: "team", id, name}]. The closed menu and closed_step stay its own.
  • Conversions: a team range past midnight becomes two days of the flow; a team without range nor closure = flow enabled: false (always open); a flow not enabled = team without range (always open); its exceptions become one-day closures.
  • No chain: 400 hours_source_chained when the source follows something itself or when others already follow the hours of the one that wants to follow; 400 validation_error (field: hours_source) for a source of another organization or a personal inbox. DELETE of a followed flow: 409 hours_followed with followers; a deleted team frees the flows that followed it. A missing source (missing: true) = its own hours.

Inbound webhooks

Providers deliver inbound SMS to /webhook/provider/<provider>/<secret>, the inbound URL of an SMS provider account (one secret per account, shown with the account and regenerable). The message is routed to the team the destination number is assigned to in the phone number registry, or to the SMS application chosen for that number (see SMS applications). Each team keeps its own conversation thread per contact: a number reassigned to another team opens a new thread.

Where the SMS of a number go: a team, an extension or a questionnaire

Each number has an SMS action (sms_routing in the number object: {action}, {action, endpoint_id} or, for a questionnaire, {action, questionnaire_id, questionnaire_name, daily_limit}), the text-message counterpart of the routing of a call. It is set with PUT /api/v1/phone-numbers/<id>/sms-routing (permission numbers.manage, as for assigning a number to a team):

  • {"action": "team", "team_id": "..."}: the SMS go to a team of the organization (without team_id: the default team). This is the action of every number that never chose one. POST /api/v1/phone-numbers/<id>/assign also sets the team action back.
  • {"action": "endpoint", "endpoint_id": "..."}: the SMS go to the user of an extension of the organization, in their personal inbox ("My messages"). When the extension changes hands, the SMS follow its new user. The extension must be enabled and have a user who is a member of the organization (otherwise 400 validation_error, field: endpoint_id).
  • {"action": "questionnaire", "questionnaire_id": "...", "daily_limit": 500, "team_id": "..."}: a questionnaire answers by itself (see SMS applications); team_id chooses the team that sees its conversations (absent: the number's team stays; null: none).

The route is closed to API keys.

The personal inbox is a hidden team: kind: "personal" and owner_user_id in the team object, named after the user. It is not listed by GET /api/v1/teams (unless include_personal=true), counts neither among the teams of the plan nor on the statement, is not managed as a team (/api/v1/teams/<id> and its sub-routes answer 404) and is never the default team. Its user reads it (web and mobile apps) and, in the web app, so do the members who hold teams.all in the organization; the push notification of an inbound SMS goes to its user only. The number is put in it (team_id = the inbox): sending from it goes through POST /api/v1/sms/send with the team_id of the inbox. An extension deleted, disabled or without a user: the SMS stay in the last inbox; a number without one yet records nothing. Conversations already open stay where they are.

In a domain with automatic softphones ("number only" accounts), a number that arrives and whose calls ring the automatic softphone also gets the endpoint action towards it, when it carries SMS and nobody has chosen its SMS action yet: its texts go to the personal inbox of the holder, like its calls.

curl -X PUT https://api.telma.ca/api/v1/phone-numbers/<id>/sms-routing \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"action": "endpoint", "endpoint_id": "<extension id>"}'

Opting out (STOP)

A message that is only an opt-out word (STOP, ARRÊT, FIN, DÉSABONNER, UNSUBSCRIBE, END, CANCEL, QUIT; case, accents and punctuation ignored) opts its sender out of the number that received it; START, DÉBUT or UNSTOP opts them back in; AIDE, HELP or INFO asks for help. The message still arrives in the conversation, triggers no automatic text (welcome, outside-hours reply), and the sender gets a single confirmation, signed with the organization's name and billed like an automatic text. From then on, until they answer START:

  • POST /api/v1/sms/send to them from that number answers 403 recipient_opted_out (with number and opt_out), recording and debiting nothing; this holds for integrations and connected assistants too;
  • no automatic text (welcome, outside-hours reply, website widget) is sent to them;
  • GET /api/v1/conversations/<id> carries opt_out {opted_out, keyword, at} (null when they never answered one of these words).

A contact who opted out of one number can still receive texts from another number of the organization: the opt-out belongs to the pair (number, contact).

The provider webhooks from before the accounts (/api/v1/system/provider-webhooks, super admin, without a screen) also give a URL of this form and are still accepted.

These addresses are not subject to any rate limit: the secret of the URL authenticates the provider, and an inbound SMS is never refused by a counter.

Only the delivery webhook of the number provider (POST /webhook/numbers/<token>, set by the domain administrator) has a limit: 120 per minute (see Rate limits).

When the WEBHOOK_MIRROR_URL variable is set on the server, every delivery is replayed in the background to that URL (used to feed the development instance).

Sending limits of a number (sms_limit_reached)

Texts leave like those of one person to another (without a commercial sender registration): so that the carriers do not filter a number, each sending number has limits, counted on everything it sends on behalf of the organization (POST /api/v1/sms/send, hence the web, the mobile app, the integrations, the connected apps and the assistants, and the website widget):

limit.kind Default limit Window (limit.window)
recipients_per_hour 100 different recipients hour: the clock hour (UTC)
recipients_per_day 300 different recipients day: the day, Eastern time
identical_text_per_day 50 different recipients of the same text day

An account less than 14 days old gets half of these limits; the platform administrator can adjust them for an organization. "The same text" ignores case, accents, punctuation and spacing, but not digits. A recipient already counted in the window is never refused by it (a conversation goes on). Not counted: the automatic answers to a text received (welcome, after hours, STOP confirmation), the questionnaires by text and the verification codes.

Beyond, POST /api/v1/sms/send answers 429 sms_limit_reached, recording and debiting nothing, with the Retry-After header (seconds to the end of the window):

{
  "error": "sms_limit_reached",
  "message": "+15145550100 already texted 100 different people this hour: …",
  "limit": {"kind": "recipients_per_hour", "max": 100, "window": "hour", "number": "+15145550100",
            "resets_at": "2026-11-12T16:00:00Z", "new_account": false},
  "retry_after": 1800
}

Test error and limit.kind (stable), not message (translated by Accept-Language). Do not retry in a loop: wait for resets_at, or personalize the text for identical_text_per_day. Do not try to get around the limit by switching numbers. The obligations of the sender (consent, identification, unsubscribe) are in the guide.

SMS applications: questionnaire by text

What answers the texts a number receives is chosen per number, like the routing of its calls: PUT /api/v1/phone-numbers/<id>/sms-routing (permission numbers.manage), sms_routing in the number object.

  • {"action": "team"} (default): the conversation with the team of the number, its welcome text and its hours.
  • {"action": "questionnaire", "questionnaire_id": "…", "daily_limit": 500}: a questionnaire of the organization (/api/v1/sms/questionnaires) answers by itself. It is a quiz (graded answers, score) or a survey (scoring: false, answers recorded without grading). A text outside a game starts one (any text, or only one of the start_keywords): the intro and the first question go in a single text; each answer gets the correction and the next question, then the last text with the score. The questions of a game (draw) are drawn at random; a game without an answer expires after timeout_minutes.

Grading. An answer is compared to the accepted answers regardless of case, accents, punctuation and a leading article (“the”, “le”, “la”…), with a tolerance for small typos; an answer that contains the right one (“it's Michael Jackson!”) is right. A doubtful answer (a partial name, a large typo) goes to the AI of the platform when the questionnaire allows it (ai_judge, on by default) and the AI is on; without a quick answer from the AI, the approximate grading decides. The result of each answer says who graded it (judged_by: fuzzy or ai).

Supervision. The team of the number, if it has one, sees the conversations of the questionnaire (received and sent messages) marked app {kind: "questionnaire", id, name} in GET /api/v1/conversations (and app on each message), without notification nor unread count while the questionnaire handles them; the settings of the team (welcome, hours, outside-hours reply) do not apply. Hand-off: at the end of a game when handoff is true, or as soon as one of the handoff_keywords (for example AGENT) is received, the conversation becomes a normal one (unread, notified) and stays with the team while it is open; once closed, the questionnaire takes the number back. Without a team, the games are played and only the SMS log of the domain keeps them.

Opt-out and limits. The opt-out words are handled first (see above): STOP ends the game in progress. Each text the questionnaire sends is billed like any outbound text of the organization, and only when the balance covers it; a number sends at most daily_limit of them a day (500 by default, 1 to 10,000). A contact starts at most 10 games a day; the help text (a text that is not a start word) goes at most once an hour; two numbers of the platform whose applications would answer each other never write to each other in a loop.

Results. GET /api/v1/sms/questionnaires/<id>/sessions (state, pagination): score, answers given, right or wrong, hand-off; kept 180 days. A completed game also sends the event questionnaire.completed to the integrations that want it.

SMS provider accounts

An SMS provider account (sms_provider_accounts) holds the credentials of an account at an SMS provider and its own inbound URL /webhook/provider/<provider>/<secret>. It belongs either to the platform (/api/v1/system/sms-accounts, super admin: configured once and shared by the domains the super admin allows, PUT /api/v1/domains/<id>/platform-sms-accounts) or to one domain (/api/v1/domains/<id>/sms-accounts, domain admin: a reseller's own account).

The provider is chosen by the number: a number's provider_account_id (PUT /api/v1/domains/<id>/phone-numbers/<id>). A number without an account uses the provider settings of its domain (/api/v1/domains/<id>/sms-providers), as before the accounts existed: that legacy setting is no longer offered by the interface, except for a number that still uses it. A domain admin never sees the name nor the provider of a platform account: to them the account is only an id and the description the super admin wrote, and their numbers show the provider platform. The super admin picks the domains of an account from the account (PUT /api/v1/system/sms-accounts/<id>/domains) or from the domain (PUT /api/v1/domains/<id>/platform-sms-accounts). Numbers are added and removed in the inventory of their account (/api/v1/system/sms-accounts/<id>/numbers, /api/v1/domains/<id>/sms-accounts/<id>/numbers); a number assigned to an organization cannot leave it (409). A free number of a platform account changes domain with POST /api/v1/system/sms-accounts/<id>/numbers/move. A domain adds its own accounts only when the super admin allows it (PUT /api/v1/domains/<id>/sms-account-settings). The SMS log of a domain (GET /api/v1/domains/<id>/sms-logs) gives for each message the account of its number (provider_account_id) and its provider_description (the description of a platform account, never its name) and filters by account (account_id); the filter by provider type is for the super admin only.

Inbound, a message is only delivered to a number the account may serve: a domain's account never delivers to another domain's numbers (404), and a number bound to an account receives only through it. For a platform account and a domain that is not allowed, the message is delivered and logged while SMS_INBOUND_ENFORCE_PLATFORM_ACCOUNTS is off, and refused once it is on.

Text-to-speech

POST /api/v1/voice/sounds/tts creates a sound from a text (text, 1000 characters at most, language fr, en or es, optional voice and name); GET /api/v1/voice/sounds/tts tells whether it is offered, in which languages, with which voices and for which text length (available, languages, voices, default_voices, max_length, max_preview_length); POST /api/v1/voice/sounds/tts/preview (text of 300 characters at most, language, voice) returns the audio (WAV) and keeps nothing, to hear a voice before creating the sound. A text-to-speech service that is off or fails answers 503 tts_unavailable. The sound counts like an uploaded sound (same limits) and keeps its text and voice (tts {text, language, engine, voice}).

Two kinds of voices: the standard voice (voice: "piper", engine: piper, one per language, Piper; the French voice comes from the SIWIS French Speech Synthesis Database (University of Edinburgh, CC-BY 4.0), the English one from LJ Speech (public domain), the Spanish one from davefx (CC0)) and, when the platform offers them, the natural voices (engine: google, voice = their id, for example fr-CA-Chirp3-HD-Kore; French of Canada and of France, English of the United States and of the United Kingdom, Spanish of the United States and of Spain). Without voice, the default voice of the language (default_voices).

Voice trunks

SIP trunks follow the same principle. A platform trunk (/api/v1/system/voice-trunks, super admin) is configured once and shared by the allowed domains (PUT /api/v1/system/voice-trunks/<id>/domains or PUT /api/v1/domains/<id>/platform-voice-trunks); a domain admin only sees its id and description (platform_trunks of GET /api/v1/domains/<id>/voice-trunks). A domain adds its own trunks (POST /api/v1/domains/<id>/voice-trunks) only with the same permission as its own SMS accounts (own_accounts_allowed, else 403 own_accounts_not_allowed). A trunk has a direction: in and out, in only (outbound_enabled: false) or out only (inbound_enabled: false), never neither (400); without outbound_enabled, a registration trunk lets calls out and an IP trunk does not; a trunk that does not let calls out may name outbound_trunk_id, another trunk of the same owner that does, through which its calls and forwards leave (400 field: outbound_trunk_id otherwise). A number gets the voice with voice_trunk_id. The voice of a platform number (bound to a platform SMS account or trunk) is set by the super admin (PUT /api/v1/system/phone-numbers/<id>/voice): a domain admin who sends voice_trunk_id for such a number gets 403, they only assign it to an organization. For the numbers of its own accounts, the domain admin picks one of its own trunks (PUT /api/v1/domains/<id>/phone-numbers/<id>). A number that changes domain keeps a platform trunk allowed in its new domain, and the voice of a number without a trunk (static default platform trunk).

Integrations and outbound webhooks

An integration gives a third-party application (a CRM, a dispatch tool, ...) access to the teams an organization chooses to expose, and pushes the events of those teams to it. It is created under Settings → Integrations (permission integrations.manage, see the guide) or with POST /api/v1/integrations and a JWT (the /api/v1/integrations* routes refuse every API key), and consists of:

  • a name (80 characters at most), shown as the sender of the messages the integration sends;
  • the list of exposed teams (empty = every team of the organization, including those created later);
  • an API key (X-API-Key), shown once at creation and replaceable (POST /api/v1/integrations/<id>/regenerate-key: the old one stops working at once). It is a restricted key: it only sees the exposed teams, on every route (GET /api/v1/conversations without team_id included), with the rights of the User profile: read and send, no administration. Billing, the free trial, organizations, metrics, voice and push notifications answer it 403;
  • an optional outbound webhook: a public https URL, a signing secret (whsec_…, readable at any time, replaceable with POST /api/v1/integrations/<id>/regenerate-secret) and the list of delivered events (all of them by default).

The API key is shown only once, right after creation: copy it before dismissing the box. The API key is shown only once, right after creation: copy it before dismissing the box.

The key is held by a hidden service account: it appears neither among the members nor in the per-agent metrics (its sends count in the team totals), and cannot log in. Disabling the integration (enabled: false) stops both the key and the webhook without erasing anything. Deleting it revokes the key and erases the service account and the delivery log: the messages it sent lose the "via Mon CRM" mention and, without sender_name, show no sender at all. To stop an integration and keep the history, disable it.

Calling the API with the key

Send the key in X-API-Key, from your server. X-Frontend-Host is optional: when present, it must be the host of the web application of the organization's domain (app.telma.ca, or the one of your whitelabel site). With the host of another domain there is no error but no team either: lists come back empty (total: 0) and every route that targets a team answers 403.

The useful routes are in the SMS & conversations, Teams, Conversation notes and Uploads groups of the reference:

Route Use
GET /api/v1/teams the exposed teams and their id
GET /api/v1/teams/<team_id>/phone-numbers the numbers of a team
GET /api/v1/conversations open and closed conversations, most recent first (team_id, status, replied, q, number, unread, skip, limit)
GET /api/v1/conversations/<id> a conversation, its messages (most recent first) and its events; reading marks it as read
POST /api/v1/sms/send send an SMS or an MMS
POST /api/v1/upload upload an MMS attachment
POST /api/v1/conversations/<id>/close, .../reopen close, reopen
PATCH /api/v1/conversations/<id> name the contact of the conversation (contact_name, null to clear it)
GET, POST /api/v1/conversations/<id>/notes, PUT, DELETE .../notes/<note_id> conversation notes
GET /api/v1/media-proxy media of inbound MMS (the proxied_url of the events)

Pagination. Lists accept skip (0 by default, a negative value counts as 0, 2147483647 at most) and limit (50 by default, 100 at most: a larger value is brought back to 100, 0 or less to 1). A skip or limit that is not an integer, or a skip over 2147483647, gets 400 validation_error with field. GET /api/v1/conversations repeats skip and limit and gives in total the number of conversations, GET /api/v1/teams likewise with the number of teams, GET /api/v1/conversations/<id> the number of messages, GET .../notes the number of notes. Teams and notes are all returned when limit is absent (GET /api/v1/teams then repeats "limit": null).

Conversations. A conversation is open or closed: since 2026-10-14 closing is archiving (there is no separate archived state any more; POST .../archive is still accepted and closes the conversation, and the former archived ones became closed). A closed conversation carries the date of its closing, closed_at, and a message from the contact reopens it. GET /api/v1/conversations only accepts status=open or status=closed (empty = both); status=archived gets 400. The closed conversations of a team, filed by day of closing, are also in GET /api/v1/teams/<team_id>/archives (and .../archives/dates), which require messages.archive (Admin and Gestionnaire profiles), hence refused to a restricted key. replied=1 keeps only the conversations the contact wrote to at least once, replied=0 those waiting for their first answer.

Sending. An integration key has no team of its own: POST /api/v1/sms/send requires team_id or from_number (the number then names its team), otherwise 403. to is required, and so is body unless there are attachments; body is 800 characters at most, unless the domain sets another limit (400 validation_error, field: body, beyond it). A switched-off number (paused, inactive or without SMS) answers 403 number_disabled. sender_name (the person sending from your application) and external_sender (their identifier on your side), 120 characters at most, give the message sent_by_name = that person and sent_via = the integration name: Telma shows "Julie Tremblay via Mon CRM" above the bubble. Without sender_name, the sender shown is the integration. A refusal from the provider answers 500 send_failed; the message stays in the conversation with status failed, and sending it again creates a second one.

A message sent from the CRM on behalf of Julie Tremblay (“Julie Tremblay via My CRM”) and a conversation note written through the same integration, in the thread and in the Notes panel. A message sent from the CRM on behalf of Julie Tremblay (“Julie Tremblay via My CRM”) and a conversation note written through the same integration, in the thread and in the Notes panel.

Attachments (MMS). Upload the file first: POST /api/v1/upload as multipart/form-data, field file, 10 MB at most, extension jpg, jpeg, png, gif, webp, mp4, mov, mp3, wav or m4a. The 201 answer gives url, content_type and filename. Pass url as is in media_urls (a list of strings or of {"url": …} objects): any other URL is refused (400 validation_error), and the type recorded is the uploaded file's. The file is served without authentication (the provider must be able to download it), at an address that cannot be guessed.

Conversation notes. They are the team's comments, never sent to the contact (body of 4000 characters at most, when creating as when editing). A note sits in the timeline at its moment (anchor_at) or right after the message it comments (message_id). With an integration key, author_name carries the name of the person writing in the third-party application (otherwise the integration name) and external_author their identifier on your side. The key only edits or deletes the notes it wrote; check external_author on your side before letting a user change a note.

Closings and reopenings. Reading a conversation also returns events: every closing or reopening, in timeline order (type closed/reopened, cause agent = an agent or the integration, inbound = message from the contact, outbound = message sent in an archived conversation, before 2026-10-14 (a send in a closed conversation leaves it closed), actor_name, via, message_id of the inbound message that reopened it, anchor_at). With an integration key, POST .../close and .../reopen accept actor_name (the person acting in your application, 120 characters at most).

Example: curl quickstart

These commands are replayed as is by the Telma tests. The answers are real, shortened (…), with made-up identifiers. A contact wrote to the number of the "Sales" team, exposed to the "Mon CRM" integration.

export TELMA_API=https://api.telma.ca
export TELMA_KEY=txts_exemple0123456789abcdef   # shown only once, when the integration is created

1. The exposed teams and their numbers

curl -s "$TELMA_API/api/v1/teams" -H "X-API-Key: $TELMA_KEY"
curl -s "$TELMA_API/api/v1/teams/6710a0000000000000000001/phone-numbers" -H "X-API-Key: $TELMA_KEY"
{"teams": [{"id": "6710a0000000000000000001", "name": "Sales", "organization_id": "6710a0000000000000000040",
            "phone_number": "+15145550100", "timezone": "America/Montreal", …}],
 "total": 1, "skip": 0, "limit": 50}
{"phone_numbers": [{"number": "+15145550100", "label": "Sales", "capabilities": ["SMS", "MMS"]}]}

2. The open conversations the contact wrote to, then reading one of them

curl -s "$TELMA_API/api/v1/conversations?status=open&replied=1" -H "X-API-Key: $TELMA_KEY"
curl -s "$TELMA_API/api/v1/conversations/6710a0000000000000000002" -H "X-API-Key: $TELMA_KEY"
{"conversations": [{"id": "6710a0000000000000000002", "team_id": "6710a0000000000000000001", "team_name": "Sales",
                    "phone_number": "+15145550123", "team_phone_number": "+15145550100", "contact_name": null,
                    "status": "open", "unread_count": 1, "last_message_at": "2026-10-09T18:43:39.429000", …}],
 "total": 1, "skip": 0, "limit": 50}
{"conversation": {"id": "6710a0000000000000000002", "status": "open", "unread_count": 0, …},
 "messages": [{"id": "6710a0000000000000000003", "direction": "inbound", "from_number": "15145550123",
               "to_number": "15145550100", "body": "Hello, has my container been delivered?", "status": "received",
               "media_urls": [], "sent_by": null, "sent_by_name": null, "created_at": "2026-10-09T18:43:39.429000", …}],
 "total": 1, "events": [], "capabilities": ["SMS", "MMS"]}

Reading marks the conversation as read (unread_count back to 0). An inbound message keeps the provider's format ("from_number": "15145550123"): identify the contact with conversation.phone_number.

3. Sending an SMS, by team_id or by from_number

curl -s "$TELMA_API/api/v1/sms/send" -H "X-API-Key: $TELMA_KEY" -H "Content-Type: application/json" \
  -d '{"team_id": "6710a0000000000000000001", "to": "+15145550123", "body": "Yes, delivered this morning at 9."}'
curl -s "$TELMA_API/api/v1/sms/send" -H "X-API-Key: $TELMA_KEY" -H "Content-Type: application/json" \
  -d '{"from_number": "+15145550100", "to": "+15145550123", "body": "Thank you for your business!"}'

201 answer (the second one has the same shape):

{"message": {"id": "6710a0000000000000000010", "conversation_id": "6710a0000000000000000002", "direction": "outbound",
             "from_number": "+15145550100", "to_number": "+15145550123", "body": "Yes, delivered this morning at 9.",
             "status": "sent", "sent_by": "6710a0000000000000000031", "sent_by_name": "Mon CRM", "sent_via": null,
             "external_sender": null, "media_urls": [], "created_at": "2026-10-09T18:43:39.879130", …},
 "conversation": {"id": "6710a0000000000000000002", "status": "open", …}}

sent_by is the integration's service account.

4. Sending in the name of a person of your application

curl -s "$TELMA_API/api/v1/sms/send" -H "X-API-Key: $TELMA_KEY" -H "Content-Type: application/json" \
  -d '{"team_id": "6710a0000000000000000001", "to": "+15145550123", "body": "I will call you back in 5 minutes.", "sender_name": "Julie Tremblay", "external_sender": "user-42"}'
{"message": {"id": "6710a0000000000000000012", "body": "I will call you back in 5 minutes.", "status": "sent",
             "sent_by_name": "Julie Tremblay", "sent_via": "Mon CRM", "external_sender": "user-42", …},
 "conversation": {…}}

5. Sending an MMS: upload, then send the URL you got

curl -s "$TELMA_API/api/v1/upload" -H "X-API-Key: $TELMA_KEY" -F "file=@photo.jpg"
curl -s "$TELMA_API/api/v1/sms/send" -H "X-API-Key: $TELMA_KEY" -H "Content-Type: application/json" \
  -d '{"team_id": "6710a0000000000000000001", "to": "+15145550123", "body": "Delivery photo", "media_urls": ["https://api.telma.ca/api/v1/uploads/9f1c2e3d4b5a69788766554433221100.jpg"]}'
{"url": "https://api.telma.ca/api/v1/uploads/9f1c2e3d4b5a69788766554433221100.jpg", "content_type": "image/jpeg",
 "filename": "9f1c2e3d4b5a69788766554433221100.jpg"}
{"message": {"id": "6710a0000000000000000013", "body": "Delivery photo", "status": "sent",
             "media_urls": [{"url": "https://api.telma.ca/api/v1/uploads/9f1c2e3d4b5a69788766554433221100.jpg",
                             "content_type": "image/jpeg"}], …},
 "conversation": {…}}

6. Adding a note (never sent to the contact)

curl -s "$TELMA_API/api/v1/conversations/6710a0000000000000000002/notes" -H "X-API-Key: $TELMA_KEY" -H "Content-Type: application/json" \
  -d '{"body": "Customer called back, delivery confirmed.", "author_name": "Julie Tremblay", "external_author": "user-42"}'

201 answer, in full:

{"note": {"id": "6710a0000000000000000020", "conversation_id": "6710a0000000000000000002",
          "team_id": "6710a0000000000000000001", "message_id": null, "anchor_at": "2026-10-09T18:43:39.930821",
          "body": "Customer called back, delivery confirmed.", "author_id": "6710a0000000000000000031",
          "author_name": "Julie Tremblay", "via": "Mon CRM", "external_author": "user-42",
          "created_at": "2026-10-09T18:43:39.930821", "updated_at": "2026-10-09T18:43:39.930821"}}

7. Closing, then reopening, in the name of the person

curl -s "$TELMA_API/api/v1/conversations/6710a0000000000000000002/close" -H "X-API-Key: $TELMA_KEY" -H "Content-Type: application/json" \
  -d '{"actor_name": "Julie Tremblay"}'
curl -s "$TELMA_API/api/v1/conversations/6710a0000000000000000002/reopen" -H "X-API-Key: $TELMA_KEY" -H "Content-Type: application/json" \
  -d '{"actor_name": "Julie Tremblay"}'
{"conversation": {"id": "6710a0000000000000000002", "status": "closed", …}, "message": "Conversation fermée"}
{"conversation": {"id": "6710a0000000000000000002", "status": "open", …}}

message is in French unless the request sends Accept-Language: en ("Conversation closed"). The next reading of the conversation gives these two changes in events:

"events": [{"id": "6710a0000000000000000050", "type": "closed", "cause": "agent", "previous_status": "open",
            "actor_name": "Julie Tremblay", "via": "Mon CRM", "message_id": null,
            "anchor_at": "2026-10-09T18:43:39.939000", …},
           {"id": "6710a0000000000000000051", "type": "reopened", "cause": "agent", "previous_status": "closed",
            "actor_name": "Julie Tremblay", "via": "Mon CRM", "message_id": null,
            "anchor_at": "2026-10-09T18:43:39.948000", …}]

The same calls with X-Frontend-Host: app.telma.ca (the organization's host) give the same answers; with the host of another domain, the list comes back empty ({"conversations": [], "total": 0, "skip": 0, "limit": 50}) and the send answers 403.

Delivered events

Event When Content
message.received an inbound SMS/MMS is stored in an exposed team conversation, message
message.sent an outbound message is sent: by an agent, by the integration, by the website widget or automatically (welcome message, out-of-hours reply, delivered right after the inbound message they answer). A refused send (500 send_failed) is not delivered conversation, message
conversation.updated a conversation is read (when it had unread messages), closed or reopened, whether by an agent, by the integration, by a message from the contact (or, before 2026-10-14, by a send in an archived conversation); or its contact is renamed (PATCH /api/v1/conversations/<id>, by an agent or by the integration; the same name again delivers nothing). Deleting a conversation is not reported conversation, change (read, closed, reopened, renamed, assigned (2026-10-30: change of the person in charge, with assignee {id, name} or null); archived is no longer sent since 2026-10-14: archiving closes), cause (agent, inbound, outbound; absent for read and renamed), message_id (reopening by a message from the contact), contact_name (renamed only: the new name, or null when it is cleared)
conversation.note a conversation note is added, edited or deleted note, change (created, updated, deleted), conversation_id
call.summarized the summary of a call of an exposed team is ready (Telma AI, transcription capability), then again each time it is made again call, summary (see Call summary)
voicemail.summarized the summary of a voicemail message of a number of an exposed team is ready (2026-10-30) voicemail, summary (see Voicemail summary)
conversation.summarized Telma AI analyzed a text conversation of an exposed team (2026-10-30) conversation, analysis, summary (see Conversation summary)
fax.summarized Telma AI read and summarized a fax received on a fax number of an exposed team (2026-11-03) fax, summary (see Fax summary)
questionnaire.completed a game of a questionnaire by text ends questionnaire, session (see Questionnaire completed)

Each delivery is a JSON POST to the webhook URL. The envelope carries id (the delivery identifier), event, created_at, organization_id and team (id, name), then the fields of the event. An MMS received, as delivered:

{
  "event": "message.received",
  "created_at": "2026-10-09T18:43:39.431526Z",
  "organization_id": "6710a0000000000000000040",
  "team": {"id": "6710a0000000000000000001", "name": "Sales"},
  "conversation": {
    "id": "6710a0000000000000000002",
    "team_id": "6710a0000000000000000001",
    "phone_number": "+15145550123",
    "contact_name": null,
    "team_phone_number": "+15145550100",
    "last_message_at": "2026-10-09T18:43:39.429000",
    "last_inbound_at": "2026-10-09T18:43:39.429000",
    "unread_count": 2,
    "status": "open",
    "created_at": "2026-10-09T18:43:39.402000",
    "archived_at": null,
    "closed_at": null,
    "assignee_id": null,
    "assignee_name": null,
    "assigned_at": null,
    "capabilities": ["SMS", "MMS"],
    "app": null,
    "last_message": {"id": "6710a0000000000000000004", "body": "Here is the photo", "direction": "inbound", "status": "received", "created_at": "2026-10-09T18:43:39.429512", "has_media": true}
  },
  "message": {
    "id": "6710a0000000000000000004",
    "conversation_id": "6710a0000000000000000002",
    "team_id": "6710a0000000000000000001",
    "direction": "inbound",
    "from_number": "15145550123",
    "to_number": "15145550100",
    "body": "Here is the photo",
    "status": "received",
    "provider": null,
    "provider_message_id": "msg-in-2",
    "sent_by": null,
    "sent_by_name": null,
    "sent_via": null,
    "external_sender": null,
    "queued": false,
    "rejected": false,
    "credit_hold": false,
    "app": null,
    "automatic": null,
    "media_urls": [
      {
        "url": "https://mms.provider.example/media/7f3e2a.jpg",
        "content_type": "image/jpeg",
        "proxied_url": "https://api.telma.ca/api/v1/media-proxy?url=https%3A%2F%2Fmms.provider.example%2Fmedia%2F7f3e2a.jpg&content_type=image%2Fjpeg"
      }
    ],
    "created_at": "2026-10-09T18:43:39.429512",
    "delivered_at": null
  },
  "id": "6711b0000000000000000002"
}

A message received outside the team's business hours carries queued: true if the team is told at opening ("Notify the team at opening": a single digest push when it opens again), or rejected: true if it is not ("Do not notify"): the message is kept and shown either way. Both are false otherwise. A message sent on its own (welcome, outside-hours reply, STOP confirmation) carries automatic (see Team hours). A team without any business hours (business_hours empty or missing) is always open (2026-10-29), as for its call queue.

conversation and message have the format of the API (GET /api/v1/conversations/<id>), with three additions or differences. conversation.last_message ({id, body, direction, status, created_at, has_media}) is the preview of the last message of the conversation, the one it counts at the time of the delivery, as in the API:

  • a message sent by an integration also carries integration_id, so your application recognises its own sends;
  • every media carries proxied_url. For a file uploaded to Telma (POST /api/v1/upload), it is that file's own address; for a media kept by the provider, it is the public Telma relay (GET /api/v1/media-proxy): it only relays the media of messages (the URL must be exactly the url of a message's media, otherwise 404 not_found), only accepts the SMS providers' host names (over http or https, ports 80 and 443, without credentials or IP addresses, and only when they point to public addresses), 5 MB at most, within 90 s at most, without following redirects; it converts AMR audio to MP3 and 3GPP video to MP4, displays images, audio, video, PDF and plain text with their type, and serves any other file as a download (application/octet-stream, named media.<extension> after its type, for example media.vcf for a contact card); a media fetched is kept up to 10 minutes: the same URL asked again meanwhile is served without being fetched again, converted or not, and accepts Range requests (a video played piece by piece); a refused URL gets 400 validation_error, a media the provider does not return 502 fetch_failed, and when too many media are already being fetched or converted (a request waits its turn 15 s at most, behind 100 others at most), the relay answers 503 busy: retry a few seconds later.

message.provider is null (the provider is only shown to the platform), and provider_message_id is the identifier the provider gave the message. What a number can send is read in capabilities (["SMS"] or ["SMS", "MMS"]) of GET /api/v1/teams/<id>/phone-numbers and in messaging_capabilities of the numbers; their provider is null for an organization.

message.from_number and message.to_number of an inbound message keep the provider's format (often without +): identify the contact with conversation.phone_number and the team number with conversation.team_phone_number, both E.164.

All dates are UTC. The envelope's created_at ends with Z; the dates of conversation and message (as in the API) have no suffix: add Z before parsing them (in JavaScript, new Date("2026-10-09T18:43:39.429000") would read it as local time).

Contact renamed (conversation.updated, "change": "renamed", abridged): contact_name gives the new name (null when it is cleared), the same as conversation.contact_name; no cause. The name belongs to the conversation: another conversation with the same number (another team number, another team) keeps its own.

{
  "event": "conversation.updated",
  "created_at": "2026-10-14T15:02:11.204518Z",
  "organization_id": "6710a0000000000000000040",
  "team": {"id": "6710a0000000000000000001", "name": "Sales"},
  "conversation": {"id": "6710a0000000000000000002", "phone_number": "+15145550123", "contact_name": "Marie Tremblay", "status": "open", "…": "…"},
  "change": "renamed",
  "contact_name": "Marie Tremblay",
  "id": "6711b000000000000000000c"
}

Request headers:

Header Content
X-Telma-Event the event name
X-Telma-Delivery the delivery identifier (same as id, repeated on every retry)
X-Telma-Timestamp the sending time, in Unix seconds
X-Telma-Signature sha256= followed by the hex HMAC-SHA256 of "<timestamp>.<raw body>" with the webhook secret
User-Agent Telma-Webhooks/1.0

The four X-Telma-* headers are also sent under their former name, X-Textos-*, with the same values (compatibility).

Call summary (call.summarized)

Delivered when the summary of a call is ready, to the integration that exposes every team or the team of the call's number (a call between two endpoints, without a number, is not delivered). It carries neither the transcript nor the audio: only who, when, how long, and the summary. Same envelope, same headers and same signature as the other events; team is null for a number in no team (only the integrations that expose every team receive it then).

{
  "event": "call.summarized",
  "created_at": "2026-10-23T14:12:05.118204Z",
  "organization_id": "6710a0000000000000000040",
  "team": {"id": "6710a0000000000000000001", "name": "Ventes"},
  "call": {
    "id": "6719c0000000000000000007",
    "start": "2026-10-23T14:02:41",
    "duration": 312,
    "direction": "inbound",
    "our_number": "+15145550100",
    "other_party": {"number": "5145550123", "e164": "+15145550123", "name": "TREMBLAY M"},
    "endpoint": {"id": "6710a0000000000000000031", "extension": "101", "label": "Ventes"},
    "phone_number_id": "6710a0000000000000000020"
  },
  "summary": {
    "summary": "The customer reports a container delivered late and asks the dispatcher to call back.",
    "reason": "Complaint: late delivery",
    "actions": ["Call the customer back before 4 pm"],
    "criteria": {"callback": true, "topic": "Complaint"},
    "criteria_labels": {"callback": {"label": "Callback requested", "type": "yes_no"}, "topic": {"label": "Topic", "type": "choice"}},
    "language": "fr",
    "summarized_at": "2026-10-23T14:12:04.903000",
    "resummarized": false
  },
  "id": "6711b0000000000000000031"
}
  • call.our_number is our number (E.164; null for an outbound call placed without a number of the organization), call.other_party the contact (e164 is null when it is not a phone number; name is the name shown by the caller of an inbound call, else null), call.duration the length of the conversation in seconds, call.endpoint the endpoint whose plan paid for the summary;
  • summary.criteria gives the value of each criterion of the organization (null when the call did not touch the subject) and summary.criteria_labels their label and type (text, yes_no, number, date, choice);
  • a summary made again ("Make the summary again" button, changed settings) is delivered again with the same call.id, resummarized: true and a new summarized_at: keep the last one. The same summary is never delivered twice (a retry keeps the same delivery id, see below);
  • the event is delivered only to the integrations that chose it: an integration created before it came (2026-10-23) must add it to its list (PUT /api/v1/integrations/<id> {"events": [..., "call.summarized"]}, or the checkbox in Settings → Integrations).

Voicemail summary (voicemail.summarized)

Delivered once when the summary of a voicemail message is ready (2026-10-30), to the integration that exposes every team or the team of the number of the message. Neither the text of the message nor the audio: an integration that wants them reads them with its key. A message without a summary (nothing asked, the summary failed) is not delivered.

{
  "event": "voicemail.summarized",
  "created_at": "2026-10-30T14:12:05.118204Z",
  "organization_id": "6710a0000000000000000040",
  "team": {"id": "6710a0000000000000000001", "name": "Sales"},
  "voicemail": {
    "id": "6722c0000000000000000003",
    "start": "2026-10-30T14:10:41",
    "duration": 38,
    "our_number": "+15145550100",
    "other_party": {"number": "+15145550123", "e164": "+15145550123", "name": "Mary"},
    "endpoint": {"id": "6710a0000000000000000031", "extension": "101", "label": "Sales"},
    "phone_number_id": "6710a0000000000000000020",
    "mailbox_id": null
  },
  "summary": {
    "summary": "A water leak in the basement, the customer asks for a quick visit.",
    "reason": "Basement leak",
    "actions": ["Call back to set the visit"],
    "actions_due": [null],
    "criteria": {"callback": true, "topic": "Complaint"},
    "criteria_labels": {"callback": {"label": "Callback requested", "type": "yes_no"}, "topic": {"label": "Topic", "type": "choice"}},
    "language": "en",
    "summarized_at": "2026-10-30T14:12:04.903000",
    "resummarized": false,
    "urgency": "high"
  },
  "id": "6722c0000000000000000009"
}

Conversation summary (conversation.summarized)

Delivered once per analysis of a text conversation that found something (2026-10-30; 10 minutes without a message or when it is closed), to the integration that exposes the team of the conversation. Without the messages: GET /api/v1/conversations/<id> gives them to whoever holds the key.

{
  "event": "conversation.summarized",
  "created_at": "2026-10-30T15:20:11.204113Z",
  "organization_id": "6710a0000000000000000040",
  "team": {"id": "6710a0000000000000000001", "name": "Sales"},
  "conversation": {"id": "6722d0000000000000000002", "our_number": "+15145550100",
                   "other_party": {"number": "+14185550111", "e164": "+14185550111", "name": "Mary Smith"}},
  "analysis": {"id": "6722d0000000000000000005", "since": "2026-10-30T14:58:02", "until": "2026-10-30T15:09:40",
               "message_count": 4, "trigger": "quiet"},
  "summary": {"summary": "The customer wants a quote for a 20-yard container.", "reason": "Quote",
              "actions": ["Send the quote"], "actions_due": ["2026-10-31"], "criteria": {"topic": "Quote"},
              "criteria_labels": {"topic": {"label": "Topic", "type": "choice"}}, "language": "en",
              "summarized_at": "2026-10-30T15:20:10.812000", "resummarized": false},
  "id": "6722d0000000000000000008"
}
  • analysis.trigger: quiet (10 minutes without a message) or closed (someone closed the conversation); a conversation that goes on gives a new analysis, so a new event (same conversation.id, another analysis.id);
  • as with call.summarized, an integration created before these events (2026-10-30) must add them to its list (PUT /api/v1/integrations/<id> {"events": [..., "voicemail.summarized", "conversation.summarized"]}); new ones have them by default.
  • Why without the text: a webhook goes to a third-party server; the summary is enough to create a task or a note in a CRM, and the whole text stays behind the key of the integration and its teams.

Fax summary (fax.summarized)

Delivered once per received fax Telma AI read and summarized (2026-11-03, fax_ai capability, see Telma AI on the faxes), to the integration that exposes the team of the fax number. Neither the text read nor the PDF: they stay in the app, behind each one's rights.

{
  "event": "fax.summarized",
  "created_at": "2026-11-03T15:20:11.204113Z",
  "organization_id": "6710a0000000000000000040",
  "team": {"id": "6710a0000000000000000001", "name": "Sales"},
  "fax": {"id": "6727e0000000000000000002", "received_at": "2026-11-03T15:18:40", "pages": 2,
          "our_number": "+15145550188", "other_party": {"number": "+14185550111", "e164": "+14185550111",
                                                        "name": "Example Concrete"},
          "phone_number_id": "6710a0000000000000000077"},
  "summary": {"summary": "Purchase order for 12 containers to deliver on Thursday.", "reason": "Purchase order 2026-114",
              "sender": "Example Concrete Inc.", "fields": [{"label": "Order", "value": "2026-114"}],
              "actions": ["Confirm the delivery"], "actions_due": ["2026-11-05"], "criteria": {"topic": "Order"},
              "criteria_labels": {"topic": {"label": "Topic", "type": "choice"}}, "language": "en",
              "summarized_at": "2026-11-03T15:20:10.812000"},
  "id": "6727e0000000000000000008"
}
  • fax.other_party.name: the name the fax machine sent, else the sender read on the document;
  • an integration created before this event must add it to its list (PUT /api/v1/integrations/<id> {"events": [..., "fax.summarized"]}); new ones have it by default.

Questionnaire completed (questionnaire.completed)

Delivered when a game of a questionnaire by text ends (every question answered), to the integration that exposes every team or the team of the number (team is null for a number without a team). Same envelope, headers and signature as the other events.

{
  "event": "questionnaire.completed",
  "created_at": "2026-10-28T15:04:11.204113Z",
  "organization_id": "6710a0000000000000000040",
  "team": {"id": "6710a0000000000000000001", "name": "Quiz"},
  "questionnaire": {"id": "6720d0000000000000000005", "name": "80s quiz", "scoring": true},
  "session": {
    "id": "6720d0000000000000000009",
    "number": "+15145550100",
    "remote": "+15145550123",
    "score": 4,
    "total": 5,
    "handed_off": false,
    "started_at": "2026-10-28T15:01:02.511000",
    "ended_at": "2026-10-28T15:04:10.987000",
    "conversation_id": "6720d0000000000000000007",
    "answers": [
      {"question_id": "q01", "question": "Which 1985 film sends Marty McFly back in time?",
       "given": "back to the future", "correct": true, "judged_by": "fuzzy", "at": "2026-10-28T15:01:40.100000"}
    ]
  },
  "id": "6720d000000000000000000b"
}
  • session.number is our number, session.remote the contact; correct is null for a survey; conversation_id is null without a team;
  • a game stopped (STOP, hand-off word) or expired is not delivered;
  • like call.summarized, an integration created before this event (2026-10-28) must add it to its list.

Example: real payloads

Bodies received while running the quickstart (made-up identifiers). A send by the integration in the name of a person (message.sent):

Full message.sent payload
{
  "event": "message.sent",
  "created_at": "2026-10-09T18:43:39.882741Z",
  "organization_id": "6710a0000000000000000040",
  "team": {"id": "6710a0000000000000000001", "name": "Sales"},
  "conversation": {
    "id": "6710a0000000000000000002",
    "team_id": "6710a0000000000000000001",
    "phone_number": "+15145550123",
    "contact_name": null,
    "team_phone_number": "+15145550100",
    "last_message_at": "2026-10-09T18:43:39.881000",
    "last_inbound_at": "2026-10-09T18:43:39.429000",
    "unread_count": 0,
    "status": "open",
    "created_at": "2026-10-09T18:43:39.402000",
    "archived_at": null,
    "closed_at": null,
    "assignee_id": null,
    "assignee_name": null,
    "assigned_at": null,
    "capabilities": ["SMS", "MMS"],
    "app": null,
    "last_message": {"id": "6710a0000000000000000012", "body": "I will call you back in 5 minutes.", "direction": "outbound", "status": "sent", "created_at": "2026-10-09T18:43:39.881523", "has_media": false}
  },
  "message": {
    "id": "6710a0000000000000000012",
    "conversation_id": "6710a0000000000000000002",
    "team_id": "6710a0000000000000000001",
    "direction": "outbound",
    "from_number": "+15145550100",
    "to_number": "+15145550123",
    "body": "I will call you back in 5 minutes.",
    "status": "sent",
    "provider": null,
    "provider_message_id": "msg-0003",
    "sent_by": "6710a0000000000000000031",
    "sent_by_name": "Julie Tremblay",
    "sent_via": "Mon CRM",
    "external_sender": "user-42",
    "queued": false,
    "rejected": false,
    "credit_hold": false,
    "app": null,
    "automatic": null,
    "media_urls": [],
    "created_at": "2026-10-09T18:43:39.881523",
    "delivered_at": null,
    "integration_id": "6710a0000000000000000030"
  },
  "id": "6711b0000000000000000005"
}

A conversation closed, then reopened by a new message from the contact (conversation.updated): cause is inbound and message_id names that message, delivered next as message.received. A closing (including by the former POST .../archive) or reopening by an agent or by the integration has the same shape with "cause": "agent"; read has no cause.

Full conversation.updated payload
{
  "event": "conversation.updated",
  "created_at": "2026-10-09T18:43:40.112093Z",
  "organization_id": "6710a0000000000000000040",
  "team": {"id": "6710a0000000000000000001", "name": "Sales"},
  "conversation": {
    "id": "6710a0000000000000000002",
    "team_id": "6710a0000000000000000001",
    "phone_number": "+15145550123",
    "contact_name": null,
    "team_phone_number": "+15145550100",
    "last_message_at": "2026-10-09T18:43:40.111000",
    "last_inbound_at": "2026-10-09T18:43:40.111000",
    "unread_count": 1,
    "status": "open",
    "created_at": "2026-10-09T18:43:39.402000",
    "archived_at": null,
    "closed_at": null,
    "assignee_id": null,
    "assignee_name": null,
    "assigned_at": null,
    "capabilities": ["SMS", "MMS"],
    "app": null,
    "last_message": {"id": "6710a0000000000000000005", "body": "One more question", "direction": "inbound", "status": "received", "created_at": "2026-10-09T18:43:40.111482", "has_media": false}
  },
  "change": "reopened",
  "cause": "inbound",
  "message_id": "6710a0000000000000000005",
  "id": "6711b000000000000000000b"
}

A note added (conversation.note): no conversation object, only conversation_id. For "change": "deleted", note is the note as it was before the deletion.

Full conversation.note payload
{
  "event": "conversation.note",
  "created_at": "2026-10-09T18:43:39.931077Z",
  "organization_id": "6710a0000000000000000040",
  "team": {"id": "6710a0000000000000000001", "name": "Sales"},
  "note": {
    "id": "6710a0000000000000000020",
    "conversation_id": "6710a0000000000000000002",
    "team_id": "6710a0000000000000000001",
    "message_id": null,
    "anchor_at": "2026-10-09T18:43:39.930821",
    "body": "Customer called back, delivery confirmed.",
    "author_id": "6710a0000000000000000031",
    "author_name": "Julie Tremblay",
    "via": "Mon CRM",
    "external_author": "user-42",
    "created_at": "2026-10-09T18:43:39.930821",
    "updated_at": "2026-10-09T18:43:39.930821"
  },
  "change": "created",
  "conversation_id": "6710a0000000000000000002",
  "id": "6711b0000000000000000007"
}

ping (Test webhook button, POST /api/v1/integrations/<id>/test), with X-Telma-Delivery: test:

{
  "id": "test",
  "event": "ping",
  "created_at": "2026-10-09T18:43:40.310448Z",
  "organization_id": "6710a0000000000000000040",
  "integration": {"id": "6710a0000000000000000030", "name": "Mon CRM"}
}

Verifying the signature

Compute the HMAC over the body as received (the bytes, before any JSON decoding: re-encoded JSON does not give the same signature), compare in constant time and reject timestamps that are too old (five minutes here). These functions return False on a missing or malformed header, without raising:

import hashlib
import hmac
import time


def telma_signature_is_valid(secret, headers, raw_body, tolerance=300):
    # headers: request.headers (Flask, Django, FastAPI: case-insensitive names)
    # raw_body: the bytes received (Flask: request.get_data())
    timestamp = headers.get("X-Telma-Timestamp") or ""
    if not (timestamp.isascii() and timestamp.isdigit()):
        return False
    if abs(time.time() - int(timestamp)) > tolerance:
        return False
    expected = "sha256=" + hmac.new(
        secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256
    ).hexdigest()
    given = headers.get("X-Telma-Signature") or ""
    return hmac.compare_digest(expected.encode(), given.encode())
const crypto = require("crypto");

// headers: req.headers (Node, Express: lower-case names)
// rawBody: the Buffer received (Express: express.raw({ type: "application/json" }))
function telmaSignatureIsValid(secret, headers, rawBody, tolerance = 300) {
  const timestamp = String(headers["x-telma-timestamp"] || "");
  if (!/^\d+$/.test(timestamp)) return false;
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > tolerance) return false;
  const expected = Buffer.from("sha256=" + crypto.createHmac("sha256", secret)
    .update(`${timestamp}.`).update(rawBody).digest("hex"));
  const given = Buffer.from(String(headers["x-telma-signature"] || ""));
  return expected.length === given.length && crypto.timingSafeEqual(expected, given);
}

Getting the raw body, by framework:

Framework Raw body Headers
Flask request.get_data() request.headers
Django request.body request.headers
Express express.raw({ type: "application/json" }) on this route, then req.body (a global app.use(express.json()) gives an object and makes the check fail) req.headers
Fetch (Next.js App Router, Workers, Deno, Bun) Buffer.from(await request.arrayBuffer()) Object.fromEntries(request.headers)

While the secret is being changed, your receiver can accept both the old and the new one (the delivery is valid if either verifies it).

Example: complete webhook receiver

Both receivers below do the same thing: they verify the signature over the raw body, answer 204 at once, ignore a retry of a delivery already accepted (same X-Telma-Delivery), process the event in the background and ignore the sends made by their own integration (message.integration_id). The ping gets 204 without going through deduplication, since its X-Telma-Delivery is always test. Unknown event types are ignored: new types may be added. They are tested for real against signed Telma deliveries.

TELMA_WEBHOOK_SECRET is the webhook secret (whsec_…, Settings → Integrations) and TELMA_INTEGRATION_ID the integration identifier (integration.id of the answer to its creation, or of the ping). The seen set and the queue live in memory: they only hold for a single process. In production, record the delivery identifiers in your database (unique constraint, seven days are enough) and hand the processing to your job queue.

Python (Flask) — pip install flask, then TELMA_WEBHOOK_SECRET=whsec_… TELMA_INTEGRATION_ID=6710a0000000000000000030 flask --app telma_webhook run --port 8000:

telma_webhook.py
# telma_webhook.py
import hashlib
import hmac
import json
import logging
import os
import queue
import threading
import time

from flask import Flask, abort, request

SECRET = os.environ["TELMA_WEBHOOK_SECRET"]
INTEGRATION_ID = os.environ.get("TELMA_INTEGRATION_ID")  # to recognise your own sends

app = Flask(__name__)
log = logging.getLogger("telma")
jobs = queue.Queue()
seen = set()  # deliveries accepted; in production: a table with a unique constraint
seen_lock = threading.Lock()


def telma_signature_is_valid(secret, headers, raw_body, tolerance=300):
    timestamp = headers.get("X-Telma-Timestamp") or ""
    if not (timestamp.isascii() and timestamp.isdigit()):
        return False
    if abs(time.time() - int(timestamp)) > tolerance:
        return False
    expected = "sha256=" + hmac.new(
        secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256
    ).hexdigest()
    given = headers.get("X-Telma-Signature") or ""
    return hmac.compare_digest(expected.encode(), given.encode())


@app.post("/telma/webhook")
def telma_webhook():
    raw = request.get_data()  # the bytes received, before any JSON decoding
    if not telma_signature_is_valid(SECRET, request.headers, raw):
        abort(401)
    event = json.loads(raw)
    if event["event"] == "ping":  # "Test" button: X-Telma-Delivery is always "test"
        return "", 204
    delivery_id = request.headers["X-Telma-Delivery"]
    with seen_lock:
        if delivery_id in seen:  # retry of a delivery already accepted
            return "", 204
        seen.add(delivery_id)
    jobs.put(event)
    return "", 204  # answer quickly: Telma does not wait for the answer more than 10 s


def handle(event):
    kind = event["event"]
    conversation = event.get("conversation") or {}
    message = event.get("message") or {}
    if kind == "message.received":
        # the contact: conversation.phone_number (E.164); message.from_number keeps the provider's format
        media = message.get("media_urls") or []  # attachments: media[i]["proxied_url"]
        log.info("SMS from %s: %s (%d attachment(s))", conversation["phone_number"], message["body"], len(media))
    elif kind == "message.sent":
        if message.get("integration_id") == INTEGRATION_ID:
            return  # sent by your application: already known
        log.info("Reply from %s to %s: %s", message["sent_by_name"], conversation["phone_number"], message["body"])
    elif kind == "conversation.updated":
        log.info("Conversation %s: %s (%s)", conversation["id"], event["change"], event.get("cause", "-"))
    elif kind == "conversation.note":
        note = event["note"]
        log.info("Note %s %s: %s", note["id"], event["change"], note["body"])
    # other events: ignored


def worker():
    while True:
        event = jobs.get()
        try:
            handle(event)
        except Exception:
            log.exception("Event %s not processed", event.get("id"))


logging.basicConfig(level=logging.INFO)
threading.Thread(target=worker, daemon=True).start()

Node (Express 4 or 5) — npm install express, then TELMA_WEBHOOK_SECRET=whsec_… TELMA_INTEGRATION_ID=6710a0000000000000000030 node telma-webhook.js:

telma-webhook.js
// telma-webhook.js
const crypto = require("crypto");
const express = require("express");

const SECRET = process.env.TELMA_WEBHOOK_SECRET;
const INTEGRATION_ID = process.env.TELMA_INTEGRATION_ID; // to recognise your own sends
const seen = new Set(); // deliveries accepted; in production: a table with a unique constraint

function telmaSignatureIsValid(secret, headers, rawBody, tolerance = 300) {
  const timestamp = String(headers["x-telma-timestamp"] || "");
  if (!/^\d+$/.test(timestamp)) return false;
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > tolerance) return false;
  const expected = Buffer.from("sha256=" + crypto.createHmac("sha256", secret)
    .update(`${timestamp}.`).update(rawBody).digest("hex"));
  const given = Buffer.from(String(headers["x-telma-signature"] || ""));
  return expected.length === given.length && crypto.timingSafeEqual(expected, given);
}

const app = express();

// Raw body on this route: a global app.use(express.json()) would make the check fail
app.post("/telma/webhook", express.raw({ type: "application/json" }), (req, res) => {
  if (!Buffer.isBuffer(req.body) || !telmaSignatureIsValid(SECRET, req.headers, req.body)) {
    return res.sendStatus(401);
  }
  const event = JSON.parse(req.body);
  if (event.event === "ping") return res.sendStatus(204); // "Test" button: X-Telma-Delivery is always "test"
  const deliveryId = req.headers["x-telma-delivery"];
  if (seen.has(deliveryId)) return res.sendStatus(204); // retry of a delivery already accepted
  seen.add(deliveryId);
  res.sendStatus(204); // answer quickly: Telma does not wait for the answer more than 10 s
  setImmediate(() => {
    try {
      handle(event);
    } catch (err) {
      console.error(`Event ${event.id} not processed`, err);
    }
  });
});

function handle(event) {
  const conversation = event.conversation || {};
  const message = event.message || {};
  switch (event.event) {
    case "message.received": {
      // the contact: conversation.phone_number (E.164); message.from_number keeps the provider's format
      const media = message.media_urls || []; // attachments: media[i].proxied_url
      console.log(`SMS from ${conversation.phone_number}: ${message.body} (${media.length} attachment(s))`);
      break;
    }
    case "message.sent":
      if (message.integration_id === INTEGRATION_ID) return; // sent by your application: already known
      console.log(`Reply from ${message.sent_by_name} to ${conversation.phone_number}: ${message.body}`);
      break;
    case "conversation.updated":
      console.log(`Conversation ${conversation.id}: ${event.change} (${event.cause || "-"})`);
      break;
    case "conversation.note":
      console.log(`Note ${event.note.id} ${event.change}: ${event.note.body}`);
      break;
    default: // other events: ignored
  }
}

app.listen(Number(process.env.PORT) || 8000);

To try it without Telma, send yourself a signed delivery (date +%s gives the timestamp, the body is signed as is):

SECRET=whsec_…; TS=$(date +%s); BODY='{"id":"try-1","event":"conversation.updated","change":"read","conversation":{"id":"6710a0000000000000000002","status":"open"}}'
SIG=$(printf '%s.%s' "$TS" "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | sed 's/^.* //')
curl -i http://localhost:8000/telma/webhook -H "Content-Type: application/json" \
  -H "X-Telma-Event: conversation.updated" -H "X-Telma-Delivery: try-1" \
  -H "X-Telma-Timestamp: $TS" -H "X-Telma-Signature: sha256=$SIG" -d "$BODY"
# → HTTP/1.1 204; the same call with another secret or a modified body → 401

Telma itself only calls a public https address (see below): to receive real deliveries, publish the receiver behind https.

Delivery, retries and pause

The webhook URL must be https on port 443 (the default https port), public, 500 characters at most, without credentials (user:password@) nor spaces. Its host name is resolved, and every address it gets must be public: private, loopback, link-local, reserved, multicast, unspecified or non-global addresses (100.64.0.0/10 included) are refused, IPv4 as well as IPv6 (an IPv4 carried in an IPv6 included), and so is a name that does not resolve. The public address of the server that hosts Telma is not refused: an application hosted on that same server receives its webhooks. The platform's operator may also exclude networks (the server's WEBHOOK_DENY_NETWORKS variable, empty by default). Every refusal gives 400 {"error": "validation_error", "message": "webhook_url must be a public https URL"}, whatever the cause. The URL is checked when it is saved with a new value, and again before each call: if it no longer passes, nothing is sent and the call fails (address not allowed, or connection error when the name no longer resolves). The URL already saved, sent again unchanged (the interface sends the whole form), is not checked again: an integration can be renamed or disabled even when the name of its receiver no longer resolves. "" or null removes the webhook.

The receiver must answer 2xx: Telma connects within 5 s, waits 10 s at most for the answer and gives up on the call after 15 s in all. A redirect (3xx) is never followed and counts as a failure. The status line and headers of the response are read up to 8 KB a line and 32 KB in all: beyond that, the call fails (connection error). The response body is ignored: Telma reads 1 KB of it at most, without keeping or showing it. A failure is only recorded as HTTP <code>, timeout, connection error, redirect not followed, address not allowed or not sent (below).

Telma makes at most 16 webhook calls at once, at most 3 of them for one organization; the waiting organizations take the places that free up in turn, and the calls of one organization go in order. A call waiting for its turn is never held against the receiver: X-Telma-Timestamp and the signature are computed when the call is made, after the wait. A delivery waits 10 minutes at most for its turn; when it did not get it, or when too many calls are already waiting (2000 in all, 100 for one organization), nothing is sent: the delivery is marked not sent, which counts neither as an attempt, nor among the failures in a row, nor towards the pause, and it stays in progress (completed_at is null). Telma takes it up again by itself one to two minutes later (and again as long as it does not get its turn), with the attempts it has left, to the URL and with the secret of that moment: the oldest first, 20 a minute at most for one integration, and for one hour after the event. After that, or when the integration no longer takes that event (integration disabled, webhook removed or paused, event or team unticked), the delivery ends with the error not sent, without any call.

Each delivery makes at most three attempts (the first one, then after 5 s and after 30 s), with the same X-Telma-Delivery, so the receiver must be idempotent on that identifier. Deliveries are asynchronous and may arrive out of order: created_at and the fields of the object are authoritative.

After 25 failed deliveries in a row the webhook is paused (the last error is shown in the interface and in webhook.last_error of GET /api/v1/integrations/<id>); the API key keeps working. It resumes when the integration is updated with webhook_paused: false, or when its URL changes (the failure count starts again from zero). The events that happen during the pause are never delivered: catch up through the API (GET /api/v1/conversations).

The webhook: masked signing secret, health, result of “Test webhook” and the recent deliveries log. The webhook: masked signing secret, health, result of “Test webhook” and the recent deliveries log.

POST /api/v1/integrations/<id>/test sends a signed ping event, without retry, even when the integration is disabled or its webhook paused, and answers for example {"success": true, "status_code": 204, "error": null} or {"success": false, "status_code": 500, "error": "HTTP 500"}. The ping has a reduced shape: id and X-Telma-Delivery are always test (do not deduplicate it), integration (id, name) replaces team, and it has neither conversation nor message. It is not listed among the deliveries and does not count in the webhook health. The receiver must answer 2xx to ping and ignore the events it does not know. The ping waits 5 s at most for its turn (otherwise {"success": false, "status_code": null, "error": "not sent"}, nothing is sent), and the route accepts 10 tests per minute per organization, all its integrations together (429 rate_limited beyond).

GET /api/v1/integrations/<id>/deliveries lists the most recent deliveries with their payload: 50 by default, limit from 1 to 200 (a limit that is not an integer gets 400), without pagination. Deliveries are kept seven days.

Security

  • Keep the key on the server side. It reads the conversations of the exposed teams and sends SMS billed to the organization: never put it in a browser, a mobile app or a code repository; read it from an environment variable or a secret manager. A web page or a mobile app goes through your own server.
  • Least privilege. Only expose the teams the application needs, and create one integration per application: each one has its own key, secret and delivery log.
  • What the key cannot do. It only has the rights of the User profile on the exposed teams: it touches no other team, does not list a team's closed conversations by day (.../archives), reads neither the billing, nor the members, nor the organization settings, and can create neither keys nor integrations (403). The closed conversations of an exposed team stay listed with status=closed and readable by their id.
  • https is mandatory. Events contain phone numbers and the text of the messages: the webhook URL must be a public https address.
  • Verify the signature over the raw body of every delivery, with a constant-time comparison, and refuse timestamps older than five minutes (Verifying the signature). Answer 401 without processing anything when it does not match.
  • Idempotency. Record the X-Telma-Delivery already processed (seven days are enough): a retry replays the same delivery.
  • Rotation. Regenerate key (POST /api/v1/integrations/<id>/regenerate-key) replaces the key: the old one gets 401 at once. Regenerate secret (POST /api/v1/integrations/<id>/regenerate-secret) replaces the secret: the next deliveries are signed with the new one, which your receiver must already accept. Do it as soon as a key or a secret may have leaked.
  • Media. Uploaded files and proxied_url addresses are public, at an address that cannot be guessed: do not republish them.

Example: errors to handle

Real answers of the API to an integration key, sent with Accept-Language: en (without it, message is in French; test error and the HTTP status, not message):

Situation HTTP Body
Unknown key, replaced with Regenerate key, integration disabled or deleted 401 {"error": "unauthorized", "message": "Invalid API key"}
team_id or from_number of a team that is not exposed, a send with neither team_id nor from_number, or the X-Frontend-Host of another domain 403 {"error": "forbidden", "message": "Access denied"}
Route closed to restricted keys (billing, organization, closed conversations by day, integrations…) 403 {"error": "forbidden", "message": "API key not allowed on this route"}
from_number that is not a number of the team_id team 400 {"error": "number_not_in_team", "message": "The number +15145550200 is not (or no longer) assigned to this team"}
media_urls that does not come from POST /api/v1/upload 400 {"error": "validation_error", "message": "media_urls must point to uploaded attachments"}
Neither body nor media_urls 400 {"error": "validation_error", "message": "Message body required"}
A body that is not a JSON object 400 {"error": "validation_error", "message": "The request body must be a JSON object"}
status=archived (or anything but open, closed) in GET /api/v1/conversations 400 {"error": "validation_error", "message": "status must be open or closed (closed conversations by day: GET /api/v1/teams/<team_id>/archives)", "field": "status"}
Not enough credit (nothing is sent; when two sends race for the last credit, the loser gets this 402 but its message stays in the conversation, failed with error_code insufficient_balance) 402 {"error": "insufficient_balance", "message": "Insufficient balance: add credit", "estimated_cost": 0.05, "current_balance": 0.0}
Refused by the provider (message and error_code come from it) 500 {"error": "send_failed", "message": "Destination refused by carrier", "error_code": "21610", "message_id": "6710a0000000000000000015"}
Sending limit of the number reached (nothing is sent nor debited) 429 {"error": "sms_limit_reached", "message": "+15145550100 already texted 300 different people today: this limit keeps the number from being filtered by the carriers. Try again tomorrow", "limit": {"kind": "recipients_per_day", "max": 300, "window": "day", "number": "+15145550100", "resets_at": "2026-11-13T05:00:00Z", "new_account": false}, "retry_after": 25200}
More than 600 POST /api/v1/sms/send in the hour for the key, refusals included 429 {"error": "rate_limited", "message": "Rate limit exceeded (600 per 1 hour), retry in 1312 s", "retry_after": 1312}

On a 500 send_failed, the message already exists in the conversation with status failed (message_id): a new attempt creates a second message, do not retry without a decision. A 429 is returned before any processing: nothing was sent, retry after Retry-After seconds (see Rate limits, with a Python and a Node client that do it).

Request headers

Header Role
Authorization: Bearer <token> the access token (JWT), see JWT token
X-API-Key the API key, instead of the token, see API key
Accept-Language fr or en: the language of message in the answers (French by default)
X-Frontend-Host the whitelabel domain aimed at (otherwise the Host header), see Multi-domain
X-Admin-Organization super_admin and domain_admin: the organization being administered, see Administration context
X-Organization-Fallback: none GET /api/v1/organizations/current: do not fall back to another organization of the domain when the current one does not fit; the answer is then 404 not_found
Idempotency-Key POST /api/v1/billing/recharge: 8 to 128 characters (or idempotency_key in the body); the same key never charges twice and returns the first answer, with replayed: true
X-MFA-Token the mfa_token of a sign-in that must first add a second factor, on the routes that add a factor (see Sign-in security)
X-Client-App: ios or android the mobile app, which sends no Origin: the passkeys are then those of the site of X-Frontend-Host
X-Request-ID the request identifier (64 characters at most): when absent, the server makes one up; every answer carries it, to quote in a support request

Errors

All errors are JSON, with at least error (a stable code, to test) and message (a readable text, translated according to Accept-Language, which may change):

{
  "error": "code",
  "message": "Human-readable message"
}

The providers' inbound webhooks (/webhook/provider) are the exception: they answer {"error": "<text>"}, a free text without message (for example 404 {"error": "Invalid provider or webhook token"}), and that text must not be tested.

Some add fields: field (the parameter at fault in a 400), retry_after (429), estimated_cost and current_balance (402), error_code and message_id (500 send_failed).

HTTP status error Meaning
400 validation_error invalid or missing data
400 configuration_error the team has no number, or its SMS provider is not configured or enabled
400 number_not_in_team from_number is not (or no longer) a number of the team
401 unauthorized authentication required, invalid or expired token, API key unknown, revoked or of a disabled integration
402 insufficient_balance not enough credit to send; nothing is sent
402 auto_recharge_required choosing a paid plan or buying lines requires automatic recharge by card
402 account_suspended the balance stayed negative past the grace period: sending, system SMS and calls are refused until the balance is back to zero or more (balance_state, release_at, balance in the answer)
403 forbidden insufficient rights (permission, team or domain); API key not allowed on this route for a route closed to the key
403 recording_skip_not_allowed the organization does not allow skipping the imposed recording of the next call (see Voice)
403 outbound_suspended the organization's outbound calls are suspended (call code refused; see Voice)
403 number_disabled the number that would send is switched off (paused, inactive or without SMS)
403 plan_feature the plan of the organization does not include the feature feature names (video, team_chat, supervision, assistant; see Plans)
403 voice_not_enabled, capability_required the organization lacks the voxos capability, or the one capability names (see Capabilities)
403 impersonation_forbidden operation refused to a session opened by an administrator (see Session opened by an administrator)
404 not_found unknown resource, or no organization in this domain
405 method_not_allowed HTTP method not supported by this route (the Allow header gives the accepted methods)
409 mfa_required removing the last second factor of an account that must have one (the other codes of the second factor are in Sign-in security)
409 profile_in_use, last_admin profile still held by members; change that would leave no member with members.admin
409 conflict duplicate (already a member of the organization, domain admin already invited...); an organization invitation already pending gets 400 validation_error
413 request_entity_too_large body over 32 MB (POST /api/v1/upload accepts 10 MB at most and refuses more with 400 validation_error, not 413)
429 rate_limited rate limit reached (see Rate limits)
429 sms_limit_reached sending limit of the number reached (different recipients per hour or per day, the same text to too many people; limit, retry_after; see Sending limits of a number)
500 send_failed the SMS provider refused or failed
500 internal_error unexpected server error
404 not_found GET /api/v1/media-proxy: no message carries this media (pass url as is, from media_urls[].url)
502 fetch_failed GET /api/v1/media-proxy: the provider did not return the media in time, or it is over 5 MB
503 busy GET /api/v1/media-proxy: too many media being fetched or converted; retry a few seconds later

The billing routes (/api/v1/billing/*) follow the same shape: no_organization (400, the user has no current organization), validation_error (400, with field: amount, threshold, invalid ISO 8601 date), configuration_error (400, no payment method), payment_declined (402, the provider refused: reason is card_declined, insufficient_funds, card_expired, cvv_declined or card_restricted; the response keeps success: false), domain_not_found (404) and conflict (409). Recharges and cards add: card_expired (400, expired card), authentication_required (402, the bank asks the cardholder to authenticate), payment_in_progress (409, another payment of the organization is under way), quote_changed (409, the total changed since the quote: quote gives the new one), billing_info_required (409, billing address to complete when taxes apply), max_balance (422, the credit would exceed the domain's cap: maximum), payment_unknown (502, unknown outcome, nothing credited: payment_id), provider_error and provider_unavailable (502, the payment provider failed). Before this harmonization, error held an English text there and message was absent.

The account routes (/auth/me/password, /auth/me/email, /auth/me/phone, /auth/verifications) add their own codes (invalid_password, invalid_code, code_expired, too_many_attempts, email_in_use, invalid_phone, sms_unavailable...), listed in Verification by code.

Other HTTP errors have the same shape, with the lower-case name of the error as error (bad_request, unsupported_media_type, ...), and keep their HTTP headers (Allow of a 405, Content-Range of a 416 on a file...). A few administration routes have their own codes, listed in the reference.

Pagination

Lists accept skip (offset, 0 by default; a negative value counts as 0) and limit (page size, 50 by default, brought back into 1 to 100). A value that is not an integer gets 400 validation_error with field (skip or limit), never a 500. The response carries the list under the name of the resource, plus:

{ "transactions": [], "total": 132, "skip": 50, "limit": 50 }

total is the number of items matching the filters of the request, whatever the page. This is the shape of GET /conversations, GET /voice/calls, GET /voice/voicemails, GET /voice/diagnostics, GET /phone-numbers, GET /organizations, GET /billing/usage, GET /billing/transactions, GET /billing/invoices and most other lists: the reference gives total, skip and limit in the return of every route that has them. The balance is read with GET /api/v1/billing/balance.

Real time (Socket.IO)

The Socket.IO server is on the same host as the API (path /socket.io). The client gives its access token at connection (io(url, { auth: { token } })); without a valid token the connection is refused with unauthorized (unknown or revoked token) or token_expired (the client refreshes its token and reconnects).

Rooms. At connection, the socket joins, without asking:

  • user_<id>: the user's personal room (events that only concern them);
  • team_<id>: one room per team the user can access (as GET /conversations: every team of the current organization with teams.all, otherwise their own). With auth: { token, member_only: true } (or ?member_only=1), only the teams of the member view of the mobile app: in each organization the team the member is placed in, admins included (nothing without one); neither teams.all nor a platform permission adds anything, so a domain_admin does not follow every organization of their domain (same rule as member_only of GET /conversations).

Administration mode. An account with platform_admin or domain_admin can open the connection with io(url, { auth: { token, admin_organization: "<organization_id>" } }) (or ?admin_organization=): same rules as the X-Admin-Organization header (without these permissions: connection refused forbidden; unknown organization: not_found; domain admin outside their domains: forbidden). The socket then joins user_<id>, admin_org_<organization_id> and the room of each team of that organization only (not those of its own memberships). The room admin_org_<id> gets the organization's balance_update and account_state, and unread_update with the totals of all its teams. The organization is fixed for the life of the socket: join_team and mark_read outside it are ignored. The connection is journaled (audit_logs, type admin_realtime_connected) and the rooms are taken away if the account loses its platform permission.

A client can still emit join_team {team_id} (team room, refused without access), leave_team {team_id} (leaves the team room only) and mark_read {conversation_id}. A team that appears after the connection (new team, user placed in a team) is joined with join_team or at reconnection.

Web phone: the tab that opens its phone (POST /api/v1/voice/web-phone) emits webphone_join {name} (the SIP name of the tab's account; acknowledgement {ok}, refused for an account that is not the user's, closed or expired, and in the administration mode) at every connection, and webphone_leave {name} when it closes its phone. It then receives webphone_wake for every call of its extensions. A tab left without a phone (404 no_endpoint, 403 capability_required) gets webphone_check in the room user_<id> as soon as the user may use it, and asks for its account again.

Messages between colleagues (/api/v1/team-chat, every member of the organization, never an API key): the client emits presence_ping (no payload, acknowledgement {ok}) when the user acts (a key, a click, the page shown again), at most once a minute; without activity for 5 minutes the user is away; a connection of the mobile app (member_only) never turns away. Opening the connection counts as activity; closing it makes the user offline 8 seconds later (the time of a page reload). The events team_message, team_read and presence_update only go to the members concerned (those of the conversation, those of the colleague's organizations); they carry organization_id: a client that follows one organization ignores the others. App push: data {type: "team_message", thread_id, message_id, organization_id, unread}, one notification per conversation (the next one replaces it and counts the unread messages), preference push.team_message (/auth/me/notifications), cut by the do not disturb.

Event (server to client) Room Payload
new_message team {message, conversation}
conversation_update team (read: the reader's user_<id> only, with reader_id, since 2026-10-30) {conversation, change: read, closed, reopened, renamed or assigned, type, cause?, message_id?, contact_name?, assignee?, reader_id?}: assigned carries assignee {id, name} or null;: type = the same value as change (archived is no longer emitted since 2026-10-14: archiving closes); renamed (contact renamed or name cleared) carries contact_name, the new name or null
conversation_note team {note, change, conversation_id}
conversation_ai_update team {conversation_id, ai}: a Telma AI analysis of the conversation ended, or one of its actions was ticked; ai has the form of an item of ai.summaries of GET /api/v1/conversations/<id> (capability message_ai)
contact_update team (shared contact) or user (private contact) {change: created|updated|deleted, contact} — the address book changed (brief form of the contact, without its notes)
user_joined, user_left team {user_id}
balance_update user_<id> of every member whose current organization is this one {balance, currency, state}: new balance, CAD, state = ok, low (when the organization set a low-balance alert: balance at or under its threshold, never low when the alert is off; otherwise under the auto-recharge threshold when it is on, otherwise under $10) or empty (zero or less); sent on every credit or debit
unread_update user_<id> of the users who can access the team {conversations, messages, conversation_id?, unread?}: THE USER's unread (each their own since 2026-10-30), conversations with unread messages and number of unread messages; conversation_id + unread = the conversation that changed and its unread for the user; over every accessible team of the user's current organization, closed conversations included; sent on every inbound message and every read
call_request user_<id> of the user who made the request {id, status, call_id?}: status change of a call request (pending, used, connected, expired, cancelled, failed); requests are created with POST /api/v1/voice/call-requests
account_state user_<id> of every member of the organization, and admin_org_<id> in administration mode {state, previous_state, balance, currency, negative_since, grace_ends_at, suspended_at, limbo_at, release_at, released_at}: state of the prepaid account (UTC dates in ISO 8601 with Z); sent on every transition and every extension of the delay
low_balance user_<id> of every member whose current organization is this one {balance, threshold, currency}: the balance has just gone under the threshold of the low-balance alert
auto_recharge_failed user_<id> of every member whose current organization is this one {reason, amount, balance, currency}: the automatic recharge failed
voicemail_new user_<id> of every member of the organization who may listen to this message (same rule as GET /api/v1/voice/voicemails) {voicemail}: a voicemail message has just been left in a box of the organization; read GET /api/v1/voice/voicemails again, which only gives the messages the user may hear
call_update user_<id> of every member of the organization who sees this call (same rule as GET /api/v1/voice/calls) {call}: missed call; {call, change: "ended"}: another call (answered, outgoing, voicemail) has just ended (dashboard)
call_live user_<id> of the user of the extension that rings {state: "ringing", call_uniqueid, endpoint_id, number_id, caller {number, e164, name}}: an incoming call rings one of the user's extensions (live notice of the web app)
live_activity user_<id> of the members of the organization who hold activity.live (and admin_org_<id>) {organization_id}: the calls in progress of the organization changed; read GET /api/v1/live again
voice_presence user_<id> of the members who hold voice.use in an organization with the voice and sip (web phone or mobile app; the organization of the calls, and the other organizations of the users of its extensions) {organization_id}: who is free or on a call may have changed (calls in progress, do not disturb); read GET /api/v1/voice/colleagues again
queue_agent user_<id> of the agent {organization_id, agent}: their state as a queue agent was changed by the web server (log in, pause, resume, "Ready", a supervisor's action); agent = the shape of GET /voice/queues (without the queues: read GET /voice/queues again for the state queue by queue). The states written by the voice server (ringing, in a call, wrap-up) emit nothing: voice_presence comes with them
webphone_check user_<id> of the user (when they have a socket open) {}: the user may now use the web phone for an extension none of their open tabs holds (extension assigned, created or enabled again, voice.use given, the webphone or sip capability set on the organization); ask POST /api/v1/voice/web-phone again (a tab without a phone gets it, an open tab gets the extension). Nothing when the access is lost: the accounts are narrowed or closed
webphone_wake webphone_<name>: the tab that joined the room of its account (webphone_join) {name, call_uuid, caller_id, caller_name, called, endpoint}: a call rings one of the user's extensions; the tab registers (SIP account of POST /api/v1/voice/web-phone), the voice server rings it as soon as it registered
web_call_linked user_<id>: the user of the web call {web_call_id, call_id}: the call of a tab (POST /api/v1/voice/web-calls, opened when answered) has its record; the notes taken during the call are now the notes of the call (/api/v1/voice/calls/<call_id>/notes, event call_note to those who see the call)
call_note user_<id> of every member of the organization who sees this call {note, change, call_id}: a call note was added, edited or deleted (change = created, updated, deleted; GET /api/v1/voice/calls/<id>/notes)
call_ai_update user_<id> of every member of the organization who sees this call {call_id, state, other_party}: the transcription or the summary of the call changed (Telma AI; other_party = the contact); read GET /api/v1/voice/calls/<id>/ai again
call_ai_alert user_<id> of each recipient of an alert on a criterion {call_id, organization_id, number, criteria [{key, label, value}], title, body}: a summarized call matches an alert of the organization (Telma AI)
closed_digest user_<id> of each recipient of the opening digest (members of the team that reopens, or users who see the calls of the flow that reopens; do not disturb and preferences respected) {title, body, data {type: closed_digest, kind: sms\|calls, count, team_id?, conversation_id?, flow_id?, call_id?}}: the same content as the push of the app, for a browser notification (2026-10-31)
voicemail_ai_update user_<id> of every member who may listen to this message {voicemail_id, state}: the transcription of the voicemail message changed (Telma AI); read GET /api/v1/voice/voicemails again
dnd_update user_<id> of the user {dnd: {active, until, set_at}}: their do not disturb has just changed (PUT /auth/me/dnd, from another device); same object as GET /auth/me/dnd
port_update user_<id> of every member of the organization {id, state, numbers: [{number, state}]}: an inbound port request of the organization changed state
video_room_update user_<id> of the host, the members invited and those who took part {room}: a video meeting changed (state, participants, lock, recording); same shape as GET /api/v1/video/rooms/<id>
video_lobby user_<id> of the host and of the video.host members in the room {room_id, room {id, title, state}, participant, waiting}: a guest waits, or was just admitted or refused; waiting = somebody waits for the host (waiting room, or admitted in a meeting not started yet). The host who is not in the room then also gets the video_lobby push (room_id, preference push.video_invite, at most one per room per minute)
video_invite user_<id> of the member invited {room, from {id, name}}: a colleague invites the user to a meeting (with the video_invite push)
video_reminder user_<id> of the host and of the members invited {room}: the scheduled meeting starts in 15 minutes
video_ai_update user_<id> of the host and of the voice.recordings members {recording_id, room_id, status}: the recording of a meeting moved on (Telma AI); read GET /api/v1/video/recordings/<id> again
video_summary_ready user_<id> of the host {recording_id, room_id, title}: the summary of a recorded meeting is ready (once; also by email and by the push video_summary)
team_message user_<id> of every member of the conversation between colleagues (the two of a one-to-one conversation, those of the team) {thread_id, organization_id, change: created|updated|deleted, message, thread, unread, unread_total, mentioned}: a message written, edited or deleted; message and thread have the shapes of GET /api/v1/team-chat/threads/<id>/messages and GET /api/v1/team-chat/threads, thread, unread (this conversation) and unread_total (all of theirs in the organization) as THIS receiver sees them, mentioned = they are named by @
team_read user_<id> of every member of the conversation {thread_id, organization_id, user_id, last_read_at}: a member read up to last_read_at (the « read by »); their own devices also get unread: 0 and unread_total
presence_update user_<id> of every member of an organization of the colleague {user_id, state, since, organization_id, presence}: their presence changed (state: in_meeting, in_call, online, away (idle), offline, kept for the app 1.6; presence: the one presence in organization_id, one event per organization of the colleague; same shape as GET /api/v1/team-chat/presence)
status_update user_<id> of the user {status}: their manual status has just changed (PUT or DELETE /auth/me/status, from another session); same object as GET /auth/me/status
todo_update user_<id> of the recipient {reason: "phone_message"}: a message taken for them, or its “handled” mark, changed their “To do”; read GET /api/v1/dashboard/todo again

"Every member of the organization" means the active users whose current organization it is. balance_update and unread_update carry the current state: the client replaces its value, it does not add.

Rate limits

Requests Limit Counted per
any route without a limit of its own 500 per hour and 2000 per day, for each route API key, user or IP address (see below)
POST /api/v1/sms/send 100 per hour user, or API key other than an integration's
POST /api/v1/sms/send with an integration's key 600 per hour key
POST /api/v1/upload (attachment of an MMS) 60 per hour user or API key
POST /api/v1/team-chat/threads/<id>/messages (message between colleagues) 60 per minute user
POST /api/v1/team-chat/phone-messages (a message taken for a colleague) 60 per minute user
POST /api/v1/team-chat/threads/<id>/files (file attached to a message between colleagues) 60 per hour user
POST /auth/me/terms (accepting the terms of use) 30 per hour user
PUT /auth/me/status (manual status) 60 per hour user
POST /api/v1/public/port-check (checking whether a number can be ported, no sign-in) 5 per minute; 20 per hour; 50 per day client address
GET /prov/<token>/<file> (configuration of a phone or an adapter) 30 per minute client address
GET /prov/ca/<file> (certificate of the phones' configuration) 120 per minute client address
POST /api/v1/voice/parked/<id>/pickup (take a parked call back) 60 per minute user
POST /api/v1/csp-report (content security policy reports, sent by the browsers, without signing in) 60 per minute client address
GET /r/<token> (secret listening link of a recording, no sign-in) 60 per minute token
GET /api/v1/video/join/<code> (a video meeting as a guest sees it, no sign-in) 60 per minute; 120 per minute if the client's address is known code of the meeting; client address
POST /api/v1/video/join/<code> (a guest asks to enter) 20 per minute; 10 per minute if the client's address is known code of the meeting; client address
GET /api/v1/video/join/<code>/status (poll of the guest, every 2 seconds) 60 per minute; 600 per minute if the client's address is known participant; client address
GET /api/v1/video/join/<code>/chat 60 per minute participant
POST /api/v1/video/join/<code>/chat, POST /api/v1/video/join/<code>/consent 30 per minute participant
POST /api/v1/internal/video/resolve (code of a meeting typed on a phone, voice server) 120 per minute the whole platform
POST /api/v1/apps/<app>/webhook (webhook of a connected application's provider: LeadConnector delivery URL, signed by the provider) 600 per minute client address
POST /auth/login 30 failures per 15 minutes; if the client's address is known, also 10 per 15 minutes per email and address, and 100 per 15 minutes per address email address sent; client address
POST /auth/signup 10 per hour; 20 per hour if the client's address is known email address sent; client address
PUT /auth/me/password, PUT /auth/me/email, PUT /auth/me/phone 10 per hour user
POST /auth/verifications 30 per hour, on top of the code sending limits (see Verification by code) user
POST /auth/verifications/<id>/confirm 60 per hour user
POST /auth/register, POST /auth/reset-password 10 per hour token sent (invitation, reset)
DELETE /auth/me (deleting one's own account) 5 per hour user
PATCH /auth/me when the body changes the password (password, deprecated) 10 per hour user
POST /api/v1/keys (creating a key) 10 per hour user
POST /api/v1/organizations/<id>/members/<user_id>/impersonate 20 per hour user
POST /api/v1/domains/<id>/number-market/order (buying numbers for the domain's bank) 30 per hour user
POST /api/v1/voice/diagnostics (diagnostics report of a call) 120 per hour user
POST /api/v1/voice/sounds/tts (create a text-to-speech sound) 100 per hour and 300 per day user
POST /api/v1/voice/sounds/tts/preview (hearing a synthesized voice) 60 per hour user
POST /api/v1/voice/ai/preview (trial of the summary of a call) 20 per hour current organization of the user
POST /api/v1/billing/payment-methods, POST /api/v1/billing/payment-methods/session, POST /api/v1/billing/payment-methods/tokenize, POST /api/v1/billing/payment-methods/tokenize/verify (cards) 30 per hour user or key
POST /webhook/numbers/<token> (delivery by the number provider) 120 per minute IP address (see below)
POST /auth/forgot-password 5 per hour email address sent
POST /widget/<key>/start (website widget) 10 per minute and 60 per hour; 3 per hour and 10 per day to the same number widget; destination number, across all widgets
POST /api/v1/integrations/<id>/test 10 per minute the integration's organization, all its integrations together
POST /auth/mfa/verify (second step of the sign-in) 10 failures per 15 minutes account of the mfa_token, whatever the token
POST /auth/webauthn/login (sign-in with a passkey) 30 failures per 15 minutes; when the client's address is known, also 30 failures per 15 minutes per address passkey presented (its id); client's address
POST /auth/webauthn/login/options 60 per 15 minutes when the client's address is known (else no limit) client's address
POST /auth/mfa/webauthn/options 60 per 15 minutes account of the mfa_token
POST /auth/mfa/totp/confirm, POST /auth/mfa/totp/disable, POST /auth/mfa/backup-codes, POST /auth/webauthn/register, POST /auth/webauthn/credentials/<id>/remove 20 failures per 15 minutes account (session or X-MFA-Token)
POST /auth/oauth/google/callback, POST /auth/oauth/microsoft/callback, POST /auth/oauth/apple/callback 30 exchanges per minute, on top of the default limits provider, for the whole platform: only the code exchanges sent to the provider count
POST /<domain>/mcp (MCP connector) 60 per minute and 1000 per hour access token
POST /<domain>/oauth/token, POST /<domain>/oauth/revoke (MCP connector) 60 per hour client (client_id); for a client known by its metadata document (an https client_id, the same for every user of the assistant), the code or the token presented
POST /<domain>/oauth/register (registration of an assistant) 1000 per hour IP address (see below)

A route with a limit of its own is not subject to the default limits. Those are counted route by route: reading 500 conversations does not touch the counter of GET /api/v1/teams.

A request is counted as soon as it arrives, before any check: every request counts, including the refused ones (400, 401, 403...), with five exceptions:

  • OPTIONS requests (browsers' CORS preflight) never count;
  • POST /auth/login counts only its failures (401): a successful sign-in or a malformed request (400) consumes nothing, and the counter is checked before the password;
  • POST /api/v1/integrations/<id>/test is only counted once the authentication and the permission are checked: a request without a valid session (401), from a user without integrations.manage (403) or with an X-API-Key header (403) does not count. A call on an unknown integration (404) or on one the user does not administer (403) counts for that user alone, not for the integration's organization;
  • on POST /widget/<key>/start, only the welcome texts handed to the provider count (a refused request, an invalid number, the bot trap, a text already sent to the same number within the minute or a text Telma could not hand to the provider, for lack of credit or of an enabled provider, does not). Each text is counted right before it is handed to the provider: simultaneous requests do not exceed these limits. The per-number counter is the one of the number actually texted, however it is written: "514 555 9999" and "+1 514 555 9999" are one and the same number. "+" followed by 10 digits depends on the provider of the widget's number: with a provider that reads North American numbers, "+5145559999" is read as 1-514-555-9999 (the number it texts); with a provider that sends the international number as given, "+47 923 45 678" stays a Norwegian number;
  • the common cap of the OAuth callbacks (POST /auth/oauth/google/callback, POST /auth/oauth/microsoft/callback, POST /auth/oauth/apple/callback) works the same way: a callback refused before the exchange (invalid body, provider not enabled for the domain) does not touch it, and each exchange is counted right before it is sent to the provider. The default limits of these routes, for their part, count every request as soon as it arrives.

Not subject to any limit: the providers' inbound webhooks (/webhook/provider and /webhook/billing, but not /webhook/numbers/<token>, limited above), the uploaded files (GET /api/v1/uploads/<file>) and the media relay (GET /api/v1/media-proxy), which browsers load without a key, and the website widget's script (GET /widget/<key>.js), which every visitor of the sites that embed it loads.

The public routes of the login page are not limited either: GET /auth/oauth/providers, GET /auth/oauth/google, GET /auth/oauth/microsoft and GET /auth/oauth/apple (which only build the sign-in address), POST /auth/oauth/apple/return (which only checks the signature of the state and sends the browser on to its page), GET /auth/signup/config and GET /api/v1/domains/current. The metadata of the MCP connector (GET /.well-known/oauth-protected-resource/<domain>/mcp, GET /.well-known/oauth-authorization-server/<domain>) and GET|DELETE /<domain>/mcp (always 405) are not limited either.

Each request is counted, in this order:

  1. on the anonymous authentication routes, per target, whatever the other headers (X-API-Key, Authorization): the email address sent for POST /auth/login, POST /auth/forgot-password and POST /auth/signup, the token sent for POST /auth/register and POST /auth/reset-password, the authorization code sent for POST /auth/oauth/google/callback, POST /auth/oauth/microsoft/callback and POST /auth/oauth/apple/callback (per IP address when the body has none; their exchanges with the provider also have the common cap of the table), and the token of the address for GET /api/v1/invitations/verify/<token>;
  2. with a valid X-API-Key (existing and not revoked), per key: every user of your application who goes through the same key shares its counters;
  3. with a valid JWT, per user (for POST /auth/refresh and POST /auth/logout, the user of the refresh token); a token that Telma signed and that expired less than an hour ago is counted separately, for its user: it therefore gets 401, which makes the client refresh its session, and never a 429 caused by anonymous traffic, without ever using up the counters of that user's valid requests (a token expired longer ago counts as an anonymous request);
  4. otherwise, per client IP address.

A made-up or revoked key creates no counter: the request is counted as without a key (steps 1, 3 or 4 above). On a route that requires authentication, it gets 401, or 403 on the routes closed to every key as soon as an X-API-Key header is present (/api/v1/integrations* and those that would give another way to sign in, see API key). The counters of the website widget (per widget, per destination number) ignore X-API-Key, Authorization and the visitor's address.

IP address. Behind the TLS relay of the production host (sslh) every request arrives from 127.0.0.1: Telma does not know the real address of its clients. A loopback, private or local address is never taken for a client's (utils/client_ip.py): the limits "per address" (the failure budgets of POST /auth/login, sign-up) then do not apply, instead of being one counter for the whole platform. The other "per address" counters (anonymous routes without a target) stay shared by every anonymous client, route by route: without a key or JWT, your requests share the default limits with everyone else's, and a 429 may come from other people's traffic. Authenticate your calls (API key or JWT) to get counters of your own. Infrastructure limit: the real address appears with no code change as soon as sslh passes it on (transparent mode, or the PROXY protocol between sslh and nginx with nginx's realip module: set_real_ip_from 127.0.0.1; real_ip_header proxy_protocol;). If nginx rather puts a single address in a header (proxy_set_header X-Real-IP $remote_addr;), the name of that header goes in the environment variable TRUSTED_CLIENT_IP_HEADER; Telma never reads a header the client can send as it likes.

The answers of limited routes carry these headers, exposed to browsers through CORS:

Header Content
X-RateLimit-Limit the current ceiling: the one of the shortest period, or the one reached
X-RateLimit-Remaining the requests left in that period
X-RateLimit-Reset the end of that period, in Unix seconds
Retry-After on a 429 only: the number of seconds to wait

Beyond the ceiling, the answer is a JSON 429; retry_after (an integer, at least 1) and Retry-After have the same value:

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 1312
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1791574536

{"error": "rate_limited", "message": "Rate limit exceeded (600 per 1 hour), retry in 1312 s", "retry_after": 1312}

A refused send is not queued

A 429 is returned before any processing: the SMS is neither sent, nor recorded, nor held at Telma. Your application must retry it after Retry-After seconds; an automatic SMS (reminder, confirmation...) it does not retry is lost. If your sends get close to the ceiling, spread them out or queue them on your side.

Examples of a client that retries after a 429, honouring Retry-After (tested against the real 429 of the API); beyond max_wait seconds of waiting, they return the error so you can put the send back in your own queue:

import os
import time

import requests

TELMA_API = os.environ.get("TELMA_API", "https://api.telma.ca")
TELMA_KEY = os.environ["TELMA_KEY"]


class TelmaError(Exception):
    def __init__(self, status, body):
        super().__init__(f"{status} {body.get('error')}: {body.get('message')}")
        self.status, self.body = status, body


def telma_send(payload, max_wait=900):
    """POST /api/v1/sms/send: returns the created message; retries after a 429, raises TelmaError otherwise."""
    waited = 0
    while True:
        response = requests.post(f"{TELMA_API}/api/v1/sms/send", json=payload,
                                 headers={"X-API-Key": TELMA_KEY}, timeout=30)
        try:
            body = response.json()
        except ValueError:  # answer of an intermediary (502, 504...): not JSON
            body = {"error": f"http_{response.status_code}", "message": response.text[:200]}
        if response.status_code == 201:
            return body["message"]
        if response.status_code == 429:  # nothing was sent: it can be retried
            delay = int(response.headers.get("Retry-After", "60"))
            if waited + delay <= max_wait:
                time.sleep(delay)
                waited += delay
                continue
        # 500 send_failed: body["message_id"] is already recorded as failed, do not resend blindly
        raise TelmaError(response.status_code, body)
const TELMA_API = process.env.TELMA_API || "https://api.telma.ca";
const TELMA_KEY = process.env.TELMA_KEY;

class TelmaError extends Error {
  constructor(status, body) {
    super(`${status} ${body.error}: ${body.message}`);
    this.status = status;
    this.body = body;
  }
}

// POST /api/v1/sms/send: returns the created message; retries after a 429, throws TelmaError otherwise
async function telmaSend(payload, maxWait = 900) {
  let waited = 0;
  for (;;) {
    const response = await fetch(`${TELMA_API}/api/v1/sms/send`, {
      method: "POST",
      headers: { "X-API-Key": TELMA_KEY, "Content-Type": "application/json" },
      body: JSON.stringify(payload),
    });
    // the answer of an intermediary (502, 504...) is not JSON
    const body = await response.json().catch(() => ({ error: `http_${response.status}`, message: "" }));
    if (response.status === 201) return body.message;
    if (response.status === 429) { // nothing was sent: it can be retried
      const delay = Number(response.headers.get("retry-after")) || 60;
      if (waited + delay <= maxWait) {
        await new Promise((resolve) => setTimeout(resolve, delay * 1000));
        waited += delay;
        continue;
      }
    }
    // 500 send_failed: body.message_id is already recorded as failed, do not resend blindly
    throw new TelmaError(response.status, body);
  }
}

Monitoring

GET /health (no authentication, never rate limited) answers 200 {"status": "ok", "mongo": true} when the API and its database answer, 503 {"status": "degraded", "mongo": false} otherwise: it is the probe of the monitoring tools, not a route for your clients.

GET /api/uploads/<file> is the old address of the uploaded files: it redirects (301) to GET /api/v1/uploads/<file>.