API Keys
API Keys provide secure programmatic access to MinuteMail services. This page explains how to create, configure, and manage API keys through the web interface.
Overview
Section titled “Overview”API keys enable you to:
- Programmatically create mailboxes via REST API or SDK
- Retrieve messages without logging into the web interface
- Automate workflows for testing and development
- Integrate MinuteMail into your applications
For detailed API usage, see the API Documentation.
Accessing API Key Management
Section titled “Accessing API Key Management”- Click the profile menu in the top-right corner
- Select API Keys
- You’ll see the API Keys management page
Creating an API Key
Section titled “Creating an API Key”Step 1: Configure Key Settings
Section titled “Step 1: Configure Key Settings”In the “Create a new API key” section, configure:
Key Name (Required)
Section titled “Key Name (Required)”- Purpose - Helps identify the key’s purpose
- Examples:
- “Production API Key”
- “Testing Environment”
- “GitHub Actions CI/CD”
- “Customer Portal Integration”
- Best Practice - Use descriptive names for easy management
Expiry Date (Optional)
Section titled “Expiry Date (Optional)”- Default - Leave empty for infinite/non-expiring key
- Set Expiration - Click the date picker to choose expiry date
- Use Cases for Expiration:
- Temporary access for contractors
- Short-term testing periods
- Security compliance requirements
- Rotating keys on schedule
Security Tip: Set expiration dates for enhanced security, especially for shared or temporary keys.
Domain Restrictions (Required)
Section titled “Domain Restrictions (Required)”- Purpose - Limit which domains this key can manage
- Security - Prevents unauthorized access to all mailboxes
- Configuration:
- All available domains shown with checkboxes
minutemail.cc(default platform domain)- Your verified custom domains
Default Behavior: By default, minutemail.cc is selected and cannot be removed if it’s your only domain.
Step 2: Add Domains to Key
Section titled “Step 2: Add Domains to Key”- View the “Domains” section showing currently selected domains
- Each domain displays:
- Domain name (e.g.,
minutemail.cc) - Remove button (✕) to exclude it
- Domain name (e.g.,
- To add more domains:
- Click the Add Domain dropdown
- Select a domain from available options
- Click Add Domain button
Note: “All available domains have been added to this key” appears when no domains remain to add.
Step 3: Create the Key
Section titled “Step 3: Create the Key”- Ensure Key Name is filled in
- Verify domain selections
- Click Create API Key
- A success modal appears with your new key
Step 4: Save Your API Key
Section titled “Step 4: Save Your API Key”⚠️ CRITICAL: The API key is displayed only once.
- Copy the full API key immediately
- Store it in a secure location:
- Password manager (recommended)
- Environment variables
- Secure key management service
- Never commit keys to version control
Example key format:
mm_sk_live_1234567890abcdefghijklmnopqrstuvwxyzIf you lose the key, you must:
- Delete the old key
- Create a new one
- Update all applications using it
Managing API Keys
Section titled “Managing API Keys”Viewing API Keys
Section titled “Viewing API Keys”The “API Keys” section displays all created keys:
Each key shows:
- Key Name - Identifier you provided
- Partial Key - Last 8 characters (e.g.,
••••••wx yz) - Created Date - When the key was generated
- Expiry Date - When it expires (or “Never expires”)
- Domain Count - Number of domains accessible
- Last Used - Most recent API call timestamp
- Status:
- Active - Working normally
- Expired - No longer valid (past expiry date)
- Revoked - Manually disabled
Key Actions
Section titled “Key Actions”For each API key, you can:
View Domains
Section titled “View Domains”- Click View Domains to see which domains this key can access
- Useful for auditing permissions
Regenerate Key
Section titled “Regenerate Key”- Click Regenerate to create a new secret
- Old secret becomes invalid immediately
- Use Case: Rotate keys periodically for security
Edit Configuration
Section titled “Edit Configuration”- Click Edit to modify:
- Key name
- Expiry date
- Domain restrictions
- Cannot change existing key secret (must regenerate)
Delete Key
Section titled “Delete Key”- Click Delete to permanently revoke the key
- All API calls using this key will fail immediately
- Cannot be undone
API Key Permissions
Section titled “API Key Permissions”What API Keys Can Do
Section titled “What API Keys Can Do”API keys grant access to:
- Create mailboxes on allowed domains
- List mailboxes you own
- Retrieve messages from your mailboxes
- Delete mailboxes you created
- Archive and restore mailboxes
- Download attachments
What API Keys Cannot Do
Section titled “What API Keys Cannot Do”API keys are restricted from:
- Viewing other users’ mailboxes (team members or other accounts)
- Managing billing or subscriptions
- Creating API keys (must use web interface)
- Inviting team members
- Adding custom domains (requires DNS verification)
Domain-Based Restrictions
Section titled “Domain-Based Restrictions”If a key is limited to specific domains:
- Can only create mailboxes on those domains
- Cannot list mailboxes from other domains
- API calls for unauthorized domains return
403 Forbidden
Example:
# Key allowed only for: example.com# ✅ AllowedPOST /api/mailboxes{ "domain": "example.com" }
# ❌ ForbiddenPOST /api/mailboxes{ "domain": "other-domain.com" }Using API Keys
Section titled “Using API Keys”Authentication Header
Section titled “Authentication Header”Include the API key in all requests:
curl -X GET https://api.minutemail.co/mailboxes \ -H "Authorization: Bearer mm_sk_live_1234567890abcdefghijklmnopqrstuvwxyz"SDK Usage
Section titled “SDK Usage”With the official SDK:
import { MinuteMailClient } from '@minutemail/sdk';
const client = new MinuteMailClient({ apiKey: process.env.MINUTEMAIL_API_KEY});
// Create a mailboxconst mailbox = await client.mailboxes.create({ domain: 'minutemail.cc', expiresIn: 900 // 15 minutes});For complete examples, see the SDK Documentation.
Security Best Practices
Section titled “Security Best Practices”Key Storage
Section titled “Key Storage”- Never hardcode API keys in source code
- Use environment variables for configuration
- Encrypt secrets at rest in production
- Use secret managers (AWS Secrets Manager, HashiCorp Vault)
Key Rotation
Section titled “Key Rotation”- Rotate regularly - Every 90 days recommended
- Rotate immediately if key may be compromised
- Keep old keys briefly during transitions
- Update all systems before deleting old keys
Access Control
Section titled “Access Control”- Principle of least privilege - Only grant needed domains
- One key per application - Isolate systems
- Set expiration dates - Especially for temporary access
- Monitor usage - Check “Last Used” timestamps
Team Environment
Section titled “Team Environment”- Individual keys - Each team member gets their own
- Shared keys - Only for team-owned integrations
- Document owners - Track who created which keys
- Revoke on departure - Delete keys when members leave
Monitoring API Key Usage
Section titled “Monitoring API Key Usage”Last Used Timestamp
Section titled “Last Used Timestamp”- Shows when key last made an API call
- Helps identify:
- Inactive keys (candidates for deletion)
- Unexpected usage patterns
- Keys to rotate
Audit Logs
Section titled “Audit Logs”Access logs via Usage page or API:
- Track all API calls per key
- Monitor for suspicious activity
- Debug integration issues
Quota and Limits
Section titled “Quota and Limits”API calls count toward your daily quota:
- Free: 100 calls/day
- Hobbyist: 1,000 calls/day
- Pro: 10,000 calls/day
- Team: 50,000 calls/day (shared)
Check current usage on the Usage page.
When Quota Exceeded
Section titled “When Quota Exceeded”- API returns
429 Too Many Requests - Quota resets at 00:00 UTC daily
- Upgrade plan for higher limits
Troubleshooting
Section titled “Troubleshooting””Invalid API key” error
Section titled “”Invalid API key” error”- Verify key copied correctly (no extra spaces)
- Check if key was deleted or expired
- Ensure using correct environment (test vs production)
“Forbidden” errors
Section titled ““Forbidden” errors”- Check if domain is included in key configuration
- Verify you own the mailbox you’re accessing
- Ensure key hasn’t expired
Keys not appearing
Section titled “Keys not appearing”- Refresh the page
- Check if you’re logged into the correct account
- Verify your plan supports API access
Cannot create key
Section titled “Cannot create key”- Verify “Key Name” field is filled
- Ensure at least one domain is selected
- Check browser console for errors
API Key Limits
Section titled “API Key Limits”- Maximum Keys - No hard limit (reasonable usage)
- Key Length - Fixed at 64 characters
- Domain Restrictions - Can include all available domains
- Expiration Range - Any future date
Advanced Use Cases
Section titled “Advanced Use Cases”Separate Keys for Environments
Section titled “Separate Keys for Environments”Development: "Dev Environment API Key" (expires monthly)Staging: "Staging Environment API Key" (expires quarterly)Production: "Production API Key" (never expires, rotated quarterly)Domain-Specific Keys
Section titled “Domain-Specific Keys”Customer Portal: domains = [customer-portal.example.com]Internal Tools: domains = [minutemail.cc, testing.example.com]Public API: domains = [api.example.com]Temporary Contractor Access
Section titled “Temporary Contractor Access”Name: "Q1 Contractor - John Doe"Expiry: March 31, 2026Domains: [contractor-temp.example.com]API Documentation
Section titled “API Documentation”For detailed API endpoint documentation:
For SDK usage: