Skip to navigation

Update agent

View as Markdown

Updates specific fields of an agent using its UUID. At least one field must be provided. Omitted keys are unchanged. New voice/runtime fields do not accept null (use empty string to clear voicemail or call-limit messages). LLM cannot be changed via API. Caution: When updating prompts or tools, include all data you want to keep (GET first, merge, then PATCH).

Authentication

X-API-Keystring

API key for authentication. Example: raya_ABCD1234567890abcdef

Path parameters

idstringRequiredformat: "uuid"
The UUID of the agent

Request

This endpoint expects an object.
namestringOptional
Agent name. If provided, replaces the existing name.
instructionsstringOptional
Instructions that define agent behavior. If provided, replaces the agent's instructions.
output_fieldslist of objectsOptional

Array of key-description pairs. Each item has key and description only. If provided, replaces the agent’s output_fields.

output_instructionsstringOptional

Instructions for how to populate output_fields after a call. If provided, replaces the agent’s output_instructions.

webhook_urlstringOptionalformat: "uri"

Webhook URL for callbacks (sent on call completed or call failure). Must be a valid URL or null. See Webhooks for payload format and when webhooks are sent.

required_silence_after_speechdoubleOptional>=0
Required silence after speech in seconds
allowed_silence_before_nudgedoubleOptional>=0
Allowed silence before nudge in seconds
allowed_speech_before_nudgedoubleOptional>=0
Allowed speech before nudge in seconds
out_diddoubleOptional
Outbound DID number for the agent's phone record
allow_call_transferbooleanOptional

When true, the voice agent may use live call transfer to a human (India only).

transfer_destination_phonestring or nullOptionalformat: "^[0-9]{10}$"
India mobile, 10 digits, no country code. Null clears stored transfer destination.
language_idstringOptionalformat: "uuid"

Call language UUID. Use Auto detect (88296485-1c49-4931-919e-7333986e16da) for an agent that speaks several languages. See Language options.

voice_idstringOptionalformat: "uuid"

Voice UUID. See /documentation/agent-voice-options.

languageslist of stringsOptional

Languages the agent speaks, as ISO 639-1 codes (hi, en, mr, te, kn, bn, as, gu, ml, ne, ta, pa). The first is the starting language. Two or more need language_id set to Auto detect (88296485-1c49-4931-919e-7333986e16da) and a multilingual voice_id that speaks all of them; otherwise the request gets a 400. More than 4 is allowed, but the response then has a note in messages: detection gets less reliable as the list grows (we recommend 3 or fewer). See Language options.

stt_language_modeenumOptional

How the caller’s language is detected. auto: detect every turn. lock: lock to the first detected language, code-mix on (the caller can still mix in other languages). handoff: lock to the detected language, code-mix off. On the portal: Detect every turn / Lock to detected language (code-mix on or off).

Allowed values:
default_voice_idstring or nullOptionalformat: "uuid"

Starting voice when voice_id is a composite voice (a mix of one voice per language that our team prepares on request): one of that composite’s member voices. null clears it. Any other voice gets a 400.

toolsobjectOptional

Function tools. Replaces the entire llm_tools list when provided.

allow_interruptionbooleanOptional
Whether the user may interrupt the agent while speaking.
min_user_speech_to_interruptdoubleOptional>=0

Minimum user speech duration (seconds) before interruption is allowed.

max_call_duration_minsdoubleOptional>=0
Maximum call duration in minutes.
say_hellobooleanOptional
Whether the agent says hello at call start.
voicemail_msgstringOptional
Voicemail message. Empty string clears the stored message.
call_duration_exceed_messagestringOptional
Message when max call duration is reached. Empty string clears the stored message.
in_diddouble or nullOptional
Inbound DID. Must be assigned to your account. Send null to clear.

Response

Agent updated successfully
uuidstringOptionalformat: "uuid"
Unique identifier of the agent
namestringOptional
Name of the agent
instructionsstringOptional
Agent instructions
output_instructionsstringOptional

Instructions for how to populate output_fields after a call.

output_fieldslist of objectsOptional

Array of key-description pairs. Each item has key and description only (no extra properties).

agent_argsmap from strings to anyOptional

Agent arguments as a JSON object (e.g. {“contact_name”: “John”, “order_id”: “123”}). Not an array.

required_silence_after_speechdouble or nullOptional
Required silence after speech in seconds
allowed_silence_before_nudgedouble or nullOptional
Allowed silence before nudge in seconds
allowed_speech_before_nudgedouble or nullOptional
Allowed speech before nudge in seconds
out_diddouble or nullOptional
Outbound DID number
in_diddouble or nullOptional

Inbound DID number (read-only; for reference)

webhook_urlstring or nullOptional

Webhook URL for callbacks (sent on call completed or call failure). See Webhooks for payload format.

allow_call_transferbooleanOptional

When true, the voice agent may use live call transfer to a human (India only). Default true.

transfer_destination_phonestring or nullOptionalformat: "^[0-9]{10}$"
India mobile, 10 digits, no country code. Null or omit if not using transfer.
language_idstring or nullOptionalformat: "uuid"

Call language UUID. See /documentation/agent-language-options.

voice_idstring or nullOptionalformat: "uuid"

Voice UUID. See /documentation/agent-voice-options.

languageslist of stringsOptional

Languages the agent speaks (ISO 639-1); the first is the starting language. Empty for a single-language agent.

stt_language_modeenumOptional

How the caller’s language is detected: auto (every turn), lock (first detected language, code-mix on) or handoff (lock, code-mix off).

Allowed values:
default_voice_idstring or nullOptionalformat: "uuid"

Starting voice of a composite voice_id, or null.

toolsobjectOptional

Function tools ({ "llm_tools": [...] }). Empty array when none configured.

allow_interruptionbooleanOptional
Whether the user may interrupt the agent while speaking.
min_user_speech_to_interruptdouble or nullOptional>=0

Minimum user speech duration (seconds) before interruption is allowed.

max_call_duration_minsdouble or nullOptional>=0
Maximum call duration in minutes.
say_hellobooleanOptional
Whether the agent says hello at call start.
voicemail_msgstring or nullOptional
Message played when voicemail is detected.
call_duration_exceed_messagestring or nullOptional
Message played when the maximum call duration is reached.
messageslist of stringsOptional

Notes about the request, present only when there are any: an inbound number moved from another agent, or more than 4 languages. The change itself was applied.

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
500
Internal Server Error