Manager guide Sign in

Integrator documentation

Benerra AI developer docs

Connect your CRM, lead sources and phone system to Benerra voice agents. Push contacts in, receive call results out, read calls and statistics, and route SIP calls into an agent.

Overview

Benerra AI runs voice agents that make and answer phone calls. An agent talks to the client in a natural voice, follows the conversation plan you configure, records the result as an outcome and extracts the fields you asked for. Everything is managed in the cabinet at app.benerra.ai. This page covers what you need to connect your own systems.

There are four integration points:

Base URL and formats

Base URL
https://app.benerra.ai/api/v1
Format
JSON in and out, UTF-8.
Times
ISO 8601 in UTC with a trailing Z, for example 2026-12-01T09:30:00Z. Parameters named date_from and date_to take calendar days (YYYY-MM-DD) in your organization time zone (UTC unless set otherwise).
Phone numbers
International format with country code, digits only or with a leading +.
Machine-readable spec
GET https://app.benerra.ai/api/v1/openapi-external.json describes every method available with an API key. No authentication needed.

Quick start

A typical lead-calling integration takes five steps.

  1. Create an agent and a campaign. In the cabinet, build the agent in a project, then create a campaign (shown as a wave in the cabinet) that uses it. Set calling hours, attempts and the retry plan on the campaign.
  2. Create a contact source. In Integrations, add a source, choose the campaign it delivers to and copy the source URL and secret. Turn on delivery when you are ready.
  3. Push a test contact. Send one request with "test": true to check authentication and field mapping without calling anyone.
    bash
    curl -X POST "https://app.benerra.ai/api/v1/intake/hook/YOUR_SOURCE_TOKEN" \
      -H "Content-Type: application/json" \
      -H "X-Webhook-Secret: YOUR_SOURCE_SECRET" \
      -d '{"test": true, "phone": "+15550100123", "external_id": "lead-1001",
           "variables": {"client_name": "John", "city": "Austin"}}'
  4. Add a webhook. In Webhooks, add an API webhook with your URL (for example https://YOUR_DOMAIN/benerra/webhook), a secret, and the events call_completed and lead_detected. Press Test to receive a sample payload and check the signature.
  5. Issue an API key in API keys with the permissions you need (for example calls_read and stats) and read results:
    bash
    curl "https://app.benerra.ai/api/v1/calls/?project_id=YOUR_PROJECT_ID&limit=20" \
      -H "X-API-Key: YOUR_API_KEY"

Then send real contacts without the test flag. Each contact is called according to the campaign schedule, and each finished call produces one webhook.

Concepts

TermMeaning
OrganizationYour account (cabinet). Holds users, projects, phone trunks and billing. Has a time zone used for daily reports.
ProjectA container inside the organization for agents, campaigns, calls and webhooks. API keys are bound to one or several projects. Identified by project_id.
AgentA configured voice agent: role, voice, language, conversation plan, outcomes and fields to extract. Has an internal agent_id and a short agent_code used in SIP headers and API calls. Codes are unique inside an organization.
CampaignAn outbound calling run (called a wave in the cabinet): one or several agents, a contact list, calling hours, an attempt limit and a retry plan. Identified by campaign_id.
Contact sourceA URL that accepts leads from your system and delivers them to a campaign. See Contact intake.
ContactA phone number with optional data (name, city, order number, custom variables). A contact accepted from a source gets a contact_id you can track.
CallOne phone call: outbound from a campaign, inbound, a transfer from your PBX, or a test. Identified by call_id. Holds the transcript, summary, outcome, extracted fields and recording link.
OutcomeThe business result of a call, for example client_apruv (lead) or voicemail_detected. See Outcomes.
Extracted fieldsStructured data the agent collected during the call (for example name, preferred time, comments). You define them on the agent.
TrunkA SIP connection used to place or receive calls. See SIP integration.
WebhookA destination that receives call results: your HTTP endpoint, Telegram, email or a Google Sheet.

Typical flow: your system sends a contact to a source, the source delivers it to a campaign, the dialer calls it during calling hours, the agent talks, the call ends with an outcome, and Benerra sends the result to your webhook. If the outcome allows another attempt, the contact is called again later according to the retry plan.

Authentication and API keys

Server integrations authenticate with an API key in the X-API-Key header. Keys are issued in the cabinet in API keys by an organization admin. A key looks like mk_live_ followed by 48 hex characters. It is shown once at issue time; Benerra stores only a hash, so keep it in your secret store.

http
GET /api/v1/calls/count?project_id=YOUR_PROJECT_ID HTTP/1.1
Host: app.benerra.ai
X-API-Key: YOUR_API_KEY

The text test API and the MCP endpoint also accept Authorization: Bearer YOUR_API_KEY.

Key scope

  • One project or several projects of the same organization. Requests for any other project get 403.
  • Whole organization. Issued by Benerra staff on request, read-only, with the calls_read permission only. It cannot be used for call control.

A key stops working when it is revoked, when all of its projects are deleted, or when the organization is archived. The cabinet shows when and from which IP each key was last used and keeps a log of key changes.

Permissions

Each key carries a set of permissions. A request without the needed permission gets 403 with code permission_denied and the field permission.

PermissionGrants
calls_readCalls: GET /calls/, /calls/count, /calls/{call_id}, /calls/by-order/{id_order}, /calls/contacts-report, /contacts/{contact_id}, /contacts/{contact_id}/calls, campaign list, the text test API and the MCP endpoint.
contactsContact lists: GET /contacts/ and /contacts/count. Needs calls_read as well.
statsCall statistics: GET /stats/calls.
deliveriesWebhook deliveries of a call and redelivery: GET /calls/{call_id}/deliveries, POST /calls/{call_id}/redeliver.
demo_linksCreate, list, extend and revoke public demo links to agents: /demo-links.
call_controlLead gate for your CRM: /call-control/external/agents-status, gate-check, record-lead. Project keys only.
agents_readAgent configuration and versions (/external/agents/...). Granted by Benerra on request, not in the cabinet.

Keys created before permissions existed and keys with an empty permission list behave as call_control plus calls_read. Read routes are read-only: a key cannot change agents, campaigns or calls.

Errors and rate limits

Every error returned to a request with an API key has a human-readable detail and a machine code. Some errors add fields such as permission or project_id.

json
{"detail": "Key has no permission: stats", "code": "permission_denied", "permission": "stats"}
HTTPcodeWhen
400bad_request, period_too_longInvalid parameter or a period longer than allowed.
401unauthorized, invalid_keyMissing key, or the key is unknown or revoked.
403permission_deniedThe key lacks the permission named in permission.
403forbidden, key_scope_inactiveProject outside the key scope, or all key projects or the organization are inactive.
404not_foundUnknown call, contact or agent, or one outside the key scope.
409conflict, ambiguous_project, already_deliveredConflicting state, for example an agent code found in several key projects (pass project_id).
422validation_error, redeliver_not_allowedBody or query did not validate, or the action is not allowed.
429too_frequentA per-method limit was hit. Wait for Retry-After seconds.
503rate_limitedThe per-key rate limit was hit. Wait for Retry-After seconds.
503unavailableThe platform is busy or the query took too long. Retry later or narrow the filter.

Rate limits

ScopeLimit
Any request with a key20 requests per second on average, bursts up to 60. Exceeding it returns 503 with rate_limited and Retry-After.
GET /stats/calls20 requests per minute per key (429 too_frequent).
POST /calls/{call_id}/redeliverOnce per minute per call.
Agent configuration60 requests per minute per key.
Text test sessions20 new sessions per 10 minutes per key, plus a cap on open sessions.
MCP endpoint60 tool calls per minute per key; heavy reports are limited per organization.

Always honor Retry-After. For bulk reads, page with skip and limit and filter by time instead of re-reading everything.

Contact intake

A contact source is a URL that accepts leads from your system and delivers them to a campaign. Create it in the cabinet in Integrations. You get a source URL with a private token and a secret.

POSThttps://app.benerra.ai/api/v1/intake/hook/{endpoint_token}

Authentication

  • Send the source secret in the X-Webhook-Secret header. The header name can be changed on the source.
  • Optionally restrict the source to an IP allow list (up to 50 addresses or subnets). With an allow list, a request from an allowed IP is accepted with or without the secret; a wrong secret is still rejected.
  • After you rotate the secret, the old one keeps working for a grace period of up to 72 hours so you can switch without losing leads.

A wrong token, a disabled source or a wrong secret returns 401.

Request body

JSON is recommended; URL-encoded form bodies are also parsed. The body may be up to 1 MB. The source finds the fields in one of two ways, chosen on the source:

  • Automatic detection (default). The phone is taken from a key such as phone, phone_number, telephone, tel, mobile, cell, msisdn, customer_phone or lead_phone, at any depth. The value must look like a phone number with 10 to 15 digits. Your lead id is taken from external_id, id, lead_id or uuid; a comment from comment, note or message.
  • Explicit paths. You point each field to a path in your body (for example lead.contact.phone) and confirm the mapping in the cabinet.

Data for the conversation goes into a variables (or fields) object next to the phone. These values fill prompt variables such as {CLIENT_NAME} and {CITY}. If the source variable mode is set to automatic, plain keys such as name, first_name, city, product, age and gender are picked up as well.

json
{
  "external_id": "lead-1001",
  "phone": "+15550100123",
  "comment": "Requested a call back from the pricing page",
  "variables": {
    "client_name": "John Smith",
    "city": "Austin",
    "offer": "Annual plan",
    "price": "199 USD",
    "plan_tier": "gold"
  }
}
  • Variable keys: lowercase letters, digits and underscores, up to 32 characters. Values: plain text up to 120 characters; braces and angle brackets are removed.
  • Built-in keys are recognized in several spellings, for example name, client_name and first_name all mean the client name.
  • Any other key (such as plan_tier above) becomes a custom variable the agent can use as {plan_tier}.
  • Send "test": true to submit a test event. It runs authentication and parsing and shows in the source journal, but nobody is called.

One contact or a list

By default one request carries one contact. If the source has Split lists enabled, a JSON array of 2 to 200 objects is accepted and each object becomes its own contact. In the detailed response mode a request that contains several contacts is rejected with multiple_contacts; send them one at a time.

Response

The response format is a source setting.

Simple mode answers 200 with {"status": "ok"} once the request is stored. Processing continues in the background; check the result with the Contacts API or the contact_delivery webhook event.

Detailed mode answers with the decision for the contact:

json
{
  "status": "ok",
  "contact": {
    "phone": "15550100123",
    "contact_id": "6f1c2a9e-3b7d-4d55-9a0e-2c8f4b1e7a10",
    "status": "accepted",
    "delivery": "queued",
    "campaign_id": "c2a4e7f0-91b3-4c1e-8f5d-7b6a3e9d2c11"
  }
}
deliveryMeaning
queuedThe contact is in the campaign queue and will be called.
waitingAccepted, but not delivered yet. waiting_reason and message say why; it is delivered automatically once the cause is resolved.
processingAccepted, the decision is still being made.

A rejected contact comes back as "status": "rejected" inside contact, with reason and message. For duplicates, contact_id points to the earlier contact.

json
{
  "status": "ok",
  "contact": {
    "phone": "15550100123",
    "status": "rejected",
    "reason": "duplicate_phone",
    "message": "duplicate_phone",
    "contact_id": "6f1c2a9e-3b7d-4d55-9a0e-2c8f4b1e7a10"
  }
}
Rejection reasonMeaning
no_phoneNo phone number found in the body.
multiple_contactsSeveral contacts in one request (detailed mode).
missing_group_fieldThe source routes by a group field and it is missing.
duplicate_phoneThe number is already in the campaign.
repeat_too_frequentThe same contact was sent again too soon.
country_not_allowedThe number does not match the allowed country prefixes of the source.
phone_blocked, do_not_callThe number is on a block list or a do-not-call list.
own_numberThe number is one of your own caller numbers.
delivery_limitThe hourly or daily limit of the source is reached.
Waiting reasonMeaning
delivery_offDelivery to a campaign is turned off on the source.
setup_pendingThe field mapping is not confirmed yet.
no_waveNo campaign is assigned for this contact or its group.
no_projectThe contact group is not assigned to a project yet.
project_pausedDelivery to the project is paused.
wave_draft, wave_completedThe campaign is a draft or completed; the contact is delivered when it starts or resumes.
too_oldThe event is older than the source allows (72 hours by default).
delivery_limitThe source delivery limit is reached.

Errors in detailed mode use {"status": "error", "code": "...", "message": "..."}: invalid_body and empty_body (400), body_too_large (413), temporary_error (503, resend the request). A source disabled by Benerra answers with code source_disabled.

Retries on your side. Resend only on network errors, 5xx or temporary_error. A repeated request with the same external_id is safe: duplicates are detected and reported as duplicate_phone or repeat_too_frequent rather than called twice.

Contacts API

Track contacts accepted from sources, files and manual adds.

GET/api/v1/contacts/contacts + calls_read
ParameterDescription
received_from, received_toISO 8601 UTC. Default: the last 7 days. At most 31 days.
source_id, group_id, campaign_idFilter by source, source group or campaign.
deliveryqueued, waiting, rejected, processing, comma-separated.
reasonWaiting or rejection reason code.
intake_external_idYour lead id.
phonePhone number.
skip, limitPaging; limit default 500, max 1000.
json
[
  {
    "contact_id": "6f1c2a9e-3b7d-4d55-9a0e-2c8f4b1e7a10",
    "received_at": "2026-12-01T14:02:11Z",
    "phone": "15550100123",
    "intake_external_id": "lead-1001",
    "source_id": "a91e0c33-5d2b-4f8e-b6a7-0e4d9c2f1b58",
    "origin": "intake",
    "group_id": null,
    "group_name": null,
    "client_id": null,
    "client_name": null,
    "delivery": "queued",
    "reason": null,
    "message": null,
    "delivery_changed_at": "2026-12-01T14:02:12Z",
    "campaign_id": "c2a4e7f0-91b3-4c1e-8f5d-7b6a3e9d2c11",
    "calls": 2,
    "last_call_outcome": "client_apruv"
  }
]
GET/api/v1/contacts/countcontacts + calls_read

Same filters, returns {"total": 42}.

GET/api/v1/contacts/{contact_id}calls_read

The contact card: status, reason, message, phone, campaign_id, external_id, group_id, group_name, accepted_at, delivery, delivery_changed_at and, while waiting, waiting_reason.

GET/api/v1/contacts/{contact_id}/callscalls_read

The contact card plus calls: every call made to this contact, newest first (up to 500). Add last=1 to get only the latest call. Organization-wide keys also receive intake_payload, the parsed body you originally sent.

Campaigns API

Campaigns are created and launched in the cabinet. With a key you can list them and read their progress.

GET/api/v1/campaigns/?project_id={project_id}calls_read
ParameterDescription
project_idRequired.
statusFilter by campaign status.
folder_idCampaign folder, or none for campaigns without a folder.
archivedall (default for keys), only or hide.
skip, limitPaging; limit default 100, max 500. The response has next_skip, or null on the last page.
json
{
  "project_id": "5b0f8f7e-2a41-4c3a-9a51-0d1e6c7b8a90",
  "skip": 0, "limit": 100, "next_skip": null,
  "waves": [
    {
      "id": "c2a4e7f0-91b3-4c1e-8f5d-7b6a3e9d2c11",
      "project_id": "5b0f8f7e-2a41-4c3a-9a51-0d1e6c7b8a90",
      "name": "December leads",
      "folder_id": null,
      "folder_name": null,
      "status": "active",
      "lifecycle_status": "active",
      "waiting_contacts": false,
      "stop_reason": null,
      "archived": false,
      "is_template": false,
      "created_at": "2026-11-28T10:00:00Z",
      "started_at": "2026-11-28T10:05:00Z",
      "completed_at": null,
      "archived_at": null,
      "agent_ids": ["0d7e9a1c-4b2f-4e8a-a3c6-5f1b2d9e7c40"],
      "total_contacts": 1840,
      "contacts_called": 1215
    }
  ],
  "templates": [],
  "folders": [],
  "statuses": {"draft": "draft, never launched", "pending": "waiting for launch"}
}

The statuses object in the live response explains every status value. Templates are listed separately: they do not call anyone and do not accept contacts.

GET/api/v1/campaign-folders/?project_id={project_id}calls_read

Campaign folders of the project: id, name, sort_order, waves_count, archived_count.

Per-contact campaign results

GET/api/v1/calls/contacts-report?project_id=&campaign_id=calls_read

One row per contact of the campaign. The contact result is its last call in the campaign; finished: true means no more calls will be made to it (final outcome or attempt limit reached). Parameters: date_from, date_to, finished_only, skip, limit (max 1000). Page with next_skip.

json
{
  "campaign_id": "c2a4e7f0-91b3-4c1e-8f5d-7b6a3e9d2c11",
  "skip": 0, "limit": 100, "next_skip": 100,
  "items": [
    {
      "contact_id": "6f1c2a9e-3b7d-4d55-9a0e-2c8f4b1e7a10",
      "phone": "15550100123",
      "campaign_id": "c2a4e7f0-91b3-4c1e-8f5d-7b6a3e9d2c11",
      "added_at": "2026-12-01T14:02:12Z",
      "attempts": 2,
      "first_call_at": "2026-12-01T14:05:40Z",
      "last_call_at": "2026-12-01T16:31:02Z",
      "finished": true,
      "state": "finished",
      "last_call": {
        "id": "3e8b1f42-7c6d-4a9e-b0f1-2d5c8a7e6b93",
        "started_at": "2026-12-01T16:31:02Z",
        "outcome": "client_apruv",
        "outcome_label": "Agreed",
        "duration_seconds": 148,
        "wave_call_attempt": 2,
        "wave_is_last_call": true,
        "extracted_fields": {"call_comments": "Wants a demo on Friday"}
      }
    }
  ]
}

A related method, GET /api/v1/calls/contacts-added?project_id=&campaign_id=, returns how many numbers were added to the campaign per day (tz sets the day time zone, default UTC).

Calls API

GET/api/v1/calls/?project_id={project_id}calls_read

Calls of a project, newest first. Each item is a call record.

ParameterDescription
project_idRequired.
campaign_id, ai_agent_idFilter by campaign or agent.
call_status, call_outcome, call_typeFilter by status, outcome or type (inbound, outbound, test).
started_from, started_toCall start time, ISO 8601 UTC (started_to is exclusive).
date_from, date_toCalendar days YYYY-MM-DD in the project time zone.
updated_sinceOnly calls changed at or after this moment (ISO 8601 UTC). Use it for incremental sync; the start window is at most 2 days.
searchPhone number or part of it.
countryCountry code of the number, for example US, GB, FR.
intake_contact_id, intake_external_idCalls of one contact by its contact_id or by your lead id.
last_per_contact, finished_onlyOnly the last call of each campaign contact; optionally only finished contacts.
skip, limitPaging; limit default 500, max 1000.
python
import requests

BASE = "https://app.benerra.ai/api/v1"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}

def calls_since(project_id, since_iso):
    skip = 0
    while True:
        r = requests.get(f"{BASE}/calls/", headers=HEADERS, timeout=60, params={
            "project_id": project_id, "updated_since": since_iso,
            "skip": skip, "limit": 500})
        r.raise_for_status()
        page = r.json()
        yield from page
        if len(page) < 500:
            break
        skip += 500
GET/api/v1/calls/count?project_id={project_id}calls_read

Same filters, returns {"total": 1215}.

GET/api/v1/calls/{call_id}calls_read

One call record. For campaign calls it also includes the calling plan fields (see wave plan fields).

GET/api/v1/calls/by-order/{id_order}calls_read

All calls for your lead or order number (the value you passed as X-Lead-ID or as the contact order id), oldest first, up to 50, with the dialog turn by turn. format=text returns plain text, format=log the full call log; with_log=true adds the log to the JSON.

json
{
  "id_order": "ORD-48213",
  "total": 1,
  "calls": [
    {
      "call_id": "3e8b1f42-7c6d-4a9e-b0f1-2d5c8a7e6b93",
      "id_order": "ORD-48213",
      "phone_number": "15550100123",
      "call_type": "inbound",
      "started_at": "2026-12-01T16:31:02Z",
      "started_at_local": "2026-12-01 10:31:02",
      "timezone": "America/Chicago",
      "duration_seconds": 148,
      "call_outcome": "client_apruv",
      "outcome_final": true,
      "agent_code": "101",
      "agent_name": "Emma",
      "recording_url": "https://app.benerra.ai/recordings/...",
      "external_call_id": "crm-call-7781",
      "call_direction": "in",
      "wave_call_attempt": null,
      "dialog": [
        {"time": "10:31", "role": "bot", "text": "Hello, this is Emma from Acme."},
        {"time": "10:31", "role": "client", "text": "Hi, yes."}
      ]
    }
  ]
}

outcome_final is false while field extraction is still running right after the call; read again a few seconds later.

Call record fields

A call record returned by GET /calls/ and GET /calls/{call_id}. Fields without a value may be null or missing.

FieldTypeDescription
id, _idstringCall id (both keys carry the same value).
project_idstringProject of the call.
campaign_idstringCampaign, for campaign calls.
contact_idstringCampaign contact card.
intake_contact_idstringThe contact_id from contact intake, when the contact came from a source.
ai_agent_idstringAgent that handled the call.
call_typestringoutbound, inbound or test.
call_directionstringin or out as reported by your PBX in X-Call-Dir.
phone_numberstringClient number.
caller_numberstringNumber the call came from or was placed with.
id_countrystringCountry code of the client number.
id_orderstringYour lead or order number (X-Lead-ID or contact data).
external_call_idstringYour call id from X-Call-ID.
client_name, offer_namestringFrom X-Client-Name and X-Offer-Name.
sip_headersobjectAll X-* SIP headers received with the call.
call_statusstringTechnical status, see Statuses.
call_outcomestringBusiness outcome, see Outcomes.
started_at, answered_at, ended_atstringUTC times. answered_at is empty when nobody answered.
duration_secondsintegerTalk time in seconds.
hangup_bystringWho ended the call.
transcriptstringConversation text.
call_summarystringShort summary of the call.
key_points, action_itemsarrayHighlights and follow-ups, when produced.
sentiment, sentiment_scorestring, numberpositive, negative or neutral; score from -1 to 1.
extracted_fieldsobjectFields the agent collected, keyed by the field names you configured.
recording_urlstringLink to the call recording.
contact_varsobjectVariables the call was made with (from a source, file or SIP headers).
sip_status_code, sip_statusinteger, stringFinal SIP response of a failed dial attempt.
attempt_no, wave_call_attempt, wave_is_last_callinteger, booleanAttempt number of the contact in the campaign, and whether no more calls will follow.
trunk_idstringTrunk the call went through.
created_atstringRecord creation time.

Fields that may hold special-category personal data are removed from extracted_fields for keys and users below organization admin.

Call statistics

GET/api/v1/stats/callsstats

A summary, not a list: totals and optional groups for a period of up to 31 days. The default period is the last 7 days in the organization time zone.

ParameterDescription
project_idProjects, comma-separated. Default: all projects of the key.
date_from, date_toOrganization-local days, inclusive.
started_from, started_toISO 8601 UTC instead of days (started_to exclusive).
campaign_idOne campaign.
ai_agent_idAgent ids, comma-separated.
group_byOne or two of day, project, campaign, agent, outcome.
json
{
  "period": {"from": "2026-11-25T06:00:00Z", "to": "2026-12-02T06:00:00Z",
             "from_date": "2026-11-25", "to_date": "2026-12-01", "timezone": "America/Chicago"},
  "group_by": ["day"],
  "totals": {"calls": 3120, "answered": 1904, "minutes": 4410, "billed_minutes": 4022,
             "outcomes": {"client_apruv": 214, "client_reject": 388, "voicemail_detected": 702}},
  "groups": [
    {"day": "2026-11-25", "calls": 402, "answered": 251, "minutes": 590, "billed_minutes": 541,
     "outcomes": {"client_apruv": 31, "client_reject": 47}}
  ]
}

minutes rounds each call up to a whole minute. billed_minutes applies your organization billing rule: test calls and calls ending as silence (and voicemail, unless your plan bills voicemail) are not billed. Groups by agent also carry agent_code and agent_name; by project and campaign, their names.

Deliveries and redelivery

GET/api/v1/calls/{call_id}/deliveriesdeliveries

All webhook deliveries of a call to webhooks visible to the key, grouped by webhook and event. Request and response bodies are not returned.

json
[
  {
    "webhook_id": "9d3f6a20-1c4e-4b7a-8e52-6f0a1b3c9d71",
    "webhook_name": "CRM",
    "webhook_type": "api",
    "event": "lead_detected",
    "result": "delivered",
    "attempts": [
      {"at": "2026-12-01T16:33:41Z", "status": "timeout", "http_code": null,
       "duration_ms": 10012, "retry": false, "log_id": "..."},
      {"at": "2026-12-01T16:34:45Z", "status": "delivered", "http_code": 200,
       "duration_ms": 184, "retry": true, "log_id": "..."}
    ]
  }
]

Attempt status: delivered, failed, timeout, pending, skipped (filtered out by the webhook settings). Group result: delivered, pending (an automatic retry is scheduled), skipped or failed.

POST/api/v1/calls/{call_id}/redeliverdeliveries

Sends the result again with the same body as the first time, the same as manual resend in the cabinet. Body (optional): {"webhook_id": "..."} to redeliver to one webhook. Only API webhooks are redelivered, and deliveries that already succeeded are not repeated.

json
{"status": "queued", "call_id": "3e8b1f42-7c6d-4a9e-b0f1-2d5c8a7e6b93",
 "queued": [{"webhook_id": "9d3f6a20-1c4e-4b7a-8e52-6f0a1b3c9d71", "event": "lead_detected"}]}

Status 202 means queued; check the outcome with deliveries. Other answers: 409 already_delivered, 422 redeliver_not_allowed, 404 not_found, 429 too_frequent (once per minute per call).

Call control

A lead gate for CRMs that route leads to agents themselves. Daily lead limits and on or off switches per agent are set in the cabinet in Call control. Requires a project key with call_control. If the key covers several projects, pass project_id or an agent_code that exists in one of them.

GET/api/v1/call-control/external/agents-statuscall_control

Parameters: agent_code, project_id, include_inactive.

json
{
  "project_id": "5b0f8f7e-2a41-4c3a-9a51-0d1e6c7b8a90",
  "project_name": "Sales US",
  "inbound_enabled": true,
  "outbound_enabled": true,
  "agents": [
    {
      "agent_code": "101",
      "agent_id": "0d7e9a1c-4b2f-4e8a-a3c6-5f1b2d9e7c40",
      "name": "Emma",
      "enabled": true,
      "max_leads_day": 100,
      "leads_today": 47,
      "remaining": 53,
      "accepting_leads": true,
      "state": "active"
    }
  ]
}

remaining is -1 when the agent has no daily limit. state is active, archived or deleted.

GET/api/v1/call-control/external/gate-check?agent_code=101&lead_id=ORD-48213call_control

A quick yes or no before you send a call. Returns {"result": "allow", "reason": "gate_open"} or {"result": "reject", "reason": "limit_reached"}. Reject reasons: inbound_disabled, agent_disabled, limit_reached. When the agent has a limit and you pass lead_id, an allowed lead is counted at once. An unknown agent code is allowed (fail-open) with reason agent_not_found_failopen.

POST/api/v1/call-control/external/record-leadcall_control
json
{"project_id": "5b0f8f7e-2a41-4c3a-9a51-0d1e6c7b8a90", "agent_code": "101", "lead_id": "ORD-48213"}

Counts a lead for the agent (agent_id or agent_code). The same lead_id is counted once. Answer: {"status": "accepted", "is_new_lead": true, "leads_today": 48, "max_leads_day": 100, "remaining": 52, "accepting_leads": true}, or "status": "rejected" with reason agent_disabled or limit_reached.

Agent configuration

Read-only access to an agent setup, for audits and for keeping your own copy of scripts in version control. Requires the agents_read permission, which Benerra grants on request.

GET/api/v1/external/agents/{agent_code}/configagents_read

Returns agent_code, name, project_id, updated_at, created_at, prompt (the role text), voice (tts_engine as a public tier name such as Premium or Standard+, and language), behavior (conversation plan, rules, outcomes in actions, fields to extract in lead_transfer_fields, greetings, silence and callback settings, and model as a public tier name), skills attached to the agent, versions_total and last_version.

GET/api/v1/external/agents/{agent_code}/versionsagents_read

Saved versions, newest first: version, changed_at, changed_by, change_summary, change_comment. Paging with skip and limit (max 200).

GET/api/v1/external/agents/{agent_code}/versions/{version}agents_read

The configuration as it was before that save, in the same shape as config.

Text test API

Talk to an agent in text instead of voice, for automated regression tests of your scripts. The agent runs the same logic as on a call: conversation plan, outcomes and field extraction. Requires calls_read. Base path /api/v1/testing/text.

GET/api/v1/testing/text/agentscalls_read

Agents available to the key: agent_id, agent_code, name.

POST/api/v1/testing/text/sessionscalls_read

Body: agent_id or agent_code, and optional start_stage_index to start from a later stage of the plan. Returns the session.

POST/api/v1/testing/text/sessions/{session_id}/messagescalls_read

Body: {"text": "Hi, yes, I can talk", "wait_sec": 50}. Waits up to wait_sec (1 to 55 seconds) for the agent reply and returns the session. Send only when can_send is true; while the agent is still replying the answer is 409.

GET/api/v1/testing/text/sessions/{session_id}?since=0calls_read

The session state; since skips transcript lines you already have. After the session ends, result holds the final call result.

GET/api/v1/testing/text/sessionscalls_read

Open sessions of the key projects.

DELETE/api/v1/testing/text/sessions/{session_id}calls_read

Closes the session. Close sessions you no longer need: the number of open sessions per key is capped.

json
{
  "session_id": "test-7c41a2",
  "agent_id": "0d7e9a1c-4b2f-4e8a-a3c6-5f1b2d9e7c40",
  "agent_name": "Emma",
  "status": "ready",
  "close_reason": "",
  "can_send": true,
  "stage": {"index": 2, "total": 5, "title": "Qualify"},
  "outcome": "",
  "outcome_label": "",
  "fields": {},
  "transcript": [
    {"role": "bot", "text": "Hello, this is Emma from Acme. Is now a good time?", "t": 1.8},
    {"role": "client", "text": "Hi, yes, I can talk", "t": 6.2},
    {"role": "bot", "text": "Great. Which city are you in?", "t": 7.9}
  ],
  "transcript_total": 3,
  "notes": [],
  "age_sec": 9,
  "idle_close_in_sec": 290
}

Session status: connecting, ready, replying, ended, closed, failed.

Analytics over MCP

AI assistants that support the Model Context Protocol can read your calls and statistics directly. The server uses Streamable HTTP without sessions and answers in JSON. It is read-only and requires a key with calls_read; it sees the projects of the key.

POSThttps://app.benerra.ai/api/v1/mcpcalls_read

Send the key in X-API-Key or Authorization: Bearer. For clients that cannot set headers, put the key in the path: POST /api/v1/mcp/k/YOUR_API_KEY (the key is masked in access logs). GET returns 405.

ToolWhat it does
list_projectsProjects available to the key, their agents (code and name), outcome labels and outcome groups. Call it first.
calls_reportSummary for up to 31 days grouped by one or two of day, hour, weekday, outcome, agent, country, campaign, attempt, call_type, project.
search_callsCalls by lead number (id_order) or phone over all time, or over a period with filters. include_dialog adds the conversation text.
get_callOne call: outcome, stages, who hung up, extracted fields, summary, recording link and the dialog.

Common filters: project_id, date_from, date_to, agent_code, outcome, outcome_group (dozvon, nedozvon, tech, apruv, non_target, reject, other), country, call_type, answered_only. Supported protocol versions: 2025-06-18, 2025-03-26, 2024-11-05.

json
{
  "mcpServers": {
    "benerra-analytics": {
      "type": "http",
      "url": "https://app.benerra.ai/api/v1/mcp",
      "headers": {"X-API-Key": "YOUR_API_KEY"}
    }
  }
}

Webhooks overview

A webhook sends call results to your system. Webhooks are created per project in the cabinet in Webhooks; an organization admin can also create an organization-wide webhook that covers several or all projects. Each webhook has:

  • a type: api (your HTTP endpoint), telegram, email or google_sheets;
  • the URL and method (POST by default, or PUT) and optional custom headers, for example Authorization;
  • a secret used to sign the body;
  • the events it subscribes to;
  • optional filters by outcome, agent and contact source;
  • options: send dial failures, send SIP headers, include the original intake body (all or selected paths), include wave plan fields, remove special-category personal data, number of automatic retries.

Every API webhook request has these headers:

HeaderValue
Content-Typeapplication/json
User-AgentBenerra-Webhook/1.0
X-Webhook-EventThe event name, for example call_completed.
X-Webhook-Signaturesha256=<hex>, when the webhook has a secret.
Your custom headersAs configured on the webhook.

Answer with any 2xx within 10 seconds. Process the payload asynchronously if your work takes longer.

Events

EventWhen
call_completedA call ended with any outcome that is not a lead and not a failure.
lead_detectedA call ended with client_apruv or call_connected. A webhook subscribed to call_completed but not to lead_detected receives leads as call_completed, so it never misses one.
call_failedThe call failed technically: no answer, carrier rejection, error.
contact_deliveryA contact from a source was queued in a campaign, started waiting or was rejected. Sent on each change of its delivery state. API webhooks only.
testSent by the Test button in the cabinet with a sample payload.

Each call produces exactly one of call_completed, lead_detected or call_failed. The cabinet also lists campaign_started and campaign_completed; they do not carry call data, so do not build logic on them.

What is not sent

  • Test calls are not sent to API, email or Google Sheets webhooks.
  • Dial failures carrier_rejected and number_invalid reach only API webhooks that enable Send dial failures or list that outcome in their outcome filter.
  • call_failed with outcome timeout (no answer) is sent only to API webhooks, or to webhooks whose outcome filter includes timeout.
  • Outcome, agent and source filters skip calls that do not match; a skipped delivery shows as skipped in the delivery log.

Payload fields

The body is a JSON envelope. Call fields are inside data. Text fields without a value are empty strings, not null.

FieldTypeDescription
eventstringEvent name.
timestampstringSend time, UTC ISO 8601.
webhook_idstringThe webhook that sent this request.
project_idstringProject of the webhook.
external_call_idstringCopy of data.external_call_id for convenience.
data.call_idstringCall id. Use it with event as your idempotency key.
data.phone_numberstringClient number.
data.id_orderstringYour lead or order number.
data.call_typestringoutbound or inbound.
data.call_outcomestringOutcome code.
data.call_statusstringCall status.
data.duration_secondsintegerTalk time.
data.agent_id, data.agent_code, data.agent_namestringThe agent.
data.agent_folder_id, data.agent_folder_namestringAgent folder.
data.contact_id, data.contact_namestringCampaign contact card.
data.campaign_id, data.campaign_namestringCampaign.
data.campaign_folder_id, data.campaign_folder_namestringCampaign folder.
data.call_urlstringLink to the call in the cabinet (sign-in required).
data.intake_source_id, data.intake_group_id, data.intake_group_name, data.intake_external_id, data.intake_client_id, data.intake_client_namestringWhere the contact came from: source, group and your lead id.
data.call_summarystringShort summary.
data.transcriptstringConversation text.
data.sentiment, data.sentiment_scorestring, numberSentiment, when computed.
data.key_points, data.action_itemsarrayHighlights and follow-ups.
data.recording_urlstringRecording link.
data.started_at, data.ended_atstringUTC times with Z.
data.external_call_idstringYour id from X-Call-ID.
data.extracted_fieldsobjectFields the agent collected, keyed by your field names.
data.wave_call_attempt, data.wave_is_last_callinteger, booleanCampaign calls: attempt number of this contact, and whether this is the last call to it.
data.sip_status_code, data.sip_status, data.dial_failure, data.attempt_no, data.attempts_chargedmixedDial details, present only when known.
data.will_retry, data.next_retry_atboolean, stringFor carrier_rejected only: whether and when the dialer tries again.
data.sip_headersobjectAll X-* SIP headers of the call, when the call had them and the webhook sends SIP headers.
data.intake_payloadobjectThe body you sent to the source, whole or the selected paths, when enabled on the webhook.
data.call_project_id, data.call_project_namestringOrganization-wide webhooks: the project of the call.

Wave plan fields

With Wave plan fields enabled, campaign calls also carry where the contact is in the calling plan. Values that do not apply are null.

FieldDescription
wave_attempts_limitTotal attempts allowed per contact.
wave_attempts_per_dayAttempts allowed per day.
wave_days_limitNumber of calling days per contact.
wave_day_number, wave_day_attemptCalling day of this call and attempt number within that day.
wave_next_call_atEarliest UTC time of the next call, once the dialer has decided.
wave_last_call_reasonOn the last call only: final_result or attempts_exhausted.

contact_delivery payload

data holds contact_id, status, delivery, reason, message, campaign_id, phone, external_id, intake_source_id, intake_group_id, intake_group_name, project_id, changed_at, previous (the prior status, reason and delivery, or null) and, while waiting, waiting_reason.

Payload examples

Lead from a campaign call

json
{
  "event": "lead_detected",
  "timestamp": "2026-12-01T16:33:40.512331",
  "webhook_id": "9d3f6a20-1c4e-4b7a-8e52-6f0a1b3c9d71",
  "project_id": "5b0f8f7e-2a41-4c3a-9a51-0d1e6c7b8a90",
  "external_call_id": "",
  "data": {
    "call_id": "3e8b1f42-7c6d-4a9e-b0f1-2d5c8a7e6b93",
    "phone_number": "15550100123",
    "id_order": "lead-1001",
    "call_type": "outbound",
    "call_outcome": "client_apruv",
    "call_status": "completed",
    "duration_seconds": 148,
    "agent_id": "0d7e9a1c-4b2f-4e8a-a3c6-5f1b2d9e7c40",
    "agent_name": "Emma",
    "agent_code": "101",
    "agent_folder_id": "",
    "agent_folder_name": "",
    "contact_id": "b51d7e0a-6c3f-4a29-9e84-1f2c7d0b5a36",
    "contact_name": "",
    "campaign_id": "c2a4e7f0-91b3-4c1e-8f5d-7b6a3e9d2c11",
    "campaign_name": "December leads",
    "campaign_folder_id": "",
    "campaign_folder_name": "",
    "call_url": "https://app.benerra.ai/c/3e8b1f42",
    "intake_source_id": "a91e0c33-5d2b-4f8e-b6a7-0e4d9c2f1b58",
    "intake_group_id": "",
    "intake_group_name": "",
    "intake_external_id": "lead-1001",
    "intake_client_id": "",
    "intake_client_name": "",
    "call_summary": "John from Austin is interested in the annual plan and wants a demo on Friday.",
    "transcript": "Agent: Hello, this is Emma from Acme...\nClient: Hi, yes...",
    "sentiment": "",
    "sentiment_score": null,
    "key_points": [],
    "action_items": [],
    "recording_url": "https://app.benerra.ai/recordings/...",
    "started_at": "2026-12-01T16:31:02Z",
    "ended_at": "2026-12-01T16:33:30Z",
    "external_call_id": "",
    "extracted_fields": {
      "client_name": "John Smith",
      "call_comments": "Wants a demo on Friday afternoon"
    },
    "wave_call_attempt": 2,
    "wave_is_last_call": true
  }
}

No answer

json
{
  "event": "call_failed",
  "timestamp": "2026-12-01T14:06:31.004912",
  "webhook_id": "9d3f6a20-1c4e-4b7a-8e52-6f0a1b3c9d71",
  "project_id": "5b0f8f7e-2a41-4c3a-9a51-0d1e6c7b8a90",
  "external_call_id": "",
  "data": {
    "call_id": "e1b7c2d4-0f3a-4e6b-9c58-7a2d1f4e8b60",
    "phone_number": "15550100123",
    "call_type": "outbound",
    "call_outcome": "timeout",
    "call_status": "failed",
    "duration_seconds": 0,
    "campaign_id": "c2a4e7f0-91b3-4c1e-8f5d-7b6a3e9d2c11",
    "campaign_name": "December leads",
    "sip_status_code": 480,
    "attempt_no": 1,
    "wave_call_attempt": 1,
    "wave_is_last_call": false,
    "extracted_fields": {}
  }
}

The example is shortened: the remaining text fields are present as empty strings.

Call transferred from your PBX

json
{
  "event": "call_completed",
  "timestamp": "2026-12-01T18:12:07.220145",
  "webhook_id": "9d3f6a20-1c4e-4b7a-8e52-6f0a1b3c9d71",
  "project_id": "5b0f8f7e-2a41-4c3a-9a51-0d1e6c7b8a90",
  "external_call_id": "crm-call-7781",
  "data": {
    "call_id": "7a0c9e13-2b5d-4f81-a6e4-3c9b0d2e1f75",
    "phone_number": "15550100456",
    "id_order": "ORD-48213",
    "call_type": "inbound",
    "call_outcome": "client_callback",
    "call_status": "completed",
    "duration_seconds": 61,
    "agent_code": "101",
    "agent_name": "Emma",
    "call_summary": "The client asked to be called back tomorrow after 5 pm.",
    "external_call_id": "crm-call-7781",
    "extracted_fields": {"callback_time": "tomorrow after 5 pm"},
    "sip_headers": {
      "X-Agent-ID": "101",
      "X-Lead-ID": "ORD-48213",
      "X-Call-ID": "crm-call-7781",
      "X-Client-Name": "Maria",
      "X-Customer-Tier": "gold"
    }
  }
}

Signature verification

When the webhook has a secret, Benerra computes HMAC-SHA256 of the exact request body bytes with the secret as the key and sends it as X-Webhook-Signature: sha256=<hex>. Verify it against the raw body before parsing JSON; re-serializing the parsed JSON changes the bytes and breaks the check. Compare in constant time.

python
import hashlib
import hmac
from flask import Flask, abort, request

app = Flask(__name__)
SECRET = b"YOUR_WEBHOOK_SECRET"
seen = set()  # use a database table in production

@app.post("/benerra/webhook")
def benerra_webhook():
    raw = request.get_data()  # raw bytes, before JSON parsing
    expected = "sha256=" + hmac.new(SECRET, raw, hashlib.sha256).hexdigest()
    got = request.headers.get("X-Webhook-Signature", "")
    if not hmac.compare_digest(expected, got):
        abort(401)
    body = request.get_json()
    key = (body["event"], body.get("data", {}).get("call_id"))
    if key in seen:
        return "", 200  # duplicate delivery, already processed
    seen.add(key)
    # queue the work and answer fast
    return "", 200
javascript
const crypto = require("crypto");
const express = require("express");

const app = express();
const SECRET = "YOUR_WEBHOOK_SECRET";

app.post("/benerra/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const expected = "sha256=" + crypto.createHmac("sha256", SECRET).update(req.body).digest("hex");
  const got = req.get("X-Webhook-Signature") || "";
  const ok = got.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(got), Buffer.from(expected));
  if (!ok) return res.sendStatus(401);
  const body = JSON.parse(req.body.toString("utf8"));
  // dedupe on body.event + body.data.call_id, then queue the work
  res.sendStatus(200);
});

app.listen(3000);

The body is compact JSON (no spaces after separators) in UTF-8, with non-ASCII characters written as is.

Retries and idempotency

Automatic retries apply to API webhooks. A delivery is retried when:

  • your server could not be reached (connection error or connect timeout), or
  • it answered 429, 502, 503 or 504.

Other 4xx and 5xx answers are not retried. A read timeout after the request was sent is not retried either, because your server may already have processed it; check the delivery log and use redelivery if needed.

Retries follow this schedule after the first failure: 1 minute, 5 minutes, 30 minutes, 2 hours, then every 6 hours. The webhook setting Retries sets how many (0 to 10, default 5). A retry is cancelled if the webhook is disabled or its URL changes.

You can also redeliver by hand in the cabinet or with POST /calls/{call_id}/redeliver.

Idempotency

  • Each call is dispatched once, but retries and redeliveries can bring the same result again. Deduplicate on event plus data.call_id.
  • timestamp is the send time of each attempt, so a retry has a new timestamp and a new signature. Do not use them for deduplication.
  • Answer 2xx to a duplicate you already processed, otherwise it will be retried.

Other destinations

Telegram
A message to a chat or a topic of a group with the outcome, summary, extracted fields, a link to the call and the recording when available. Use the platform bot or your own bot token.
Email
A message to one or more addresses with a configurable subject.
Google Sheets
One row per call appended to your spreadsheet. Share the sheet with the service account email shown in the form as an Editor; column headers are written to an empty sheet on save. A spreadsheet can be connected to one organization only.

These destinations use the same events and filters. Signature, retries and redelivery apply to API webhooks only.

SIP integration

Benerra agents can use phone lines in three ways:

ModeWho dialsTypical use
Our dialer, your trunkBenerraCampaigns call your contacts through your own carrier account and caller numbers.
Transfer from your PBXYour dialer or PBXYour system places or receives the call and hands the live call to an agent with SIP headers.
Inbound lineThe clientClients call a number and reach an agent.

Trunks are added in the cabinet in Telephony. A trunk connects either by registration (username and password) or by IP (an allow list of your signaling addresses), and can be inbound, outbound or both. Benerra support gives you the SIP address, port and the addresses to allow on your side when the trunk is set up. In the examples below sip.benerra.ai stands for that address.

Codecs. Offer G.711 (PCMU and PCMA) as in the example below. A trunk can carry its own codec list, for example ulaw,alaw, if your carrier needs a specific order.

Our dialer, your trunk

  1. Add an outbound trunk with your carrier host, port and credentials (or IP mode) and an optional dial prefix.
  2. Set the caller numbers: one fixed number or a pool that rotates, with an optional hourly cap per number.
  3. Choose which projects may use the trunk, and pick it on the campaign (or let the campaign split traffic between several trunks).

Dial results are recorded on each call: sip_status_code and sip_status keep the final SIP response of a failed attempt. A carrier rejection gives outcome carrier_rejected, a number that does not exist gives number_invalid, no answer gives timeout.

Transfer from your PBX

Your PBX or dialer sends the call (a new INVITE, or a transfer of an answered call) to the Benerra SIP address. The agent is chosen by the X-Agent-ID header, which carries the agent_code. Other headers pass client data that the agent uses in the conversation and that come back in the webhook.

sip
INVITE sip:+15550100999@sip.benerra.ai SIP/2.0
Via: SIP/2.0/UDP pbx.YOUR_DOMAIN:5060;branch=z9hG4bK776asdhds
Max-Forwards: 70
From: "Maria" <sip:+15550100456@pbx.YOUR_DOMAIN>;tag=1928301774
To: <sip:+15550100999@sip.benerra.ai>
Call-ID: a84b4c76e66710@pbx.YOUR_DOMAIN
CSeq: 314159 INVITE
Contact: <sip:+15550100456@pbx.YOUR_DOMAIN:5060>
X-Agent-ID: 101
X-Lead-ID: ORD-48213
X-Call-ID: crm-call-7781
X-Client-Name: Maria
X-Offer-Name: Annual plan
X-Client-Address: 12%20Main%20St%2C%20Austin%2C%20TX
X-Client-Age: 42
X-Client-Gender: f
X-Call-Dir: in
X-Customer-Tier: gold
Content-Type: application/sdp
Content-Length: 142

v=0
o=pbx 2890844526 2890844526 IN IP4 pbx.YOUR_DOMAIN
s=-
c=IN IP4 203.0.113.10
t=0 0
m=audio 49170 RTP/AVP 0 8
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
  • If X-Agent-ID is missing, the call goes to the trunk default agent when one is set in Telephony, otherwise it is rejected. An unknown or inactive agent code is always rejected.
  • Calls over the trunk concurrent-call limit, or while calls of the organization are stopped, are rejected.
  • Every inbound attempt, accepted or rejected, is recorded in the trunk journal in the cabinet with the reason, the headers received and any warnings.
Rejection reasonMeaning
no X-Agent-IDNo agent code and no default agent on the trunk.
unknown agent codeNo agent with this code in the organization.
agent inactiveThe agent is archived or deleted.
IP not in the allow listThe INVITE came from an address not allowed on the trunk.
wrong login or passwordRegistration credentials did not match.
concurrent calls limit exceededToo many calls at once on this trunk.
organization calls are stoppedCalling is paused for the organization.
platform overloadedNo capacity at this moment; retry.

SIP headers

Header names are case-insensitive. Values are plain text unless noted; keep them under 2000 characters.

HeaderWhere it goesDescription
X-Agent-IDagent choiceThe agent_code that takes the call.
X-Lead-IDid_order, {ORDER_NUMBER}Your lead or order number. Lets you find all calls with GET /calls/by-order/{id_order}.
X-Call-IDexternal_call_idYour call id for correlation. Returned in the webhook at the top level and in data.
X-Client-Nameclient_name, {CLIENT_NAME}Client name, plain ASCII.
X-Con-Name{CLIENT_NAME}Client name URL-encoded as UTF-8 (for names with accents). Used when X-Client-Name is empty.
X-Offer-Nameoffer_name, {OFFER}Product or offer the call is about.
X-Client-Address{CLIENT_ADDRESS}Client address, URL-encoded UTF-8.
X-Client-Age{AGE}Age as an integer.
X-Client-Genderagent contextm or f (also male, female). Helps the agent address the client correctly.
X-Call-Dircall_directionin or out: whether the original call on your side was inbound or outbound. X-CALL_DIR is also accepted.
Any other X-*sip_headers, custom variablesStored on the call and sent in data.sip_headers. Map a header to a prompt variable in the trunk settings to use it in the agent text.
  • Up to 40 X-* headers are kept per call; extra ones are dropped with a warning in the trunk journal.
  • The header map of a trunk (up to 30 entries) turns a custom header into a variable, for example X-Customer-Tier into {customer_tier}.
  • X-Org-ID, X-Route and X-Room-Sid are reserved for the platform. Do not send them.
  • A value that is not valid UTF-8 after URL decoding, an unrecognized gender or a non-numeric age is ignored and reported as a warning in the trunk journal; the call still goes through.

Inbound line

To let clients call an agent directly, Benerra support attaches your inbound numbers to a trunk. Calls to those numbers go to the trunk default agent, or, on a shared line, the caller is asked to enter the agent code by tone. Inbound calls produce the same call records and webhooks as outbound calls, with call_type set to inbound.

In Call control you can switch inbound calls off for the whole project or for a single agent; switched-off agents are reported by gate-check as agent_disabled.

Outcomes

call_outcome is the business result of a call. Five system outcomes exist on every agent; their codes never change, although you can rename their labels. Agents can also have custom outcomes with your own codes; those appear in the same field.

System outcomes

CodeLabelMeaning
client_apruvLeadThe client is interested and agreed to the next step. Sends lead_detected.
client_rejectRefusalThe client explicitly declined the offer.
cant_talkCan't talkThe client cannot or does not want to talk now, no decision. Not a refusal.
voicemail_detectedVoicemailVoicemail, an answering robot, a secretary or a voice assistant answered.
silence_hangupSilenceNobody spoke; the call ended in silence.

Other common outcomes

CodeMeaning
call_connectedTransferred to a human operator. Counts as a lead and sends lead_detected.
client_callbackThe client asked to be called back.
call_droppedThe conversation broke off and needs an urgent callback.
no_requestThe client says they never asked to be contacted.
timeoutNo answer.
carrier_rejectedThe carrier rejected the call.
number_invalidThe number does not exist.
technical_errorA technical failure; there was no conversation.

Outcome groups

Reports and the MCP endpoint group outcomes like this:

GroupOutcomes
dozvon (reached)A human answered: client_apruv, client_reject, cant_talk, client_callback, call_dropped, no_request and custom outcomes.
nedozvon (not reached)voicemail_detected, silence_hangup.
techtimeout, carrier_rejected, number_invalid, technical_error.
apruvclient_apruv.
rejectclient_reject.
non_targetno_request.

For a contact with several calls, a lead stays a lead: a later voicemail or callback does not undo it; only an explicit refusal does.

Statuses

Call status

call_status is the technical state of the call, separate from the outcome.

ValueMeaning
initiatedCreated, dialing has started.
ringingThe phone is ringing.
answeredThe call is in progress.
completedThe call ended normally.
failedThe call failed; sends call_failed.
no_answerNobody answered.

Campaign status

ValueMeaning
draftCreated, never launched.
pendingWaiting for launch.
activeRunning: calls are placed during calling hours.
pausedPaused by a user or automatically; stop_reason says why.
completedAll contacts are processed.
stoppedStopped before completion.

In the API list, lifecycle_status is archived for archived campaigns and equals status otherwise.

Contact delivery

See Contact intake responses: queued, waiting, processing, rejected.

Prompt variables

The agent role, greeting and phrases can contain variables in braces. They are replaced with contact data at the start of each call. Names are case-insensitive.

VariableAlso written asFilled from
{CLIENT_NAME}{NAME}, {FIRST_NAME}, {CLIENT}client_name or name in contact data, X-Client-Name, X-Con-Name.
{ORDER_NUMBER}{ORDER_ID}, {ORDER}order_id in contact data, X-Lead-ID.
{OFFER}{PRODUCT}offer or product, X-Offer-Name.
{PRICE}{COST}price or cost in contact data.
{CITY}city in contact data.
{AGE}{CLIENT_AGE}age in contact data, X-Client-Age.
{CLIENT_ADDRESS}client_address in contact data, X-Client-Address.
{LANGUAGE}{LANG}The agent language code.
{your_key}Any custom key from contact data, a campaign file column or a mapped SIP header.
  • Contact data comes from the source variables object, campaign file columns or SIP headers. Translated column names are understood too, for example nombre, ciudad, prix.
  • If a built-in variable has no value, a neutral word in the agent language is used, for example "customer" for the name and "your city" for the city; for the order number and price the variable is left empty.
  • Agents can declare their own variables with default values. A declared variable without a value is removed together with its surrounding spaces, so the client never hears braces.

Languages

Each agent speaks one configured language and keeps it for the whole call unless you allow switching.

CodeLanguage
enEnglish
esSpanish
frFrench
deGerman
itItalian
plPolish
ptPortuguese
roRomanian

Voices come in tiers: Premium voice and Standard+ voice, with more tiers depending on your plan. The language model is chosen per agent by tier as well (Advanced, Fast, Economy). The API and webhooks report only these public tier names.

FAQ

Can I start a single call through the API?

Send the contact to a contact source that delivers to an active campaign. The campaign calls it within its calling hours. For calls your own system places, use transfer from your PBX.

How do I match a call to my lead?

Send your lead id as external_id in the source body (it comes back as data.intake_external_id) or as X-Lead-ID on SIP calls (it comes back as data.id_order). On SIP calls you can also pass your own call id in X-Call-ID.

Where do the extracted fields come from?

You define them on the agent, each with a name and an instruction. After the call they are filled from the conversation and sent in data.extracted_fields under those names.

Why did the outcome change a few seconds after the call?

Right after hangup the call is analyzed once more and fields are extracted. Webhooks are sent after this step; when reading through the API immediately, wait until outcome_final is true in by-order, or re-read the call a little later.

I did not get a webhook for a call.

Check the call delivery log in the cabinet or with GET /calls/{call_id}/deliveries. Common causes: the event is not subscribed, an outcome or agent filter skipped it, it was a test call, or your server answered with an error that is not retried.

Is the recording link public?

Treat recording_url as sensitive and do not publish it. Download the file to your storage if you need to keep it.

Which IP addresses do webhooks come from?

Ask Benerra support for the current list if your firewall needs an allow list, and verify the signature in any case.

Changelog

Version 1.0, December 2026

  • First public release of the Benerra AI integrator documentation.
  • Demo links: public pages to talk to an agent in the browser, created in the cabinet or with the demo_links permission.
  • API keys with project scope and permissions, uniform error codes and rate limits.
  • Contact intake with simple and detailed responses, Contacts API and contact_delivery event.
  • Calls, campaigns, statistics, deliveries and redelivery, call control, agent configuration, text test API and analytics over MCP.
  • Signed webhooks with automatic retries; Telegram, email and Google Sheets destinations.
  • SIP integration: own trunks, transfer from your PBX with headers, inbound lines.