API and MCP
Everything here is also described as OpenAPI 3.1 at /openapi.json, and the webhook events at /docs/api/events.json.
Keys
Make a key on the dashboard's API keys page and send it as Authorization: Bearer <key>. A secret key starts pct_ and has scopes: read, events:write (an app sending its accounts and events), and full, which can do both and change things. A publishable key starts pcf_, is safe in a web page, and can only submit a sign-up form from the sites the form lists. A key can be bound to one app. Errors are { error: { code, message } }.
curl https://programmable.contact/api/v1/me \ -H "Authorization: Bearer pct_…"
What an app usually does
- Send its accounts once:
PUT /api/v1/contacts/batch. This makes contacts and subscribes nobody. - Send account events from then on:
POST /api/v1/eventswithuser.created,user.updated,plan.changedoruser.deleted. - Ask its users for consent with programmable-ui's
consent-promptitem, which calls/api/v1/consents/promptand/api/v1/consents. - Say when a lifecycle message is due:
POST /api/v1/eventswithlifecycle.<name>. - Before sending its own optional email, check:
POST /api/v1/suppressions/check.
Calls
| Call | What it does | Key |
|---|---|---|
| GET /api/v1/me | What the key isThe workspace and app the key speaks for, and its scopes. The way to test a key. | Key: read |
| GET /api/v1/topics | List topicsThe kinds of email a person can say yes or no to. | Key: read |
| POST /api/v1/suppressions/check | Check whether optional email to addresses is stoppedThe check an app calls before it sends its own optional mail. A POST so that no address appears in a URL. | Key: read |
| PUT /api/v1/contacts/batch | Send an app's accountsFor the first load or a re-sync. Makes contacts and app memberships. Subscribes nobody. Each row stands alone; sending the same batch again is safe. | Key: events:write |
| GET /api/v1/contacts/{id} | Everything held about one personA copy for the person: their details, apps, email preferences, messages sent and consent history. There is no API call to erase a person: an owner or admin does that on the person's page in the dashboard. | Key: read |
| POST /api/v1/events | Tell Contact something happened to an accountAccount events (user.created, user.updated, plan.changed, user.deleted) keep the contact record current and subscribe nobody. A lifecycle event (lifecycle.<name>) says now is the moment for that app's message of that name; the answer's lifecycle field says what happened, and nothing is queued. Each id is acted on once. | Key: events:write |
| PUT /api/v1/optouts/batch | Bring over people who already turned a kind of mail offSent once when an app's lifecycle mail moves to Contact, so nobody who stopped it starts getting it again. An app stops only its own topics. This call can only stop mail. | Key: events:write |
| POST /api/v1/consents/prompt | Should this app ask this person for marketing consent now?Apps normally use programmable-ui's consent-prompt item instead of calling this. Give it a short timeout and show nothing on any failure: it must never hold up a sign-in. A POST although it only reads, so that no address appears in a URL. | Key: events:write |
| POST /api/v1/consents | Record what a person answered to the consent promptgranted is the topics they ticked; every other topic offered is recorded as declined. An empty list is a no. | Key: events:write |
| POST /api/v1/leads | A sign-up from a formStarts double opt-in: nobody is subscribed until they confirm from the message sent to the address. The answer is the same whatever the address's state. A web page sends a publishable key (pcf_) from one of the form's listed sites, with a Turnstile token; a server relaying its own form sends a secret key with events:write and the visitor's ip. A form that requires a name or a country refuses a sign-up without it (name_required, country_required). Answers to the form's own fields (custom_fields in GET /api/v1/forms) go in fields, by key, and are checked against the form's current version: a key it doesn't ask is refused (422 unknown_field), a value its kind can't hold too (422 bad_field_value), and a required one left out or empty is 400 field_required; error.field names the key. An answer is kept on the sign-up's own record and only fills a value that record doesn't have: a sign-up never changes or clears a value already there. Send form_version, the version whose wording your page showed, and a sign-up on a form that has changed since is refused (form_changed) rather than recorded against wording the person didn't see. | Key: publishable key |
| GET /api/v1/campaigns | List campaigns | Key: read |
| POST /api/v1/campaigns | Start a campaign draftThe API can draft and read campaigns. It cannot test, approve or send one: those are done by a person in the dashboard. | Key: full |
| GET /api/v1/campaigns/{id} | One campaign, with its results | Key: read |
| PATCH /api/v1/campaigns/{id} | Change a draftAny change clears the last test. Refused once the campaign is approved. | Key: full |
| GET /api/v1/sequences | List sequencesEmails sent in order to each person who joins a topic. The API only reads them: drafting is the dashboard's and the MCP's, and approving, resuming or putting anyone in one is a person's, in the dashboard. | Key: read |
| GET /api/v1/replies | List replies to the workspace's mailReplies people sent to campaign, sequence and lifecycle email, for a workspace with replies on (Settings, Sending). Read only: nothing in the API answers one, sends, or acts on one. A reply that seems to ask to stop is flagged for a person; it stops nothing. Ids, words and flags: never an address or a name. | Key: read |
| GET /api/v1/sequences/{id} | One sequence, with its steps and results | Key: read |
| PUT /api/v1/subscribers/import | Hand over a list of people who already agreed to a topic elsewhere, for reviewNobody is added: the list waits, with its evidence, until an owner or admin approves it in the dashboard (which brings it in as that person) or rejects it. A list nobody decides on is deleted after 30 days. The list is checked as an import would be: double_opt_in needs confirmed_at for every row; an imported yes permits nothing under the strict consent policy; an older yes never undoes a newer stop. Nothing is sent. Up to 20 lists may wait at once. | Key: full |
| GET /api/v1/subscribers/import/{id} | Where a staged list standsNo addresses: the people are not given back. A list nobody decided on is gone after 30 days (404). | Key: read |
| GET /api/v1/contacts | List contactsNewest first, 50 a page. search matches anywhere in an address or the start of a name. | Key: read |
| GET /api/v1/tags | List tagsThe workspace's tags, each with how many people have it. | Key: read |
| POST /api/v1/tags/batch | Put tags on, or take them off, many peopleA tag is a label, not consent: this subscribes nobody and stops nothing. A new name makes a new tag. People erased or not in this workspace are skipped. | Key: full |
| GET /api/v1/contacts/{id}/tags | One person's tags | Key: read |
| POST /api/v1/contacts/{id}/tags | Put tags on one person, or take them offA label, not consent. Removing is a POST too: there is no DELETE. | Key: full |
| GET /api/v1/contacts/{id}/fields | One person's values for the workspace's fields | Key: read |
| PATCH /api/v1/contacts/{id}/fields | Set some of a person's field valuesBy key; null or an empty string clears one. Every value is checked first: an unknown key or a bad value changes nothing. A fact about the person, not consent. | Key: full |
| GET /api/v1/fields | List the workspace's own fields | Key: read |
| POST /api/v1/fields | Define a fieldIts key (made from the label when not given) and type never change. A choice needs its options. | Key: full |
| GET /api/v1/segments | List saved segmentsEach with how many people it matches now. | Key: read |
| POST /api/v1/segments | Save a segmentA filter over contacts. It never subscribes anyone; a campaign narrowed by it still goes only to people who agreed to its topic. | Key: full |
| GET /api/v1/segments/{id} | One segment, with its count nowCounts only; list its people with GET /api/v1/contacts?segment=<id>. | Key: read |
| GET /api/v1/forms | List sign-up forms | Key: read |
| GET /api/v1/funnel | Sign-ups and new payers per app and week, by source, and per formFrom what apps have reported. No revenue. | Key: read |
| GET /api/v1/report | The audience, sending and health over timeCounts per week or month (UTC), worked out from the consent ledger and the message log: subscribers joined (by form, import, app prompt, other), left (unsubscribed, stopped all email, erased), net, the total at each period's end, bounces and complaints that stopped a subscriber's address, and people who turned the topic off. Emails sent by kind against the monthly limit, and the last 30 days' bounce and complaint rates. Aggregates only: no address, name or person. | Key: read |
| GET /api/v1/calendar | What is on the calendarDays in the workspace's own time zone: campaigns scheduled (approved with a start time to come), sending and sent, by the time they go; sequences on the day they started and on each later approval; and planned items (a title, a channel and notes on a day; a plan sends and posts nothing, and posting to social networks from Contact isn't available). Ids, days, kinds and titles: no address or person. Read only: a campaign is scheduled by the person who approves it, in the dashboard. | Key: read |
| GET /api/v1/prospects | List prospectsA record of who the workspace is talking to. Nothing is ever sent to a prospect from Contact. | Key: read |
| POST /api/v1/prospects | Add a prospect | Key: full |
| GET /api/v1/prospects/{id} | One prospect with its history | Key: read |
| PATCH /api/v1/prospects/{id} | Change a prospect, move its stage, or add a noteFields not sent stay as they are. do_not_contact also stops optional email to the address. | Key: full |
| GET /api/v1/campaigns/{id}/preview | A campaign as a recipient would get itMerge fields are filled in for a sample person. | Key: read |
| GET /api/v1/campaigns/{id}/audience | How many a draft would go to nowNumbers only, no addresses. | Key: read |
| GET /api/v1/links | List tracked links with their click countsClicks are counted per link per day, never per person; bots and mail scanners are counted apart. | Key: read |
| POST /api/v1/links | Make a tracked linkA short address on the link host that sends people to the destination, with these tags added. The destination can't be changed by whoever follows it. | Key: full |
| GET /api/v1/webhooks | List webhooks | Key: read |
| POST /api/v1/webhooks | Add a webhookContact will POST events to the address, signed with X-Programmable-Signature. The events are listed at /docs/api/events.json. The secret is in this answer and never shown again. | Key: full |
| DELETE /api/v1/webhooks/{id} | Remove a webhook | Key: full |
Nothing in the API tests, approves or sends a campaign, or turns a lifecycle message on: a person does that in the dashboard.
What a key can't do
No key can send, approve, subscribe anyone, lift a stop or erase anyone. An agent prepares; a person decides.
- Bringing in subscribers.
PUT /api/v1/subscribers/importhands over a list with its evidence and answers202with the list's id andstatus: "pending". Nobody is added until an owner or admin reviews it in the dashboard (Contacts, Bring in subscribers) and approves it; they can also reject it. A list nobody decides on is deleted after 30 days. Follow it withGET /api/v1/subscribers/import/<id>or theimport.stagedwebhook event. - Erasing a person. There is no API call for it. An owner or admin erases someone from the person's page in the dashboard, which is kept in the activity log; a person can also erase themselves from a link mailed to them.
GET /api/v1/contacts/<id>gives the copy of their data that goes with a request.
MCP, for AI agents
https://programmable.contact/api/mcp, streamable HTTP, with the same keys. A read key gets the read tools; full adds drafting campaigns and sequences, keeping prospects and planning on the calendar. An agent can read, draft and propose. No tool sends, approves, schedules a send, subscribes anyone, lifts a stop or erases anyone.
{
"mcpServers": {
"programmable-contact": {
"type": "http",
"url": "https://programmable.contact/api/mcp",
"headers": { "Authorization": "Bearer pct_…" }
}
}
}contact_whoamicontact_list_topicscontact_find_contactscontact_get_contactcontact_list_tagscontact_list_fieldscontact_list_segmentscontact_get_segmentcontact_check_suppressioncontact_list_campaignscontact_get_campaigncontact_campaign_audiencecontact_preview_campaigncontact_funnelcontact_reportcontact_list_formscontact_list_prospectscontact_get_prospectcontact_draft_campaign(full)contact_update_campaign_draft(full)contact_list_sequencescontact_get_sequencecontact_list_repliescontact_draft_sequence(full)contact_update_sequence_draft(full)contact_calendarcontact_add_planned_item(full)contact_update_planned_item(full)contact_add_prospect(full)contact_update_prospect(full)
Webhooks
Add an address on the dashboard's Webhooks page or with POST /api/v1/webhooks. Each delivery is { id, type, created_at, data }, signed in X-Programmable-Signature as t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">, keyed by the whole whsec_… secret. Refuse a t more than five minutes off, and act on each id once. No event carries an email address or a name.
contact.createdA new person is on record: an app reported an account, someone answered a prompt or signed up on a form, or someone in the workspace added them by hand.lead.createdSomeone signed up on a form and was sent a link to confirm. Nothing is subscribed until they do (lead.confirmed).contact.subscribedA person said yes to a topic: in an app's consent prompt, by confirming a sign-up, or in their email preferences.contact.unsubscribedA person stopped a topic, or all optional email (topic is then null).lead.confirmedSomeone who signed up on a form confirmed their address, and is now a contact subscribed to what they asked for.import.stagedAn API key staged a list of subscribers. Nobody is added until an owner or admin approves it in the dashboard; a list nobody decides on is deleted after 30 days.contact.erasedA person's record was erased at their request or an operator's. Delete anything you keep under this contact id; it will never be used again.message.bouncedA message could not be delivered and the address is now stopped (a permanent bounce).message.complainedA recipient marked a message as spam. The address is stopped and is never started again.campaign.finishedEvery recipient of a campaign has been tried. Counts are by outcome at that moment; bounces and complaints can still arrive.reply.receivedA person replied to a campaign, sequence or lifecycle email (only for a workspace with replies on). The words are read with GET /api/v1/replies; this event carries ids and flags only. A reply that seems to ask to stop is flagged, never acted on: nothing about their consent changed.pingA test, sent when someone presses Send a test. Nothing happened.