Mail API reference

Mail API · Drafts

get/v1/workspaces/{workspace_id}/draftsAuth

List drafts

Drafts in every mailbox you may list (`mail.list`), or in `mailbox_id`; most recently changed first. Default: the open ones (`draft`, `pending_approval`). `status=pending_approval` is the approval queue ("Waiting for approval"); `author=agents` narrows it to drafts written by agents.

Path parameters

workspace_id*string · uuid

Id of the workspace.

Query parameters

statusenum (6)

Only drafts in this status. Default: the open ones (`draft` and `pending_approval`).

mailbox_idstring · uuid

Only this mailbox. Omit for every mailbox you may list.

thread_idstring · uuid

Only drafts in this conversation.

authorenum (2)

`me`: drafts you wrote, or agents wrote for you. `agents`: drafts written by agents (MCP grants and OAuth clients).

limitinteger

Page size, 1–100.

cursorstring

Opaque cursor from `pagination.next_cursor`.

Response · 200

data*array

Drafts, most recently changed first.

pagination*object
next_cursor*string

Opaque cursor for the next page. `null` when no more pages are available.

Example: "eyJjcmVhdGVkX2F0IjoiMjAyNi0wNS0wMVQwMDowMDowMFoifQ"

has_more*boolean

True iff another page exists; if true, pass `next_cursor` on the next request.

Example: false

Example

Request

GET https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/drafts
Authorization: Bearer YOUR_TOKEN

Response

{
  "data": [
    {
      "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"
    }
  ],
  "pagination": {
    "next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wNS0wMVQwMDowMDowMFoifQ",
    "has_more": false
  }
}