API keys
Keys that let scripts and CI use the Teral API.
An API key authenticates requests to the API. Each key belongs to a workspace and can do only what its permissions allow. Only admins can see and manage keys.
Create a key
- Open Settings → API Keys and create a key.
- Give it a name that says where it's used, such as
github-actions-deploy. - Choose its permissions. Start from a template, such as all read permissions, or pick permissions per resource: projects, apps, deployments, environments, variables, domains, gateway policies and so on. You can't give a key more permissions than you have yourself.
- Optionally set an expiry date.
Copy the secret when it's shown. Teral doesn't store it in readable form, so you can't see it again later.
Use a key
Send it as a bearer token:
curl -X POST https://api.teral.dev/v1/projects.listProjects \
-H "Authorization: Bearer $TERAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Keep keys in your CI's secret store, never in a repository.
Rotate or delete a key
- Rotate creates a new secret with the same name and permissions. Use it on a schedule, or when a secret may have leaked.
- Delete revokes the key. Requests using it fail from then on.
If you lose a secret, rotate the key and update the places that use it.