Versioned resources. Explicit responses.
A proposed implementation surface for email intelligence, inbound and outbound mail, classification, and mailbox migration.
https://api.maail.co/v1JSON by default. Bearer authentication. Stable request identifiers.Predictable at every endpoint.
Authenticate with a Bearer token. Send JSON unless an endpoint explicitly accepts message/rfc822. Responses include a request identifier, and mutation endpoints accept an idempotency key.
Authorization: Bearer YOUR_API_KEY Content-Type: application/json Idempotency-Key: YOUR_UNIQUE_OPERATION_KEY
/v1/email/validate
Run deliverability checks without the complete address and host analysis.
GET /v1/email/validate?email=demo-user-1042%40research.example
{
"email": "demo-user-1042@research.example",
"status": "deliverable",
"cleanedEmail": "demo-user-1042@research.example",
"metrics": ["valid_syntax", "has_mx", "mailbox_exists"]
}
/v1/email/analyze
Return the complete analysis shape. All values below are synthetic; .example domains are reserved for documentation.
GET /v1/email/analyze?email=demo-user-1042%40research.example
{
"email": "demo-user-1042@research.example",
"status": "deliverable",
"cleanedEmail": "demo-user-1042@research.example",
"metrics": [
"valid_syntax",
"known_mailer",
"has_mx",
"mailbox_exists"
],
"address": {
"isDisposable": false,
"isGraylisted": false
},
"name": {
"value": null,
"firstname": null,
"lastname": null
},
"host": {
"value": "research.example",
"provider": null,
"catchAll": false,
"isKnown": true,
"reputation": "high"
},
"server": {
"exists": true,
"records": [
{
"exchange": "mx1.research.example",
"priority": 10
}
]
}
}
/v1/mailbox/inbound
Create an inbound route and deliver normalized messages, including parsed DMARC reports, as signed webhook events.
{
"label": "invoice-intake",
"webhook": "https://hooks.product.example/mail",
"retentionHours": 24
}
{
"id": "inbox_demo_72",
"address": "route-demo-2048@inbound.example",
"event": "email.received",
"status": "active"
}
/v1/email/sendSend composed content or render a template.
/v1/email/templateCreate a reusable text and HTML template.
/v1/email/message/:idRead message acceptance and delivery state.
/v1/email/classify
Classify structured content or a raw RFC 822 message as spam or ham.
{
"from": "updates@service.example",
"subject": "Synthetic account notice",
"text": "This is artificial sample content."
}
{
"classification": "ham",
"score": 0.96,
"reasonCodes": ["transactional_pattern"],
"model": "maail-classifier"
}
/v1/mailbox/migrate
Start a resumable transfer between verified mailbox connection resources.
{
"sourceConnection": "conn_demo_old",
"destinationConnection": "conn_demo_new",
"options": {
"preserveFlags": true,
"preserveInternalDates": true,
"catchUp": true
}
}
{
"id": "migration_demo_41",
"status": "queued",
"progress": {
"folders": 0,
"messages": 0,
"bytes": 0
}
}
/v1/mailbox/connectionCreate and verify an encrypted mailbox connection.
/v1/mailbox/migrate/:idRead progress, warnings, and completion state.
/v1/mailbox/migrate/:id/catch-upCopy the final delta before changing mail delivery.
Shape the API around a real workflow.
The resource names and payloads here are a coherent starting point and can be refined against the implementation.