# Bearer token

> A bearer token is a credential sent in the HTTP Authorization header as \"Bearer <token>\"; whoever holds it can use it, which is why it must travel only over HTTPS and be stored as a secret.

The bearer scheme, defined for OAuth 2.0 in RFC 6750 and now used far beyond it, is the simplest form of HTTP authentication. The client sends `Authorization: Bearer` followed by the token, and the server checks the token and nothing else: the request itself is not signed, and possession is the only proof required. As the name suggests, the token works for whoever holds it, like cash.

That makes bearer authentication convenient and universal, and puts all of its security in two places: transport encryption, so that the token cannot be read in transit, and secret handling at both ends. Compared with schemes that sign every request, bearer tokens are far easier to integrate, and for server-to-server calls they are comparably safe when the token is scoped, rotated and restricted by IP. A token can be opaque, like most API keys, which the server looks up, or self-contained, like a JSON Web Token, which the server verifies; the header is the same either way.

## Example

A developer debugging a hypothetical integration pastes a full cURL command, live key included, into a public issue tracker. Anyone who copies it can now send messages on that account's balance. Editing the post does not help, because the key may already have been copied; revoking it and issuing a new one does.

## Common mistakes

- Passing the token in a URL query string, where it ends up in logs and browser history.

- Sending it over plain HTTP, even once, even in testing.

- Wrapping the token in quotes, or leaving out the space after `Bearer`.

- Logging the `Authorization` header in full.

At SMSMeteor: every API request carries `Authorization: Bearer sk_live_…`, or an `sk_test_` key for testing. Keys are scoped to `send`, `read` or both and may carry an IP allowlist; a missing, revoked, wrongly scoped or IP-restricted key gets `401 unauthorized`. Traffic in the other direction is authenticated differently: events sent to your webhook endpoint carry an [HMAC signature](https://smsmeteor.io/glossary/hmac-signature). More on keys under [API key](https://smsmeteor.io/glossary/api-key) and on the [security page](https://smsmeteor.io/security).

Related terms: [API key](https://smsmeteor.io/glossary/api-key), [REST API (SMS)](https://smsmeteor.io/glossary/rest-api), [HMAC signature (webhooks)](https://smsmeteor.io/glossary/hmac-signature)

---
Source: https://smsmeteor.io/glossary/bearer-token (HTML). Generated by SMSMeteor from the same data as the page. Summary of the whole site: https://smsmeteor.io/llms.txt
