simtrunkDocs

API keys and scopes

Call the simtrunk API with a key that has only the scopes it needs.

The API is at https://api.simtrunk.com, under /v1/<resource>: lines, calls, SMS, USSD, trunks, SIP users, SIM banks, webhooks and the audit log. See the HTTP API reference.

API keys come with the Team plan (up to 10 keys, 50,000 requests a day) and the Business plan (up to 100 keys, 1,000,000 requests a day).

Create a key

Under API keys in the dashboard, create a key and choose its scopes. Copy it when it is shown: it starts with simtrunk_live_. A key belongs to one organization, so paths name none.

Terminal
export SIMTRUNK_API_KEY=simtrunk_live_…curl https://api.simtrunk.com/v1/lines -H "Authorization: Bearer $SIMTRUNK_API_KEY"

Scopes

Each operation needs one scope, listed in the reference. A key without it gets 403.

ResourceReadWrite
Lineslines:readlines:write
Callscalls:readcalls:write
SMSsms:readsms:write
USSD—ussd:write
SIP trunkstrunks:readtrunks:write
SIP userssip_users:readsip_users:write
SIM banksbanks:readbanks:write
Webhookswebhooks:readwebhooks:write
Settingssettings:readsettings:write
SIP tracestraces:read—
Audit logaudit:read—
Live eventsevents:read—
Carrierscarriers:read—
Tunnel proxies—proxies:write

Give each key only what it needs: a key that sends SMS needs sms:write, nothing more.

Good to know

  • A suspended organization's keys can read but not change anything (403).
  • Writes to a line, a trunk or the settings may send If-Match with the revision read (its ETag); a stale one is refused with 412.
  • GET /v1/events is a live stream of events (Server-Sent Events).
  • Every change made with a key is in the audit log.

How is this guide?

Last updated on

On this page