> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trugen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Agent

> Updates an Agent with new avatar, knowledge base, or system settings.



## OpenAPI

````yaml PUT /ext/agent/{id}
openapi: 3.0.3
info:
  title: TruGen Developer Platform API
  version: 1.0.0
  description: OpenAPI specification for MCP endpoint
servers:
  - url: https://api.trugen.ai/v1
security: []
paths:
  /ext/agent/{id}:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Unique identifier for the Agent
    put:
      summary: Update an existing Agent
      description: Updates an Agent with new avatar, knowledge base, or system settings.
      operationId: updateAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                agent_name:
                  type: string
                  description: Display name of the agent.
                  example: Customer Support Agent
                agent_system_prompt:
                  type: string
                  description: Foundational system instruction used by this agent.
                  example: >-
                    You are a helpful AI assistant that handles customer service
                    inquiries.
                avatars:
                  type: array
                  description: List of avatars associated with this agent.
                  items:
                    type: object
                    properties:
                      avatar_key_id:
                        type: string
                        description: Avatar identifier key.
                        example: 1e4ea106
                      persona_name:
                        type: string
                        description: Display name for the avatar persona.
                        example: Sofia - Friendly Support
                      persona_prompt:
                        type: string
                        description: Behavioral prompt for the avatar interaction style.
                        example: >-
                          Speak in a warm, engaging tone and provide clear
                          answers.
                      config:
                        type: object
                        description: >-
                          Configuration for avatar behavior and runtime
                          settings.
                        properties:
                          llm:
                            type: object
                            description: Large Language Model settings used by the avatar.
                            properties:
                              model:
                                type: string
                                description: Identifier of the LLM model.
                                example: meta-llama/llama-4-maverick-17b-128e-instruct
                              provider:
                                type: string
                                description: Provider used for LLM inference.
                                example: groq
                              url:
                                type: string
                                description: >-
                                  Custom provider URL of the LLM model.
                                  (Required if provider is 'custom')
                                default: sample url
                              token:
                                type: string
                                description: >-
                                  Custom provider API token for the LLM model.
                                  (Required if provider is 'custom')
                                default: sample token
                          stt:
                            type: object
                            description: Speech-to-Text model configuration.
                            properties:
                              model:
                                type: string
                                description: Speech recognition model identifier.
                                example: flux-general-en
                              provider:
                                type: string
                                description: STT provider service name.
                                example: deepgram
                              min_endpointing_delay:
                                type: number
                                description: Minimum endpointing delay in seconds.
                                example: 0.3
                              max_endpointing_delay:
                                type: number
                                description: Maximum endpointing delay in seconds.
                                example: 0.4
                          tts:
                            type: object
                            description: Text-to-Speech generation configuration.
                            properties:
                              model_id:
                                type: string
                                description: Voice synthesis model identifier.
                                example: eleven_turbo_v2_5
                              provider:
                                type: string
                                description: TTS provider service name.
                                example: elevenlabs
                              voice_id:
                                type: string
                                description: Voice ID used to synthesize speech.
                                example: ZUrEGyu8GFMwnHbvLhv2
                callback_events:
                  type: array
                  description: Webhook events that should trigger callbacks.
                  items:
                    type: string
                    example: utterance_committed
                  example:
                    - participant_left
                    - agent.started_speaking
                    - agent.stopped_speaking
                    - agent.interrupted
                    - user.started_speaking
                    - user.stopped_speaking
                    - utterance_committed
                    - max_call_duration_timeout
                callback_url:
                  type: string
                  description: Webhook endpoint URL to send callback events to.
                  example: https://webhooks.example.com/agent-events
                config:
                  type: object
                  description: Agent-level configuration properties.
                  properties:
                    maxCallDuration:
                      type: integer
                      description: Maximum call duration allowed in seconds.
                      example: 1800
                    conversationalContext:
                      type: string
                      description: >-
                        Context label used to maintain continuity across
                        sessions.
                      example: customer-support
                    memory:
                      type: object
                      description: Memory configuration for the agent.
                      properties:
                        isEnabled:
                          type: boolean
                          description: Whether memory is enabled for the agent.
                          example: false
                        instruction:
                          type: string
                          description: Instruction for how the agent should utilize memory.
                          example: >-
                            Sample instruction for the agent to utilize memory
                            effectively in conversations.
                knowledge_base:
                  type: array
                  description: List of knowledge bases attached to this agent.
                  nullable: true
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Knowledge base identifier.
                        example: ac79226e-73e1-41fe-8cde-469ae4e244fa
                      name:
                        type: string
                        description: Name of the knowledge base.
                        example: Product Support Articles
                      description:
                        type: string
                        description: Short summary of the knowledge base content.
                        example: >-
                          Contains FAQs and troubleshooting guides for product
                          lines.
                tool:
                  type: array
                  description: List of tools attached to this agent.
                  nullable: true
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Tool identifier.
                        default: ac79226e-73e1-41fe-8cde-469ae4e244fa
                      name:
                        type: string
                        description: Name of the tool.
                        default: Product Support Articles
                mcp:
                  type: array
                  description: List of MCPs attached to this agent.
                  nullable: true
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: MCP identifier.
                        default: ac79226e-73e1-41fe-8cde-469ae4e244fa
                      name:
                        type: string
                        description: Name of the MCP .
                        default: Product Support Articles
                record:
                  type: boolean
                  description: Determines whether voice call recordings should be stored.
                  example: true
                is_active:
                  type: boolean
                  description: Determines whether this record is active or not.
                  example: true
                created_at:
                  type: string
                  format: date-time
                  description: Timestamp indicating when the agent was created.
                  example: '2025-12-01T10:20:30.000Z'
                updated_at:
                  type: string
                  format: date-time
                  description: Last updated timestamp for the agent.
                  example: '2025-12-03T14:50:00.000Z'
            example:
              id: b63c2a53-266b-4b43-a71b-7ea8b5e2e916
              agent_name: Customer Support Agent
              agent_system_prompt: >-
                You are a helpful AI assistant that handles customer service
                inquiries.
              avatars:
                - avatar_key_id: 1e4ea106
                  persona_name: Sofia - Friendly Support
                  persona_prompt: Speak in a warm, engaging tone and provide clear answers.
                  config:
                    llm:
                      model: meta-llama/llama-4-maverick-17b-128e-instruct
                      provider: groq
                    stt:
                      model: flux-general-en
                      provider: deepgram
                      min_endpointing_delay: 0.3
                      max_endpointing_delay: 0.4
                    tts:
                      model_id: eleven_turbo_v2_5
                      provider: elevenlabs
                      voice_id: ZUrEGyu8GFMwnHbvLhv2
              callback_events:
                - participant_left
                - agent.started_speaking
                - agent.stopped_speaking
                - agent.interrupted
                - user.started_speaking
                - user.stopped_speaking
                - utterance_committed
                - max_call_duration_timeout
              callback_url: ''
              config:
                maxCallDuration: 1800
                conversationalContext: customer-support
                memory:
                  isEnabled: false
                  instruction: sample memory instruction for the agent
              knowledge_base:
                - id: ac79226e-73e1-41fe-8cde-469ae4e244fa
                  name: Product Support Articles
                  description: Contains FAQs and troubleshooting guides for product lines.
              record: true
              is_active: true
              created_at: '2025-12-01T10:20:30.000Z'
              updated_at: '2025-12-03T14:50:00.000Z'
      responses:
        '200':
          description: Agent updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  message:
                    type: string
              example:
                id: 098f083e-64c3-4c84-b3af-1b3e0b2538b3
                message: Agent updated successfully
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Invalid request body
        '401':
          description: Unauthorized – missing or invalid API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: 'Unauthorized: not a valid authorization api key'
        '404':
          description: Agent not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                message: Agent details not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Failed to update agent
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````