Emails

Send email

Queue a transactional email for delivery.

POST/emails
1curl -X POST 'https://sendtern.com/emails' \
2  -H 'Authorization: Bearer st_your_api_key' \
3  -H 'Content-Type: application/json' \
4  -d '{
5  "from": "Acme <hello@mail.acme.io>",
6  "to": [
7    "ada@example.com"
8  ],
9  "subject": "Your sign-in code",
10  "html": "<p>482 913</p>",
11  "tags": [
12    {
13      "name": "category",
14      "value": "auth"
15    }
16  ]
17}'
Response
1{
2  "id": "47be30ca-24b7-48fb-b35d-ff287b89e66d"
3}

Accepts the email and returns HTTP 200 with its ID. Delivery happens asynchronously; follow it with Retrieve email. Send an Idempotency-Key header to retry safely.

Body parameters

fromstringrequired

Sender address. Use Name <address> for a friendly name. The domain must be verified.

tostring | string[]required

Recipient address, or an array of up to 50.

subjectstringrequired

Email subject, up to 500 characters.

htmlstring

HTML body. Required unless text is set.

textstring

Plain-text body. Provide text, HTML, or a published template.

ccstring | string[]

Cc recipients. Count toward the 50 recipient limit.

bccstring | string[]

Bcc recipients. Count toward the 50 recipient limit.

reply_tostring | string[]

Where replies go.

tagsobject[]

Up to ten objects containing a name and value.

templateobject

A published template ID or alias and optional variables.

Headers

Idempotency-Keystring

Up to 256 characters. See Idempotency keys.