OverviewProductsPlatformsAPI ReferenceResources
Email

Move a message to trash

DELETEhttps://zernio.com/api/v1/email/messages/{messageId}

Authentication

AuthorizationBearer tokenRequired

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

Path parameters

messageIdstringRequired

Query parameters

accountIdstringRequired

The connected Google, Microsoft or IMAP account.

Responses

Success· the request worked

Errors· the request failed

Send an email

Sends from the connected mailbox and returns the stored sent copy. The message is mirrored into the inbox (`message.sent` fires once) and counted against the mailbox's daily cap. The cap is reported in the `X-Zernio-Send-Limit`, `X-Zernio-Send-Remaining` and `X-Zernio-Send-Reset` response headers. ### Sending limits These mailboxes are for one-to-one mail, not bulk sends. Protection on every mailbox: - Daily cap: Microsoft 1,000; Google Workspace 500; Gmail consumer 200. Reaching it answers 429 `email_send_cap_reached` with `details.cap`. - The same body reaching more than 50 distinct recipients within an hour pauses the mailbox with an escalating cooldown (429 `rate_limited`, `account.rate_limited` webhook). ### Scheduling With `scheduledFor` the request answers 202 with a `ScheduledEmail` instead of sending. The account and payment method are checked now; the caps, cooldowns and the send itself run at `scheduledFor`. A send that fails then fires `email.send_failed`. List, read and cancel scheduled sends under `/v1/email/messages/scheduled`. ### Tracking - `trackOpens` adds a 1x1 image to the html and fires `email.opened`. - `trackLinks` rewrites every http(s) link in the html through a Zernio redirect and fires `email.link_clicked`. - `trackReplies` fires `email.thread_replied` when someone else writes in the thread. Tracking costs nothing extra. Opens are approximate: image proxies prefetch and image blocking hides them. ### Other errors - 402: Gmail sends need a payment method on the workspace. Reading, calendar and files do not. - 400: `holdAsDraft` without `scheduledFor`; `trackOpens` or `trackLinks` without `html`; `scheduledFor` outside 1 minute to 30 days.

List the occurrences of a recurring event

Lists the occurrences and exceptions of a series between `from` and `to`. Each one has its own `id` to read, update or delete just that occurrence, and `originalStart` for its place in the pattern.

DELETE/v1/email/messages/{messageId}
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.email.trashEmailMessage({  path: {    messageId: 'message_abc123',  },  query: {    accountId: 'account_abc123',  },});console.log(data);
{  "data": {    "id": "string",    "trashed": true  }}
OpenAPI specification
Was this page helpful?