Prerequisites
You need one of the following:- Hosted Plunk — Sign up at useplunk.com and create a project.
- Self-hosted Plunk — Deploy using Docker and connect to AWS SES. See the Self-Hosting guide.
Get your API key
Open the Plunk dashboard, navigate to your project, and go to Settings → API Keys.You’ll see two keys:
- Secret key (
sk_*) — Required for sending email and all other write operations. Keep this server-side and never expose it in client code. - Public key (
pk_*) — Only works with the/v1/trackendpoint. Safe to use in browser JavaScript.
Send a transactional email
Use A successful response looks like:Key request fields:
POST /v1/send to send an email directly from the API. The from address must come from a domain you have verified in Plunk.Recipient email address. Accepts a string (
"[email protected]"), an object with name and email ({"name": "Jane", "email": "[email protected]"}), or an array of either for multiple recipients.Email subject line. Supports
{{variable}} substitution using values from data.HTML email body. Supports
{{variable}} substitution. Use {{field ?? default}} for fallback values.Sender address. Must be from a domain verified in your Plunk project. Accepts a string email or
{"name": "Sender Name", "email": "[email protected]"}.Sender display name when
from is a plain string.Key-value pairs for template variable substitution and contact data. Simple values are persisted to the contact record. To pass a value for this email only without saving it, use
{"value": "ABC", "persistent": false}.Up to 10 attachments (10 MB total). Each attachment requires
filename (string), content (base64-encoded string), and contentType (MIME type string).Template ID from your dashboard. When set,
subject and body are optional — the template values are used unless you override them.Track a contact event
Use A successful response looks like:Key request fields:
POST /v1/track to record a named event for a contact. This creates the contact if they don’t exist yet, updates their data, and can trigger any matching workflows you’ve configured.You can use either your secret key (sk_*) or your public key (pk_*) for this endpoint.The contact’s email address. If this contact doesn’t exist yet, Plunk creates them automatically.
Name of the event to record (e.g.,
signed_up, purchase_completed, plan_upgraded). Use this name in workflows and segments to filter by event.Key-value pairs saved to the contact record and made available in workflow templates. To pass a value for this event only without persisting it to the contact, use
{"value": "order_123", "persistent": false}.Explicitly set the contact’s subscription status. If omitted, new contacts default to subscribed and existing contacts keep their current status.
Next steps
Verify your sending domain
Add DNS records so you can send from your own domain with proper DKIM and SPF authentication.
Build a workflow
Set up an automated email sequence triggered by events you track with
/v1/track.Send a campaign
Broadcast an email to all contacts or a targeted segment of your audience.
API reference
Explore every endpoint: contacts, templates, campaigns, segments, workflows, and more.