Patch agent settings
const url = 'https://api.somebodyai.co/api/v1/agents/507f1f77bcf86cd799439011/settings';const options = { method: 'PATCH', headers: { 'x-base-revision-id': '665f1f77bcf86cd799439099', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"presentation":{"skin":"aura"},"agent":{"timer":{"minutes":10}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”MongoDB ObjectId
MongoDB ObjectId
Header Parameters
Section titled “Header Parameters”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.
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.
Request Body
Section titled “Request Body”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
Responses
Section titled “Responses”Settings patched
object
Anyone with the link can talk to this agent
object
Values explicitly set on this agent. Never contains template defaults.
object
Settings with the template defaults resolved over it — what the player receives. Read-only: writing this back would persist defaults.
object
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.
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
object
Example
{ "error": "Resource not found", "details": [ "Field is required" ]}Unauthorized - missing or invalid auth
object
Example
{ "error": "Resource not found", "details": [ "Field is required" ]}Resource not found
object
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.
object
object
A settings param path such as agent.voiceId, or name / templateId on PUT.
The effective value in the base revision; null when that revision has been purged.
The effective value stored now.
The value this save tried to write.
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.
The newest revision now, to send as the base when saving again.
Example
{ "error": "Edit conflict", "code": "edit_conflict", "conflicts": [ { "path": "agent.voiceId" } ]}