Login / Register
GET
/api/public/v1/emails

List emails

Messages in the token’s own mailboxes, summarized — the fields that identify a message and a ~300-character `snippet` of its body, never the HTML or the headers. The boundary is the employee’s addresses rather than the company’s: this returns mail sent to or from an address that employee owns, and nothing else. The response names the mailboxes it searched (`searchedMailboxes`) beside every mailbox the employee owns, so an empty page says which inbox was looked in. `mailbox` narrows to one of those addresses — the support inbox, say — and is ignored for any address the employee does not own. `threadId` groups a back-and-forth, and the first message in a thread carries its own id there. `search` matches the subject, the addresses and the body.

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:read

Query Parameters

NameTypeRequiredDescription
limitnumberOptionalMaximum number of items to return (1-100).Default: 20
offsetnumberOptionalNumber of items to skip before starting to collect the result set.Default: 0
sortBystringOptionalField to sort by. Allowed values vary by endpoint.Default: createdAt
sortOrderstring
asc
desc
OptionalSort direction.Default: desc
searchstringOptionalFree-text search across the resource’s primary fields.
createdAfterstringOptionalISO 8601 timestamp — only return items created after this time.
createdBeforestringOptionalISO 8601 timestamp — only return items created before this time.
updatedAfterstringOptionalISO 8601 timestamp — only return items updated after this time.
mailboxstringOptionalOnly mail in this address of yours. Repeatable.
directionstring
INBOUND
OUTBOUND
OptionalReceived or sent.
tostringOptionalExact recipient address.
fromstringOptionalExact sender address.
folderstringOptional`inbox` for mail in its natural place; `archive`, `junk` or `trash` for the system folders; or a custom folder id.
threadIdstringOptionalOne conversation, in full.
unreadbooleanOptional
starredbooleanOptionalSet `true` for flagged mail.
includeTextbooleanOptionalAdd each message’s full plain-text body to the summary.
GETExample request
curl
curl -X GET "https://www.pxb.app/api/public/v1/emails" \
  -H "Authorization: Bearer your_access_token"
200Example response
json
{
  "message": "Emails retrieved successfully!",
  "content": {
    "emails": [
      {
        "id": "eml_3390",
        "threadId": "eml_3390",
        "from": "sam@acme.example",
        "to": "ap@northwind.example",
        "cc": null,
        "subject": "Invoice 1042",
        "snippet": "Attached is the invoice for phase one. Let me know if purchasing needs anything else.",
        "direction": "OUTBOUND",
        "unread": false,
        "starred": false,
        "folder": null,
        "accountId": "acc_7712",
        "hasAttachments": true,
        "attachments": [
          {
            "id": "eat_19",
            "fileName": "invoice-1042.pdf",
            "contentType": "application/pdf",
            "fileSize": 84210
          }
        ],
        "receivedAt": "2026-08-22T15:04:00.000Z",
        "createdAt": "2026-08-22T15:04:00.000Z",
        "updatedAt": "2026-08-22T15:04:00.000Z"
      }
    ],
    "mailboxes": [
      "sam@acme.example",
      "support@acme.example"
    ],
    "searchedMailboxes": [
      "sam@acme.example",
      "support@acme.example"
    ],
    "pagination": {
      "total": 42,
      "limit": 20,
      "offset": 0,
      "hasMore": true
    }
  }
}

In the console

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