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
- Log into the Stable Dashboard.
- Go to Settings > API Keys
- Enter a name for the key.
- 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:
- Create a new key.
- Deploy the new key to your system.
- 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.
