Skip to Content
CallMitraDocs
API referenceWebhooks

Set an agent's post-call webhook

After each of this agent's calls, a summary is POSTed to `url` (used when the campaign has no webhook of its own). `trigger` picks which calls are sent: `every`, `completed` or `voicemail`. Send an empty `url` to turn it off. Omit `secret` to keep the stored one; the secret is never returned (`hasSecret` says whether one is set). The change applies to the live agent at once. A URL that does not point at a public internet address is refused with `agent_state_blocked`.

PUT
/api/v1/agents/{agent_id}/post-call-webhook

After each of this agent's calls, a summary is POSTed to url (used when the campaign has no webhook of its own). trigger picks which calls are sent: every, completed or voicemail. Send an empty url to turn it off. Omit secret to keep the stored one; the secret is never returned (hasSecret says whether one is set). The change applies to the live agent at once. A URL that does not point at a public internet address is refused with agent_state_blocked.

Authorization

headerX-API-Key<token>

Create in the console: Settings → API & webhooks.

Path Parameters

agent_id*Agent Id

Request Body

application/json
  1. body

Where to send each call's summary for this agent.

secret?|

Signing secret. Omit to keep the current one.

trigger?Trigger

Which calls are sent: every call, completed calls only, or voicemails only.

Default"every"
Value in"every""completed""voicemail"
url?Url

HTTPS URL. Empty removes the webhook.

Lengthlength <= 2000
Default""

Response Body

OK

application/json
  1. response

The agent and its updated post-call webhook.

agent*

An AI agent: its live configuration, draft, status and numbers.

success?Success

Always true on success.

Defaulttrue
webhook*

The agent's post-call webhook (the secret itself is never returned).

[key: string]?any
Example Request
curl -X PUT 'https://api.callmitra.ai/api/v1/agents/string/post-call-webhook' \  -H 'Content-Type: application/json' \  -d '{  "secret": "whsec_example",  "trigger": "completed",  "url": "https://example.com/hooks/calls"}'
Example Response
{  "agent": {    "id": "3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10",    "name": "Priya",    "status": "published"  },  "success": true,  "webhook": {    "hasSecret": true,    "trigger": "completed",    "url": "https://example.com/hooks/calls"  }}