Request
POST
/v1/messages| Name | Type | Description |
|---|---|---|
to | (string | {email, name?})[] | Recipients. Plain address strings or objects with an optional name. |
cc, bcc | same as to | Optional. At most 100 recipients across to, cc and bcc. |
subject | string | Up to 998 characters. |
text | string | Plain-text body. |
html | string | Optional HTML body. Send text as well for clients that do not render HTML. |
reply_to_message_id | string | Reply to this message so it is threaded and the original is marked answered. |
attachments | {attachment_id}[] | Up to 20 uploaded attachments. See Attachments. |
draft | boolean | Save as a draft instead of sending. Recipients are optional for drafts. |
A sent message needs at least one recipient and at least one of subject, text or html. Header: Idempotency-Key (optional but recommended, see Idempotency).
curl -X POST "https://api.tuskmail.africa/v1/messages" \
-H "X-API-Key: $TK_API_KEY" \
-u "$MAILBOX_EMAIL:$APP_PASSWORD" \
-H "Idempotency-Key: invoice-2041" \
-H "Content-Type: application/json" \
-d '{
"to": [
{
"email": "[email protected]",
"name": "Amina Wanjiru"
}
],
"cc": [
"[email protected]"
],
"subject": "Invoice 2041",
"text": "Hello Amina, please find your invoice attached.",
"html": "<p>Hello Amina, please find your invoice attached.</p>",
"attachments": [
{
"attachment_id": "B987"
}
]
}'201 Created
{
"id": "Mnew456",
"sent": true
}With draft: true the response is { "id": "...", "sent": false }.
Reply to a message
curl -X POST "https://api.tuskmail.africa/v1/messages" \
-H "X-API-Key: $TK_API_KEY" \
-u "$MAILBOX_EMAIL:$APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{
"to": [
"[email protected]"
],
"subject": "Re: Quote request for Q4 deliveries",
"text": "Thanks Amina, our rate card is attached.",
"reply_to_message_id": "Mabc123"
}'Limits and errors
Sends count toward the daily sending limit (Rate limits). Invalid addresses or missing fields return 422 validation_error naming the field.