Browse the docs

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

GET/v1/trunks
Bearer API key

Lists 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

Authorizationstringrequired

Bearer <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.

example 550e8400-e29b-41d4-a716-446655440000
entityExternalIdstring

Return only the items of the entity with this external id. Send this or entityId, not both.

1 to 255 charactersexample club-42

Responses

SIP trunks

dataobject[]required
Show child attributes
idstring<uuid>required
namestringrequired
example acme-sip
providerstringrequired
example sip
regionstring | nullrequired
example null
phoneNumbersCountintegerrequired
example 3
callsPerSecondintegerrequired
example 10
entityIdsstring<uuid>[]required

The 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>required
Allowedfalse
errorobjectrequired
Show child attributes
nameenum<string>required
AllowedZodError
issuesobject[]required
Show child attributes
codestringrequired
example invalid_enum_value
pathstring | number[]required
messagestringrequired
example Invalid email

Unauthorized

errorstringrequired

Entity not found

errorstringrequired
GET
curl "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())
Response
{
  "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"
}