Creating an API Key
Open the API keys page
Navigate to app.tusky.io/account/api-keys in the Tusky dashboard.
Generate a new key
Click Create API Key. Provide a descriptive name (for example,
production-backend or ci-pipeline) and select the permission scopes you need.Permission Scopes
API keys can be scoped to limit what operations they are allowed to perform:| Scope | Description |
|---|---|
environments:read | List and retrieve environment metadata |
environments:write | Create, update, and delete environments |
files:read | List, retrieve, and download files |
files:write | Upload and delete files |
members:read | List environment members |
members:write | Add, update, and remove environment members |
account:read | Read account info, usage, and balance |
aggregators:read | Read aggregator configuration |
aggregators:write | Update aggregator settings and custom domains |
Using Your API Key
With the SDK
Pass your API key when initializing the Tusky client:With the REST API
Include the API key in theAuthorization header of every request:
Key Management
Rotation
Rotate API keys regularly, especially if they may have been exposed. To rotate:- Create a new API key with the same scopes
- Update your application configuration to use the new key
- Verify the application works with the new key
- Revoke the old key
Tusky does not enforce automatic key expiration. You are responsible for rotating keys according to your organization’s security policy.
Revocation
Revoke a key instantly from the API keys page. Revocation takes effect immediately — any in-flight requests using the revoked key will fail.Security Best Practices
-
Use environment variables — never hardcode API keys in source code
-
Never commit keys to version control — use
.gitignoreto exclude.envfiles and audit your git history if a key is accidentally committed - Use separate keys per environment — create distinct keys for development, staging, and production
- Scope keys narrowly — grant only the permissions each integration needs
- Revoke unused keys — regularly audit your active keys and revoke any that are no longer needed
- Monitor usage — check the dashboard for unexpected API activity that could indicate a compromised key
If you suspect a key has been compromised, revoke it immediately from the dashboard at app.tusky.io/account/api-keys. Then create a new key and update your application.