Developers

Send Email

Send transactional emails via the Artmail API - direct send or using templates

Send Email

The Artmail API provides two ways to send transactional emails: direct send with raw HTML/text content, or template send using pre-configured transactional templates. Both endpoints support single and batch sending (up to 50 recipients per request).

Authentication

All requests require a Bearer token in the Authorization header:

Authorization: Bearer art_live_your_api_key_here

Your API key must have the transactional:send permission. Learn more about authentication →

POST /api/v1/send — Direct Send

Send emails with raw HTML and/or plain text content. Use this when you don't need a template or want full control over the email body.

Request Body

FieldTypeRequiredDescription
tostring | arrayYesRecipient(s). String for single, array for batch (max 50 recipients).
fromstringYesSender. Supports "Name <email@domain.com>" or email@domain.com.
subjectstringYesSubject line (max 998 characters).
htmlstringNo*HTML body. Either html or text is required.
textstringNo*Plain text body. Either html or text is required.
replyTostringNoReply-to address.
headersobjectNoCustom headers as key-value pairs.
tagsobjectNoCustom tags for tracking (e.g. { "campaign": "welcome" }).

Single Recipient Request

JSON
Loading...

Batch Request (up to 50 recipients)

JSON
Loading...

Response — Single Recipient

JSON
Loading...

Response — Batch

JSON
Loading...

The failed array is only present when one or more recipients failed to queue.


POST /api/v1/send/[slug] — Template Send

Send emails using a transactional template. Variables are substituted into the template's subject and content.

URL

POST /api/v1/send/welcome-email POST /api/v1/send/order-confirmation

Replace [slug] with your template's slug (from the dashboard).

Request Body

FieldTypeRequiredDescription
tostring | arrayYesRecipient(s). String for single, array for batch (max 50).
variablesobjectNoKey-value pairs substituted in template ({{ variableName }}).
fromstringNoOverride template's sender. Supports "Name <email>" format.
subjectstringNoOverride template's subject. Variables supported.
replyTostringNoOverride template's reply-to.

Example Request

JSON
Loading...

Response

Same format as direct send: { id, status } for single, { ids, status, count, failed? } for batch. Template responses also include "template": "slug".


Code Examples

cURL — Direct Send

Bash
Loading...

cURL — Template Send

Bash
Loading...

Node.js — Direct Send

Typescript
Loading...

Node.js — Template Send

Typescript
Loading...

Error Codes

CodeHTTP StatusDescription
validation_error400Invalid request (missing fields, invalid email, max recipients exceeded).
sender_not_verified400Sender email/domain not verified in Settings → Sender Identities.
recipient_suppressed400One or more recipients are on your suppression list (unsubscribed/bounced).
template_not_found404No template with the given slug, or template is inactive.
missing_variables400Template requires variables that were not provided.
template_error400/500Template rendering failed (e.g. JSON_BLOCKS not supported).
queue_failed500Email could not be queued for sending.

Example Error Response

JSON
Loading...
JSON
Loading...

Best Practices

  1. Verify sender identity — Add and verify your from address in Settings before sending.
  2. Use templates for consistency — Transactional templates ensure brand consistency and faster sends.
  3. Include both html and text — Improves deliverability and accessibility.
  4. Handle batch failures — Check the failed array when sending to multiple recipients.
  5. Use tags — Add tags to segment and filter emails in logs and analytics.

Next Steps

Webhooks

Receive real-time notifications when emails are sent, delivered, opened, or bounced.

Webhooks guide →

Error Handling

Learn how to handle API errors and implement retries.

Error handling →