Mail API reference

Mail API · Messages

get/v1/workspaces/{workspace_id}/mailboxes/{id}/messagesAuth

List messages in a mailbox

Path parameters

workspace_id*string · uuid

Id of the workspace.

id*string · uuid

Id of the mailboxe.

Query parameters

fromstring

Filter by From address (substring match)

subjectstring

Filter by subject (substring match)

sincestring · date-time

Only include messages received on or after this ISO-8601 timestamp.

untilstring · date-time

Only include messages received on or before this ISO-8601 timestamp.

unreadboolean

Filter to only unread (true) or only read (false) messages

limitinteger

Page size, 1–100.

cursorstring

Opaque pagination cursor

Response · 200

data*array

The messages on this page, newest 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}/mailboxes/{id}/messages
Authorization: Bearer YOUR_TOKEN

Response

{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "mailbox_id": "00000000-0000-0000-0000-000000000000",
      "seq_id": "42",
      "raw_object_key": "string",
      "envelope_to": "string",
      "from_address": "string",
      "from_local": "string",
      "from_domain": "string",
      "to_addresses": [
        "string"
      ],
      "cc_addresses": [
        "string"
      ],
      "subject": "string",
      "body_preview": "string",
      "rfc822_message_id": "string",
      "size_bytes": 0,
      "spam_score": "string",
      "spam_verdict": "string",
      "spf_result": "string",
      "dkim_result": "string",
      "dmarc_result": "string",
      "quarantined": false,
      "received_at": "2026-01-01T00:00:00.000Z",
      "read_at": "2026-01-01T00:00:00.000Z",
      "deleted_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "pagination": {
    "next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wNS0wMVQwMDowMDowMFoifQ",
    "has_more": false
  }
}