> ## Documentation Index
> Fetch the complete documentation index at: https://docs.senderz.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Messages

> Send transactional email and SMS.

Send one-off transactional messages — order confirmations, receipts, alerts. These bypass marketing consent, frequency caps and quiet hours (the recipient triggered them), but email still needs a verified From domain and SMS still goes through the sender-ID gate and the wallet.

Both endpoints use the [`X-Sender-Tenant` + `X-API-Key`](/en/api-reference/authentication) headers and return **202 Accepted** — the message is queued through the send pipeline.

## Send email

```http theme={null}
POST /api/v1/public/messages/email
```

<ParamField body="fromEmail" type="string" required>
  Sender address. Its **domain must be verified** in your workspace.
</ParamField>

<ParamField body="subject" type="string" required>Max 500.</ParamField>
<ParamField body="html" type="string" required>HTML body (max 500,000).</ParamField>
<ParamField body="to" type="string">Recipient email. Provide `to` or `contactId`.</ParamField>
<ParamField body="contactId" type="string">Recipient contact UUID.</ParamField>
<ParamField body="fromName" type="string">Max 255.</ParamField>
<ParamField body="replyTo" type="string">Reply-to email.</ParamField>
<ParamField body="text" type="string">Plain-text body (max 500,000).</ParamField>

### Response

<ResponseField name="messageId" type="string">The queued message's ID.</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.senderz.app/api/v1/public/messages/email \
    -H "X-Sender-Tenant: your-workspace-slug" \
    -H "X-API-Key: your-api-key" \
    -H "Content-Type: application/json" \
    -d '{
      "to": "dana@example.com",
      "fromEmail": "orders@yourstore.com",
      "fromName": "Your Store",
      "subject": "Your order is confirmed",
      "html": "<p>Thanks, Dana!</p>"
    }'
  ```

  ```json Response (202) theme={null}
  { "success": true, "data": { "messageId": "msg_…" } }
  ```
</CodeGroup>

<Warning>
  If `fromEmail`'s domain isn't verified, the send is rejected. See
  [Domains & authentication](/en/deliverability/domains).
</Warning>

## Send SMS

```http theme={null}
POST /api/v1/public/messages/sms
```

<ParamField body="body" type="string" required>Message text (max 1600).</ParamField>
<ParamField body="to" type="string">Recipient phone (max 32). Provide `to` or `contactId`.</ParamField>
<ParamField body="contactId" type="string">Recipient contact UUID.</ParamField>
<ParamField body="senderId" type="string">Sender ID (max 11). Must be approved; defaults to the platform pool.</ParamField>

### Response

<ResponseField name="messageId" type="string">The queued message's ID.</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.senderz.app/api/v1/public/messages/sms \
    -H "X-Sender-Tenant: your-workspace-slug" \
    -H "X-API-Key: your-api-key" \
    -H "Content-Type: application/json" \
    -d '{ "to": "0501234567", "body": "Your code is 4821", "senderId": "SHOP" }'
  ```

  ```json Response (202) theme={null}
  { "success": true, "data": { "messageId": "msg_…" } }
  ```
</CodeGroup>

<Info>
  Transactional SMS is **wallet-gated** — a `402 Insufficient SMS credits`
  means you need to top up. The sender ID must be approved or the send fails
  with `sender_id_not_approved` at the worker.
</Info>
