API Key Management
API keys provide programmatic access to SureStage for CI/CD pipelines, scripts, and integrations.
Types of API Keys
| Type | Scope | Use Case |
|---|---|---|
| Personal | Single user's permissions | CLI authentication, personal scripts |
| Organization | Organization-wide access | CI/CD pipelines, shared integrations |
Creating an API Key
Personal Key
- Go to Settings > API Keys
- Click Generate Personal Key
- Name the key (e.g., "CI Pipeline - staging")
- Set an expiration (optional)
- Copy the key (shown only once)
Organization Key
Requires Admin role
- Go to Settings > Organization API Keys
- Click Generate Key
- Name the key and set permissions scope
- Set an expiration
- Copy the key
Using API Keys
HTTP Header
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.surestage.com/v1/instances
CLI
surestage auth login --api-key YOUR_API_KEY
Environment Variable
export SURESTAGE_API_KEY=your_api_key
Revoking Keys
- Go to Settings > API Keys
- Click Revoke next to the key
- Confirm revocation
Revoked keys stop working immediately.
Next Steps
- Audit Logs - Track API key usage
- API Reference - Use API keys with the REST API