Replies

Draft Email

Draft a new email to the lead for review (RO-300). Nothing is sent: the draft joins the reply-draft review queue (`kind = compose`, `pending`) for a person to approve and send. The lead's address is checked first like a one-off send (suppressions, `can_contact` for email/marketing, contact pressure): a permanent denial is a 409 and nothing is stored; a contact-pressure hold stores the draft with `send_not_before`. Sending re-checks everything.

API key access

Needs the replies:write scope with an API key (ro_pat_...). A signed-in session uses the caller's role.
POST/api/v1/leads/{lead_id}/draft-email
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

lead_idstring
Formatuuid

Header Parameters

X-Workspace-Id?string | null

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

subjectstring
Length1 <= length <= 998
bodystring

Plain text.

Length1 <= length <= 20000
mailbox_id?string | null

The connected mailbox to send from (default: the workspace's oldest connected one).

Formatuuid

Response Body

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