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

# Update agent



## OpenAPI

````yaml /openapi.json patch /api/agents/{id}
openapi: 3.0.0
info:
  title: GoMobile Backend API
  description: >-
    API documentation for GoMobile telephony platform - automated calling
    campaigns, interactive voice flows, and call management
  version: '1.0'
  contact: {}
servers:
  - url: http://localhost:3000
    description: Local Development
security: []
tags:
  - name: Organizations
    description: Multi-tenant organization management
  - name: Teams
    description: Team structure and hierarchy
  - name: Contacts
    description: Customer contact management (CRM)
  - name: Entities
    description: Business entities management
  - name: Audiences
    description: Contact segmentation and groups
  - name: Programs
    description: Call campaign configuration
  - name: Call Flows
    description: Interactive call flow builder
paths:
  /api/agents/{id}:
    patch:
      tags:
        - Agent Studio
      summary: Update agent
      operationId: AgentStudioController_update
      parameters:
        - name: id
          required: true
          in: path
          description: Agent ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentDto'
      responses:
        '200':
          description: Agent updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentResponseDto'
        '400':
          description: Invalid input data
        '404':
          description: Agent not found
      security:
        - bearer: []
components:
  schemas:
    UpdateAgentDto:
      type: object
      properties:
        name:
          type: string
          description: Agent name
          example: Customer Support Agent
          minLength: 1
          maxLength: 128
        description:
          type: string
          description: Agent description
          example: An AI agent that helps customers with their inquiries
          maxLength: 2000
        instructions:
          type: string
          description: Agent instructions (system prompt)
          example: You are a helpful customer support agent...
          maxLength: 10000
        policy:
          type: string
          description: >-
            Agent policy — business rules auto-injected into the prompt (set to
            null to clear)
          example: Refunds are only allowed within 30 days of purchase.
          maxLength: 10000
          nullable: true
        modelConfig:
          type: object
          description: Model configuration
          example:
            model: openai/gpt-4o
            modelSettings:
              temperature: 0.7
          nullable: true
          additionalProperties: true
        voiceConfig:
          type: object
          description: Voice pipeline configuration
          example:
            pipelineMode: batch
            voiceId: EXAVITQdyfvLewQXW32eyLI
          nullable: true
          additionalProperties: true
        memoryConfig:
          type: object
          description: Memory configuration
          example:
            enabled: true
            lastMessages: 20
          nullable: true
          additionalProperties: true
        metadata:
          type: object
          description: Additional metadata
          example:
            category: support
          nullable: true
          additionalProperties: true
        knowledgeBaseConfig:
          type: object
          description: Knowledge base configuration for RAG (set to null to detach)
          example:
            knowledgeBaseId: 550e8400-e29b-41d4-a716-446655440000
            topK: 5
            similarityThreshold: 0.7
          nullable: true
          additionalProperties: true
        resolutionCriteria:
          description: >-
            Resolution criteria for evaluating conversation outcomes (max 5).
            Replaces all existing criteria when provided. Set to [] to clear.
          example:
            - label: Payment confirmed
              description: Customer confirms the payment date and amount
          type: array
          items:
            $ref: '#/components/schemas/CreateResolutionCriterionDto'
    AgentResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Agent ID
        organizationId:
          type: string
          description: Organization ID
        name:
          type: string
          description: Agent name
          example: Customer Support Agent
        description:
          type: string
          description: Agent description
          nullable: true
        instructions:
          type: string
          description: Agent instructions
        policy:
          type: string
          description: Agent policy (business rules)
          nullable: true
        status:
          type: string
          description: Agent status
          enum:
            - draft
            - active
            - archived
        version:
          type: number
          description: Agent version
        modelConfig:
          description: Model configuration
          allOf:
            - $ref: '#/components/schemas/AgentModelConfigDto'
        voiceConfig:
          description: Voice configuration
          allOf:
            - $ref: '#/components/schemas/AgentVoiceConfigDto'
        memoryConfig:
          description: Memory configuration
          allOf:
            - $ref: '#/components/schemas/AgentMemoryConfigDto'
        metadata:
          type: object
          description: Additional metadata
          nullable: true
          additionalProperties: true
        knowledgeBaseConfig:
          type: object
          description: Knowledge base configuration for RAG
          nullable: true
          additionalProperties: true
        createdAt:
          format: date-time
          type: string
          description: Created at timestamp
        updatedAt:
          format: date-time
          type: string
          description: Updated at timestamp
        createdBy:
          type: string
          description: Created by user ID
          nullable: true
      required:
        - id
        - organizationId
        - name
        - instructions
        - status
        - version
        - modelConfig
        - createdAt
        - updatedAt
    CreateResolutionCriterionDto:
      type: object
      properties:
        label:
          type: string
          description: Short label for the resolution criterion
          example: Customer confirms payment date
          maxLength: 255
        description:
          type: string
          description: Detailed description of what constitutes meeting this criterion
          example: >-
            The customer explicitly states or confirms a specific date for
            payment during the conversation.
      required:
        - label
        - description
    AgentModelConfigDto:
      type: object
      properties:
        model:
          type: string
          example: openai/gpt-4o
        modelSettings:
          type: object
          nullable: true
          additionalProperties: true
        providerOptions:
          type: object
          nullable: true
          additionalProperties: true
      required:
        - model
    AgentVoiceConfigDto:
      type: object
      properties:
        pipelineMode:
          type: string
          example: batch
          enum:
            - batch
            - streaming
            - sts
        voiceId:
          type: string
          example: EXAVITQdyfvLewQXW32eyLI
        stsProvider:
          type: string
          example: openai
          enum:
            - openai
            - gemini
      required:
        - pipelineMode
    AgentMemoryConfigDto:
      type: object
      properties:
        enabled:
          type: boolean
          example: true
        lastMessages:
          type: number
          example: 20
        semanticRecall:
          type: boolean
          example: false
      required:
        - enabled
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````