Skip to Content
SendlySendly
API ReferenceMailboxes

Draft a message with AI

POST
/api/mailboxes/{id}/drafts

Ask Sendly's assistant to write a message for a mailbox — a new email from a short brief, a rewrite of something you already have, or a set of subject lines.

It returns text and sends nothing. The response always reports sent: false, and there is no argument that changes that. Putting a draft in someone's inbox is a separate operation (sendMailboxMessage) under a separate scope, so a client that may draft is not thereby a client that may mail your customers.

That is also why this operation asks only for mailboxes:read: it names a mailbox so the draft can be written in that address's voice, reads no correspondence, and stores nothing.

Everything you pass — the brief, the draft, the recipient context — is treated strictly as data describing what to write, never as instructions to the model.

Drafting is capped at 120 requests per hour per project.

Requires the mailboxes:read scope — View the mailboxes on your domains and their settings.

headerAuthorizationBearer <API Key>

API key authentication. Use a sk_* (FULL) or pk_* (SENDING_ONLY) key as the bearer token. Public keys (pk_*) are restricted to the email-send endpoints and the self-serve list subscribe/unsubscribe pair; every other endpoint — event tracking included — answers 403 for them. In scope terms (used by /api/v1/* operations): FULL keys hold every scope; SENDING_ONLY keys hold only emails:send.

id*string
Formatuuid
application/json
  1. body

Body for POST /api/mailboxes/{id}/drafts — ask for help writing, never for sending.

mode*string
Value in"draft""rewrite""subject"
brief?string
Lengthlength <= 4000
draft?string
Lengthlength <= 20000
instruction?string
Lengthlength <= 500
tone?string
Value in"friendly""neutral""formal""apologetic""direct"
recipientContext?string
Lengthlength <= 2000
senderAddress?string
Lengthlength <= 320

Response Body

A draft. Nothing was sent.

application/json
  1. response
success*true
Value intrue
data*
Example Request
curl -X POST 'https://api.sendly.now/api/mailboxes/497f6eca-6276-4993-bfeb-53cbbbba6f08/drafts' \  -H 'Content-Type: application/json' \  -d '{  "mode": "draft"}'
Example Response
{  "success": true,  "data": {    "subject": "string",    "body": "string",    "subjects": [      "string"    ],    "sent": false  }}