Update Post-call Settings

Post-call

Update Post-call Settings

Changes what an agent does after each call; send only what you are changing. collectFields replaces the whole list, and an empty list stops collecting (details already collected are kept). Any other key is refused — the rest of the agent belongs to Update Agent. followUp sets the WhatsApp and/or SMS sent to the caller when a call ends, and is partial: what it leaves out keeps what is saved. A WhatsApp template must be an approved Utility one; an SMS needs a connected SMS provider. Answers with the settings as they now stand. A build key may do this, except followUp: it messages customers, so it needs a full key.

PATCH/agents/{id}/post-call

Path parameters

idstringrequired
The agent's ag_… id.

Headers

Katexs-Workspacestring
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.

Request body

summariseCallsboolean
Write a short summary after each call.
recordCallsboolean
Record each call.
collectFieldsobject[] | null
The details to fill from every call, replacing the list. An empty list (or null) stops collecting.
followUpobject
The message sent to the caller when a call ends. Partial: anything left out keeps what is saved. Set a channel with its list (whatsappTemplates, smsTemplates, up to 3 each, sent in order; an empty list stops it) or with the single field (whatsapp, sms), which replaces the list with that one template, or null to stop it. Not both for one channel.
followUp.whenstring
One of: answered, missed, all.
followUp.whatsappobject | null
One channel of the post-call message, or null when that channel is not sent.
followUp.whatsappTemplatesobject[]
The WhatsApp Utility templates to send, in order.

Example request

bash
curl -X PATCH "https://app.katexs.com/api/v1/agents/{id}/post-call" \
  -H "Authorization: Bearer $KATEXS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "summariseCalls": true,
  "recordCalls": true,
  "collectFields": [
    {
      "name": "budget",
      "type": "number",
      "description": "Budget in dollars"
    },
    {
      "name": "interest",
      "choices": [
        "Hot",
        "Warm",
        "Cold"
      ]
    }
  ],
  "followUp": {
    "when": "answered",
    "sms": {
      "templateId": "8d2e4f6a-1b3c-4d5e-9f70-a1b2c3d4e5f6",
      "values": [
        "customer_name",
        "fixed:example.com/book"
      ]
    }
  }
}'

Responses

StatusDescription
200The agent's post-call settings, after the change.
400The body is empty, names something that is not a post-call setting, or a value breaks its rule.
401The key is missing, wrong or revoked. The answer is always the same, whichever it is.
403The key's access level (read-only or build) does not allow this request, the plan does not include it, or a customer's key named another workspace in Katexs-Workspace. code says which: key_scope_read, key_scope_build, workspace_header_forbidden, or forbidden.
404No agent with that id in this workspace.
409summariseCalls or recordCalls on an agent that takes no calls. Set it up for calls first.
410The customer named in Katexs-Workspace was deleted. POST /customers/{id}/restore brings it back until its erase date.
429Over a per-minute limit. Wait for Retry-After seconds. code and limit say which limit: rate_limit_resources (240 requests a minute for the workspace), rate_limit_family (2,400 across a developer's customers), rate_limit_calls, rate_limit_messages, rate_limit_codes, rate_limit_code_recipient, concurrent_calls or number_daily_limit.

Response fields

agentstringrequired
The agent's ag_… id.
takesCallsbooleanrequired
False when the agent takes no calls — the two switches then do nothing.
summariseCallsbooleanrequired
Writes a short summary after each call.
recordCallsbooleanrequired
Records each call.
recordingKeptDaysintegerrequired
How long your plan keeps a recording before deleting it.
collectFieldsobject[]required
The details filled from every call.
collectModestring | nullrequired
Read only. parser reads the transcript after the call; tool has the agent save the details as it goes. Null when nothing is collected. Chosen in the console on the agent's Actions page. One of: parser, tool.
followUpobject | nullrequired
The messages sent to the caller when a call ends — up to 3 WhatsApp templates, sent in order. Sent once per call, never to a number on the do-not-call list, and at most once a day to the same number on each channel.
200 response
{
  "agent": "ag_5c4a5f93-2b1e-4d7a-9f60-8e2d1c3b4a71",
  "takesCalls": true,
  "summariseCalls": true,
  "recordCalls": true,
  "recordingKeptDays": 49,
  "collectFields": [
    {
      "name": "budget",
      "type": "number",
      "description": "Budget in dollars",
      "choices": null
    },
    {
      "name": "interest",
      "type": "text",
      "description": null,
      "choices": [
        "Hot",
        "Warm",
        "Cold"
      ]
    }
  ],
  "collectMode": "parser",
  "followUp": {
    "when": "answered",
    "whatsapp": {
      "templateId": "3f1c2b7e-9a41-4f0b-8e2d-5c6a7b8d9e01",
      "values": [
        "customer_name",
        "business_name"
      ]
    },
    "sms": {
      "templateId": "8d2e4f6a-1b3c-4d5e-9f70-a1b2c3d4e5f6",
      "values": [
        "customer_name",
        "fixed:example.com/book"
      ]
    }
  }
}

Last updated November 2026 · Found a problem? Email support@katexs.com