Phase 2 — API integration
This phase keeps your system and Voicebot in step. A customer appears on your side, an account appears here, and the two stay matched for as long as both exist. Your engineers write that loop once.
Step 1 — Authenticate
Section titled “Step 1 — Authenticate”The key from phase 1 is a bearer credential. Send it on every request:
Authorization: Bearer <your key>There is no exchange step and no token to refresh: the key is what authenticates.
Treat it as you would any other production secret. It belongs in your secret store, never in source control, and it reaches your service the way the rest of your credentials do.
| Key | Opens |
|---|---|
| A tenant-level user’s key | the Tenant API, and the Account API for every account in your tenant |
| An account-level user’s key | the Account API for the one account that user belongs to |
A key lives until its expires_at passes; POST/v1/t/user/{sid}/api-key states the full
lifetime. Identity and access covers which key opens what.
An exposed key is withdrawn with DELETE/v1/t/user/{sid}/api-key/{key_sid}, and GET/v1/t/user/-/api-key shows the keys your tenant holds. To replace a key without an outage, issue the new one first, switch your service to it, then revoke the old one.
Done when GET/v1/t/account answers under that key.
Step 2 — Mirror your resources
Section titled “Step 2 — Mirror your resources”Four resources cross the boundary. All four work the same way: something happens in your system, you call the matching operation here, and the two records stay joined by an identifier you choose.
Accounts
Section titled “Accounts”One per organisational unit on your side: a department, a brand, a region, or a customer of yours.
POST/v1/t/accountPATCH/v1/t/account/{sid}
DELETE/v1/t/account/{sid}
GET/v1/t/account
The people who sign in to that account. An account needs at least one. You give each user roles by name. Roles and permissions lists the fixed roles of your tenant and what each permission lets a user do.
POST/v1/a/userPATCH/v1/a/user/{sid}
DELETE/v1/a/user/{sid}
GET/v1/a/user
Numbers
Section titled “Numbers”An identifier the account places and answers calls on. It is an alphanumeric value carried in a SIP URI, not necessarily a dialable telephone number.
POST/v1/a/numberPATCH/v1/a/number/{id}
DELETE/v1/a/number/{id}
GET/v1/a/number
Number pools
Section titled “Number pools”Only if you group numbers. A pool widens the inbound side: an agent bound to one answers on every active number in it.
Membership lives on the number rather than on the pool — you attach and detach by patching the
number’s pool_sid, not by calling the pool.
PATCH/v1/a/number-pool/{id}
DELETE/v1/a/number-pool/{id}
GET/v1/a/number-pool
SMS providers
Section titled “SMS providers”Only if the account sends SMS. It sits outside the loop the four resources above form.
A provider is an account’s configuration of an SMS gateway: the one call that hands a message over, and the sender identities registered with that gateway.
Your tenant-level key creates one for a named account, the same way it creates that account’s
other resources. When you omit access_type, you administer the provider: the account reads it and sends
through it, and a change or delete from inside the account is refused. So the gateway you
contracted keeps pointing where you set it, whoever is administering that account. To let the
account administer it, send
access_type: account.
The refusal governs writing, not reading: an administrator of that account can still read the configuration you stored, credentials included. Treat what you put in a provider as visible to the account it serves.
An account running an SMS contract of its own configures its own provider instead. Both kinds appear together when that account lists them.
POST/v1/a/integrations/sms/providerPATCH/v1/a/integrations/sms/provider/{id}
DELETE/v1/a/integrations/sms/provider/{id}
GET/v1/a/integrations/sms/provider
Done when every resource on your side has a counterpart here, a change on your side reaches it, and a deletion on your side removes it.
Step 3 — Sign your users in
Section titled “Step 3 — Sign your users in”Neither shape below gives your people a second password to remember. Pick one and apply it uniformly.
You issue a one-time link for a user and hand it to them: your system redirects them straight into the panel, or delivers the link however it already reaches that person.
POST/v1/a/user/{sid}/magic-link/requestPOST/v1/a/auth/magic-link/consume
The link is a credential while it is in transit. How it travels matters as much as the fact that it expires.
You create the user and drive a password reset; the person then signs in with an email address and a password.
POST/v1/a/user/{sid}/password-reset/requestPOST/v1/a/auth/regular
Use this where a redirect is not possible.
Either a tenant-level user’s key or that account’s own user’s key can issue the link. Identity and access covers the rest.
Done when one of your people has signed in for real and last_login_at comes back set from
GET/v1/a/user.
Step 4 — Validate
Section titled “Step 4 — Validate”Work through both against a real account rather than a scratch one.
Everything your system created here, and the changes it makes afterwards.
| # | Check | How |
|---|---|---|
| 1 | every account on your side has a counterpart here | GET/v1/t/account |
| 2 | numbers registered | GET/v1/a/number |
| 3 | numbers grouped into pools | GET/v1/a/number-pool |
| 4 | a change on your side reaches here | PATCH/v1/a/number/{id} |
| 5 | a deletion on your side removes the counterpart here | DELETE/v1/a/number/{id} |
The pass that matters: a user you created signs in and reads their own profile.
| # | Check | How |
|---|---|---|
| 1 | that user can be issued a one-time link | POST/v1/a/user/{sid}/magic-link/request |
| 2 | consuming it returns a session | POST/v1/a/auth/magic-link/consume |
| 3 | the session reads its own profile | GET/v1/a/profile |
The profile answers with that user, the account they belong to, and the features enabled for it, so a successful call confirms the whole chain in one request.
Passing both is what opens phase 3, however the resources were created.