Overview
AutoSend uses API Key authentication with Bearer tokens. Every API request must include your API key in theAuthorization header. API keys are tied to a specific project and provide access to all resources within that project.
Creating an API Key
Follow these steps to generate a new API key from your AutoSend dashboard:Step 1: Navigate to API Keys Settings
- Log in to your AutoSend dashboard
- Select your project from the project dropdown (if you have multiple projects)
- Go to Settings > API Keys in the sidebar
Step 2: Generate New API Key
- Click the “Generate API Key” button in the top-right corner
- Enter a descriptive name for your API key:
- Use names that describe the purpose or environment (e.g., “Production”, “Staging”, “Development”, “Marketing Automation”)
- This helps you identify and manage multiple keys
- Click “Generate”
Step 3: Save Your API Key Secret
After generation, you’ll see your API Key Secret displayed once:For security reasons, the API key secret is only shown once during creation. You will NOT be able to view it again.
- Copy the key immediately to your clipboard
- Store it securely (password manager, environment variables, secrets management system)
- Download the .txt file as a backup
- Never commit API keys to version control (Git, SVN, etc.)
- Never share your API key publicly or in client-side code
API Key Format
AutoSend API keys follow this format:as- Prefix identifying AutoSend keyssecret_string- Cryptographically secure alphanumeric characters
Making Authenticated Requests
Include your API key in theAuthorization header of every request using the Bearer authentication scheme:
HTTP Header Format
Managing API Keys
Viewing API Keys
In your dashboard under Settings > API Keys, you can see:- API Key Name - The label you assigned
- API Key ID - A unique identifier for the key
- Generated On - Creation date
Deleting API Keys
To delete an API key:- Go to Settings > API Keys
- Find the API key you want to delete
- Click the three-dot menu icon
- Select “Delete”
- Confirm the deletion
When you delete an API key, it stops working immediately. Any applications or services using that key will start receiving authentication errors. Make sure to update your applications before deleting keys.
Best Practices for API Key Management
-
Use Environment Variables
Never hardcode API keys in your source code.
-
Separate Keys for Different Environments
- Create separate keys for development, staging, and production
- Use descriptive names: “Production API Key”, “Staging API Key”
- This allows you to rotate keys without affecting other environments
-
Rotate Keys Regularly
- Generate new keys periodically (every 90 days recommended)
- Update your applications with the new key
- Delete the old key after confirming the new one works
-
Limit Key Exposure
- Never commit keys to version control
- Don’t include keys in client-side JavaScript
- Use secrets management services (AWS Secrets Manager, HashiCorp Vault, etc.)
-
Add API keys to
.gitignore:
Authentication Errors
401 Unauthorized
Error Response:- Missing
Authorizationheader - Invalid API key format
- Expired or deleted API key
- API key not properly prefixed with “Bearer ”
- Verify the
Authorizationheader is present - Check that your API key is correct and hasn’t been deleted
- Ensure the format is:
Authorization: Bearer YOUR_API_KEY - Confirm there’s a space after “Bearer”
403 Forbidden
Error Response:- API key doesn’t have access to the requested resource
- API key belongs to a different project
- Verify you’re using the correct API key for the project
- Check that the resource (domain, template, etc.) exists in the project
Security Considerations
Keep Your API Keys Secret
API keys provide full access to your AutoSend account and should be treated like passwords:- Never share API keys in public forums, support tickets, or chat
- Don’t include keys in screenshots or screen recordings
- Revoke keys immediately if exposed
- Use read-only keys when possible (future feature)
HTTPS Only
Always use HTTPS when making API requests. AutoSend APIs reject non-HTTPS requests to protect your API keys from interception.Rate Limiting
API keys are subject to rate limits:- 2 requests per second per API key
- 50 requests per minute per API key
429 Too Many Requests error. See the API Reference for more details.