The official pristinesend package is the fastest way to call the API from Node or TypeScript. It encodes the whole contract — typed methods and errors, an auto-paginating cursor iterator, automatic idempotency on sends, retry/backoff, and a react: convenience for React Email. ESM + CJS, no required dependencies.
Pass your API key. A ps_test_ key runs in the sandbox (captured, not delivered).
Idempotency is automatic:
Pass a React Email component as react; the SDK lazily imports @react-email/render and sends the rendered HTML.
HTML-only for now: the API has no text field yet, so React Email's plaintext alternative is dropped. The SDK will send it automatically once the field lands.
Every list() returns a page that auto-paginates when iterated — see Pagination.
Every failure is a typed subclass of PristineSendError carrying the API's code, the offending param, and the requestId to quote to support. See Error codes.
The client retries up to maxRetries times (default 2) on 429, 502, 503, and network errors, honoring Retry-After with exponential backoff. See Rate limits.
| Method | Description |
|---|---|
emails.send(params) | Send one email. Pass html or react:. |
emails.sendBatch(params) | Send up to 100 (207 per-item result). |
emails.get(id) | Retrieve one sent email. |
emails.clicks(id, params?) | Every click on one message. The only route to a transactional message's clicks. |
emails.list(params?) | List sent emails (auto-paginating). |
contacts.create(params) | Create a contact. |
contacts.get(id) | Retrieve a contact. |
contacts.update(id, params) | Update a contact (merges properties). |
contacts.delete(id) | Delete a contact. |
contacts.list(params?) | List contacts (auto-paginating). |
domains.list(params?) | List verified sending domains. |
campaigns.list(params?) | List campaigns, newest first; status: "draft" for the drafts. |
campaigns.get(id) | One campaign with its email as written (the design or the Markdown), its version and its open notes. |
campaigns.create(params) | Make a draft from a design, a starter, Markdown or one of the account's templates (template_id), keyed so a retry never makes two. Sends nothing. |
campaigns.update(id, params) | Change a draft at the version you read; a draft changed since throws ConflictError. Sends nothing. |
campaigns.check(id, params?) | The score, design findings and warnings; with links: true, every link and picture opened. Writes nothing. |
campaigns.sendTest(id, params?) | Send the campaign as a test to someone on the account's team, keyed so a retry never sends two. |
campaigns.resolveNote(id, noteId, params) | Resolve a note the team left on a draft, with a reply saying what changed. Changes nothing in the email. |
designKit.get() | The brand kit, pictures, starters, senders, topics, merge tags and rules, for designing an email. |
pictures.add(params) | Copy a picture from its web address into the account's library, so a draft can show it. Keyed so a retry never adds two; sends nothing. |
templates.list(params?) | The account's templates, newest first, without their email. Auto-paginates when iterated. |
templates.get(id) | One template, with its email as written: the design, the Markdown or the HTML, and its version. |
templates.create(params) | Create a template from a design, a starter, Markdown or HTML; HTML's pictures from other sites are copied into the library. Keyed so a retry never makes two; sends nothing. |
templates.update(id, params) | Change a template at the version you read. ConflictError when it changed since. |
forms.list() | Every signup form of the account (at most 50), newest first, with its page address and confirmed signups. |
forms.get(id) | One form: its draft, what Publish would still refuse, its numbers once live, and what its draft may name. |
forms.create(params) | Create a signup form as a draft, checked before it is made. Keyed so a retry never makes two; a person publishes it in PristineSend. |
forms.update(id, params) | Change a form's draft at the draft_updated_at you read. ConflictError when it was saved since. Never publishes. |
campaigns.links(id, params?) | Rank a campaign's clicked links. Opt-out links are counted, never returned. |
campaigns.cancel(id) | Cancel a scheduled campaign before it starts sending. Cannot start one. |
automations.sendEvent(input) | Start an automation from an event in your own system. Sends nothing a human has not activated; an unknown contact is a 404, never an implicit create. |
metrics.get(params?) | Aggregate delivery and engagement metrics for a window. |
suppressions.create(params) | Add an email to the do-not-send list. |
suppressions.delete(params) | Remove an email (pass force to lift a bounce/complaint). |
suppressions.list(params?) | List suppressions. |
events.list(params?) | List the webhook delivery log. |
deliverability.check(params) | Score content before sending. Sends nothing. |
segments.create(params) | Build an audience from a filter; returns its recipient count. |
companies.list(params?) | The CRM's companies, newest first; q searches name and domain. Auto-paginates when iterated. |
companies.get(id) | One company. |
companies.create(params) | Create a company from a name, a domain, or both. |
companies.update(id, params) | Change a company's name, domain or property values. |
companies.delete(id, opts?) | Delete a company; its contacts stay, in no company. ignoreDomain: true keeps its domain from making one again. |
pipeline.get() | The pipeline: its currency, its stages in order, and the team. |
deals.list(params?) | Deals, newest first, by status, stage, company, contact or owner. Auto-paginates when iterated. |
deals.get(id) | One deal, with its contacts. |
deals.create(params) | Create a deal. Needs a live key: a deal entering a stage can start an automation. |
deals.update(id, params) | Change a deal's fields, or move it with stage_id, at the updated_at you read. |
deals.delete(id) | Delete a deal and its history. |
notes.list(params) | One record's notes: contact_id, company_id or deal_id. Auto-paginates when iterated. |
notes.create(params) | Write a note, call, meeting or email on a contact, company or deal. |
tasks.list(params?) | Tasks, newest first; kind: "reply" with status: "open" lists the replies waiting for an answer. Auto-paginates when iterated. |
tasks.get(id) | One task. |
tasks.create(params) | Create a task, about a record or none. |
tasks.update(id, params) | Finish or reopen a task (done), or change its fields at the updated_at you read. |
timeline.list(params) | A contact's, company's or deal's timeline, newest first. Auto-paginates when iterated. |
crm.search(q) | Companies, deals and contacts matching some text, at most 8 of each. |
meetings.list(params?) | Meetings, upcoming (soonest first) or past (newest first), on your booking pages and through Calendly or Cal.com; email: one guest's. Auto-paginates when iterated. |
meetings.get(id) | One meeting, a moved one included. |
meetings.cancel(id, params?) | Cancel a booking page's meeting, with a message for the guest. Needs a live key: the guest is emailed. |
bookingPages.list() | Every booking page of the account: its kind, hosts, status, address, lengths and time zone. A team page's teammates are its hosts. |
bookingPages.freeTimes(id, params?) | A page's free times on the days asked, as the page offers them, each with a link to book it; or why the page takes no bookings now. |
busyTimes.get(params?) | A team member's busy times from their AI that have not ended, and when and by whom they were last sent. |
busyTimes.set(params) | Replace a team member's busy times inside a window, kept off their booking pages. Needs a live key. |