API and MCP
API keys, the REST API, and connecting AI agents (Claude, ChatGPT, Cursor) over MCP.
Everything you do in Zeebra can also be done from code with the REST API, or by an AI agent over MCP (the Model Context Protocol). Both run the same operations, with the same checks and limits as the app. The API reference lists every operation.
API keys
Workspace owners and admins create keys in Settings → API. A workspace can have up to 20. A key is shown once, when you create it: store it somewhere safe. There are two kinds:
- Full access: everything in the API reference. Keep it on your server.
- Signups only: can only add signups (
add_signup), so it is safe in website or app code.
Revoke a key you no longer use; anything using it stops working at once. The API page shows when each key was last used.
The REST API
Send the key as a bearer token:
curl https://zeebra.ai/api/v1/overview \
-H "Authorization: Bearer YOUR_KEY"
- Requests and answers are JSON. Results are in
data; lists that come in pages also havemeta(page,per_page,total,last_page). Ask for a page with?page=2&per_page=50. - Contacts can be filtered and sorted on any property, custom ones too (as
field:<key>):/api/v1/contacts?filter[status]=active&filter[tag]=VIP&filter[field:plan]=is:Pro&sort=-created_at. A filter's value isoperator:value(contains:acme,gte:10,between:1,5,in_period:last_30_days,is_set:) or just a value.filter[q]searches like the contacts page: every word in a name, email or searchable property, and*stands for any characters and then matches a whole value (filter[q]=*@acme.comis everyone at acme.com,jane*@acme.comJane's addresses there);%and_match themselves. For AND/OR, send a rule tree inwhere, like a segment's.get_segment_fieldslists the fields and operators;export_contactstakes the same filters. - Errors answer
{"error": {"code": "…", "message": "…"}}with a matching status:unauthorized(401),subscription_required(402, the workspace needs a plan: sending, test emails, imports, exports, domains, new keys, webhooks and signups wait for one),forbidden(403),not_found(404),conflict(409, the campaign's state doesn't allow it),validation_failed(422, withfields),rate_limited(429, withRetry-After),upstream_error(502, Amazon SES or DNS). - Templates and campaigns take
themeandtheme_align(centerorleft;leftreads like a personal email). Changing thethemewithout sendingtheme_alignputs the email back in the center. - Each key can make up to 300 requests a minute.
- The OpenAPI document describes every operation for code generators and API tools.
Sending safely
Sending can't be undone, so sending takes two steps:
review_campaignreturns the checks andaudience.recipients, the number of people it will go to.checkslists every check with itsid,level(blockorwarning), whether itpassed, and what to fix.send_campaign(orschedule_campaign) takes that number asconfirm_recipients. If the audience changed in between, it is refused and you review again.
A campaign's publish_to says where it goes: email (the default), both (email, and your public pages once it goes out) or web (the public pages only). A web-only campaign sends no email, so its review has only the content checks and you send it with confirm_recipients set to 0.
get_campaign and list_campaigns include web: the public page's url, its own title, description and image (null follows the email), edited_at when an edit went live after it went out, and pending for an edit waiting for our content check (in_review) or refused by it (rejected, with a note). update_campaign_web_page changes the page apart from the email: before it goes out title, description and image; after, also content (a Tiptap editor document, not for a campaign written as HTML), going live only once the content check has read it, so check web.pending. It is limited to 30 changes an hour per workspace. get_campaign_report includes page_views: total, today, last_7_days, best_day and the last 30 days.
Sections
In a campaign or template with format editor, a top-level block of type section holds blocks only some readers get:
{
"type": "section",
"attrs": {
"audience": "only",
"groupType": "tag",
"groupId": 3,
"where": "email"
},
"content": [
{
"type": "paragraph",
"content": [
{ "type": "text", "text": "Thanks for being a member." }
]
}
]
}
audience:everyone,only(readers with the tag or in the segment) orexcept(everyone but them).groupTypeandgroupId:tagorsegment, and its id in this workspace (list_tags,list_segments). Needed unlessaudienceiseveryone.where:both,email(emails only) orweb(public pages only).
create_campaign, update_campaign, create_template and update_template answer 422 for a nested section, one inside another block, unknown values, or a tag or segment that isn't in this workspace. A tag or segment deleted later makes review_campaign block with check sections, and that section reaches nobody. Public pages never show a section limited to a tag or segment. send_test_campaign shows every section, marked with who sees it, unless you pass a contact to read it as; preview_template does too, unless you pass a contact_id. Markdown and HTML formats have no sections. See Campaigns.
count_section_readers says how many of a campaign's readers each tag and segment picks: everyone, and tags and segments as [{"id": 3, "name": "VIP", "readers": 12}]. Pass group_type and group_id to count just one. readers is null for a segment whose rules no longer work. has_audience is false for a campaign with no lists or segments yet, or one only on the public pages. Counts can run a few above review_campaign, which also takes out the global do-not-email list, and are kept for a minute; a changed audience counts again at once.
Campaign results
get_campaign_report has a campaign's counts, rates, links, inbox providers and opens hour by hour, and recipient_counts: how many recipients each filter of list_campaign_recipients picks. list_campaign_recipients lists who it went to, a page at a time, with what each did: status (sent, delivered, opened, clicked, failed, bounced or complained), when, the links they clicked and whether they unsubscribed through it. filter is all, opened, clicked, unopened, undelivered, bounced or unsubscribed; contact is null when the contact was deleted.
Notifications
list_notifications returns the notifications under the bell in the app, most recent first, a page at a time: paused and finished campaigns, content reviews, imports (as they start and how they went), domain problems. With unread=true you get only unread ones, and meta.total counts them. Fetching marks nothing as read. mark_notifications_read takes those in ids off the unread count, or all of them when ids is left out, and answers marked and unread.
clear_notifications removes notifications from a person's bell: those in ids, or everything at or before until (the created_at of the newest one to clear). Anything newer stays, and a cleared one comes back only if the same thing happens again. It answers cleared and unread.
The bell is a person's. An app connected with OAuth reads, marks and clears its member's bell. An API key belongs to no one, so it uses the workspace's first owner's notifications about this workspace to read and mark, and marking them read clears them from that owner's bell too. It can't remove them: an API key can't clear a person's bell, so clear_notifications answers 403 forbidden for one. Connect an app with OAuth to clear your own.
Test emails
send_test_email tests a campaign (campaign_id), a template (template_id) or a signup form's confirmation or welcome email (signup_form_id, signup_email), with the same rules as the app's Send a test form. send_test_campaign and send_test_template do the same for one kind.
tois a list of up to 5 addresses, each its own email. Members of the workspace can always get one; other addresses must be real inboxes, not unsubscribed, bounced or complained here or on the global never-email list. One outside address gets at most 10 tests a day across Zeebra, a workspace tests at most 20 outside addresses a day, and at most 30 test emails go out an hour per key or person.contactis an active contact's id: the test reads as them, and they don't get it. A contact from another workspace answers422.save_as_defaultsaves these addresses as what the connected person's tests start with in the app. An API key belongs to no one, so it answers422for this field.
Signup and last-chance emails
update_signup_form_emails writes a signup form's confirmation and welcome emails, and update_last_chance_email the workspace's own last-chance email for list cleanup. get_signup_form and get_last_chance_email read them. Only the fields you send change.
- Editor document or Markdown: send a Tiptap document (
confirmation_document,welcome_document,document) or Markdown (confirmation_markdown,welcome_markdown,markdown). Without a format, what you send picks it. Markdown keeps working as it always did. - Each reader's own link: a confirmation email must hold
{{confirm_url}}and a last-chance email{{keep_url}}, or it's refused withvalidation_failed. In a document, that's a button whosehrefis exactly the tag:{"type": "button", "attrs": {"href": "{{confirm_url}}", "label": "Yes, subscribe me"}}. In Markdown:[Yes, subscribe me]({{confirm_url}} "button"). - The built-in emails:
confirmation_use_built_in,welcome_use_built_inanduse_built_inreturn to Zeebra's own email.built_inin the answer says which you have. - The content check: your own version is checked when saved.
email_revieworreviewsays if it's held, and meanwhile the built-in confirmation or last-chance email goes out, and no welcome email.
AI agents over MCP
The MCP server is at https://zeebra.ai/mcp. Every API operation is a tool there; the ones that send or delete are marked as destructive, so agents ask you before using them. The MCP server page explains what agents can do and lists every tool.
With an app that supports OAuth (Claude, ChatGPT): add Zeebra as a connector with the MCP address. You sign in to Zeebra, choose which workspace the app may use (one you own or manage), and approve. Connected apps are listed in Settings → API, where you can disconnect them.
With an API key (Claude Code, Cursor, Codex and other tools): give the MCP address and an Authorization: Bearer YOUR_KEY header. For example, in Claude Code:
claude mcp add --transport http zeebra https://zeebra.ai/mcp \
--header "Authorization: Bearer YOUR_KEY"
Webhooks and the command line
Webhooks send your server a signed request when contacts change and emails are delivered, opened, clicked, bounce or are marked as spam. The zeebra CLI runs every operation from a terminal or an AI agent's shell.
For AI tools reading the docs
llms.txt lists these docs for language models, and llms-full.txt has all of them, including the full API reference, in one file.