Mailboxes

Send Mailbox Email

Send a one-off email from a connected mailbox to a lead (manual follow-ups and replies). Enforced in code, exactly like the sequence runner's sends: the lead's email must not be on the suppression list and `can_contact(email, purpose)` must allow it (409 `Sending is not allowed: <reasons>`), the mailbox must be connected, not paused by the deliverability guard and under its daily cap (409). A marketing send held back by the contact-pressure rules (a manual touch: exempt while the lead is in a conversation with us) or a resource rate limit is a 409 with `code` `contact_deferred`, the `reasons` and `next_allowed_at`. A `marketing` email (the default) gets one-click `List-Unsubscribe` headers (RFC 8058) and the CAN-SPAM footer with the workspace's postal address (409 `missing_postal_address` without one). The send is logged and appended to the lead's timeline (`email_sent`, by the caller). `reply_to_message_id` threads the email under a provider message (e.g. the lead's reply).

API key access

Needs the mailboxes:write scope with an API key (ro_pat_...). A signed-in session uses the caller's role.
POST/api/v1/mailboxes/{mailbox_id}/send
AuthorizationBearer <token>

Access token from /api/v1/auth/login, or an API key (ro_pat_..., RO-176) from /api/v1/workspaces/current/api-keys: the key implies its workspace and needs the route's scope. MCP connectors (/api/v1/mcp only) may use an OAuth access token (ro_oat_..., RO-284).

In: header

Path Parameters

mailbox_idstring
Formatuuid

Header Parameters

X-Workspace-Id?string | null

Id of the workspace to act on (must be a member).

lead_idstring

The recipient: a live lead of the workspace (sent to its email).

Formatuuid
subjectstring

One line (no line breaks), stripped.

Length1 <= length <= 998
bodystring

HTML or plain text; not blank.

Length1 <= length <= 100000
purpose?ConsentPurpose
Default"marketing"
reply_to_message_id?string | null

Provider id of the message this answers (threads the email).

Length1 <= length <= 255

Response Body

curl -X POST "http://localhost:8000/api/v1/mailboxes/497f6eca-6276-4993-bfeb-53cbbbba6f08/send" \  -H "X-Workspace-Id: string" \  -H "Content-Type: application/json" \  -d '{    "lead_id": "9bddab70-98e6-43a9-8f32-c9788b9de0c0",    "subject": "string",    "body": "string"  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "mailbox_id": "4d23d1af-2eef-4598-a5e0-1f19ae0b0c14",
  "lead_id": "9bddab70-98e6-43a9-8f32-c9788b9de0c0",
  "provider_message_id": "string",
  "sent_at": "2019-08-24T14:15:22Z"
}
Empty
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
Empty