Set pre-call functions
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.
Authorization
bearerAuth A personal access token from Settings > API tokens.
In: header
Header Parameters
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.
1 <= length <= 255Request 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_pre_call_functions" \ -H "Content-Type: application/json" \ -d '{ "functions": [ { "tool": "string", "args": { "property1": "string", "property2": "string" } } ], "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 field POST
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.
Set pronunciations POST
Replace the agent's custom pronunciations. Each entry teaches the voice (text-to-speech) to SAY a word a specific way ('Joondalup' → 'Joondahlup', 'Matte' → 'Mahtay'), the SPEAK side. Distinct from set_keyterms, which boosts speech-to-text recognition, the HEAR side; use set_pronunciations when the agent mispronounces a term, set_keyterms when it mishears one. The voice reads case from capitalisation, so write each word as it should appear. Pass the FULL list; the existing entries are replaced.