Skip to content

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.

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.

KeyOpens
A tenant-level user’s keythe Tenant API, and the Account API for every account in your tenant
An account-level user’s keythe 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.

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.

One per organisational unit on your side: a department, a brand, a region, or a customer of yours.

POST/v1/t/account
PATCH/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/user
PATCH/v1/a/user/{sid}
DELETE/v1/a/user/{sid}
GET/v1/a/user

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/number
PATCH/v1/a/number/{id}
DELETE/v1/a/number/{id}
GET/v1/a/number

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.

POST/v1/a/number-pool
PATCH/v1/a/number-pool/{id}
DELETE/v1/a/number-pool/{id}
GET/v1/a/number-pool

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/provider
PATCH/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.

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/request
POST/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.

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.

Work through both against a real account rather than a scratch one.

Everything your system created here, and the changes it makes afterwards.

#CheckHow
1every account on your side has a counterpart hereGET/v1/t/account
2numbers registeredGET/v1/a/number
3numbers grouped into poolsGET/v1/a/number-pool
4a change on your side reaches herePATCH/v1/a/number/{id}
5a deletion on your side removes the counterpart hereDELETE/v1/a/number/{id}

Passing both is what opens phase 3, however the resources were created.