Update Agent
Agents
Update Agent
Updates one or more fields on an agent. Only send the fields you want to change. Architecture cannot be changed after creation.
PUT
Update Agent
Overview
Updates an existing agent’s configuration. Send only the fields you want to modify — all other fields remain unchanged. Authentication: Session-based (Better Auth) Scope: Active organization from sessionRequest
Path Parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | ✅ | Agent ID (ULID format) |
| Field | Type | Validation | Description |
|---|---|---|---|
name | string | 2-50 chars | Agent display name |
description | string | Max 200 chars | Internal description |
sysMsg | string | Max 5000 chars | System prompt |
languages | array | 1+ items | Language codes (en, ur, sd) |
agentArchitecture | string | Fixed after create | pipeline, realtime, or text |
model | string | Required for pipeline/text | LLM model |
stt | string | Required for pipeline | STT provider |
voiceId | string | Required for pipeline | Voice ID |
realtimeProvider | string | Required for realtime | openai or gemini |
greetingType | string | agentFirst or userFirst | Who speaks first |
greetingMessage | string | Optional | Greeting text |
lastMessage | string | Max 100 chars | Farewell message |
temperature | number | 0.1–1.0 | Response randomness |
inactivityTimeout | number | 10–60 seconds | Silence timeout |
mode | string | public, private, commercial | Visibility mode |
Response
Status:200 OK
Access Control
| User Role | Can Update |
|---|---|
| Owner | ✅ Any agent in organization |
| Admin | ✅ Any agent in organization |
| Member (Creator) | ✅ Own agents (except commercial) |
| Member (Not Creator) | ❌ Cannot update |
- Only Owners/Admins can update commercial agents
- Creators cannot modify their own commercial agents
Validation Rules
Architecture-Specific Validation
Pipeline:Field Validation
| Field | Rule | Error Message |
|---|---|---|
inactivityTimeout | 10–60 seconds | ”Inactivity timeout must be between 10 and 60 seconds” |
mode | public/private/commercial | ”Invalid agent mode” |
languages | en/ur/sd only | ”Invalid language: “ |
name | Required | ”Name is required” |
description | Required | ”Description is required” |
sysMsg | Required | ”System message is required” |
Mode Change Validation
Changing to Commercial:- ✅ Allowed for Owners/Admins
- ❌ Forbidden for Members
- Error: “Only organization owners and admins can set agent as commercial”
Error Responses
401 Unauthorized
403 Forbidden
400 Bad Request
404 Not Found
500 Server Error
Examples
cURL
JavaScript (Fetch)
Next.js (Client Component)
Update Languages
Change to Commercial Mode
Use Cases
Partial Update (Recommended)
Full Configuration Update
Architecture-Specific Update
Related Endpoints
- List Agents — List all agents
- Get Agent — Get agent details
- Create Agent — Create new agent
- Delete Agent — Delete agent
Authorizations
Your TalkifAI API key. Generate from Studio → Settings → API Keys. Format: tk_live_...
Path Parameters
Body
application/json
Available options:
openai, gemini Available options:
agentFirst, userFirst Required range:
10 <= x <= 60Available options:
public, private, commercial