Skip to Content
POST
/api/v1/accounts/{accountId}/templates/{slug}/send

Renders the template once per recipient, with that recipient's own variables layered over the shared ones, and sends each as its own message, now. There is no sendAt: scheduling belongs to the mailbox product, and an unknown key is refused.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Two credential kinds share this scheme; GET /api/v1/auth/whoami answers which one you hold and what it reaches.

oek_… API key (minted by POST /api/v1/api-keys; shown once at mint). role: account reaches the full account surface: the directory (domains, routes, patterns, api-keys, accounts, address lists) plus every mailbox the account owns. role: system additionally reaches the operator surface, which is documented separately.

oemp_… mailbox app password (minted by POST /api/v1/identities/{identityId}/credentials). Reaches ONE mailbox: its messages, labels, threads, search, sync, send, filters and PIM collections. Directory routes refuse it with 403 insufficient_scope.

Refusal vocabulary: a missing, malformed, expired, or revoked credential answers 401 unauthorized with a WWW-Authenticate: Bearer challenge; a VALID credential outside its scope answers 403 (insufficient_scope for an app password on a directory route, system_credentials_required where only the operator may call). The public routes (health, branding, token-in-path capabilities) declare security: [].

Path Parameters

accountId*string

Account ULID identifier.

slug*string

The template's name within this account.

Match^[a-z0-9][a-z0-9_-]*$
Length1 <= length <= 64

Header Parameters

x-delivery-id?string

Idempotency key. Each recipient's message derives its own from this, the template and the recipient's address, so a retry converges per recipient whatever the order or subset of the list it carries, and the same key used for a different template is a different message. At most 200 characters; # is reserved. A retry does not get around a sending hold: while the sender is paused or disabled it is refused like any submission, and once the hold lifts it continues without a second charge.

Request Body

application/json
  1. body
bounce?boolean
headers?

Extra headers for every message. Auto-Submitted, X-Auto-Response-Suppress and Content-Language are the route's own and are refused in any spelling.

lang?|

Language tag, e.g. en or de-AT. Stored lowercased.

Match^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$
Length2 <= length <= 35
replyTo?|
Formatemail
Lengthlength <= 320
save?boolean

Keep a Sent copy. Default FALSE here, unlike /send.

to*array<>

One message is built per entry, and an address may appear once. No cc or bcc: personalisation makes shared bytes meaningless.

Items1 <= items <= 50
vars?

Response Body

Every recipient was accepted

application/json
  1. response
deliveryId*string

The batch id; retry with it to converge only the failures

langUsed*string
results*array<>
slug*string
templateVersion*integer
Example Request
curl -X POST 'https://api.open.email/api/v1/accounts/string/templates/string/send' \
  -H 'Content-Type: application/json' \
  -d '{
  "to": [
    {
      "email": "user@example.com"
    }
  ]
}'
Example Response
{
  "deliveryId": "string",
  "langUsed": "string",
  "results": [
    {
      "address": "string",
      "deliveryId": "string",
      "error": "string",
      "retryAfterSeconds": 0,
      "sentCopy": "saved",
      "status": "delivered"
    }
  ],
  "slug": "string",
  "templateVersion": 0
}