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

# Update an existing AI Agent



## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api patch /aiAgent/{id}
openapi: 3.0.0
info:
  version: '1'
  title: enneo.MIND API
  description: This describes the API of enneo Mind, the main ticketing backend
  contact:
    name: enneo GmbH
    email: richard@enneo.ai
  license:
    name: Proprietary software
    url: https://enneo.ai
servers:
  - url: https://demo.enneo.ai/api/mind
    description: Production server, demo client
  - url: https://main.enneo.dev/api/mind
    description: Development main branch
  - url: http://localhost:8005/api/mind
    description: Local development server
security:
  - bearerAuth:
      - api
  - cookieAuth:
      - api
paths:
  /aiAgent/{id}:
    patch:
      tags:
        - AiAgent
      summary: Update an existing AI Agent
      operationId: updateAiAgent
      parameters:
        - name: id
          in: path
          required: true
          description: The unique identificator of the AI Agent
          schema:
            type: string
          example: process_meter_reading
      requestBody:
        description: The new updated AI agent
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiAgent'
      responses:
        '200':
          description: Intent description updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
        '403':
          description: Unauthorized
        '404':
          description: Intent description not found
        '422':
          description: AI agent definition contains invalid parameter references
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiAgentValidationError'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AiAgent:
      type: object
      properties:
        id:
          type: integer
          format: int32
          minimum: 0
          description: Unique identifier of the AI agent (unsigned integer)
          example: 1
        tagId:
          type: integer
          description: Category of this ai agent
          example: 41
        channels:
          type: array
          description: Channels this ai agent is available on
          items:
            type: string
          example:
            - all
        name:
          type: string
          description: >-
            The name of the AI agent visible to the user. It is also used by the
            LLM to validate if the intent is correctly identified
          example: Change bank data (Code)
        description:
          type: string
          description: >-
            The description of the AI agent as defined by the user. It is also
            used by the LLM to validate if the intent is correctly identified
          example: Customer wants to change his bank data
        appearance:
          type: object
        exampleTicketIds:
          type: array
          items:
            type: integer
          example:
            - 8
            - 26
        settings:
          type: object
    Success:
      type: object
      description: Data format of Enneo success messages
      properties:
        success:
          type: boolean
          example: true
          description: Operation was successful
    AiAgentValidationError:
      type: object
      description: >-
        Response returned when an AI agent definition contains invalid parameter
        references (HTTP 422)
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: Human-readable error summary
          example: >-
            The AI agent definition contains invalid parameter references.
            Please fix the highlighted fields and try again.
        violations:
          type: array
          description: List of referential-integrity violations detected by Cortex
          items:
            type: object
            properties:
              responseCaseId:
                type: integer
                description: ID of the response case that contains the broken reference
                example: 1707648933463
              location:
                type: string
                description: Where in the response case the broken reference was found
                enum:
                  - conditionOperand
                  - outputParameter
                example: conditionOperand
              missingParameterId:
                type: string
                description: >-
                  The parameter ID that was referenced but not found in
                  settings.parameters
                example: '1707644198624'
              operandId:
                type: string
                nullable: true
                description: >-
                  The operand ID that contained the broken reference (null for
                  outputParameter violations)
                example: '1707649003847'
              message:
                type: string
                description: Human-readable description of the violation
                example: >-
                  Response case 1707648933463 condition operand references
                  parameter id '1707644198624', which is not defined in the
                  agent parameters.
    Error:
      type: object
      description: Data format of Enneo error messages
      properties:
        error:
          type: string
          example: Contract 121 could not be processed
          description: Readable error message that should be shown to the user
        details:
          type: string
          example: >-
            Uncatched null point exception in testFunction() in
            /app/src/file:212
          description: Not easily readable error message that is for the developer
        txId:
          type: string
          example: c916167c94
          description: >-
            Internal transaction id. Useful for debugging. Corresponds to the
            OpenTelemetry trace ID.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT-based authentication
      x-scopes:
        api: Full access to the API
    cookieAuth:
      type: apiKey
      in: cookie
      name: connect.sid
      description: Cookie-based authentication
      x-scopes:
        api: Full access to the API

````