Overview
API keys let you access the Alfred API from scripts, automations, and integrations. Each key provides full access to your API endpoints.Creating an API key
- Go to your Alfred Black dashboard
- Navigate to Settings > API Keys
- Click Create
- Give it a descriptive name (e.g., “CI pipeline”, “n8n automation”, “shell scripts”)
- Click Create and copy the key immediately
Key format
Alfred API keys use the format:alf_ prefix followed by 32 hexadecimal characters.
Making API requests
Include your key in theAuthorization header as a Bearer token:
/api/v1/....
Managing your keys
From the Settings > API Keys page in your dashboard, you can:- View all keys — See names, creation dates, and last used timestamps
- Track usage — Check when each key was last used
- Revoke keys — Delete keys you no longer need
You can create up to 10 API keys per account.
Best practices
- Don’t hardcode keys — Use environment variables instead:
- Use descriptive names — Name keys after their purpose so you know which to revoke
- Rotate periodically — Create a new key and revoke the old one every few months
- Revoke unused keys — If you’re no longer using an integration, revoke its key
Example integrations
Shell script
Python automation
Error responses
If your key is missing or invalid, you’ll receive a401 Unauthorized response:
Testing your key
Use the health endpoint to verify your key works:API Reference
See all available endpoints
Authentication
Full authentication documentation
