OverviewProductsPlatformsAPI ReferenceResources
Email

List email messages

GEThttps://zernio.com/api/v1/email/messages

Same filters and envelope as GET /v1/email/threads, one row per message. Bodies are omitted; fetch a message to read text and html.

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Query parameters

accountIdstringRequired

The connected Google, Microsoft or IMAP account.

folderstring
unreadboolean
starredboolean
hasAttachmentboolean
subjectstring
fromstring
tostring
ccstring
bccstring
anyEmailstring
afterstring (date-time)
beforestring (date-time)
searchQueryNativestring, max 500
sortOrderstringDefault descOne of asc | desc
cursorstring
limitintegerDefault 50

Responses

Success· the request worked

Errors· the request failed

How it behaves

On Google

  • List rows also omit attachments (Gmail's metadata pages carry headers only); hasAttachment=true still filters server-side.
  • sortOrder=asc reverses the fetched page.
  • archive means mail without the inbox, trash or spam labels.
GET/v1/email/messages
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.email.listEmailMessages({  query: {    accountId: 'account_abc123',  },});console.log(data);
{  "data": [    {      "id": "string",      "threadId": "string",      "accountId": "string",      "provider": "google",      "folders": [        "string"      ],      "from": {        "email": "user@example.com",        "name": "string"      },      "sender": {        "email": "user@example.com",        "name": "string"      },      "to": [        {          "email": "user@example.com",          "name": "string"        }      ],      "cc": [        {          "email": "user@example.com",          "name": "string"        }      ],      "bcc": [        {          "email": "user@example.com",          "name": "string"        }      ],      "replyTo": [        {          "email": "user@example.com",          "name": "string"        }      ],      "subject": "string",      "snippet": "string",      "text": "string",      "html": "string",      "attachments": [        {          "id": "string",          "filename": "string",          "contentType": "string",          "size": 0,          "isInline": true,          "contentId": "string"        }      ],      "headers": {        "property1": "string",        "property2": "string"      },      "raw": "string",      "date": "2019-08-24T14:15:22Z",      "unread": true,      "starred": true,      "labels": [        "string"      ],      "metadata": {        "property1": "string",        "property2": "string"      },      "trackingId": "string",      "clean": {        "text": "string",        "status": "stripped",        "removed": {          "quoted": true,          "forwardHeader": true,          "boilerplate": true        },        "signature": "string",        "forwarded": {          "from": "string",          "to": "string",          "date": "string",          "subject": "string"        }      },      "draftId": "string",      "forwardedFrom": "string"    }  ],  "pagination": {    "hasMore": true,    "nextCursor": "string"  },  "meta": {    "filteredClientSide": [      "string"    ]  }}
OpenAPI specification
Was this page helpful?