Skip to content

API reference

Base URL https://mcpdial.com/api/v1. Authenticate with Authorization: Bearer cv_live_… — keys are per workspace, created in Settings → API keys and shown once. Requests and responses are JSON; most responses wrap the object or list in data — the samples below show the exceptions.

Machine-readable: the OpenAPI 3.1 spec at /api/v1/openapi. AI agents can use the same workspace over MCP.

Agents

An agent is one company voice in one role. Its configuration is an AgentSpec — create one from a role template and override what you need. New agents start as a draft: set status "live" before they answer or place calls.

GET/api/v1/agents

List agents in the workspace, newest first, each with its AgentSpec. Deleted (archived) agents are left out; add ?include_archived=true to list them too (archived_at is set on those). limit 1–200 (default 200); to page, pass next_before back as before.

responsejson
{ "data": [{ "id": "…", "name": "Front desk", "role": "receptionist", "status": "live", "version": 3, "spec": { … } }], "has_more": false, "next_before": null }

POST/api/v1/agents

Create an agent from a role template (receptionist | sales | appointment_setter | events | survey | support). `spec` is merged over the template.

request bodyjson
{
  "name": "Front desk",
  "role": "receptionist",
  "language": "de",
  "company": { "name": "Acme Dental", "description": "Family dental practice in Zurich" }
}
responsejson
// HTTP 201
{ "data": { "id": "…", "name": "Front desk", "role": "receptionist", "status": "draft", "version": 1, "spec": { … } } }

GET/api/v1/agents/{id}

Fetch one agent with its AgentSpec — archived ones too (archived_at is then set), so call history can always be resolved.

PATCH/api/v1/agents/{id}

Update name, status (draft | live | paused) and/or spec. Spec sections merge one level deep, lists replace and null clears an optional section (e.g. "transfer": null). An invalid spec is refused with 400 invalid_spec, every problem listed in error.detail. A spec change bumps the version.

request bodyjson
{ "status": "live" }
responsejson
{ "data": { "id": "…", "status": "live", "version": 1, … } }

POST/api/v1/agents/{id}/knowledge

Give the agent documents or web pages to answer from during calls. A document as multipart `file` (PDF, Word, Excel, OpenDocument, CSV, HTML, Markdown, text; up to 10 MB — only its text is kept), or a public page as JSON — with "linked": true also up to 9 pages it links to on the same site. The agent looks things up in them with its "answer from knowledge" tool (switched on with the first source). GET lists them; POST /api/v1/agents/{id}/knowledge/{source_id} re-reads a web page; DELETE removes one. 50 sources per agent.

request bodyjson
{ "url": "https://dr-meier.example/prices", "linked": true }
responsejson
// HTTP 201
{ "data": { "id": "…", "kind": "url", "title": "Prices — Dr. Meier", "url": "https://dr-meier.example/prices", "status": "ready", "chars": 8420, "pages": 4, … } }

POST/api/v1/agents/{id}/duplicate

Copy an agent as a new draft. Optional body `{ "name": "…" }` (default "Copy of <name>").

responsejson
// HTTP 201
{ "data": { "id": "…", "name": "Copy of Front desk", "status": "draft", … } }

DELETE/api/v1/agents/{id}

Delete an agent. It is archived, not destroyed: it stops taking and placing calls, its numbers are unassigned (inbound stops until you route them elsewhere), its draft and paused campaigns are marked done and its scheduled calls canceled. Calls, campaigns and bookings keep pointing at it. Refused with 409 agent_in_use while a campaign is running with it. Safe to retry.

responsejson
{ "archived": true, "data": { "id": "…", "archived_at": "…", "campaigns_closed": [], "numbers_unassigned": ["+41…"], "scheduled_calls_canceled": 0 } }

GET/api/v1/agents/{id}/checks

Setup check before you test or go live — the same list as the dashboard Test lab. Each check is pass | warn | fail | info with a plain-language fix. browser_ready: a browser test call can start now; phone_ready: live, a routed number, credits, calling on and nothing failing. Read-only and free (MCP: check_agent_setup).

responsejson
{ "data": { "agent_id": "…", "browser_ready": true, "phone_ready": false,
  "summary": "Ready for a browser test · 1 thing to fix before real calls.",
  "checks": [
    { "key": "voice", "status": "pass", "label": "Speaks German as Leni", "detail": "Azure Neural voice (de-CH).", "fix": { "label": "Hear it", "tab": "voice" } },
    { "key": "calendar", "status": "fail", "label": "Booking is on but no calendar is picked", "detail": "…", "fix": { "label": "Choose a calendar", "tab": "hours" } }
  ] } }

GET/api/v1/voices?language=de

Voices an agent can use in your workspace region for one language, native speakers first. Set BOTH spec.voice.engine and spec.voice.voice_id from one entry (a voice only works with its own engine), or leave engine "auto" for the language default. Free. Listening to samples is in the dashboard (agent → Voice).

responsejson
{ "region": "EU", "language": "de", "default_model": "vox-fast-tts",
  "data": [ { "id": "de-CH-LeniNeural", "name": "Leni", "engine": "azure", "locale": "de-CH", "native": true }, … ] }

POST/api/v1/agents/{id}/restore

Restore a deleted (archived) agent. It comes back paused and without numbers — route a number to it and set it live again. Safe to retry.

responsejson
{ "data": { "id": "…", "status": "paused", "archived_at": null, … } }

Calls

Outbound calls pass the compliance gate first. Outside the callee’s calling hours the call is scheduled, not dialled — the response says when. The agent must be live (409 agent_not_live otherwise), and calling must not be paused for the workspace (409 calling_paused — an owner or admin can pause and resume all calling in Settings). 503 phi_tenant_key_missing means calling isn’t fully set up for the workspace yet (contact support); the same applies to starting a campaign. A minute costs your plan’s rate, plus a destination surcharge on routes whose carrier cost is high (e.g. Swiss mobiles, German mobiles called from a non-EU number) — GET /api/v1/rates quotes it before you dial. Premium-rate, special-service and very high-cost numbers are refused with 409 destination_not_allowed before anything is charged.

POST/api/v1/calls

Place (or schedule) an outbound call. Dials a real number and uses credits. Only agent_id and to are required. contact.kind is used only when the number is a new contact — change an existing contact’s kind with PATCH /api/v1/contacts/{id}. Send an Idempotency-Key header (e.g. a UUID per intended call): a retry with the same key within 24 hours returns the original call (HTTP 200, "replayed": true) instead of dialing again; the same key with other arguments is 409 idempotency_conflict. A number already on an outbound call is refused with 409 call_in_progress; a premium-rate or special-service number with 409 destination_not_allowed (nothing charged). The dialing response carries rate_credits_per_minute — the plan’s rate plus any destination surcharge. A brief (objective, talking_points, avoid, variables for {{placeholders}}) focuses the call; the agent also reads what is known about the contact — background, facts and its recent timeline (emails, earlier calls, bookings). contact.external_ref is your lead id, set on the contact and sent back in webhooks. Optional max_seconds (whole seconds, at least 60) caps this call’s length — it runs at most min(the agent’s max_call_seconds, max_seconds, what the balance affords), also on a partner workspace whose funder is unlimited; the dialing response returns the cap applied (400 invalid_max_seconds otherwise). Optional region (CH, EU, US, UK or WORLD) runs this call’s speech recognition, model and voice in that region instead of the workspace’s (400 invalid_region otherwise).

request bodyjson
{
  "agent_id": "…",
  "to": "+41441234567",
  "contact": { "name": "Anna Keller", "kind": "b2c", "external_ref": "lead_8812" },
  "goal": "Confirm Tuesday's appointment",
  "brief": { "objective": "Confirm Tuesday 10:00", "talking_points": ["Parking behind the building"], "avoid": ["Prices"] },
  "language": "de",
  "consent": { "basis": "existing_customer" },
  "external_ref": "crm-8812",
  "callback_url": "https://example.com/hooks/calls",
  "max_seconds": 300,
  "region": "CH"
}
responsejson
// HTTP 201 — dialling
{ "call_id": "…", "status": "dialing", "rate_credits_per_minute": 190, "max_seconds": 300 }
// HTTP 202 — outside the callee's local hours
{ "call_id": "…", "status": "scheduled", "scheduled_for": "2026-10-01T07:00:00Z" }
// HTTP 422 — refused by the compliance gate
{ "call_id": "…", "status": "canceled", "reason": "consent_required" }

GET/api/v1/rates?to=+41791234567

What a call to this number costs per connected minute right now: your plan’s rate plus any destination surcharge, from the caller ID POST /api/v1/calls would use (the workspace’s number with the cheapest route there). A destination POST /api/v1/calls refuses answers allowed: false with the reason. rate_credits_per_minute is exactly the rate POST /api/v1/calls would store on the call; rate_usd_per_minute is it at your usd_per_credit (0.001 unless a partner prices your workspace). cheapest_rate_credits_per_minute appears when a caller ID you don’t have yet (e.g. a number in the EU) would be cheaper. Add channel=sms to quote a text instead: credits_per_segment / usd_per_segment for one 160-character segment to that number (priced by the recipient’s country — what the agent’s send_sms and automatic confirmations / reminders charge), or allowed: false with code sms_destination_not_allowed; add text=… to price a whole message (segments, credits, usd). Read-only.

responsejson
{
  "data": {
    "to": "+41791234567", "country": "CH", "allowed": true,
    "route": "Switzerland - Mobile - Swisscom", "from": "+41445550100",
    "rate_credits_per_minute": 590, "plan_rate_credits_per_minute": 190,
    "surcharge_credits_per_minute": 400, "rate_usd_per_minute": 0.59, "usd_per_credit": 0.001
  }
}

GET/api/v1/calls

List calls, newest first, without transcripts. Filters: agent_id, contact_id, campaign_id, status, direction, outcome, external_ref, disposition and min_interest (0–3, from the structured result), since, before; limit 1–200 (default 50). To page, pass next_before back as before.

responsejson
{ "data": [{ "id": "…", "direction": "outbound", "status": "completed", "outcome": "booked", … }], "has_more": true, "next_before": "2026-09-28T09:14:02.481233Z_…" }

GET/api/v1/calls/{id}

A call with its transcript, summary, outcome, actions, latency, cost (cost_credits, and `cost`: credits, usd, rate_credits_per_minute, usd_per_credit — the same object as the call webhooks, settled once the call ended), recording metadata (has_recording, duration — never a file URL or storage key), the brief it was placed with and its structured result: disposition, interest 0–3, next_step, callback_at, objections, opt_out and your agent’s custom result_fields (null until the call ends).

responsejson
{
  "data": {
    "id": "…", "direction": "outbound", "status": "completed", "outcome": "booked",
    "duration_seconds": 143, "cost_credits": 450, "rate_credits_per_minute": 150,
    "cost": { "credits": 450, "usd": 0.45, "rate_credits_per_minute": 150, "usd_per_credit": 0.001 },
    "transcript": [{ "direction": "out", "text": "Just so you know, I'm Alex, an AI assistant…" }],
    "actions": [{ "type": "book_appointment", "starts_at": "2026-10-06T12:30:00Z" }],
    "latency": { "turns": 11, "p50_ms": 760, "p95_ms": 1180 },
    "has_recording": true,
    "recording": { "status": "ready", "consent_mode": "announce", "duration_seconds": 141, "size_bytes": 562104, "format": "ogg" },
    "recording_url": "/api/v1/calls/…/recording"
  }
}

GET/api/v1/calls/{id}/recording

Play or download the recording: a 302 redirect to a private link valid for 5 minutes (follow redirects; Range requests work). Add ?download=1 for an attachment. 404 recording_not_found (none, or deleted because the caller objected), 409 recording_not_ready (processing or failed), 503 recording_not_configured. Every access is audited. Recording is off by default — turn it on per agent (guardrails.recording). Not available over MCP (get_call only says has_recording).

responsejson
HTTP 302  Location: https://db-ch.cloudsitus.com/…?X-Amz-Expires=300&X-Amz-Signature=…

DELETE/api/v1/calls/{id}/recording

Delete the recording for good (the transcript and call record stay). Owner/admin or API key; audited. Recordings are also deleted automatically after the workspace’s retention (Settings → Recordings: 30, 90 — default — or 365 days, or kept), when the contact is erased and when the workspace is closed.

responsejson
{ "ok": true, "deleted": true, "storage": "deleted" }

Numbers

Buy a local number and route it to an agent. Buying charges the first month’s rent; some countries (CH, most of the EU, the UK) need the workspace’s business details first — entered once in Settings → Telephony or through the Verification endpoints below; missing ones are refused with 409 needs_documents (error.detail.missing lists them) before anything is charged, and a number whose details are under the carrier’s review is returned with status pending and "awaitingApproval": true (it goes live — webhook number.activated — or is cancelled and refunded — number.rejected — once the carrier decides). Searching is free. Rent is then charged monthly from credit: if it can’t be paid the number is suspended (status suspended, release_scheduled_at set) and released automatically at release_scheduled_at — 30 days later — unless credit is added first. Imported numbers never are.

GET/api/v1/numbers

List the workspace’s numbers, newest first (released ones excluded), and the agent each routes to. limit 1–200 (default 200); to page, pass next_before back as before.

responsejson
{ "data": [{ "id": "…", "e164": "+41…", "agent_id": "…", "status": "active", … }], "has_more": false, "next_before": null }

GET/api/v1/numbers/available?country=CH&type=local

Numbers you can buy right now, with monthly rent in credits — rent depends on the country and type (at least 3,000 credits for a local number and 6,000 for mobile or toll-free, more where the carrier charges more, e.g. 18,000 for a Swiss mobile and 60,000 for a German one). country is required (CH, DE, FR, AT, IT, NL, BE, ES, GB, US, CA — others get 400 invalid_country); type: local | mobile | toll_free; contains: 2–16 digits, letters or * (use it for an area code). Any other parameter is refused with 400 invalid_filter.

responsejson
{ "data": [{ "e164": "+41…", "locality": "Zürich", "region": null, "type": "local", "monthly_cost_credits": … }] }

GET/api/v1/numbers/{id}

One number (404 number_not_found if it is unknown or released).

responsejson
{ "data": { "id": "…", "e164": "+41…", "country": "CH", "number_type": "local", "agent_id": "…", "status": "active", "monthly_cost_credits": …, "paid_through": "…", "release_scheduled_at": null } }

POST/api/v1/numbers

Buy a number (a specific e164 from /available, or the first match) and optionally route it. Charges the first month’s rent. Send an Idempotency-Key header (e.g. a UUID per intended purchase): a retry with the same key within 24 hours returns the original number (HTTP 200, "replayed": true, its current status) instead of buying again; the same key with other arguments is 409 idempotency_conflict. A failed purchase keeps nothing, so retrying it with the same key tries again. In a regulated country the number comes back pending with "awaitingApproval": true while the carrier reviews the business details. 409 needs_documents (nothing charged; error.detail.missing says what to add), 409 calling_paused, 402 insufficient_credits, 422 number_unavailable (taken meanwhile — pick another).

request bodyjson
{ "country": "CH", "e164": "+41…", "type": "mobile", "agent_id": "…" }
responsejson
// HTTP 201
{ "ok": true, "id": "…", "e164": "+41…", "status": "pending", "awaitingApproval": true }

PATCH/api/v1/numbers/{id}

Route a number to another agent (null unassigns) and/or give it a label of up to 60 characters (null clears it). Send either field or both.

request bodyjson
{ "agent_id": "…", "label": "Front desk" }
responsejson
{ "ok": true, "data": { "id": "…", "e164": "+41…", "label": "Front desk", "agent_id": "…", … } }

DELETE/api/v1/numbers/{id}

Release a number: it stops ringing, goes back to the carrier and stops billing. Irreversible. A number imported from your own carrier (provider twilio_byo / telnyx_byo) is only removed from MCPDial: its routing is put back on your account and it stays yours.

Number verification

Carriers in CH, DE, FR, AT, IT, NL, BE, ES, the UK and more verify the business behind a number before it works: legal name and registration details, a business address (for most, IN that country) and documents such as a commercial register excerpt. Enter them once per workspace — here, or in Settings → Telephony — and they are reused for every number. There is no separate submit step: the first POST /api/v1/numbers for a regulated country and type files the details with the carrier and returns the number pending; it goes live (webhook number.activated) or is cancelled with its first month refunded (number.rejected, with the reason) once the carrier decides — usually 1–3 business days. Numbers are registered to a business by default; where the carrier allows it (end_user_types — e.g. Swiss local and mobile, France, Italy, the Netherlands, Belgium, Spain, Austria, the UK; Germany only toll-free) an individual can register instead with a personal ID: PUT the profile with end_user_type "individual" (full name and the personal details listed), the address and a passport or ID card. A workspace has one profile at a time; every order is filed under its type. An individual’s details and ID scans are personal data, kept and erased exactly like a business’s. Owner/admin sessions or any API key; every write is validated and audited. Documents are stored privately and never returned. Not available over MCP beyond the read-only get_number_requirements and get_verification_status — identity documents never pass through an AI tool.

GET/api/v1/numbers/requirements?country=CH&type=mobile&end_user_type=business

What the carrier needs for this country and type (type defaults to local) and end-user type (business by default, or individual): the profile fields (with format, max length and whether required), the address rule (address.must_be_in_country), the document requirements with the accepted kinds and the fewest uploads that cover them (suggested_uploads), the typical review time — and where this workspace stands (ready, missing, status, next_purchase). end_user_types lists who the carrier registers these numbers to; asking for one it doesn’t allow answers with no fields and missing [{ "kind": "end_user_type", "allowed": ["business"] }]. Free and read-only.

responsejson
{ "data": { "country": "CH", "type": "mobile", "end_user_type": "business", "needed": true, "summary": "Swiss mobile numbers need …", "end_user_types": ["business", "individual"],
  "review": { "required": true, "typical_time": "1–3 business days" },
  "fields": [{ "key": "business_name", "label": "Legal business name", "required": true, … }, { "key": "registration_number", … }],
  "address": { "required": true, "rule": "local", "must_be_in_country": true, "country": "CH", "postal_code": { "label": "Postal code", "example": "8001", … } },
  "documents": [{ "requirement": "business_name_info", "label": "Business Name", "upload": true, "accepted": [{ "kind": "commercial_registrar_excerpt", "label": "Excerpt from the commercial register" }], "must_show_address": false }, …],
  "suggested_uploads": [{ "kind": "commercial_registrar_excerpt", … }],
  "workspace": { "ready": false, "missing": [{ "kind": "address", "country": "CH", "label": "Business address in Switzerland" }, …], "status": "draft", "next_purchase": "missing" } } }

GET/api/v1/regulatory/profile

The verification profile on file — a business (business_name) or an individual (full_name) — null until saved.

responsejson
{ "data": { "end_user_type": "business", "business_name": "Keller AG", "details": { "registration_number": "CHE-123.456.789", "contact_email": "anna@keller.example" } } }

PUT/api/v1/regulatory/profile

Save the profile. end_user_type "business" (default): business_name + details registration_number, vat_number, tax_id, website, contact_first_name, contact_last_name, contact_email, contact_phone, rep_birth_date, rep_birth_place, rep_nationality, id_document_number, id_issuing_authority, id_issue_date. end_user_type "individual": full_name (as on the ID) + details birth_date, birth_place, nationality, profession, email, phone (international format), tax_id, academic_degree, id_document_number, id_issuing_authority, id_issue_date, and optionally first_name + last_name when the name doesn’t split as first word / the rest. Dates YYYY-MM-DD; x_<name> for a carrier-specific field. The name replaces; details merge — keys you send replace, "" or null removes one, keys you leave out are kept. Switching end_user_type replaces the details (409 filing_in_review while a carrier reviews a filing). Unknown keys: 400 invalid_profile (error.detail.field); a bad value: 422 invalid_profile.

request bodyjson
{ "business_name": "Keller AG", "details": { "registration_number": "CHE-123.456.789", "website": "keller.example" } }
// or, an individual:
{ "end_user_type": "individual", "full_name": "Anna Keller", "details": { "birth_date": "1988-04-12", "nationality": "Swiss", "profession": "Architect" } }
responsejson
{ "data": { "end_user_type": "business", "business_name": "Keller AG", "details": { … } } }

GET/api/v1/regulatory/addresses

The addresses on file (the business’s, or the individual’s home address), one per country.

responsejson
{ "data": [{ "id": "…", "country": "CH", "street": "Bahnhofstrasse 1", "street2": null, "city": "Zürich", "postal_code": "8001", "region": null }] }

POST/api/v1/regulatory/addresses

Save the address for a country — 201, or 200 with "replaced": true when it replaces that country’s address. Validated per country (postal code format, building number; region required for US/CA): 422 invalid_address with error.detail.field.

request bodyjson
{ "country": "CH", "street": "Bahnhofstrasse 1", "city": "Zürich", "postal_code": "8001" }
responsejson
// HTTP 201
{ "data": { "id": "…", "country": "CH", … }, "replaced": false }

DELETE/api/v1/regulatory/addresses/{id}

Delete an address (404 address_not_found).

responsejson
{ "deleted": true }

GET/api/v1/regulatory/documents

The uploaded documents — metadata only; files are never returned.

responsejson
{ "data": [{ "id": "…", "kind": "commercial_registrar_excerpt", "kind_label": "Excerpt from the commercial register", "file_name": "hr-auszug.pdf", "content_type": "application/pdf", "size_bytes": 182311, "created_at": "…" }], "uploads_available": true }

POST/api/v1/regulatory/documents

Upload a supporting document as multipart/form-data: kind (one of the accepted kinds the requirements list — e.g. commercial_registrar_excerpt, or for an individual passport, government_issued_document, personal_id_card, national_id_card, residence_permit, utility_bill; the carrier’s document type, filed under the same name) and file (PDF, JPG or PNG, up to 5 MB — the real type is read from the bytes). Stored privately; at most 30 documents per workspace and 20 uploads an hour. 422 invalid_kind / invalid_file_type / empty_file, 413 file_too_large, 409 too_many_documents, 429 upload_rate_limited.

request bodyjson
curl -X POST …/api/v1/regulatory/documents -H "Authorization: Bearer cv_live_…" -F kind=commercial_registrar_excerpt -F file=@hr-auszug.pdf
responsejson
// HTTP 201
{ "data": { "id": "…", "kind": "commercial_registrar_excerpt", "file_name": "hr-auszug.pdf", "content_type": "application/pdf", "size_bytes": 182311, "created_at": "…" } }

DELETE/api/v1/regulatory/documents/{id}

Delete a document; the stored file is deleted too (404 document_not_found).

responsejson
{ "deleted": true }

GET/api/v1/regulatory/status?country=CH

The carrier’s review per country and type, with the end_user_type it is for: not_required, draft (nothing filed yet — missing lists what to add), in_review, approved or rejected (rejection_reason), with the numbers held for it. Without country: every filing of the workspace; with country (and optionally type) every type is listed even before anything was filed.

responsejson
{ "data": [{ "country": "CH", "type": "mobile", "end_user_type": "business", "provider": "twilio", "status": "in_review", "review_required": true, "ready": true, "missing": [], "rejection_reason": null, "submitted_at": "…", "decided_at": null, "numbers": [{ "id": "…", "e164": "+4179…", "status": "pending" }] }] }

Bring your own Twilio/Telnyx

Use numbers you already own at Twilio or Telnyx (guide: /docs/carrier). Imported numbers pay no monthly fee to us and are never released at your carrier. Reads and importing work with an API key; connecting, updating credentials (key rotation on the same account), applying routing and disconnecting handle your carrier credentials or change your carrier account, so they are dashboard-only for owners and admins (an API key gets 403 session_required). Every route answers 503 needs_update until the feature is enabled for the workspace.

GET/api/v1/telephony/carrier

Connection status: provider, masked account and key hints, routing mode (automatic | manual) and state (none | pending | ready | error), imported numbers. Never returns a secret and never calls the carrier.

responsejson
{ "connected": true, "provider": "twilio", "account_hint": "AC…1a2b", "key_hint": "SK…9f0e", "routing_mode": "automatic", "routing_state": "ready", "numbers": [{ "id": "…", "e164": "+1…", "status": "active", "routed": true }], "setup": { "origination_uri": "sip:…;transport=tcp", … } }

GET/api/v1/telephony/carrier/numbers

The numbers on your connected account (a read-only call to your carrier), each with state: available | imported | in_use (another workspace) | no_voice.

responsejson
{ "data": [{ "ref": "PN…", "e164": "+1…", "label": "Front desk", "type": "local", "state": "available", "current_routing": "Webhook POST https://…" }] }

POST/api/v1/telephony/carrier/numbers

Import numbers by ref (1–50). Your account is re-listed server-side, so only numbers you own are imported. Free. Each stays pending until routing is set up and verified.

request bodyjson
{ "refs": ["PN…", "PN…"] }
responsejson
{ "imported": [{ "id": "…", "e164": "+1…" }], "skipped": [{ "ref": "PN…", "reason": "in_use" }] }

GET/api/v1/telephony/carrier/routing

Preview Automatic routing: every object that would be created on your account and every number change (before → after), with a confirm_token. Read-only. Applying it is done in the dashboard.

responsejson
{ "steps": [{ "action": "create", "what": "An Elastic SIP Trunk named "MCPDial" …" }], "numbers": [{ "e164": "+1…", "before": "Webhook POST https://…", "after": "MCPDial SIP trunk" }], "confirm_token": "…" }

POST/api/v1/telephony/carrier/check

Verify, read-only, that your account routes the imported numbers to MCPDial. When every check passes the numbers go live. 409 no_routing_mode / no_numbers.

responsejson
{ "ok": false, "items": [{ "key": "origination", "ok": false, "label": "Origination URI sip:…", "detail": "Add it under the trunk’s Origination settings." }, { "key": "transfer", "ok": false, "advisory": true, "label": "Call transfer enabled on the trunk …" }] }

Calendar & bookings

The native calendar behind every booking tool. Linked Google or Microsoft calendars contribute their busy times, and every booking is mirrored into them: created on booking, moved on reschedule, removed on cancel. If that mirror fails the booking change still happens and the booking carries calendar_sync_error until a retry succeeds. Times are ISO 8601; a time without an offset is read in the calendar’s timezone. List calendars to get the ids the other endpoints take.

GET/api/v1/calendars

The workspace’s calendars (id, name, timezone, settings), oldest first, each with its connected Google/Microsoft calendars: masked account, connected_at and sync health (ok, failing = some bookings could not be mirrored, idle = nothing mirrored yet).

responsejson
{ "data": [{ "id": "…", "name": "Main calendar", "timezone": "Europe/Zurich", "settings": { "slot_minutes": 30, … },
    "links": [{ "provider": "google", "account_email": "j•••e@example.com", "connected_at": "2026-09-01T08:00:00Z",
                "sync": { "status": "ok", "failed_bookings": 0, "last_synced_at": "2026-09-28T14:02:11Z" } }] }],
  "sync_available": true }

POST/api/v1/calendars/{id}/link

Connect Google Calendar or Microsoft 365 with an API key: returns the consent URL to open in the calendar owner’s browser (valid 10 minutes, single use — hand it only to them). They come back to return_url with ?calendar=connected&calendar_id=<id>, or ?calendar=error&reason=access_denied | expired | scopes_missing | calendar_not_found | workspace_unavailable | failed. return_url: https, on your partner’s allowed hosts (mcpdial.com for other workspaces), else 400 invalid_return_url. 409 calendar_sync_unavailable while calendar sync is not offered to the workspace (sync_available on GET /api/v1/calendars).

request bodyjson
{ "provider": "google", "return_url": "https://founderreply.com/settings/calendar" }
responsejson
{ "auth_url": "https://accounts.google.com/o/oauth2/v2/auth?…", "expires_at": "2026-10-02T08:30:00.000Z" }

Disconnect Google Calendar or Microsoft 365 (owner/admin or API key; provider is needed only when both are connected). Our access is revoked. With remove_future_events=true the upcoming events we added are deleted first — if any cannot be removed, nothing is disconnected (502). To connect one, POST /api/v1/calendars/{id}/link (or the dashboard).

responsejson
{ "disconnected": true, "provider": "google", "events_removed": 0, "kept_events": true, "revoke": "revoked", "hint": null }

POST/api/v1/calendars/{id}/closures

Close the calendar on whole days — a vacation, a holiday, a training day — in its own timezone, both ends included (ends_on defaults to starts_on; at most 366 days). Nothing is offered or bookable then; bookings already made stay. GET lists the closed days still to come (with the holiday region); DELETE /api/v1/calendars/{id}/closures/{closure_id} removes one.

request bodyjson
{ "starts_on": "2026-12-24", "ends_on": "2027-01-02", "label": "Christmas break" }
responsejson
{ "data": { "id": "…", "calendar_id": "…", "starts_on": "2026-12-24", "ends_on": "2027-01-02", "label": "Christmas break", "source": "manual", "created_at": "…" } }

PUT/api/v1/calendars/{id}/holidays

Close on a region’s public holidays: a country ("CH", "DE", "US" …) or a subdivision ("CH-ZH", "DE-BY" …) for its own holidays too; null turns it off and removes them. This year’s and next year’s are imported at once (as closures with source "holiday") and refreshed weekly. Bank and school holidays are not included.

request bodyjson
{ "region": "CH-ZH" }
responsejson
{ "data": { "holiday_region": "CH-ZH", "imported": 21 } }

GET/api/v1/availability?calendar_id={id}&from={iso}&days=7

Free slots on a calendar. from defaults to now; days 1–31 (default 7).

responsejson
{ "slots": [{ "start": "2026-10-06T12:30:00Z", "end": "2026-10-06T13:00:00Z" }] }

GET/api/v1/bookings

Bookings that are not canceled, soonest first. Filters: calendar_id, from (default 24 hours ago); limit 1–200 (default 200). To page forward, pass next_after back as after.

responsejson
{ "data": [{ "id": "…", "calendar_id": "…", "starts_at": "2026-10-07T09:00:00+00:00", "status": "confirmed", … }], "has_more": true, "next_after": "2026-10-07T09:00:00Z_…" }

POST/api/v1/bookings

Book a slot. end defaults to start + the calendar’s slot length. 409 slot_unavailable if it is taken. With an Idempotency-Key header a retry within 24 hours returns the original booking (HTTP 200, "replayed": true), never a second one.

request bodyjson
{ "calendar_id": "…", "start": "2026-10-06T12:30:00Z", "name": "Anna Keller", "phone": "+41441234567", "notes": "Check-up" }
responsejson
// HTTP 201
{ "data": { "id": "…", "calendar_id": "…", "starts_at": "2026-10-06T12:30:00Z", "ends_at": "2026-10-06T13:00:00Z", "status": "confirmed", … } }

PATCH/api/v1/bookings/{id}

Reschedule. Keeps the duration unless end is given; 409 if the new time is not free. The linked calendar event moves too.

request bodyjson
{ "start": "2026-10-07T09:00:00Z" }

DELETE/api/v1/bookings/{id}

Cancel a booking and free its slot (idempotent; repeating it also retries removing the linked calendar event).

responsejson
{ "canceled": true, "calendar_sync_error": null }

POST/api/v1/bookings/{id}/calendar-sync

Retry mirroring a booking to its linked Google/Microsoft calendar (create, move or remove the event to match). Safe to repeat; returns the booking with calendar_sync_error null on success.

Contacts

People you call. A contact is found by its identities — your own lead id (external_ref), then email, then phone — so a lead pushed from your CRM before its number is known lands on the same contact later. Each contact carries a brief the agent reads before calling (background, facts, legal_basis) and a timeline (emails, notes, calls, bookings, messages). Anywhere a contact id goes in the path, ext:<external_ref> works too (e.g. /api/v1/contacts/ext:FR-123). Consent you assert is written to the evidence ledger; an opt-out always wins over consent. Every opt-out also goes on the workspace’s do-not-call list, which keeps the number blocked even after the contact is deleted and marks it do-not-call again if it is re-imported.

GET/api/v1/contacts

Contacts, newest first. q matches name, company, phone or email; phone, email and external_ref are exact lookups; limit 1–500 (default 100). To page, pass next_before back as before.

responsejson
{ "data": [{ "id": "…", "name": "Anna Keller", "phone": "+41…", "call_consent": true, "dnc": false, … }], "has_more": true, "next_before": "2026-09-28T22:53:49.281828Z_…" }

POST/api/v1/contacts

Bulk upsert by phone (max 5,000 per request). Only fields you send are written. consent records a consent basis; opt_out: true marks the contact do-not-call. kind is set only on new contacts — an existing contact keeps its type (counted in kept_type); change it with PATCH /api/v1/contacts/{id}.

request bodyjson
{
  "contacts": [
    { "phone": "+41441234567", "name": "Anna Keller", "email": "anna@example.com", "kind": "b2c",
      "consent": { "basis": "web form 2026-09-01" } }
  ]
}
responsejson
{ "upserted": 1, "rejected": [], "ids": ["6f1c…"], "kept_type": 0, "conflicts": [] }
// rejected rows carry their index and reason: { "index": 3, "reason": "invalid phone …" }

POST/api/v1/contacts(one lead)

One lead (send the contact itself, no contacts array): found by external_ref → email → phone, or created (HTTP 201). Phone is optional. Nothing is ever blanked — empty values are ignored and facts merge key by key; phone, email and external_ref are filled when missing, never replaced. An address that belongs to another contact is not moved: it comes back in conflicts (merge them). background (≤ 8,000 chars) and facts (flat, ≤ 50 keys, values ≤ 500 chars) are what the agent reads before calling; legal_basis records why you may contact the lead.

request bodyjson
{
  "external_ref": "FR-123", "email": "anna@example.com", "name": "Anna Keller",
  "background": "Head of ops at Keller AG; replied to our second email asking for pricing.",
  "facts": { "role": "Head of Ops", "employees": 40 },
  "legal_basis": { "basis": "cold_after_email", "evidence": { "email_id": "m_881" } }
}
responsejson
// HTTP 201
{ "contact": { "id": "…", "external_ref": "FR-123", "phone": null, "facts": { … }, … }, "created": true, "conflicts": [] }

GET/api/v1/contacts/{id}

One contact with its brief (external_ref, background, facts, legal_basis), consent ledger (kind, basis, created_at — newest first) and recent_events (the last 10 timeline events). 404 contact_not_found.

GET/api/v1/contacts/{id}/timeline

The contact’s timeline, newest first: calls, bookings and automatic messages here, plus emails and notes you pushed. limit 1–200 (default 50); pass next_before back as before.

POST/api/v1/contacts/{id}/timeline

Add one event (kind: email_sent, email_opened, email_reply, sms_received, note, meeting, status, other …; source: founderreply, cognilead, api, manual). Send excerpts, not threads (body ≤ 4,000 chars). With external_id a retry returns the stored event (HTTP 200, created: false) instead of adding it twice.

request bodyjson
{ "kind": "email_reply", "source": "cognilead", "direction": "inbound", "occurred_at": "2026-09-30T09:12:00Z",
  "title": "Re: Quick question", "body": "Sounds interesting — can you call me Tuesday?", "external_id": "msg_7781" }
responsejson
// HTTP 201
{ "data": { "id": "…", "kind": "email_reply", … }, "created": true }

POST/api/v1/contacts/timeline

Bulk import (max 500 events): each event names its contact by contact_id or identities (+ optional lead fields); unknown leads are created. Idempotent per (source, external_id) — re-sending a batch imports nothing twice; rejected entries come back by index.

request bodyjson
{ "events": [ { "contact": { "external_ref": "FR-123", "email": "anna@example.com" }, "kind": "email_sent", "source": "cognilead", "external_id": "msg_7780", "title": "Quick question" } ] }
responsejson
{ "imported": 1, "duplicates": 0, "contacts_created": 0, "rejected": [], "conflicts": [], "events": [{ "index": 0, "id": "…", "contact_id": "…", "created": true }] }

POST/api/v1/contacts/{id}/merge

Merge duplicates into this contact: calls, bookings, timeline, consent ledger, campaign enrolments and identities move here; empty fields are filled from them; the duplicates are deleted. Do-not-call on any of them makes the merged contact do-not-call. Safe to retry. Owner/admin or API key.

request bodyjson
{ "source_ids": ["…"] }
responsejson
{ "data": { "id": "…", … }, "merged_ids": ["…"], "moved": { "calls": 2, "bookings": 0, "events": 5, "consent_events": 1, "campaigns": 1, "campaigns_dropped": 0 } }

PATCH/api/v1/contacts/{id}

Edit name, company, email, timezone, language, kind or the brief — external_ref, background, facts (merged; a null value deletes that key, facts: null clears all), legal_basis (null clears a field); record consent; or opt the contact out with opt_out: true. A new phone number is accepted (409 phone_taken if another contact has it — merge them) and clears call consent, because consent belongs to the number — unless consent is sent in the same request. Consent never lifts a do-not-call — that is done by an owner or admin in the dashboard, with written consent. dnc_screen: { note, screened_at? } records a UK TPS/CTPS screen for a UK business contact (owner/admin or API key): it may then be called without consent for 28 days.

request bodyjson
{ "company": "Keller AG", "consent": { "basis": "signed form 2026-09-20" } }
responsejson
{ "data": { "id": "…", "phone": "+41…", "call_consent": true, "dnc": false, "consent_events": [{ "kind": "call_consent", "basis": "signed form 2026-09-20", "created_at": "…" }], … } }

DELETE/api/v1/contacts/{id}

Erase a contact (GDPR right to erasure). Deletes the contact, its consent ledger, its timeline and identities (and webhook deliveries about it) and wipes the transcripts, summaries and recordings of every call with them — the calls linked to the contact and every call to or from its number, linked or not; calls_scrubbed is that count. The call records themselves (numbers, times, duration, cost, outcome) are kept for billing and legal records. A do-not-call number stays on the do-not-call list. To only take the contact out of the contact book, send ?keep_history=true: its calls stay, unlinked, with their transcripts (the response has erased: false and calls_unlinked). Owner/admin or API key; irreversible; not available over MCP.

responsejson
{ "deleted": true, "id": "…", "calls_scrubbed": 2 }

Campaigns

An outbound agent over a contact list. The scheduler dials contacts inside their local window, retries per the campaign settings, and skips anyone the gate blocks.

GET/api/v1/campaigns

List campaigns, newest first. limit 1–200 (default 200); to page, pass next_before back as before.

responsejson
{ "data": [{ "id": "…", "name": "October follow-ups", "status": "draft", … }], "has_more": false, "next_before": null }

POST/api/v1/campaigns

Create a campaign (as a draft) and enrol existing contacts — by id, or as contacts [{ contact_id | external_ref, brief }] where each lead’s brief is merged over the campaign’s (later wins, lists combined).

request bodyjson
{ "agent_id": "…", "name": "October follow-ups", "goal": "Book a demo", "brief": { "objective": "Book a 20-minute demo" }, "contacts": [{ "external_ref": "lead_8812", "brief": { "context": "Replied to the second email" } }] }
responsejson
// HTTP 201
{ "data": { "id": "…", "status": "draft", … }, "contacts_added": 1, "contacts_ignored": 0 }

GET/api/v1/campaigns/{id}

A campaign with contact counts per state and its pre-launch checklist (checks).

PATCH/api/v1/campaigns/{id}

Rename, change goal, brief or settings, pause (status "paused") or stop (status "done"). Start with …/start.

request bodyjson
{ "status": "paused" }

DELETE/api/v1/campaigns/{id}

Delete a campaign that is not running (409 campaign_running — pause it first). Call history is kept.

responsejson
{ "deleted": true }

GET/api/v1/campaigns/{id}/contacts

Per-contact progress: state, attempts, next_at, last_outcome, skip_reason.

POST/api/v1/campaigns/{id}/contacts

Enrol more existing contacts, by id or external_ref, each optionally with its own brief (an already-enrolled lead keeps its progress and gets the new brief). Unknown ids are ignored; unknown external refs come back in unresolved_external_refs.

request bodyjson
{ "contacts": [{ "external_ref": "lead_8812", "brief": { "objective": "Re-book the demo" } }] }
responsejson
{ "added": 0, "updated": 1, "ignored": 0 }

POST/api/v1/campaigns/{id}/start

Start dialling (places real calls; uses credits). 422 with checks unless the agent is live, a caller-ID number is active, credits suffice and at least one contact is callable.

responsejson
{ "ok": true, "queued": 42 }

Notifications

The workspace notification centre: low or used-up credits, campaigns paused automatically, suspended numbers (and their release reminders), and calendar, webhook, carrier or recording problems. Each notification names the one action to take and links to the dashboard page where it is fixed. Owners and admins also get them by email (and Slack, if connected) — see Settings → Notifications.

GET/api/v1/notifications

List notifications, newest first. ?unread=true for unread only. `read` is per user: the signed-in user, or for an API key the user who created it. limit 1–100 (default 50); to page, pass next_before back as before.

responsejson
{ "data": [{ "id": "…", "event": "credits_low", "severity": "warning", "title": "Your credit balance is low", "body": "You have 420 credits left…", "link": "/dashboard/settings/billing", "action_label": "Top up credits", "data": { "balance": 420, "threshold": 500 }, "created_at": "…", "read": false }], "has_more": false, "next_before": null }

POST/api/v1/notifications/read

Mark notifications read for the caller. Body `{ "ids": ["…"] }` or `{ "all": true }`. Idempotent.

request bodyjson
{ "all": true }
responsejson
{ "marked": 3 }

Branding & messages

The company identity on the automatic emails and SMS MCPDial sends (booking confirmations to both parties, reminders, call summaries, follow-ups), the texts of those messages and the log of what was sent. Built so a product that already holds your company settings can keep MCPDial in sync. Writes need an API key or an owner/admin session (403 forbidden for other members); every write changes only the fields you send, so repeating it is safe. Invalid values are 400 with a message that names the field and the rule.

GET/api/v1/branding

Branding and sender identity: display_name, logo_url, brand_color, sender_name, reply_to, notify_emails (business copies; empty = owners and admins), website, address, footer_text, reminder_hours (0 = off), email_local_part, the From header in use right now and the custom sending_domain.

responsejson
{ "data": { "display_name": "Acme Dental", "brand_color": "#2563eb", "sender_name": null, "reply_to": "front@acme-dental.ch",
  "notify_emails": ["team@acme-dental.ch"], "website": "acme-dental.ch", "address": "Bahnhofstr. 1, Zürich", "footer_text": null,
  "reminder_hours": 24, "email_local_part": "notifications", "logo_url": "https://…/branding/…/logo-….png",
  "from": "\"Acme Dental via MCPDial\" <agent@mcpdial.com>",
  "sending_domain": { "domain": null, "status": "none", "records": [], "address": null }, "updated_at": "…" } }

PATCH/api/v1/branding

Change any of the fields above; null (or "") clears a text field, unknown fields are refused. logo_url: an https link the server downloads and sets as the logo (public addresses only, ≤ 512 KB, PNG/JPEG/WebP by content — SVG is refused); null removes the logo. 400 invalid_branding / unsafe_url / logo_fetch_failed say why. Returns the full branding.

request bodyjson
{ "display_name": "Acme Dental", "brand_color": "#2563eb", "reply_to": "front@acme-dental.ch", "logo_url": "https://acme-dental.ch/logo.png" }
responsejson
{ "data": { "display_name": "Acme Dental", … } }

Set the logo by upload (multipart/form-data, field `file`) or by URL (JSON `{ "url": "https://…" }`, downloaded with the same checks as logo_url). PNG, JPEG or WebP, up to 512 KB.

request bodyjson
curl -X PUT …/api/v1/branding/logo -H "Authorization: Bearer cv_live_…" -F file=@logo.png
responsejson
{ "data": { "logo_url": "https://…", … } }

Remove the logo.

responsejson
{ "data": { "logo_url": null, … } }

POST/api/v1/branding/domain

Send automatic emails from your own domain. Returns the DNS records (SPF, DKIM, MX) to add at your DNS provider; until it is verified, mail goes out as "<name> via MCPDial". Free-mail domains and domains another workspace uses are refused (400 invalid_domain, 409 domain_taken). GET returns the same object; DELETE goes back to MCPDial’s address.

request bodyjson
{ "domain": "acme-dental.ch" }
responsejson
{ "data": { "domain": "acme-dental.ch", "status": "pending", "records": [{ "record": "DKIM", "type": "TXT", "name": "resend._domainkey", "value": "p=…" }, …], "address": "notifications@acme-dental.ch" } }

POST/api/v1/branding/domain/verify

Re-check the DNS records now. status: pending | verified | failed. 404 no_domain without a domain.

responsejson
{ "data": { "domain": "acme-dental.ch", "status": "verified", … } }

GET/api/v1/message-templates

Every automatic message — event (booking_confirmed, booking_rescheduled, booking_canceled, booking_reminder, call_summary, call_followup) × audience (caller | business) × channel (email | sms) — with its effective subject and body, enabled, default_enabled and customized, plus the {{variables}} you can use.

responsejson
{ "data": [{ "event": "booking_confirmed", "audience": "caller", "channel": "email", "label": "Appointment booked", "enabled": true, "default_enabled": true,
  "subject": "Your appointment with {{business.name}} is confirmed", "body": "Hi {{caller.name}},\n\nYour appointment …", "customized": false }, …],
  "variables": [{ "name": "appointment.date", "description": "Date, in the calendar’s timezone (e.g. Wed 14 Oct 2026)" }, …] }

PUT/api/v1/message-templates/{event}/{audience}/{channel}

Turn one message on or off and/or change its text. Only the fields sent change; subject or body null = the built-in text. Emails need a subject; SMS have none (400 invalid_template). An unknown combination is 400 unknown_message.

request bodyjson
{ "enabled": true, "body": "Hi {{caller.name}}, see you on {{appointment.date}} at {{appointment.time}}. — {{business.name}}" }
responsejson
{ "data": { "event": "booking_confirmed", "audience": "caller", "channel": "sms", "enabled": true, "customized": true, … } }

DELETE/api/v1/message-templates/{event}/{audience}/{channel}

Back to the built-in text and the default on/off.

responsejson
{ "data": { "customized": false, … } }

GET/api/v1/messages

What was sent: automatic emails and SMS, newest first, with status (queued | sending | sent | failed | skipped | canceled), error and credits. Filters: call_id, booking_id, event, status, channel, audience, since. `to` is the full recipient (like a contact’s phone and email), "[erased]" after a contact erasure. limit 1–200 (default 50); to page, pass next_before back as before.

responsejson
{ "data": [{ "id": "…", "event": "booking_confirmed", "audience": "caller", "channel": "sms", "to": "+41791234567", "subject": null, "status": "sent", "error": null,
  "call_id": "…", "booking_id": "…", "credits": 10, "attempts": 1, "test": false, "send_after": "…", "created_at": "…", "sent_at": "…" }], "has_more": false, "next_before": null }

GET/api/v1/messages/inbound

What came back: texts received on your numbers, newest first. A STOP-type keyword (STOP, UNSUBSCRIBE, STOPP, ARRÊT …) has already put the number on the do-not-call list and flagged the contact (keyword "stop"); START lifts an opt-out that was made by text ("start"); ordinary replies have keyword null and also land on the contact’s timeline and in the message.received webhook. Filters: contact_id, from, keyword (stop | start | help | none), since. Receiving texts is free.

responsejson
{ "data": [{ "id": "…", "channel": "sms", "direction": "inbound", "from": "+41791234567", "to": "+41445551234", "body": "Yes, Thursday at 10 works.",
  "keyword": null, "segments": 1, "contact_id": "…", "number_id": "…", "received_at": "…" }], "has_more": false, "next_before": null }

Balance & usage

1 credit = $0.001. A workspace created and paid for by a partner product spends that partner’s balance: it answers funded_by "partner" and its balance is not shown.

GET/api/v1/analytics?days=30

How the calls went over the last 7, 30 or 90 days (test calls not counted): totals (calls, answered, talk seconds, average answered call, inbound / outbound / web, opted out, booked), outcomes, structured results, calls per day, outbound pick-up by hour, per agent and per campaign, bookings — and the previous period’s totals for comparison. Days and hours are in your calendar’s timezone.

responsejson
{ "days": 30, "tz": "Europe/Zurich", "totals": { "calls": 412, "answered": 297, "seconds": 51340, "avg_answered_seconds": 172, "inbound": 120, "outbound": 290, "web": 2, "opted_out": 6, "booked": 41 },
  "outcomes": { "completed": 180, "booked": 41, "no_answer": 80, … }, "dispositions": { "interested": 52, … }, "daily": [{ "day": "2026-09-05", "calls": 14, "answered": 10, "seconds": 1720 }, …],
  "hours": [{ "hour": 10, "calls": 40, "answered": 31 }, …], "agents": [{ "agent_id": "…", "name": "Front desk", "calls": 120, "answered": 118, "seconds": 20100, "booked": 22 }],
  "campaigns": [ … ], "bookings": { "confirmed": 48, "from_calls": 41 }, "previous": { "totals": { … } } }

GET/api/v1/balance

Credits, unlimited, the low-credit threshold (and whether you are below it), can_spend (covers at least one minute), plan and the plan’s rate per minute (some destinations add a surcharge — GET /api/v1/rates).

responsejson
{ "data": { "funded_by": "self", "credits": 18250, "unlimited": false, "low_threshold": 500, "low": false, "can_spend": true, "plan": "free", "rate_credits_per_minute": 190, "usd_per_credit": 0.001 } }
// partner-funded
{ "data": { "funded_by": "partner", "credits": null, "unlimited": null, "low_threshold": null, "low": null, "can_spend": true, "plan": "free", "rate_credits_per_minute": 190, "usd_per_credit": null } }

GET/api/v1/usage?since=2026-09-01T00:00:00Z&until=2026-10-01T00:00:00Z

Spend in a window (default the last 30 days, at most 366): calls (count, billable minutes, credits), phone-number rent, SMS and emails, voice previews, other — net of refunds — and credits added. A call still in progress counts its hold until it settles.

responsejson
{ "data": { "since": "…", "until": "…", "calls": { "count": 42, "minutes": 117, "credits": 22230 }, "numbers": { "credits": 3000 },
  "messages": { "sms": { "count": 30, "credits": 300 }, "email": { "count": 51, "credits": 102 } }, "voice_previews": { "credits": 0 }, "other": { "credits": 0 },
  "total_spent_credits": 25632, "credits_added": 50000, "truncated": false } }

Webhooks

Workspace webhook endpoints: up to 10 https URLs that receive the events they subscribe to — call.completed, call.result, booking.*, message.*, contact.*, campaign.finished (or "*" for all) — signed with your workspace secret. Retried with backoff for up to ~22 hours; an endpoint failing for more than a day is turned off and you are notified. Owner/admin or API key; not available over MCP. Events and payloads: /docs/webhooks.

GET/api/v1/webhooks

List endpoints, with the supported event types and the limit.

responsejson
{ "data": [{ "id": "…", "url": "https://crm.example.com/hooks/mcpdial", "events": ["call.result", "booking.created"], "enabled": true, "failure_count": 0, "last_success_at": "…", … }], "limit": 10, "events": ["call.completed", …] }

POST/api/v1/webhooks

Add an endpoint (public https URL). If the workspace has no signing secret yet, one is created and returned once as signing_secret. 409 endpoint_limit past 10.

request bodyjson
{ "url": "https://crm.example.com/hooks/mcpdial", "events": ["call.result", "booking.created"], "description": "CRM" }
responsejson
// HTTP 201
{ "data": { "id": "…", "url": "https://crm.example.com/hooks/mcpdial", "events": ["call.result", "booking.created"], "enabled": true, … }, "signing_secret": "whsec_…" }

GET/api/v1/webhooks/{id}

One endpoint. 404 endpoint_not_found.

PATCH/api/v1/webhooks/{id}

Change url, description, events or enabled. Turning an endpoint back on (or changing its URL) resets its failure streak.

request bodyjson
{ "enabled": true }

DELETE/api/v1/webhooks/{id}

Delete an endpoint and its delivery log.

responsejson
{ "deleted": true, "id": "…" }

GET/api/v1/webhooks/{id}/deliveries

Deliveries of the last 30 days, newest first, with payloads. ?status=pending|delivering|delivered|failed|dead, ?event=, ?limit= (≤ 100); to page, pass next_before back as before.

responsejson
{ "data": [{ "id": "…", "event": "call.result", "event_id": "call.result:…", "status": "delivered", "attempts": 1, "last_status_code": 200, "payload": { … } }], "next_before": null }

POST/api/v1/webhooks/{id}/deliveries/{deliveryId}/replay

Send the same event (same id and body) again now, with a fresh retry schedule. Returns the delivery after the attempt. 409 endpoint_disabled / delivery_in_flight.

POST/api/v1/webhooks/{id}/test

POST a signed test.ping to the endpoint now (one attempt, logged in its deliveries).

responsejson
{ "data": { "event": "test.ping", "status": "delivered", "last_status_code": 200, … }, "delivered": true }

Errors and rate limits

Every error has the same shape and a matching HTTP status. Branch on code; the message is for humans and may change.

errorjson
{ "error": { "code": "agent_not_found", "message": "Agent not found." } }
StatusMeaning
400Invalid body, query or path value (invalid_body, invalid_filter, invalid_spec, invalid_limit, invalid_cursor…). Fix the request; do not retry as is.
401Missing, malformed or revoked API key (missing_api_key, invalid_api_key). Deleting a workspace revokes all of its keys.
402insufficient_credits — not enough credit to reserve the call or buy the number. Top up in Billing.
403The key cannot use this endpoint (session_required: dashboard-only, such as browser test calls), or its workspace was deleted (workspace_deleted). Deleting a workspace is dashboard-only on purpose — no API key can do it.
404No such agent, call, number, booking or campaign in this workspace (agent_not_found, call_not_found, number_not_found…), or no such endpoint (not_found).
409State conflict: agent_not_live, agent_archived (restore it first), agent_in_use, slot_unavailable, slot_taken, needs_documents (error.detail.missing lists what to add), campaign_running, idempotency_conflict (an Idempotency-Key reused with other arguments).
413 / 415Document uploads only: file_too_large (over 5 MB), unsupported_media_type (send multipart/form-data).
422Understood but refused — a call blocked by the compliance gate (the body says why), or a campaign failing its pre-launch checks.
429rate_limited — 120 requests per minute per workspace. Wait for the retry-after header (seconds), then retry.
502The phone carrier failed (provider_error, dispatch_failed). Safe to retry later.

Rate limit: 120 requests per minute per workspace, shared by the REST API and MCP. Over it, requests get 429 rate_limited with a retry-after header in seconds.