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.

Authorization

AuthorizationBearer <token>

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.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

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

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/mailboxes/497f6eca-6276-4993-bfeb-53cbbbba6f08/drafts" \  -H "Content-Type: application/json" \  -d '{    "mode": "draft"  }'
{
  "success": true,
  "data": {
    "subject": "string",
    "body": "string",
    "subjects": [
      "string"
    ],
    "sent": false
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}