1. Concepts
What an API key is
An API key authenticates a request to the Zenskar API without a user login session. It is sent in the request’sx-api-key header.
Key prefix identifies the environment
A generated key is prefixed withsandbox_ or production_, matching the type of the organization it belongs to, so the environment a key belongs to is visible from the key itself.
Shown once, never recoverable
Zenskar stores only a hash of the key, not the key itself. The full key is shown exactly once, immediately after creation. If it is lost, generate a new key; there is no way to retrieve an existing key’s value again.Creating and deleting a key requires permission
Viewing, creating, and deleting API keys each require a separate permission. A user without the relevant permission does not see the corresponding action.2. How-to guides
Create an API key
- Click the account menu at the bottom of the sidebar, and select Settings.
- Open the API Keys tab.
- Click Create API Key.
- Enter a descriptive name, and click Generate API Key.
- Copy the key immediately. It is shown only once and cannot be viewed or copied again after this step.
Delete an API key
- Open Settings > API Keys.
- Open the actions menu on the row for the key to remove, and select Delete.
- Confirm the deletion.
Authenticate a request with an API key
Add the key to the request’sx-api-key header.
Troubleshooting
- The API key value was lost after creation: a key cannot be retrieved once its creation screen is closed. Delete the old key if it is no longer usable, and create a new one.
- Create API Key or Delete is not available: the signed-in user does not have permission to create or delete API keys.