Skip to content

Authentication

Every request is authenticated with an API key sent as a bearer token:

Authorization: Bearer tw_live_EXAMPLEKEY000000000
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.

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.

  1. Create a new key in the dashboard.
  2. Deploy it to your servers.
  3. Revoke the old key once traffic has moved over.

Revoked keys stop working immediately and return 401 Unauthorized.