Skip to main content
POST
Send a template, a recipient and your data; Maqetin answers 202 with the message id, and the email follows. Use it for mail a person expects from an action of theirs: a receipt, a password reset, an invite. A transactional message ignores the contact’s email opt-in, never reaches a suppressed address and has no unsubscribe link.

Limits

Headers

string
required
Bearer mq_sec_…, a secret key with the messages:send scope. A public key is a 401. A secret key without the scope is a 403.
string
Send the same key on a retry and Maqetin sends the message once. See Send a retry safely.

Body

Any top-level field that is not listed here is a 400.
string
required
email, the one channel built today.
string
required
The id of a template in your workspace.
object
required
Exactly one of these two fields.
string
required
Name <local@domain> or local@domain, 3 to 320 characters on one line. Without a name, Maqetin uses the workspace name. The domain must be a verified sending domain of the workspace.
string
Replaces the subject of the template. 1 to 300 characters, on one line.
object
Merge data for the template. It goes over the traits of the person but never over email or user_id.
In the samples, replace templateId with one of your templates and the domain of from with a verified sending domain of your workspace.

Send it from Node

The server entry of the JavaScript SDK makes this call, and makes an idempotency key when you give none.

Send a retry safely

A retry with the same Idempotency-Key sends the message once and answers 202 with the same messageId. The first body sent with a key is the one that counts. The SDK retries after a 5xx, a 429 or a network error with the same key, and gives up on a request that does not answer after requestTimeoutMs, 15 seconds by default.

Response

A reply holds success, data and meta. See Answers.
string
required
The id of the message. A contact’s messages carry it as id.
string
required
queued.

Errors

A send checks the workspace, then the template, then the sender, then the recipient, and answers the first problem it finds. The message of a 409 names the reason in lower case, for example Sending is not available: sender_domain_invalid.