Update Agent

Updates an existing agent's configuration.

Endpoint

PUT /v1/agents/{agent_id}

Parameters

Parameter
Type
Required
Description

agent_id

string

Yes

Unique identifier of the agent to update

Authentication

Requires a valid API key or user authentication token.

Request Body

{
  "name": "string",
  "description": "string",
  "system_prompt": "string",
  "language": "string",
  "voice_id": "string",
  "tts_provider": "string",
  "stt_provider": "string",
  "llm_model": "string",
  "knowledge_base_ids": ["string"]
}

Request Fields

Field
Type
Required
Description

name

string

No

New display name for the agent

description

string

No

New description of the agent's purpose

system_prompt

string

No

New instructions for the agent's behavior

language

string

No

New language code (e.g., "en" for English)

voice_id

string

No

New voice identifier

tts_provider

string

No

New text-to-speech provider

stt_provider

string

No

New speech-to-text provider

llm_model

string

No

New language model to use

knowledge_base_ids

array

No

New list of knowledge base IDs

Response

Returns the updated agent object with its new configuration.

Response Format

{
  "id": "string",
  "name": "string",
  "description": "string",
  "system_prompt": "string",
  "language": "string",
  "voice_id": "string",
  "tts_provider": "string",
  "stt_provider": "string",
  "llm_model": "string",
  "knowledge_base_ids": ["string"],
  "created_at": "datetime",
  "updated_at": "datetime",
  "created_by": "string"
}

Example Request

curl -X PUT "https://api.krosai.com/v1/agents/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Senior Product Expert",
    "system_prompt": "You are a senior product expert for KrosAI with deep technical knowledge...",
    "voice_id": "echo",
    "knowledge_base_ids": ["kb-product-catalog", "kb-technical-docs"]
  }'

Example Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Senior Product Expert",
  "description": "Helps users with product information and recommendations",
  "system_prompt": "You are a senior product expert for KrosAI with deep technical knowledge...",
  "language": "en",
  "voice_id": "pidgin",
  "tts_provider": "krosaimlingual",
  "stt_provider": "krosaimlingual",
  "llm_model": "krosaimlingual",
  "knowledge_base_ids": ["kb-product-catalog", "kb-technical-docs"],
  "created_at": "2023-07-10T15:30:00Z",
  "updated_at": "2023-07-10T16:45:00Z",
  "created_by": "user-12345"
}

Error Responses

Status Code
Description

400

Bad Request - Invalid input data

401

Unauthorized - Invalid or missing API key

403

Forbidden - Not authorized to update this agent

404

Not Found - Agent with the specified ID does not exist

500

Internal Server Error

Notes

  • Only provide the fields you want to update. Omitted fields will retain their current values.

  • The updated_at timestamp is automatically set to the current time.

  • Changes take effect immediately for new conversations.

  • Existing voice sessions may need to be restarted to apply the changes.

Last updated