Docs · for developers
API and MCP overview
Most of what you can do in Emrg is available over a REST API and an MCP server, as the same actions, with the same permissions and audit log.
Reference
Every operation, with its fields, is in the API reference, and code to copy (curl, JavaScript, Python, checking webhooks) is in the API examples. The same, as an OpenAPI 3.1 document for your API client or code generator, is at https://app.emrg.ai/v1/openapi.json.
API keys
Scripts and other apps sign in with an API key. Create one in Emrg under Settings › API keys: give it a name, choose whether it only reads or also makes changes, and whether it expires. Emrg shows the key once; copy it into your app's secret settings. Keys start with emrg_sk_.
- A key works in the one workspace it was created in, as the person who created it, and never does more than their role allows.
- It stops working when it's revoked or expires, when its person leaves the workspace, and when they sign out everywhere, reset their password, or change it and sign out their other devices.
- Changes made with a key are logged under its person, marked as made with an API key. What needs a person, such as deciding approvals, imports, answering website chats or managing the team, can't be done with a key.
- Workspace owners and admins see and can revoke everyone's keys.
REST basics
- Base address:
https://app.emrg.ai/v1 - Who you are: send
Authorization: Bearer <API key>. Calls act with that person's permissions, limited by the key's access. - Which workspace: the key's own. If you send
x-emrg-workspace, it must name that workspace. - Writes: send JSON with
Content-Type: application/json. - Safe retries: send an
Idempotency-Keyheader on writes. Retrying with the same key does the work once. - IDs are readable and prefixed by type, for example
con_01J…for a contact.
curl -X POST https://app.emrg.ai/v1/contacts \
-H "Authorization: Bearer $EMRG_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7f3c9a2e-new-lead" \
-d '{"firstName": "Sam", "email": "sam@example.com"}'Pages
Lists take limit (25 unless you say, at most 100) and answer {"data": {"items": […], "nextCursor": …}}. To read the next page, send the same call with cursor set to nextCursor; when it is null, there are no more. These lists page the same way with other sizes:
GET /booking-pages: 200 unless you say, at most 200GET /bookings: 500 unless you say, at most 500GET /calendar/events: 250 unless you say, at most 500GET /chat-widgets: 100 unless you say, at most 100GET /sequences/{sequenceId}/enrolments: 50 unless you say, at most 200
These answer one page only, with no cursor: ask for a narrower range or filter instead.
GET /accounts/{accountId}/approvals: 50 unless you say, at most 100GET /duplicates: 20 unless you say, at most 50GET /search: 8 unless you say, at most 20GET /sequences/{sequenceId}/joiners: 50 unless you say, at most 200GET /suppressions: 50 unless you say, at most 200
Responses and errors
Successful calls return {"data": …}. Errors return a code, a message and a fix that says how to make the call succeed:
{
"error": {
"code": "not_found",
"message": "No contact with id con_01J...",
"fix": "Check the id, or list contacts first."
}
}| Code | Status | What it means |
|---|---|---|
invalid_input | 400 | The input is wrong or names a field this call doesn't take. The fix says which. |
unauthenticated | 401 | No API key or session, or one that was revoked or has expired. |
insufficient_credits | 402 | The workspace is out of credits for work that uses them. |
spend_limit_reached | 402 | An agency's spending limit for this client is reached. |
forbidden | 403 | Your role, or the key's access, doesn't allow this. |
workspace_closing | 403 | The workspace is being closed and takes no more changes. |
account_closing | 403 | The person behind the call is closing their Emrg account. |
not_found | 404 | No such record in this workspace, or no such path in the API. |
unknown_action | 404 | No operation by that name. |
conflict | 409 | The change clashes with the current state, for example a record changed meanwhile. |
idempotency_conflict | 409 | The Idempotency-Key was used for a different request. |
approval_invalid | 409 | The approval named doesn't fit this call, or isn't approved. |
record_limit | 409 | The workspace is at its plan's record limit. |
paused | 423 | What this would run is paused, for example a worker or sending. |
rate_limited | 429 | Too many calls this minute. Wait for Retry-After, then try again. |
internal | 500 | Something went wrong on our side. Retrying with the same Idempotency-Key is safe. |
storage_full | 507 | The workspace's file storage is full. |
A path the API doesn't have answers 404 not_found in the same shape. A body over 1 MB answers 413 invalid_input.
Every call refuses parameters it doesn't take, in the body or the query string: you get 400 invalid_input naming each one, and where another call takes it, which.
If a call needs someone's approval first, for example because a worker asked for it, you get 202 with {"approval": {"id": …}}. The action runs once it is approved.
Webhooks
Webhooks tell your app the moment something happens in Emrg. Owners and admins add them under Settings › Webhooks: an https address, and which events to send. They're free on every plan, up to 10 per workspace.
Each event is a POST of JSON with the ids of what changed, never anyone's details: read the rest through the API with your own access.
POST https://your-app.example/hooks/emrg
webhook-id: whd_01JQ...
webhook-timestamp: 1763380800
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=
{
"type": "deal.updated",
"timestamp": "2026-11-17T12:00:00.000Z",
"data": { "object": "deal", "id": "deal_01JQ...", "activityId": "act_01JQ...", "fields": ["stageId"] }
}- Events: contacts, companies, deals and your own record types added, changed or deleted (a change lists the fields that changed; a deal's stage is
stageId), notes added, forms submitted, and bookings made, moved or cancelled. Alsotask.createdandtask.completedfor every task (data.aboutnames the record it's about, or isnull),deal.wonanddeal.lostwhen a deal enters a won or lost stage from an open one, andcontact.unsubscribedwith how they opted out (data.via:reply,linkorone_click).webhook.testis the test Settings sends. - Signed as Standard Webhooks describes:
webhook-id,webhook-timestampandwebhook-signature, an HMAC-SHA256 ofid.timestamp.bodywith thewhsec_secret Settings showed you. Any Standard Webhooks library verifies it. Refuse a timestamp more than five minutes off. - New secrets: making a new secret in Settings signs with both the new and the old one for a day, so you can change over without missing an event. If a secret leaks, remove the webhook and add it again: the new one has a new secret and the old one stops at once.
- Answer within 15 seconds with any
2xx. Anything else, or no answer, is tried again: after 30 seconds, 2 minutes, 10 minutes, half an hour, then hourly for three days, with the samewebhook-ideach time so you can ignore a repeat. - Turned off after three days of failures, or at once when you answer
410 Gone. Owners and admins get an email; events from while it's off aren't sent. Turn it back on in Settings. - Resending: in Settings › Webhooks, the log's Resend failed deliveries (or Resend on one) sends given-up deliveries again with their first
webhook-id, signed with the current secret and tried again for three days, up to 200 a webhook an hour. - Addresses must be public https. Emrg doesn't follow redirects.
- The delivery log in Settings shows the last 30 days: each event, its answer and how many tries.
MCP server
Emrg's MCP server is at https://app.emrg.ai/mcp (streamable HTTP). It offers most of the REST API's actions as tools, with read-only and destructive tools marked, and interactive views for approvals, the pipeline, records and worker receipts. Clients sign in with OAuth and act with the user's permissions.
Your AI can read your own connected email and calendar when you ask it to. It sees only your own mailbox and calendar, plus any inbox a teammate chose to share with the team. Every access is logged, and you can disconnect it at any time from Emrg's settings.
Not a developer? Connect Claude or ChatGPT in three steps.
Limits
The API and MCP server are free on every plan. Calls count per minute:
- Each workspace: 600 calls on the Free plan, 3,000 on a paid plan, across the API and MCP.
- Each API key: 300 calls, on top of its workspace's limit.
- A request body: at most 1 MB.
Past a limit you get 429 rate_limited with Retry-After saying how many seconds to wait. Every answer also carries RateLimit-Policy naming these limits, as the IETF's draft rate-limit headers describe it (draft 11; the header may change when it becomes a standard).
Request ids and retries
- Every answer carries
x-request-id: yours, if you sent one (letters, digits and._:-, up to 128), or one of ours. Quote it when you contact support. - A write that takes an
Idempotency-Key(the reference says which), sent again with the same key within 24 hours, returns the first answer, markedIdempotent-Replayed: true. The same key with a different body is refused with409idempotency_conflict. - These writes don't keep their answer, so a repeat runs again:
POST /api-keys,POST /billing/store-purchases/restore,POST /billing/store-purchases,POST /imports/{importId}/rows. Creating an API key is one: its answer holds the key, which Emrg never stores, so a retry makes a second key (revoke the one you don't use). - The agency routes under
/accountsrequire anIdempotency-Keybut don't keep their own answer: a repeat runs again, and each client it reaches with the same key answers as it did the first time. The answer is markedIdempotent-Replayed: trueonly when every client it wrote to did that; one that reached a client for the first time or failed there, or that changed only the agency account (a handoff, say), isn't. Send a new key for each new request, and before retrying a write whose answer you lost, check whether it happened.
Versioning
The API is version 1, at /v1. Within it, Emrg only adds: new operations, new optional fields in what you send, new fields in what you get back, and new error codes. Write your code to ignore fields it doesn't know.
Anything that would break working code (removing or renaming an operation or field, making an optional field required, changing what a field means) comes only in a new version at a new path, /v2, and /v1 keeps working beside it for at least 12 months.
When an operation is on its way out, every answer from it carries a Deprecation header (RFC 9745) and, once its last day is set, a Sunset header (RFC 8594) at least 6 months ahead. The reference marks it deprecated and names what replaces it, and the changelog below says so.
Changelog
- November 2026, version 1. API keys; the versioning promise above; published limits with
Retry-AfterandRateLimit-Policy;x-request-idandIdempotent-Replayedon every answer; a 1 MB body limit; every list pages the same way (GET /sendsnow takes at most 100 a page, 25 unless you say). - November 2026. Webhook events for tasks, deal outcomes and unsubscribes:
task.created,task.completed,deal.won,deal.lost,contact.unsubscribed. - November 2026. Resending a webhook's failed deliveries (
POST /webhooks/{id}/resend, or Settings). - November 2026. Webhooks, signed per Standard Webhooks, free on every plan.