Operations
Operations

Set post-call field

Add or replace one post-call field, matched by name. The post-call analysis fills each field from the call, in the same pass that writes the call summary, and post-call functions read the value as {{name}} in their inputs, requests and messages, and in their conditions. A field is {name, type, description, choices?}: type text, choice (the analysis picks one of `choices`, at least one), boolean (true or false) or number. The description says what to pull from the call, such as "The day and time the caller wants a callback". A value the call never gave is left empty. Names are snake_case, unique, and never a built-in post-call variable such as call_summary or customer_name. Up to 20 fields. Pass `previousName` to rename; functions that read the old name keep reading it until you change them with set_workflow_function. Works on a draft, or on a published latest version when you pass draftFrom.

POST
/operations/set_post_call_field

Authorization

bearerAuth
AuthorizationBearer <token>

A personal access token from Settings > API tokens.

In: header

Header Parameters

Idempotency-Key?string

A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.

Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/operations/set_post_call_field" \  -H "Content-Type: application/json" \  -d '{    "field": {      "name": "string",      "type": "text"    },    "agent": "string"  }'
{}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}

Set post-call analysis POST

Set this version's summary instructions for the post-call analysis. The analysis still writes a one-sentence summary of every call; these instructions say what else it must cover. Post-call functions read the summary as {{call_summary}}. Up to 1000 characters. The on/off switch for the whole analysis is agent-wide and is not set here. Works on a draft, or on a published latest version when you pass draftFrom.

Set pre-call functions POST

Set the agent's pre-call functions: some of its own tools, run before the conversation starts so the agent begins already holding the caller's record (a CRM or directory lookup, their open tickets) instead of opening with 'let me pull up your details'. This is Retell's pre-call functions slot. Each function names a tool, the arguments to send (literal text, a {{caller.*}} field such as {{caller.number}} on a phone call or {{caller.email}} from a Teams sign-in, or a {{variable}} an earlier function maps) and, optionally, response fields to keep as variables for later functions (e.g. {"caller_sys_id": "result.0.sys_id"}). They all start together; one that uses another's variable runs after it, and is skipped when that variable came back empty. Every call that returned a result reaches the agent in its call context, before the caller's first words, on every phone call, Teams call, chat and eval. The tools run as they do when the model calls them (same URL, headers, secrets and mocks). This list is read only while the version's workflow has no pre-call functions; prefer set_workflow_function. Pass the whole list; [] removes them. Use when the operator says 'look the caller up before the call', 'the agent should already know who's calling', 'stop it saying let me pull up your details', or asks for Retell-style pre-call functions, dynamic variables or an inbound call webhook.