Add a post-call action
Add one post-call action to the agent. The agent's other actions are not changed. Send an `Idempotency-Key` header to make a retry safe: the same key and body return the action the first request added.
agent_idrequiredReseller keys only: act as one of your clients by its user id. Omit it to act on your own account. [How acting for a client works](/docs/reseller/your-clients/acting-as-clients).
The channel. It cannot change after the action is created: delete it and add a new one. google_sheets, slack, salesforce, hubspot and zoho_bigin deliver through an account connected in the dashboard: pass its id as integration_id (see List integrations).
google_sheets, slack, salesforce, hubspot, zoho_bigin only, required: the id of your integration of that type.
curl -X POST 'https://backend.omnidim.io/api/v1/agents/{agent_id}/post-call-actions' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -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" ] }'
{ "action": { "id": 0, "type": "email", "recipients": [ "string" ], "url": "string", "phone_number_id": 0, "template_id": 0, "template_variables": [ "string" ], "templates": [ "string" ], "workflow_id": 0, "integration_id": 0, "spreadsheet_id": "string", "spreadsheet_name": "string", "worksheet_name": "string", "channel_id": "string", "channel_name": "string", "object_name": "string", "create_call_log": false, "update_contact": false, "create_contact": false, "include": [ "string" ], "extracted_variables": [ { "key": "customer_issue", "prompt": "Identify the main issue the customer is experiencing." } ], "trigger_call_statuses": [ "string" ] }, "applies_after_publish": false }
BearerAuthAuthorizationBearer <token>Bearer token authentication. Obtain your API key from the OmniDimension dashboard.
agent_id*integerThe ID of the agent.
Idempotency-Key?stringAny unique string. A retry with the same key and body adds nothing new.
application/jsonOne post-call action. type picks the channel; send the fields of
that channel plus any of the shared ones. type is required when
adding an action; an update sends only the fields it changes.
user_id?ClientUserIdReseller keys only: act as one of your clients by its user id. Omit it to act on your own account. How acting for a client works.
type*stringThe channel. It cannot change after the action is created:
delete it and add a new one. google_sheets, slack,
salesforce, hubspot and zoho_bigin deliver through an
account connected in the dashboard: pass its id as
integration_id (see List integrations).
"email""webhook""omni_crm""cloud_whatsapp""workflow""google_sheets""slack""salesforce""hubspot""zoho_bigin"integration_id?integergoogle_sheets, slack, salesforce, hubspot, zoho_bigin
only, required: the id of your integration of that type.
spreadsheet_id?stringgoogle_sheets only, required: the id in the sheet's URL, the
part after /d/.
spreadsheet_name?stringgoogle_sheets only: the sheet's name, for display.
worksheet_name?stringgoogle_sheets only: the tab to append to. Defaults to Sheet1.
channel_id?stringslack only: the channel id. Send this or channel_name.
channel_name?stringslack only: the channel name. Send this or channel_id.
object_name?stringsalesforce: Lead (default), Contact, Account,
Opportunity, Case, Task or Product. hubspot, required:
contact, company, deal or ticket. Both send a fixed set of
fields for the chosen object, so they take no extracted_variables.
create_call_log?booleanzoho_bigin only: log the call in Zoho Bigin. Defaults to true.
update_contact?booleanzoho_bigin only: update a matching contact with what the call captured. Defaults to true.
create_contact?booleanzoho_bigin only: create a contact when no contact matches. Defaults to true.
recipients?array<string>email only, required: the addresses to notify.
url?stringwebhook only, required: the endpoint that receives a POST with the call payload.
uriphone_number_id?integercloud_whatsapp only, required: your Cloud WhatsApp number the message is sent from. Also send template_id or templates, or nothing is sent.
template_id?integercloud_whatsapp only: an approved template on that number.
template_variables?cloud_whatsapp only: which extracted variable fills each template placeholder.
templates?cloud_whatsapp only: one or more templates to send.
workflow_id?integerworkflow only, required: the workflow to run. It must have a published version, or the action is skipped.
include?array<string>Which sections to include.
extracted_variables?Variables the model should pull out of the conversation. A key
already used by another action on this agent must have the same
prompt, or the request is refused with 400. Other actions are
never changed to match.
trigger_call_statuses?array<string>Call outcomes that fire this action. Omit to use the default
(completed, voicemail_detected).
Response body
application/jsonThe action was added.
application/jsonaction?One post-call action on an agent, with the fields of its type.
applies_after_publish?AppliesAfterPublishFalse for an agent that has never been published: the change is live on the next call. True when the agent is published: changes go to the draft, so they reach live calls only after you publish the agent in the dashboard.
