API Reference
Emails API
Endpoints for sending transactional emails.
POST
/api/v1/emails/sendSend a single transactional email using a template.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient email address |
template | string | Yes | Template slug |
data | object | No | Template variables |
from | string | No | Custom sender email (must be verified) |
from_name | string | No | Sender display name |
reply_to | string | No | Reply-to address |
priority | string | No | high, normal, low (default: normal) |
Example Request
Terminal
curl -X POST https://artamail.artatol.com/api/v1/emails/send \ -H "Authorization: Bearer am_live_sk_xxx" \ -H "Content-Type: application/json" \ -d '{ "to": "[email protected]", "template": "welcome", "data": { "name": "John", "verifyUrl": "https://example.com/verify/abc123" } }'Response
json
{ "id": "550e8400-e29b-41d4-a716-446655440000", "status": "queued", "queued_at": "2024-01-15T10:30:00Z", "test_mode": false}POST
/api/v1/emails/batchSend multiple emails in a single request (max 1000 per batch).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
emails | array | Yes | Array of email objects (same fields as send) |
Example Request
Terminal
curl -X POST https://artamail.artatol.com/api/v1/emails/batch \ -H "Authorization: Bearer am_live_sk_xxx" \ -H "Content-Type: application/json" \ -d '{ "emails": [ { "to": "[email protected]", "template": "notification", "data": { "message": "Hello" } }, { "to": "[email protected]", "template": "notification", "data": { "message": "Hello" } } ] }'Response
json
{ "queued": 2, "failed": 0, "results": [ { "to": "[email protected]", "id": "email-id-1" }, { "to": "[email protected]", "id": "email-id-2" } ], "test_mode": false}GET
/api/v1/emails/:idRetrieve status and details of a sent email.
Example Request
Terminal
curl https://artamail.artatol.com/api/v1/emails/550e8400-e29b-41d4-a716-446655440000 \ -H "Authorization: Bearer am_live_sk_xxx"Response
json
{ "id": "550e8400-e29b-41d4-a716-446655440000", "to_email": "[email protected]", "subject": "Welcome to Our App", "status": "delivered", "template_slug": "welcome", "sent_at": "2024-01-15T10:30:05Z", "delivered_at": "2024-01-15T10:30:10Z", "opened_at": "2024-01-15T11:00:00Z", "clicked_at": null}Email Statuses
| Status | Description |
|---|---|
queued | Email is queued for sending |
sending | Email is being sent |
sent | Email was sent to the mail server |
delivered | Email was delivered to recipient |
bounced | Email bounced (hard or soft) |
complained | Recipient marked as spam |
failed | Email failed to send |