X-API-KEY header.
Obtaining an API Key
- Log in to the Atomscale Dashboard
- Click your name at the bottom of the sidebar, then select Manage account > Access
- Enter a Label (optional) to identify the key, and choose an Expiration (see Key Expiration)
- Click Generate API Key
- Copy and securely store the key. It is only shown once.
Using Your API Key
Include your API key in theX-API-KEY header of every request:
Code Examples
Environment Variables
For security, store your API key in an environment variable rather than hardcoding it. The SDK readsAS_API_KEY automatically when you create a Client() without an api_key argument (it also accepts ATOMSCALE_API_KEY as a fallback):
Key Permissions
API keys do not have separate scopes. A request made with your key has the same permissions as your user account.Key Expiration
- When you generate a key, you can set it to expire after 7, 30, 60, or 90 days, or never. The default is 90 days.
- A banner at the top of the dashboard warns you when a key will expire within 14 days.
- A key that goes unused for 90 days is revoked automatically, whatever expiration you chose.
- Generating a new key immediately expires your previous key. Update any applications that use the old key.
- Requests made with an expired or revoked key return
401 Unauthorized.
Revoking Keys
If a key is compromised or no longer needed:- Open the Access page (click your name at the bottom of the sidebar, then select Manage account > Access)
- Find the key and click Revoke, then click Revoke again to confirm
- The key is immediately invalidated
Revoking a key cannot be undone. Any applications using that key will stop working immediately.