curl --request PUT \
--url https://app.thinnest.ai/api/v1/phone-numbers/carrier-accounts/{provider} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "AC3f9e2b7d41c08a6e5b1d2f7c9e04a41c",
"token": "9b7c2e4f1a8d3065c7e2b9f14d6a8e3c"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: 'AC3f9e2b7d41c08a6e5b1d2f7c9e04a41c',
token: '9b7c2e4f1a8d3065c7e2b9f14d6a8e3c'
})
};
fetch('https://app.thinnest.ai/api/v1/phone-numbers/carrier-accounts/{provider}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/phone-numbers/carrier-accounts/{provider}"
payload = {
"accountId": "AC3f9e2b7d41c08a6e5b1d2f7c9e04a41c",
"token": "9b7c2e4f1a8d3065c7e2b9f14d6a8e3c"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"provider": "twilio",
"accountEnding": "a41c"
}Save Carrier Account
Saves the keys of your own account with a carrier, which lets its brought numbers be confirmed, answered and called out from. The keys are checked with the carrier before anything is stored, stored sealed, and never returned. One account per carrier: switching to a different account while numbers are still brought on the first is refused. telnyx takes its API key as token alone. Needs a full key — a carrier credential can spend money on your account.
curl --request PUT \
--url https://app.thinnest.ai/api/v1/phone-numbers/carrier-accounts/{provider} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "AC3f9e2b7d41c08a6e5b1d2f7c9e04a41c",
"token": "9b7c2e4f1a8d3065c7e2b9f14d6a8e3c"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: 'AC3f9e2b7d41c08a6e5b1d2f7c9e04a41c',
token: '9b7c2e4f1a8d3065c7e2b9f14d6a8e3c'
})
};
fetch('https://app.thinnest.ai/api/v1/phone-numbers/carrier-accounts/{provider}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/phone-numbers/carrier-accounts/{provider}"
payload = {
"accountId": "AC3f9e2b7d41c08a6e5b1d2f7c9e04a41c",
"token": "9b7c2e4f1a8d3065c7e2b9f14d6a8e3c"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"provider": "twilio",
"accountEnding": "a41c"
}Authorizations
Your API key (ta_live_…) from Settings → API keys, sent as Authorization: Bearer <key>. Keep it on a server: it can message every customer you have. A key is full, build or read-only; a request its level does not allow is refused with 403.
Headers
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Path Parameters
Which carrier the account is with. A carrier a brought number can be on — whose network your own account is with.
plivo, vobiz, twilio, telnyx "twilio"
Body
Response
The keys were checked and saved.
A carrier a brought number can be on — whose network your own account is with.
plivo, vobiz, twilio, telnyx "twilio"
The last four characters of the account id, so you can tell which account is connected; empty for an id too short to hint at.
"a41c"