API Reference

Emails API

Endpoints for sending transactional emails.

POST/api/v1/emails/send

Send a single transactional email using a template.

Request Body

FieldTypeRequiredDescription
tostringYesRecipient email address
templatestringYesTemplate slug
dataobjectNoTemplate variables
fromstringNoCustom sender email (must be verified)
from_namestringNoSender display name
reply_tostringNoReply-to address
prioritystringNohigh, 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 '{
"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/batch

Send multiple emails in a single request (max 1000 per batch).

Request Body

FieldTypeRequiredDescription
emailsarrayYesArray 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/:id

Retrieve 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

StatusDescription
queuedEmail is queued for sending
sendingEmail is being sent
sentEmail was sent to the mail server
deliveredEmail was delivered to recipient
bouncedEmail bounced (hard or soft)
complainedRecipient marked as spam
failedEmail failed to send