# Update Agent Replace a custom agent. Persisted OOTB agents return HTTP 422; use root PATCH to customize them. Endpoint: PUT /agents/{id} Version: 2.68.0 Security: OAuth2 ## Path parameters: - `id` (string, required) ## Request fields (application/json): - `id` (string,null) - `companyId` (string,null) - `name` (string, required) Example: "Agent name" - `version` (string,null) - `description` (string, required) Example: "Some description" - `prompt` (string, required) Prompt used for agent Example: "Hello GPT, how are you?" - `model` (string,null) Model UID used for this agent. If not specified, the default model will be used. Example: "b099cb97-4a5c-458f-8dcf-91139e731214" - `systemPrompt` (string,null) System prompt for the agent Example: "You are a helpful assistant." - `outputFormat` (object,null) Output format specification for the agent - `editors` (array) Editor ids that can edit agent - `configuration` (object,null) Additional agent configuration - `toolIds` (array,null) Ids of the tools assigned to this agent. On create/update: null or omitted leaves the assignments unchanged (a new agent starts with none), [] removes them all, and a list replaces them with exactly this set (a change creates a new agent version). Populated on by-id reads; null in list responses. - `type` (string, required) The type of agent (BASIC, BASIC_V2, AGENTIC, METADATA, PAGE_BY_PAGE, LLM_OCR, STATIC, CASE_CLASSIFICATION, FILE_SUMMARIZATION, SCRIPT). SCRIPT runs author-provided TypeScript (from the prompt field, rendered with full mustache context) in a sandbox and returns JSON instead of calling an LLM. Example: "BASIC" ## Response 200 fields (application/json): - `id` (string, required) Example: "dcbc075f-a99c-4199-86ed-fb4ed5684dd9" - `rootAgentId` (string,null) Example: "dcbc075f-a99c-4199-86ed-fb4ed5684dd9" - `companyId` (string, required) Example: "6081acde0377a83b93f05a10" - `name` (string, required) Example: "Agent name" - `version` (string, required) Example: "Agent version" - `description` (string, required) Example: "Some description" - `prompt` (string, required) Prompt used for agent Example: "Hello GPT, how are you?" - `model` (string,null) Model UID used for this agent. If not specified, the default model will be used. Example: "b099cb97-4a5c-458f-8dcf-91139e731214" - `systemPrompt` (string,null) System prompt for the agent Example: "You are a helpful assistant." - `outputFormat` (object,null) Output format specification for the agent - `createdAt` (string,null) Date when Agent was added Example: "2023-10-27T11:38:18.000Z" - `createdBy` (string,null) Agent creator Example: "2023-10-27T11:38:18.000Z" - `updatedBy` (string,null) Agent updater Example: "Updater" - `updatedAt` (string,null) Date when Agent was last modified Example: "2023-10-27T12:38:18.000Z" - `editors` (array) Editor ids that can edit agent - `versions` (array) Other versions of this agent - `versionsMetadata` (array) Lightweight version summaries, populated when withVersionsMetadata=true - `versionsMetadata.createdAt` (string,null) - `versionsMetadata.createdBy` (string,null) - `configuration` (object,null) Additional agent configuration - `toolIds` (array,null) Ids of the tools assigned to this agent. On create/update: null or omitted leaves the assignments unchanged (a new agent starts with none), [] removes them all, and a list replaces them with exactly this set (a change creates a new agent version). Populated on by-id reads; null in list responses. - `isOotb` (boolean) Whether the agent is an out-of-the-box agent - `sourceTemplateAgentId` (string,null) Source template agent identifier - `sourceTemplateAgentVersion` (string,null) Concrete source template agent version used for import - `type` (string, required) The type of agent (BASIC, BASIC_V2, AGENTIC, METADATA, PAGE_BY_PAGE, LLM_OCR, STATIC, CASE_CLASSIFICATION, FILE_SUMMARIZATION, SCRIPT). SCRIPT runs author-provided TypeScript (from the prompt field, rendered with full mustache context) in a sandbox and returns JSON instead of calling an LLM. Example: "BASIC" ## Response 401 fields (application/json): - `status` (integer, required) Example: 422 - `title` (string, required) Example: "Request validation error" - `detail` (string,null) Example: "Validation error details" ## Response 403 fields (application/json): - `status` (integer, required) Example: 422 - `title` (string, required) Example: "Request validation error" - `detail` (string,null) Example: "Validation error details" ## Response 404 fields (application/json): - `status` (integer, required) Example: 422 - `title` (string, required) Example: "Request validation error" - `detail` (string,null) Example: "Validation error details" ## Response 422 fields (application/json): - `status` (integer, required) Example: 422 - `title` (string, required) Example: "Request validation error" - `detail` (string,null) Example: "Validation error details"