Skip to content

Patch agent settings

PATCH
/agents/{id}/settings
curl --request PATCH \
--url https://api.somebodyai.co/api/v1/agents/507f1f77bcf86cd799439011/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-base-revision-id: 665f1f77bcf86cd799439099' \
--data '{ "presentation": { "skin": "aura" }, "agent": { "timer": { "minutes": 10 } } }'

Merges a partial settings tree into the agent, guided by the template param paths, then validates the merged tree. Only the paths present in the body are written, so two tabs editing different params cannot overwrite each other. Use PUT /agents/{id} for the name or template. Send X-Base-Revision-Id to refuse overwriting a path someone else changed since that revision; paths nobody else changed still merge.

id
required

MongoDB ObjectId

string
/^[a-fA-F0-9]{24}$/

MongoDB ObjectId

x-base-revision-id

The revisionId the edit was made against. With it, a value someone else changed since then is not overwritten: the save answers 409 edit_conflict and writes nothing. Without it, the last write wins.

string
/^[a-fA-F0-9]{24}$/

The revisionId the edit was made against. With it, a value someone else changed since then is not overwritten: the save answers 409 edit_conflict and writes nothing. Without it, the last write wins.

Media typeapplication/json

Partial settings tree. Only the paths present are written; every other stored value survives, including siblings inside a group you touch. An array leaf is replaced whole.

object
key
additional properties

Settings patched

Media typeapplication/json
object
id
required
string
name
required
string
templateId
required
string
playerUrl
required
string
shareLink
required

Anyone with the link can talk to this agent

boolean
moderation
required
object
status
required
string
Allowed values: active under_review suspended removed
notice
required
string | null
updatedAt
required
string | null
preset
Any of:

The template's system-prompt preset the agent's prompt was copied from, and that preset's version then. Send it on create when settings holds a preset's prompt, so the dashboard can offer the preset's later versions.

object
id
required
string
>= 1 characters
version
required
integer
> 0
settings
required

Values explicitly set on this agent. Never contains template defaults.

object
key
additional properties
effectiveSettings
required

Settings with the template defaults resolved over it — what the player receives. Read-only: writing this back would persist defaults.

object
key
additional properties
revisionId
required

The newest revision of the agent: the version token to send as X-Base-Revision-Id on PUT /agents/{id} and PATCH /agents/{id}/settings. null for an agent saved before revisions existed, until its next save.

string | null
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{
"id": "507f1f77bcf86cd799439011",
"name": "My Voice Agent",
"templateId": "gaussian",
"playerUrl": "https://player.example.com/voice",
"moderation": {
"status": "active"
},
"preset": {
"id": "customer-support",
"version": 2
},
"settings": {
"transportService": "daily",
"systemPrompt": "You are a helpful assistant"
},
"effectiveSettings": {
"transportService": "daily",
"llmService": "openai",
"systemPrompt": "You are a helpful assistant"
},
"revisionId": "665f1f77bcf86cd799439099",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}

Bad request - validation failed

Media typeapplication/json
object
error
required
string
details
Array<string>
Example
{
"error": "Resource not found",
"details": [
"Field is required"
]
}

Unauthorized - missing or invalid auth

Media typeapplication/json
object
error
required
string
details
Array<string>
Example
{
"error": "Resource not found",
"details": [
"Field is required"
]
}

Resource not found

Media typeapplication/json
object
error
required
string
details
Array<string>
Example
{
"error": "Resource not found",
"details": [
"Field is required"
]
}

Someone saved a different value for a path this save writes since X-Base-Revision-Id. Nothing was written.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed values: edit_conflict
conflicts
required
Array<object>
object
path
required

A settings param path such as agent.voiceId, or name / templateId on PUT.

string
base

The effective value in the base revision; null when that revision has been purged.

theirs

The effective value stored now.

mine

The value this save tried to write.

savedBy
required

User id behind the newest revision that changed the path since the base (the newest revision when the base was purged); null for a save made with an API key.

string | null
savedAt
required
string format: date-time
revisionId
required

The newest revision now, to send as the base when saving again.

string | null
Example
{
"error": "Edit conflict",
"code": "edit_conflict",
"conflicts": [
{
"path": "agent.voiceId"
}
]
}