Post-call actions over the API
Send every call's results to email, a webhook, WhatsApp, Google Sheets, Slack, your CRM or a workflow, and add, change or remove those deliveries from your own code.
When a call ends, your agent runs its post-call actions. Each action sends the call's results somewhere: an email report, a webhook to your server, a new row in a Google Sheet, a Slack message or a CRM record.
With the API you manage these actions one at a time. Add a webhook, and the agent's other actions stay exactly as they were, including the ones set up in the dashboard.
What your agent can send after a call
A call report in any inbox.
Webhook
The full call data, POSTed to your server.
Google Sheets
One new row per call.
Slack
A message in the channel you pick.
Salesforce
A Lead, Contact, Case or other record.
HubSpot
A contact, company, deal or ticket.
Zoho Bigin
A call log, and the contact created or updated.
Omni CRM
The caller and the call, in your built-in CRM.
An approved template sent to the caller.
Workflow
One of your workflows, started with the call's data.
How it works
- 1
Connect the account once in the dashboardOptional
Under Integrations. One connection works for every agent in your workspace. - 2
Look up its idOptional
GET /integrations lists your connections with their ids. - 3
Add an action to the agent
POST one action. The agent's other actions are not touched. - 4
After every call, the action runs
Delivered
To the inbox, URL, sheet, channel or workflow you chose.
Waiting for publish
Only if the agent is published: publish it in the dashboard.
Your step Done for you
Before you start
- Your API key goes in the
Authorization: Bearerheader. - For Google Sheets, Slack, Salesforce, HubSpot or Zoho Bigin, connect the account once in the dashboard under Integrations. Signing in to Google or Slack has to happen in a browser, so the API can't do that part.
- Resellers can manage a client's agent by adding
user_id. See Acting as clients.
Step by step
See the agent's actions
API reference: List post-call actions
curl "https://omnidim.io/api/v1/agents/158910/post-call-actions" \
-H "Authorization: Bearer YOUR_API_KEY"You get every action with its id and type:
{
"actions": [
{
"id": 63535,
"type": "email",
"recipients": ["demo@example.com"],
"include": ["summary"],
"extracted_variables": [],
"trigger_call_statuses": ["completed", "voicemail_detected"]
}
],
"applies_after_publish": false
}Add a webhook
API reference: Add a post-call action
curl -X POST "https://omnidim.io/api/v1/agents/158910/post-call-actions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c2d9e-0b7a-4c1e-9a55-3e2f8b1d7c40" \
-d '{
"type": "webhook",
"url": "https://crm.acme-corp.io/omnidim-callback",
"include": ["summary", "extracted_variables"],
"extracted_variables": [
{ "key": "outcome", "prompt": "Did the caller book an appointment?" }
],
"trigger_call_statuses": ["completed", "failed"]
}'You get the new action back, with its id:
{
"action": {
"id": 63536,
"type": "webhook",
"url": "https://crm.acme-corp.io/omnidim-callback",
"include": ["summary", "extracted_variables"],
"extracted_variables": [
{ "key": "outcome", "prompt": "Did the caller book an appointment?" }
],
"trigger_call_statuses": ["completed", "failed"]
},
"applies_after_publish": false
}- The
urlmust be a real, public address. Placeholder hosts likeexample.com,localhostand private network addresses are refused. - The
Idempotency-Keyis any unique string you choose, up to 255 characters. If your request times out and you send it again with the same key and body, you get the same action back instead of a second copy.
Check that it works
Before you point the webhook at your real server, try it with a free test inbox:
- Open webhook.site and copy your unique URL.
- Add a webhook action with that URL, as in the step above.
- Make a short test call to the agent and hang up.
- Watch webhook.site. The call data arrives shortly after the call ends, once the summary and variables are ready.
The data you see is described in
What a webhook receives. When it looks right,
change the action's url to your server.
Add Google Sheets, Slack or a CRM
API reference: List integrations, Add a post-call action
First, find the id of the account you connected:
curl "https://omnidim.io/api/v1/integrations" \
-H "Authorization: Bearer YOUR_API_KEY"Pick the entry whose integration_type is google_sheets (or slack,
salesforce, hubspot, zoho_bigin). Pass its id as integration_id:
curl -X POST "https://omnidim.io/api/v1/agents/158910/post-call-actions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "google_sheets",
"integration_id": 812,
"spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
"worksheet_name": "Calls",
"include": ["summary", "extracted_variables"],
"extracted_variables": [
{ "key": "customer_name", "prompt": "The caller'\''s full name." }
]
}'- The
spreadsheet_idis the part of the sheet's link after/d/. - Each call adds one new row. The row includes the call's details, such
as
call_id,call_date,phone_number,to_number,from_number,call_direction,call_status, the call duration,recording_urlandbot_name. Every variable extracted on the call gets its own column, from all of the agent's actions, not only this one.summary,sentimentand the full conversation are added when youincludethem. call_dateis in the agent's timezone, not UTC. See Agent timezone.- Bulk call campaigns add
bulk_call_name,retry_countand onemetadata_<key>column for each key in the contact'smetadata. - Columns are created from the first call, and new ones are added when later calls bring new fields.
Change an action
API reference: Update a post-call action
Send only what changes. Everything else stays the same.
curl -X PATCH "https://omnidim.io/api/v1/agents/158910/post-call-actions/63536" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://crm.acme-corp.io/omnidim-callback-v2" }'An action can't change its type. To switch, remove it and add a new one.
Remove an action
API reference: Delete a post-call action
curl -X DELETE "https://omnidim.io/api/v1/agents/158910/post-call-actions/63536" \
-H "Authorization: Bearer YOUR_API_KEY"The agent's other actions stay as they are.
Action types
type | What it does | You must send |
|---|---|---|
email | Emails the call report | recipients |
webhook | POSTs the call data to your URL | url |
omni_crm | Logs the call in Omni CRM | Nothing extra |
cloud_whatsapp | Sends a WhatsApp template | phone_number_id. Also send a template_id or templates, or nothing is sent. |
workflow | Runs one of your workflows | workflow_id. The workflow must be published, or the action is skipped. |
google_sheets | Adds a row to a sheet | integration_id, spreadsheet_id |
slack | Posts in a Slack channel | integration_id, plus channel_id or channel_name |
salesforce | Creates a Salesforce record | integration_id (creates a Lead unless you set object_name) |
hubspot | Creates a HubSpot record | integration_id, object_name |
zoho_bigin | Logs the call in Zoho Bigin | integration_id |
A workflow action starts the workflow's published version with the call's
details and transcript, plus the summary, sentiment and extracted variables
when the call produced them. To create and publish a workflow from your code, see
Build with the API. Its
List workflows call gives you
the workflow_id.
Every type also accepts three options:
include: what to send. Pick fromsummary,extracted_variables,fullConversationandsentiment. Zoho Bigin, workflow and WhatsApp always receive extracted variables. See How extracted variables work.extracted_variables: details for the agent to pull out of the conversation, each akeyand aprompt. Salesforce and HubSpot send a fixed set of fields, so they take none.trigger_call_statuses: which call outcomes run the action. If you leave it out, the action runs oncompletedandvoicemail_detected.
Every field is listed in the Add a post-call action reference.
When a change goes live
Most agents: right away. The next call uses it, and every response says
"applies_after_publish": false.
Agents you publish in the dashboard: calls use the published version. The
response says "applies_after_publish": true, and your change goes live the
next time you publish. See
Agent versioning and publishing.
Finding your action again
An action's id can change. Saving post-call changes in the dashboard, or
restoring an older version, gives every action a new id.
So don't keep the id. When you need your action again, list the actions and match it by what it points at:
- a webhook by its
url - an email by its
recipients - Sheets, Slack or a CRM by its
integration_id
Your actions are safe from the dashboard, too. If someone has the agent open in the dashboard while you add an action, their next save keeps yours. Their own post-call change in that save is not applied: the dashboard shows the current list and asks them to make it again.
Errors
| Status | What it means |
|---|---|
400 | Something in the action is wrong, like a missing field or another workspace's integration_id. Nothing is saved. |
401 | The API key is missing or wrong. |
403 | The key's user isn't allowed to change agents. |
404 | The agent or action wasn't found. List the actions to find its current id. |
409 | The Idempotency-Key was already used with a different request. Use a new key for a new request. |
Every error comes back as { "error": "...", "error_description": "..." },
and the description tells you what to fix.
Related
Post-call actions in the dashboard
Set up the same deliveries in the agent editor, and see the webhook payload.
Per-call post-call actions
Send one call's results somewhere else, chosen when you dial.
List integrations
Find the id of an account you connected in the dashboard.
Acting as clients
Manage your clients' agents with your reseller key.
Was this page helpful?
FAQ
Common questions about running client accounts on the reseller API, from keys and access to credits, verification, and branding.
Per-call post-call actions
Choose where one specific call's results are sent, and which variables are extracted, at dial time, without changing the agent's own configuration.
