Send a message

Sends a message on the requested channel and returns its receipt (id, status, and why it waits when it does) with a 201 Created status.

POST
/v1/messages

Sends a message on the requested channel and returns its receipt (id, status, and why it waits when it does) with a 201 Created status. Requires messages:create or the send permission of the channel it sends on, such as email:send. channel selects the payload variant. Repeating an identical request with the same optional Idempotency-Key header returns the original receipt; reusing the key for different content returns a conflict.

x-api-key<token>

In: header

Header Parameters

idempotency-key?|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

conversationId?|null|null
metadata?|null
channel*"email"

Value in

  • "email"
to*array<|>
Items1 <= items
cc?array<|>|null|null
bcc?array<|>|null|null
from?|null
email*

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/messages" \  -H "Content-Type: application/json" \  -d '{    "channel": "email",    "to": [      {        "contactId": "string"      }    ],    "email": {}  }'
{  "id": "string",  "status": "pending",  "waitReason": "rate",  "reviewExpectedAt": "string",  "skippedRecipients": [    {      "address": "string",      "reason": "bounce",      "unsubscribeGroupId": "string"    }  ],  "createdAt": "string"}

Related documentation