API Documentation
Send messages, check status, and retrieve delivery events via REST.
The Messages API allows you to send transactional and marketing emails via REST. Messages are queued immediately and delivered via your dedicated IP pool.
Send a Message
POST/v1/messages
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| from | string | required | Sender email. Use format: Name <email@domain.com> or bare email@domain.com |
| to | array | required | Array of recipient email addresses. Max 1,000 per request. |
| subject | string | required | Message subject line |
| html | string | optional | HTML message body. At least one of html or text is required. |
| text | string | optional | Plain text fallback body |
| cc | array | optional | CC recipients |
| reply_to | string | optional | Reply-To address |
| headers | object | optional | Custom headers as key-value pairs |
| ip_pool | string | optional | Specific IP pool to use. Defaults to your account's default pool. |
| track_opens | boolean | optional | Enable open tracking (default: true) |
| track_clicks | boolean | optional | Enable click tracking (default: true) |
| scheduled_at | string | optional | ISO 8601 datetime to schedule delivery. Max 72 hours in advance. |
| tags | array | optional | Array of string tags for reporting segmentation (max 3) |
Example
curl -X POST https://api.cloudserverforemail.com/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "Acme Corp <hello@acme.com>",
"to": ["customer@example.com"],
"subject": "Your order has shipped",
"html": "<p>Your order #12345 has shipped.</p>",
"text": "Your order #12345 has shipped.",
"ip_pool": "transactional",
"tags": ["transactional", "shipping"]
}'
Response
{"id":"msg_01JQRT...","status":"queued","queued_at":"2026-04-08T12:00:00Z"}Get Message Status
GET/v1/messages/{id}
curl https://api.cloudserverforemail.com/v1/messages/msg_01JQRT \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "msg_01JQRT...",
"status": "delivered",
"from": "hello@acme.com",
"to": "customer@example.com",
"subject": "Your order has shipped",
"queued_at": "2026-04-08T12:00:00Z",
"delivered_at": "2026-04-08T12:00:01Z",
"opens": 1,
"clicks": 0
}