Mail API reference

Mail API · Drafts

post/v1/workspaces/{workspace_id}/drafts/{id}/sendAuth

Send your own draft

The author (a person, or an API key) sends their own draft without a reviewer, when the mailbox allows it: with `reply_approval: agents` (the default) people and API keys may, agents never; with `everyone` nobody, and the draft needs another person's approval. Needs `mail.send` on the mailbox.

Path parameters

workspace_id*string · uuid

Id of the workspace.

id*string · uuid

Draft id.

Headers

Idempotency-Keystring

Opaque client-generated string (1–256 chars, `[A-Za-z0-9._:-]`) used to deduplicate retries within a 24h window. A retry with the same key and body returns the original response with `Idempotent-Replay: true`.

Request body

versioninteger

Optional: The `version` you read. Someone else changed the draft since: 409 `MAIL_DRAFT_VERSION_CONFLICT` (`details.version` is the current one); read it again.

Response · 200

id*string · uuid

Draft id.

mailbox_id*string · uuid

The mailbox it is sent from.

thread_id*string · uuid

The conversation; null for a `new` email until it is sent.

reply_to_message_id*string · uuid

The message answered or forwarded; null for `new`.

kind*object

`reply`, `reply_all`, `forward` (of `reply_to_message_id`) or `new` (a new email from the mailbox).

status*object

`draft` → `pending_approval` (submitted) → `sent` (approved and sent) or `rejected`. `discarded` when deleted. `approved` only while the send is in flight.

to*array

To recipients (for replies, computed when the draft was created).

cc*array

Cc recipients.

bcc*array

Bcc recipients.

subject*string

Subject it will go out with.

text*string

Plain-text body written in the draft (the quote of the answered message is added when sent).

html*string

HTML body written in the draft.

quote*boolean

Replies: the answered message is quoted under the text when sent.

attachments*array

Files stored with the draft.

author*object
type*object

`user`: a person signed in. `api_key`: a Platform API Key. `agent`: an MCP grant or an OAuth client acting for a person.

id*string · uuid

Account id (people, and the person an agent acted for) or API key id.

label*string

Display label: the OAuth client, key name or email.

is_agent*boolean

Written by an agent (MCP grant or OAuth client).

on_behalf_of_user_id*string · uuid

The person an agent acted for, or who created the API key. They cannot approve it.

client_id*string

OAuth client id of an agent.

submitted_at*string · date-time

When it was submitted for approval.

reviewed_by*string · uuid

The person who approved or rejected it.

reviewed_at*string · date-time

When it was approved or rejected.

review_note*string

The reviewer's note.

sent_email_id*string · uuid

The email it was sent as (`GET /emails/{id}`; a message of the thread).

version*integer

Bumped on every change; pass it to edit, approve or send.

Example: 1

created_at*string · date-time

When the draft was created.

updated_at*string · date-time

When it last changed.

Example

Request

POST https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/drafts/{id}/send
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "version": 0
}

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "mailbox_id": "00000000-0000-0000-0000-000000000000",
  "thread_id": "00000000-0000-0000-0000-000000000000",
  "reply_to_message_id": "00000000-0000-0000-0000-000000000000",
  "kind": {},
  "status": {},
  "to": [
    "string"
  ],
  "cc": [
    "string"
  ],
  "bcc": [
    "string"
  ],
  "subject": "string",
  "text": "string",
  "html": "string",
  "quote": false,
  "attachments": [
    {
      "filename": "invoice-1234.pdf",
      "content_type": "application/pdf",
      "size": 18232
    }
  ],
  "author": {
    "type": {},
    "id": "00000000-0000-0000-0000-000000000000",
    "label": "string",
    "is_agent": false,
    "on_behalf_of_user_id": "00000000-0000-0000-0000-000000000000",
    "client_id": "string"
  },
  "submitted_at": "2026-01-01T00:00:00.000Z",
  "reviewed_by": "00000000-0000-0000-0000-000000000000",
  "reviewed_at": "2026-01-01T00:00:00.000Z",
  "review_note": "string",
  "sent_email_id": "00000000-0000-0000-0000-000000000000",
  "version": 1,
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}