SMS YANU 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.

Live and test keys

Key starts withWhat happens
yanu_live_Real SMS. Each message is charged to your balance.
yanu_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.smsyanu.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.

Send the key

Put the key in the Authorization header on every request:

Authorization: Bearer yanu_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.
queryReading messages and balance.
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.

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.

To be confirmed

Scope names come from the current code and may change before launch.

On this page