v1

Unitpost API Documentation

Guides to get you sending, plus a complete reference for every API endpoint — generated live from the spec, so it never drifts.

Base URL: https://www.unitpost.com/api/v1

Quickstart

A key, then an SDK, the CLI, or plain HTTP. The same steps for every channel. Then pick one.

Install the SDK

Add the official SDK for your language — or use the CLI, or call the API directly.

Open this guide on its own page

You can integrate in whichever way fits your stack. The official SDKs wrap the same REST API with idempotent retries and a { data, error } result shape; the CLI wraps it for your terminal and CI; or skip the dependency entirely and call the HTTP API directly with cURL or your language's HTTP client.

1. Add the SDK

Pick your language tab. The API tab needs nothing installed — any HTTP client works.

Bash
# No package to install — call the REST API with any HTTP client.
# Keep your key in an environment variable:
export UNITPOST_API_KEY="pk_live_..."

2. Initialize the client

Construct a client once and reuse it. Each SDK reads UNITPOST_API_KEY from the environment by default, or you can pass the key explicitly. Never hard-code a key in source you commit.

cURL
# Every request carries your key as a Bearer token plus a User-Agent.
curl https://www.unitpost.com/api/v1/email \
  -H "Authorization: Bearer $UNITPOST_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: my-app/1.0"

Keys live in the environment

Store your API key in an environment variable (UNITPOST_API_KEY) or your secrets manager — not in committed source. Scope it to Sending if the integration only sends mail. See Quickstart for creating and scoping keys.

That's it — you're ready to send. Head to the Quickstart to make your first request, or jump straight to Templates & variables.

Command line (CLI)

Send, inspect, and script every API operation from your terminal and CI.

Open this guide on its own page

unitpost is the official command-line interface — one command per API operation, generated from the same OpenAPI contract as the SDKs. Install it, sign in once, and send from your shell, your scripts, and your agents. The complete reference — flags, profiles, JSON mode, CI, troubleshooting — lives on the CLI docs page.

1. Install

Homebrew and the install scripts give you a standalone binary with no Node.js needed; the scripts check the download's SHA-256 before installing. With Node.js 20+ you can use npm instead, or npx for a one-off.

Homebrew (macOS, Linux)
brew install unitpostcom/tap/unitpost
Install script (macOS, Linux)
curl -fsSL https://www.unitpost.com/install.sh | sh
PowerShell (Windows)
irm https://www.unitpost.com/install.ps1 | iex
npm (Node.js 20+)
npm install -g unitpost-cli

Check it worked with unitpost --version. For a one-off without installing, run npx unitpost-cli@latest --help.

2. Sign in

Bash
unitpost login              # browser sign-in (OAuth 2.1 + PKCE)
unitpost login --no-browser # prints the URL — for SSH / remote shells
unitpost whoami             # which credential is in effect, and its scopes

Commands read as unitpost <resource> <action> — try unitpost --help for all 82, or open the CLI docs for auth, profiles, scripting, agents, and CI.

The unitpost sms commands need a paid plan. On the free plan, sending a text or an SMS campaign fails with 403 limit_reached, and the CLI tells you to upgrade the plan rather than to change your key's scopes. Reading your SMS history works on every plan.

Bash
unitpost --help
unitpost email send --help
unitpost doctor

Search docs and guides

Search the docs and product guides.