Getting Started
This guide walks you through authenticating with the API and making your first request.
Base URL
All API requests go to:
https://api.cakemail.dev
Authentication
The API uses OAuth2 password grant. Exchange your credentials for an access token:
curl -X POST https://api.cakemail.dev/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=password&username=YOUR_EMAIL&password=YOUR_PASSWORD"
The response includes an access_token and refresh_token:
{
"access_token": "eyJ...",
"token_type": "bearer",
"expires_in": 432000,
"refresh_token": "..."
}
Use the access token in subsequent requests:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
https://api.cakemail.dev/campaigns
Your first API call
List your campaigns:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
"https://api.cakemail.dev/campaigns?page=1&per_page=10"
Using MCP with AI assistants
If you're using an AI coding assistant like Claude Code, you can connect directly to the API via MCP servers instead of writing HTTP calls manually.
claude mcp add exec-mcp \
--transport http \
https://exec.mcp.cakemail.com/api/mcp \
--header "Authorization: Basic $(echo -n 'you@example.com:your-password' | base64)"
Once connected, your AI assistant can call API operations directly — list campaigns, create contacts, check analytics — without you writing any code.
Learn more about MCP servers →
AI-powered development
The Cakemail OpenAPI spec is indexed on Context7, so AI coding assistants that support it can pull up-to-date API documentation on demand. You can also connect any MCP-compatible assistant directly to Cakemail's API servers.
Learn more about AI assistant integrations →
API Reference
Explore all available endpoints in the interactive API reference.
Next steps
- Managing contacts — Create lists and add contacts
- Sending campaigns — Create and send your first email campaign
- Using webhooks — Get notified about events in real time