Workflows API
Use the API to send email from any language, see what you sent, and manage templates, broadcasts, automations, and opt-outs from your own systems.
When to use the API
| Surface | Use it when |
|---|---|
| Server SDKs | Your backend sends transactional email in Node.js, Python, Go, .NET, Rust, Ruby, Elixir, or PHP. The SDKs retry with idempotency keys for you. |
| API | Your language has no SDK, or you sync templates, broadcasts, automations, and opt-outs with your own systems. |
| MCP | You want your coding agent to build and change automations and broadcasts for you in plain language. |
| Web app | You build, test, and watch automations and broadcasts yourself. |
To send your first email with curl, follow send transactional emails with the API.
Endpoints
There are two kinds of endpoint:
- Sending endpoints run on your server with a project secret API key. They send email, upload attachments, read the status of a send, and update a person's opt-outs.
- Project endpoints use a personal API key. They read your send history, and manage templates, broadcasts, automations, opt-outs, and the suppression list.
| Sending endpoint | What it does |
|---|---|
POST /api/messaging/send/email/ | Send one email. |
POST /api/messaging/send/email_batch/ | Send one email to up to 100 recipients, each with their own copy. |
POST /api/messaging/attachments/uploads/ | Get upload URLs for files to attach to an email. |
GET /api/messaging/emails/:message_id/ | Get the status of one send, such as delivered or bounced. |
POST /api/messaging/preferences/ | Update a person's opt-outs from your own preferences page. |
API reference
Each reference page lists every endpoint and field.
| Reference | What it covers |
|---|---|
| Transactional email | Send email, upload attachments, and check the status of a send. |
| Email templates | Manage the templates in the email library, and mark a template as transactional. |
| Email logs | Read the sends of the last 30 days, with the timeline of each send. |
| Broadcasts | Manage broadcasts, schedules, and batch jobs. POST /api/projects/:project_id/hog_flows/user_blast_radius/ counts how many people a set of filters reaches, so you can check an audience before you send. |
| Workflows | Manage automations and their drafts, publish them, and read their runs. |
| Email subscriptions | Manage opt-outs and message categories. |
| Suppression list | Add and remove addresses on the suppression list, one at a time or in bulk. |
For rate limits, attachment sizes, and bulk request sizes, see API and SDK limits. For every other lookup page, see the Workflows reference.
Authentication
Send the key as a bearer token.
| Key | Endpoints | Scopes |
|---|---|---|
| Project secret API key | Sending endpoints | transactional_email:write to send and upload attachments, transactional_email:read to read the status of a send, and messaging_preference:write to update opt-outs |
| Personal API key | Project endpoints | hog_flow:read to read and hog_flow:write to make changes. The send history and the suppression list also need person:read, because they show recipients. Counts of what people did after an email also need query:read. Launching or scheduling a broadcast also needs person:read. Counting an audience with user_blast_radius also needs the read scope for the data its filters use, such as person:read, group:read, or query:read. |
Keep a project secret API key on your server. Keep a hog_flow:write key as safe as a password: it can turn on automations that email real people.
Other surfaces
- MCP – ask your agent to do the same things in plain language.
- Web app – do the same things in PostHog.
- PostHog API reference – every PostHog API, not only Workflows.





