pepa

How to Authenticate

Pass your API key correctly on every request.

142 words·1 min read

Every request to the Widgets API must include a bearer token in the Authorization header. This page explains how to obtain a key and attach it to your requests. For the full auth scheme spec (scopes, error codes, token expiry), see the API Reference.

Get an API key

Sign in to your dashboard and navigate to Settings → API Keys. Click Create key, give it a name, and copy the value — it won't be shown again.

Attach the token

Pass your key as a bearer token on every request:

curl https://api.example.com/v1/widgets \
  -H "Authorization: Bearer YOUR_API_KEY"

Common errors

StatusCodeCause
401unauthorizedMissing or malformed Authorization header
401unauthorizedKey has been revoked

If you receive a 401, double-check that the header value is exactly Bearer <key> with no extra whitespace.