API Key Management
API keys are the authentication method for using the Firstage API. This guide explains how to create, manage, and delete API keys.
What is an API Key?
API keys have the following characteristics:
- Unique string starting with the
fak_prefix - Shown only once during creation (cannot be viewed later)
- Managed per workspace
- Granular permission settings available
Creating an API Key
Step 1: Access Developer Center
- Log in to Firstage dashboard
- Click Developer menu in the left sidebar
- Select API Keys tab
Step 2: Create New API Key
- Click Create API Key button
- Enter required information:
- Name: Name indicating the key’s purpose (e.g., “Production API Key”)
- Description (optional): Detailed purpose description
- Permissions: Select required permissions
Step 3: Select Permissions
Select the permissions the API key can access:
Available Permissions
contents:read- Read contentcontents:write- Create and update contentschedules:read- Read schedulesschedules:write- Create and update schedules
Note: Currently only content and schedule permissions are supported. Additional APIs will be released gradually.
Step 4: Set Rate Limit (Optional)
Set the number of API requests allowed per hour.
- Default: 1,000 requests/hour
- Maximum: 10,000 requests/hour (varies by plan)
Step 5: Save API Key
- Click Create button
- The generated API key will be displayed in a popup
- Important: This key won’t be shown again, so copy it to a secure location
fak_Abc123XyZ789...- Store it in environment variables or a secrets management tool
Viewing API Keys
View Key List
You can view all created keys on the API Keys page in the Developer Center.
Information displayed:
- Name: API key name
- Key Prefix: First 10 characters of the key (e.g.,
fak_Abc123) - Permissions: List of configured permissions
- Rate Limit: Allowed requests per hour
- Status: active, revoked, expired
- Last Used: Time of last API call
- Created: Key creation date
Identifying by Key Prefix
You can’t view the full key, but you can identify which key it is by the key prefix (fak_Abc123).
Deleting API Keys
API keys should be deleted immediately if they’re no longer needed or have been exposed.
How to Delete
- Find the key to delete in the API key list
- Click the Delete button (🗑️) for that key
- Confirm deletion in the confirmation dialog
Deletion Precautions
- Deleted keys are immediately invalidated
- All API requests using that key will fail
- Deletion cannot be undone
Pre-deletion Checklist
✅ Check before deleting:
- Verify if any services are using this key
- Generate a new key in advance and replace it
- Confirm the key has been updated in all environments
Security Best Practices
Protecting API Keys
- Use Environment Variables
# .env file
FIRSTAGE_API_KEY=fak_your_api_key_here- Don’t Commit to Git
# Add to .gitignore
.env
.env.local
.env.production- Use Secrets Management Tools
- AWS Secrets Manager
- HashiCorp Vault
- Google Secret Manager
Separate Keys per Environment
❌ Wrong way:
// Using same key for all environments
const API_KEY = 'fak_Abc123...';✅ Correct way:
// Different keys per environment
const apiKey = {
development: process.env.DEV_API_KEY,
staging: process.env.STAGING_API_KEY,
production: process.env.PROD_API_KEY,
}[process.env.NODE_ENV];Regular Key Rotation
We recommend rotating API keys every 3-6 months for security.
Rotation procedure:
- Generate new API key
- Deploy new key to all services
- Delete old key after a grace period (e.g., 1 week)
Minimize Permissions
Grant only necessary permissions.
❌ Bad example:
// Granting all permissions
permissions: [
'contents:read', 'contents:write',
'schedules:read', 'schedules:write',
]✅ Good example:
// Granting only necessary permissions
permissions: [
'contents:read',
'schedules:write',
]If a Key is Exposed
If an API key has been exposed, take immediate action:
Immediate Actions
- Delete Key: Delete immediately in Developer Center
- Generate New Key: Issue a new API key
- Update Services: Deploy new key to all services
- Check Logs: Review for suspicious API activity
Preventing Exposure
- Don’t commit keys to public repositories
- Don’t share keys via Slack, email, etc.
- Be careful not to show keys in screenshots
- Don’t expose keys in client-side code
Troubleshooting
API Calls Failing
Symptom: 401 Unauthorized error
Causes:
- Using incorrect API key
- Key has been deleted or expired
- Key format is incorrect
Solution:
- Verify API key is correct
- Check key status is “active”
- Verify key is correctly entered in
X-API-Keyheader
Permission Errors
Symptom: 403 Forbidden error
Cause: Missing required permissions for the operation
Solution:
- Check if API key has required permissions
- If missing permissions, regenerate key or issue new one
Rate Limit Exceeded
Symptom: 429 Too Many Requests error
Cause: Exceeded hourly request limit
Solution:
- Check limit information in response headers
- Reduce request frequency
- Upgrade plan if higher limit is needed
Next Steps
- Practice using API keys in Quick Start Guide