API reference
SIP trunks
The carrier connections behind the SIP numbers, with the calls-per-second limit every number on a trunk shares.
List SIP trunks
/v1/trunksLists the tenant's SIP trunks. Calls per second is a trunk-level limit shared by every number on the trunk. Filtered on an entity, it returns the trunks carrying at least one of that entity's numbers.
Authorization
AuthorizationstringrequiredBearer <API key>, a key created at app.callshift.ai/api-keys.
Query parameters
entityIdstring<uuid>Return only the items of this entity. Send this or entityExternalId, not both.
entityExternalIdstringReturn only the items of the entity with this external id. Send this or entityId, not both.
Responses
SIP trunks
dataobject[]requiredShow child attributes
idstring<uuid>requirednamestringrequiredproviderstringrequiredregionstring | nullrequiredphoneNumbersCountintegerrequiredcallsPerSecondintegerrequiredentityIdsstring<uuid>[]requiredThe entities of the numbers on this trunk. A trunk shared by several entities lists each of them; a trunk whose numbers are all shared lists none.
Invalid request
successenum<boolean>requiredfalseerrorobjectrequiredShow child attributes
nameenum<string>requiredZodErrorissuesobject[]requiredShow child attributes
codestringrequiredpathstring | number[]requiredmessagestringrequiredUnauthorized
errorstringrequiredEntity not found
errorstringrequiredcurl "https://api.callshift.ai/v1/trunks" \
-H "Authorization: Bearer $CALLSHIFT_API_KEY"const res = await fetch("https://api.callshift.ai/v1/trunks", {
headers: {
Authorization: `Bearer ${process.env.CALLSHIFT_API_KEY}`,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://api.callshift.ai/v1/trunks",
headers={"Authorization": f"Bearer {os.environ['CALLSHIFT_API_KEY']}"},
)
print(res.json()){
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "acme-sip",
"provider": "sip",
"region": null,
"phoneNumbersCount": 3,
"callsPerSecond": 10,
"entityIds": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
]
}{
"success": false,
"error": {
"name": "ZodError",
"issues": [
{
"code": "invalid_enum_value",
"path": [
"contacts",
0,
"email"
],
"message": "Invalid email"
}
]
}
}{
"error": "Authentication error"
}{
"error": "Entity not found"
}