POST
/api/public/v1/email-drafts

Create an email draft

Write a message without sending it. This is how an assistant proposes mail: it drafts, the person reads it — in the console’s Drafts folder or back through the assistant — and only sending it (below) reaches anybody. Every field is optional here; what a send needs is checked when it is sent.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Dev Tools → API, to an assistant or CLI sign-in when you approve or edit it under Dev Tools, and to a teammate under Employee → Permissions.

email:messages:write

Request Body

PropertyTypeDescription
fromstringThe address to send from. Must be one this employee owns by the time it is sent.
toarrayRecipient addresses, up to 20.
ccarrayUp to 20 addresses.
bccarrayUp to 20 addresses.
subjectstringUp to 500 characters.
textstringThe plain-text body.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/email-drafts" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "sam@acme.example",
    "to": [
      "ap@northwind.example"
    ],
    "subject": "Re: Invoice 1042",
    "text": "Thanks — confirming Friday works on our side."
  }'
200Example response
json
{
  "message": "Email draft created successfully!",
  "content": {
    "draft": {
      "id": "edr_88c1",
      "from": "sam@acme.example",
      "to": [
        "ap@northwind.example"
      ],
      "cc": [],
      "bcc": [],
      "subject": "Re: Invoice 1042",
      "text": "Thanks — confirming Friday works on our side.",
      "scheduledAt": null,
      "createdAt": "2026-08-23T09:30:00.000Z",
      "updatedAt": "2026-08-23T09:31:00.000Z"
    }
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Email → Compose
/email/inbox
  1. Compose.
  2. Close — the draft is kept.