PristineSend
Get started
API Reference

Emails

Read back the emails your workspace has sent and their delivery status. These endpoints are read-only — to send, use Send email or Batch send.

Overview

MethodPathDescription
GET/api/v1/emailsList sent emails (cursor-paginated)
GET/api/v1/emails/:idGet a single email by UUID

The email object

Both endpoints return the same object shape:

FieldTypeDescription
idstringThe email's UUID — the same id POST /api/v1/send returns.
tostringRecipient email address.
subjectstringSubject line.
statusstringDelivery status: sent, delivered, opened, clicked, failed, complained, bounced, or suppressed (a send blocked by the suppression list).
typestringSend type: campaign, automation, or transactional.
environmentstringWhich key sent it: live (delivered) or test (captured in the sandbox). See Test mode.
sent_atstringISO 8601 timestamp the email was sent.
delivered_atstring | nullWhen the receiving server confirmed delivery, or null.
opened_atstring | nullWhen the recipient first opened the email, or null.
clicked_atstring | nullWhen the recipient first clicked a tracked link, or null.
bounced_atstring | nullWhen the email bounced, or null.
complained_atstring | nullWhen the recipient marked the email as spam (a complaint), or null.
errorstring | nullThe failure reason — present only when status is "failed", otherwise null.

List emails

GET/api/v1/emails

Returns a cursor-paginated list of sent emails, newest first. Pass next_cursor from the response back as the cursor parameter to fetch the next page.

Query parameters

FieldTypeRequiredDescription
limitnumberoptionalMax emails to return. Default 50, max 100 (over-large values are clamped).
cursorstringoptionalOpaque pagination cursor from a previous response's next_cursor. Omit for the first page; a malformed cursor returns 400 invalid_field.
statusstringoptionalFilter by delivery status. One of: sent, delivered, opened, clicked, bounced, complained, failed, suppressed.
typestringoptionalFilter by send type. One of: campaign, automation, transactional.
environmentstringoptionalFilter by send environment. One of: live, test (test-mode captured sends).
Note: The selectable status filters are every status an email can hold — sent, delivered, opened, clicked, bounced, complained, failed, and suppressed (a send blocked by the suppression list). Any other value returns 400 invalid_field.

Response

"color:#ff7b72">import { PristineSend } "color:#ff7b72">from "pristinesend"

"color:#ff7b72">const ps = "color:#ff7b72">new PristineSend(process.env.PRISTINESEND_API_KEY!)

// The returned page auto-paginates — iterate across every page transparently.
for "color:#ff7b72">await ("color:#ff7b72">const email of "color:#ff7b72">await ps.emails.list({ limit: 100, status: "delivered" })) {
  console.log(email.id, email.status)
}

Get an email

GET/api/v1/emails/:id

Returns a single email wrapped in { "data": { … } }. The :id is the email's UUID — the same value POST /api/v1/send returns. Returns 404 not_found if the email doesn't exist or belongs to another workspace; a non-UUID id also returns 404.

"color:#ff7b72">import { PristineSend } "color:#ff7b72">from "pristinesend"

"color:#ff7b72">const ps = "color:#ff7b72">new PristineSend(process.env.PRISTINESEND_API_KEY!)

"color:#ff7b72">const email = "color:#ff7b72">await ps.emails.get("550e8400-e29b-41d4-a716-446655440000")
console.log(email.status, email.delivered_at)

Errors

Errors use the standard envelope — unauthorized (401), invalid_field (400, for a bad status/type/cursor), and not_found (404). See the full Error codes reference for the canonical envelope.