JT Noble SMS documentation home

Authentication and API keys

Create an API key, send it as a Bearer token and keep it secret.

Every API call needs an API key, except the few public routes marked in the API reference.

Live and test keys

Key starts withWhat happens
jtsms_live_Real SMS. Each message is charged to your balance.
jtsms_test_Sandbox. Nothing is sent to a phone and nothing is charged. Use it while you build.

A test key only sees test messages. A live key only sees live messages.

Create a key

  1. Sign in at app.sms.jtnoble.com.
  2. Open API keys and choose Create key.
  3. Give it a name, for example website, and pick live or test.
  4. Copy the key now. It is shown once. We only store a fingerprint of it.

Keys are made and revoked in the dashboard. An API key cannot make another key (HTTP 403, code portal_only).

Send the key

Put the key in the Authorization header on every request:

Authorization: Bearer jtsms_live_YOUR_KEY

Do not put the key in the URL. URLs end up in logs.

Scopes

A key can be limited to some actions.

ScopeAllows
sendSending messages, and every other change except webhooks.
queryReading messages, balance and reports.
webhooksReading and changing webhook settings.

New keys get send, query and webhooks. A call outside the key's scopes gets HTTP 403 with code insufficient_scope. A key with query only is read-only on every route.

What a key cannot do

These need a person signed in to the dashboard: making or revoking API keys, team and workspace membership, and reseller client routes. In the reference they are marked "dashboard session token". API calls to them get HTTP 403 with code portal_only, or reseller_only on reseller routes.

Errors

HTTPCodeMeaning
401unauthorizedNo key, or the key is wrong or revoked.
403insufficient_scopeThe key does not have the scope for this action.
403portal_onlyThis action is only available in the dashboard.
403account_suspendedThe account is suspended or paused. Contact support.

Keep keys safe

  • Keep keys on your server. Never put a key in a mobile app, a web page or a public code repository.
  • Use one key per app, so you can turn one off without stopping the others.
  • If a key leaks, delete it in the dashboard at once and create a new one.

On this page