Documentation
Complete API Documentation & Guides
Complete API reference, quick start guides, and tutorials for integrating Mailhook programmable email inboxes 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.
Custom Domains
Add and verify your own domain for branded email addresses.
AI Agent Integration
Best practices for integrating Mailhook with LLM agents and automation.
CI/CD Testing
Use Mailhook in your test suite for email verification flows.
Rate Limits & Best Practices
Understand rate limits and optimize your API usage.
Error Handling
Handle API errors gracefully with proper error codes and retry logic.