---
title: "Update an agent"
method: PATCH
path: "/v2/agents/{uid}"
tags: ["Agents"]
---

# Update an agent

`PATCH /v2/agents/{uid}`

Partially updates an agent. Only the fields you include are modified.

Set `knowledge_base_id` to `null` to detach the current knowledge base.

## Request body

- UpdateAgentRequest
  - `name` string
  - `prompt` string
  - `first_message` string — Cannot be combined with `auto_first_message: true`.
  - `auto_first_message` boolean
  - `knowledge_base_id` integer, nullable — Set to `null` to detach the current knowledge base.
  - `voice_provider` 'OpenAI' | 'ElevenLabs' | 'Deepgram' | 'Cartesia'
  - `voice` string
  - `voice_model` string
  - `voice_speed` number
  - `llm_model_name` string
  - `llm_model_temperature` number
  - `llm_max_tokens` integer
  - `stt_provider` 'Deepgram'
  - `stt_model` string
  - `auto_end_call` boolean
  - `call_settings` CallSettings
    - `max_call_duration` integer — Maximum call duration in minutes.
    - `silence_timeout` integer — Seconds of silence before timing out.
    - `silence_timeout_max_retries` integer
    - `silence_timeout_message` string
    - `call_recording_enabled` boolean
    - `voicemail_detection_enabled` boolean
    - `voicemail_action` 'hangup' | 'leave_message'
    - `voicemail_message_type` 'prompt' | 'static'
    - `voicemail_message` string
    - `voicemail_post_detection_delay` integer
    - `hipaa_compliance_enabled` boolean
    - `pci_compliance_enabled` boolean
  - `advanced_settings` AdvancedSettings
    - `agent_personality` 'casual' | 'humorous' | 'direct' | 'formal' | 'persuasive' | 'friendly'
    - `humanize_conversation` boolean
    - `background_noise_reduction` boolean
    - `allow_interruptions` boolean
    - `min_interruption_duration` number
    - `background_sound` string
    - `agent_response_length` 'normal' | 'short' | 'concise' | 'long'
    - `short_pause` number
    - `long_pause` number
    - `filter_phrases` string
  - `boosted_keywords` string[]
  - `selected_jargons` string[]
  - `post_call_settings` PostCallSettings
    - `summary_prompt` string
    - `success_evaluation_prompt` string
    - `success_evaluation_rubric_type` 'NUMERIC_SCALE' | 'DESCRIPTIVE_SCALE' | 'PERCENTAGE_SCALE' | 'LIKERT_SCALE' | 'PASS_FAIL' | 'SENTIMENT'
    - `structured_extraction_prompt` string
    - `structured_extraction_json_schema` object — A valid JSON Schema object describing the fields to extract.

## Response `200`

Updated agent.

- AgentResponse
  - `uid` string, required — Unique agent identifier (slug/UUID).
  - `name` string, required
  - `prompt` string, required
  - `first_message` string
  - `auto_first_message` boolean
  - `knowledge_base_id` integer
  - `voice_provider` 'OpenAI' | 'ElevenLabs' | 'Deepgram' | 'Cartesia'
  - `voice` string
  - `voice_model` string
  - `voice_speed` number
  - `llm_model_name` string
  - `llm_model_temperature` number
  - `llm_max_tokens` integer
  - `stt_provider` 'Deepgram'
  - `stt_model` string
  - `auto_end_call` boolean
  - `call_settings` CallSettings
    - `max_call_duration` integer — Maximum call duration in minutes.
    - `silence_timeout` integer — Seconds of silence before timing out.
    - `silence_timeout_max_retries` integer
    - `silence_timeout_message` string
    - `call_recording_enabled` boolean
    - `voicemail_detection_enabled` boolean
    - `voicemail_action` 'hangup' | 'leave_message'
    - `voicemail_message_type` 'prompt' | 'static'
    - `voicemail_message` string
    - `voicemail_post_detection_delay` integer
    - `hipaa_compliance_enabled` boolean
    - `pci_compliance_enabled` boolean
  - `advanced_settings` AdvancedSettings
    - `agent_personality` 'casual' | 'humorous' | 'direct' | 'formal' | 'persuasive' | 'friendly'
    - `humanize_conversation` boolean
    - `background_noise_reduction` boolean
    - `allow_interruptions` boolean
    - `min_interruption_duration` number
    - `background_sound` string
    - `agent_response_length` 'normal' | 'short' | 'concise' | 'long'
    - `short_pause` number
    - `long_pause` number
    - `filter_phrases` string
  - `boosted_keywords` string[]
  - `selected_jargons` string[]
  - `post_call_settings` PostCallSettings
    - `summary_prompt` string
    - `success_evaluation_prompt` string
    - `success_evaluation_rubric_type` 'NUMERIC_SCALE' | 'DESCRIPTIVE_SCALE' | 'PERCENTAGE_SCALE' | 'LIKERT_SCALE' | 'PASS_FAIL' | 'SENTIMENT'
    - `structured_extraction_prompt` string
    - `structured_extraction_json_schema` object — A valid JSON Schema object describing the fields to extract.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400` — Validation error or invalid request body.
- `401` — Missing or invalid API key.
- `404` — The requested resource does not exist.
- `429` — Rate limit exceeded.
- `500` — Unexpected server error.

---

[API](https://skmtc.net/openmicai/apis/openmic-v1-external-api.md) · [All operations](https://skmtc.net/openmicai/apis/openmic-v1-external-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openmicai/openmic-v1-external-api/revisions/58dc5cff0ca7/schema)
