Authentication
Every request is authenticated with an API key sent as a bearer token:
Authorization: Bearer tw_live_EXAMPLEKEY000000000Test and live keys
Section titled “Test and live keys”| Prefix | Mode | Sends real messages | Charged |
|---|---|---|---|
tw_test_ |
Test | No | No |
tw_live_ |
Live | Yes | Yes |
Objects created in test mode are only visible to test keys, and the same goes for live mode, so you can’t mix them up by accident.
Restricted keys
Section titled “Restricted keys”For services that only need part of the API, create a restricted key and choose exactly which resources it can read or write. A reporting job, for example, only needs messages:read.
Rotating a key
Section titled “Rotating a key”- Create a new key in the dashboard.
- Deploy it to your servers.
- Revoke the old key once traffic has moved over.
Revoked keys stop working immediately and return 401 Unauthorized.