Authentication

Learn how to authenticate with the Stable API.

The Stable API authenticates using API keys passed in the x-api-key header.

Create an API key

  1. Log into the Stable Dashboard.
  2. Go to Settings > API Keys
  3. Enter a name for the key.
  4. Copy the key.

The API key is only shown once.

Use API key in requests

Send the API key in a x-api-key header of each request.

curl https://api.usestable.com/v1/locations \
  -H "x-api-key: $STABLE_API_KEY"

If you fail to supply a valid API key, you'll receive an HTTP 400 error in response.

Rotate an API key

Keys do not expire. To replace a key:

  1. Create a new key.
  2. Deploy the new key to your system.
  3. Revoke the old key.

Keep keys safe

  • Use keys only on your server.
  • Use one key for each system. This will let you revoke one key without affecting other systems.
  • Note that Stable is unable to recover API keys you lose access to.