Agents
Edit agent
Updates and publishes an existing agent. Only the fields you include are changed; everything else is left untouched. All fields are optional, so you can send partial updates.
Authentication
AuthorizationBearerAuthenticate server-side requests with a Fonema API key. Create one in the API keys section of the Dashboard and send it in the Authorization header as Bearer <token>. Keep keys out of client-side code and public repositories.
Path parameters
slugstringRequiredBody
Top-level parameters
namestringOptionalgreetingstringOptionalpromptstringOptionaltextPromptstringOptionalfarewellstringOptionalvoiceIdstringOptionalVoice identifier for the agent. Get available values from List voices.
outputVariablesarrayOptionalVariables to capture during the call (same shape as in Create agent).
recallLogicobjectOptionalRetry configuration for calls that are not answered. See recallLogic.
numberOfAttemptintegerOptionalallowReturnCallbooleanOptionallocalizationsobjectOptionalworkingHoursobjectOptionalHours when the agent can place calls. See workingHours.
dtmfbooleanOptionaltransferCallDestinationsarrayOptionalPhone numbers the agent can transfer the call to. An empty array disables transfers. See transferCallDestinations.
endOfCallWebhookstringOptionalendOfSessionWebhookstringOptionalcallUpdatesWebhookstringOptionalknowledgeBaseFilesinteger[]OptionaltoolsarrayOptionalconfigobjectOptionaltools items
tools[].idintegertools[].namestringcontent.functionName if omitted.tools[].typestringAPI_CALL).tools[].descriptionstringtools[].variablesarraytools[].contentobjectconfig object
config accepts the same configuration as several top-level fields. You can send values either at the top level or inside config — top-level fields take precedence when both are present. Supported keys:
transcriberLanguage, endOfCallMessage, silenceTimeoutSeconds, silenceMessages, maxDurationSeconds, voice, captureDataVariables, endOfCallWebhook, endOfSessionWebhook, callUpdatesWebhook, allowReturnCall, workingHours, dtmf, transferCallDestinations, localizations.
The keys that only exist inside config are:
config.transcriberLanguagestringLanguage the agent listens in. One of es, es-419 (Latin American Spanish), en, pt, pt-BR, ro.
config.endOfCallMessagestringfarewell.config.silenceTimeoutSecondsnumberconfig.silenceMessagesstring[]Phrases the agent says when the caller stays silent (one is picked at random) before the silence timeout ends the call. Only used when silenceTimeoutSeconds is set. Sending this field replaces the whole list; send [] to clear it.
config.maxDurationSecondsnumberconfig.voiceobjectFine-tuning of the agent voice. See config.voice.
config.captureDataVariablesarrayoutputVariables.config.voice object
config.voice.stabilitynumber0 – 1Higher values sound more stable and consistent; lower values sound more expressive and variable.
config.voice.similarityBoostnumber0 – 1How closely the generated audio matches the original voice (clarity).
config.voice.speednumber0.7 – 1.2Speaking speed. 1 is normal speed.
Only the keys you send are changed; the rest keep their current value.
recallLogic object
Controls automatic retries when a call is not answered (no answer, busy, voicemail, etc.).
recallLogic.allowRetrybooleanrecallLogic.triesarrayOne item per retry, in order. Each item is { "waitMinutes": number }: minutes to wait after the previous unanswered attempt before calling again. The number of items is the number of retries.
recallLogic.timeZonestringDefaults to America/Mexico_CityIANA time zone used to schedule retries (e.g. America/Mexico_City). Defaults to America/Mexico_City.
recallLogic.scheduleTypestringSAME_AS_WORKING to retry only within workingHours, or CUSTOM to use availability.
recallLogic.availabilityobjectRetry hours when scheduleType is CUSTOM. Same shape as workingHours.availability.
tries, availability and scheduleType are replaced as a whole every time you send recallLogic, so always send the complete list of tries.
Example: retry twice, 30 and 120 minutes after an unanswered call, for a total of 3 attempts:
{
"numberOfAttempt": 3,
"recallLogic": {
"allowRetry": true,
"timeZone": "America/Mexico_City",
"scheduleType": "SAME_AS_WORKING",
"tries": [{ "waitMinutes": 30 }, { "waitMinutes": 120 }]
}
}
workingHours object
workingHours.typestringALL_DAY (no restriction) or CUSTOM.workingHours.availabilityobjectRequired when type is CUSTOM. Keys are days (monday … sunday); each value is a list of { "start": "HH:mm", "end": "HH:mm" } windows. Days that are missing or empty are unavailable.
{
"workingHours": {
"type": "CUSTOM",
"availability": {
"monday": [{ "start": "09:00", "end": "18:00" }],
"tuesday": [{ "start": "09:00", "end": "14:00" }, { "start": "16:00", "end": "19:00" }]
}
}
}
transferCallDestinations items
Each destination is a phone number the agent can transfer the call to. Send an empty array to disable transfers.
transferCallDestinations[].numberstringRequiredDestination phone number in E.164 format (e.g. +525512345678).
transferCallDestinations[].messagestringOptionaltransferCallDestinations[].extensionstringOptionaltransferCallDestinations[].descriptionstringOptionalWhen the agent should transfer to this number. The agent uses it to choose the right destination.
{
"transferCallDestinations": [
{
"number": "+525512345678",
"message": "Let me transfer you to an advisor, one moment please.",
"description": "Transfer when the customer asks to speak with a human advisor."
}
]
}
Response
Returns the full, updated agent — the same structure as Get agent.
Errors
400403