Documentation
API Documentation
Everything you need to integrate Mailhook into your application.
Quick Start Guide
Get up and running with Mailhook in under 5 minutes.
1. Get Your API Credentials
Sign up for a free account and generate your API credentials.
- Create an account at app.mailhook.co
- Navigate to Settings → API
- Generate a new API key
- Save your Agent ID and API Key securely
2. Create Your First Inbox
Use the API to create a random email address.
curl -X POST https://app.mailhook.co/api/v1/email_addresses/random \
-H "X-Agent-ID: your_agent_id" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"domain_id": "your_domain_id"}'
3. Receive Emails
Poll for incoming emails or set up webhooks for real-time notifications.
curl https://app.mailhook.co/api/v1/email_addresses/{id}/inbound_emails \
-H "X-Agent-ID: your_agent_id" \
-H "X-API-Key: your_api_key"
Example Response
{
"data": [
{
"id": "ie_abc123",
"type": "inbound_email",
"attributes": {
"from": "[email protected]",
"subject": "Hello from Mailhook",
"text_body": "Your email content here...",
"received_at": "2025-01-14T12:00:00Z"
}
}
]
}
Next Steps
- Set up webhooks for real-time email notifications
- Add a custom domain for branded email addresses
- Explore the full API reference for all available endpoints
Webhooks Setup
Configure webhooks to receive emails in real-time with signed payloads.
Webhooks
Real-time
Custom Domains
Add and verify your own domain for branded email addresses.
Domains
DNS
AI Agent Integration
Best practices for integrating Mailhook with LLM agents and automation.
AI
Automation
CI/CD Testing
Use Mailhook in your test suite for email verification flows.
Testing
CI/CD
Rate Limits & Best Practices
Understand rate limits and optimize your API usage.
Performance
Limits
Error Handling
Handle API errors gracefully with proper error codes and retry logic.
Errors
Debugging