messages_compose
Create a one-off message to a lead outside any campaign. Accepts plain text or template syntax (${field}, {{prompt}}, {opt1|opt2}). Templates are resolved against the lead's context before saving. Specify send_now: true to schedule for immediate delivery, or scheduled_at for a future time; otherwise the message is saved as a draft (status=NEW). The lead goes through the same compliance checks as campaign messages: a blocked lead returns 409 (code: compliance_blocked) before anything is generated or charged. When replying (in_reply_to_message_sqid), quote_previous: true appends the replied-to message below the body as a > -quoted block, the same way threaded sequence steps quote the step before them.
Recipient. By default the message goes to the lead's contact. When replying to an inbound message it goes to the address that message came from instead (the person who actually wrote back may be a colleague or use another address); replying to one of our own sends keeps that send's recipient. Pass email_to to choose the address explicitly. The response's email_to is empty when the lead's contact is used.
Content lint (compliance gate content_lint): unless the message replies to in_reply_to_message_sqid, a subject starting with Re:/Fwd: (AW:, TR:, RV:…) or quoted email history ("On … wrote:") is deceptive; so is a mailbox display name using another brand (Google, PayPal, a bank…). In enforce mode that is 400 code: "content_lint" with issues; in warn mode the message is created and the response carries warnings.
Footer (include_footer): whether the message ends with the footer — company name, postal address, unsubscribe line — and carries the List-Unsubscribe headers. Default: off when the message replies to an incoming message (in_reply_to_message_sqid of a message the lead sent: personal correspondence), on otherwise. The text is the default footer template (codedoc/compliance.md). Sending a new (non-reply) message without the footer is allowed but recorded as a compliance warning (gate footer, reason footer_disabled); anti-spam laws require an opt-out and the sender's identity in most countries.
Method: POST /api/v1/workspaces/{workspace_sqid}/messages/compose/
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"body": "<body>",
"lead_sqid": "<lead_sqid>",
"mailbox_sqid": "<mailbox_sqid>",
"subject": "<subject>"
},
"name": "messages_compose"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| subject | Yes | ||
| email_to | No | Recipient address. Omit to use the default: the sender of the replied-to inbound message, else the lead's contact. | |
| send_now | No | ||
| lead_sqid | Yes | ||
| mailbox_sqid | Yes | ||
| scheduled_at | No | ||
| include_footer | No | Add the footer (unsubscribe & company details) and List-Unsubscribe headers. Omit for the default: off for a reply to an incoming message, on otherwise. | |
| quote_previous | No | ||
| in_reply_to_message_sqid | No |