> ## Documentation Index
> Fetch the complete documentation index at: https://doc.evolution-api.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Bot

> Update OpenAI bot with detailed configuration



## OpenAPI

````yaml openapi-v2 PUT /openai/update/:openaiBotId/{instance}
openapi: 3.0.3
info:
  title: Evolution API
  version: 2.1.1
servers:
  - url: https://{server-url}
    variables:
      server-url:
        default: evolution-example
        description: The URL of your EvolutionAPI server
    description: Your instance domain
security: []
paths:
  /openai/update/:openaiBotId/{instance}:
    put:
      tags:
        - OpenIA Controller
      summary: Update OpenAI Bot
      description: Update OpenAI bot with detailed configuration
      operationId: updateBotOpenAI
      parameters:
        - name: instance
          in: path
          required: true
          description: Name of the instance
          schema:
            type: string
        - name: openaiBotId
          in: path
          required: true
          description: ID of the bot
          schema:
            type: string
      requestBody:
        description: Configuration for the OpenAI bot instance
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enabled:
                  type: boolean
                  description: Indicates if the bot is enabled
                openaiCredsId:
                  type: string
                  description: The OpenAI credentials ID
                botType:
                  type: string
                  enum:
                    - assistant
                    - chatCompletion
                  description: The type of bot (either 'assistant' or 'chatCompletion')
                assistantId:
                  type: string
                  description: The ID of the assistant (only if 'botType' is 'assistant')
                functionUrl:
                  type: string
                  description: The function URL that the bot will call
                model:
                  type: string
                  description: The OpenAI model to use for chat completion (e.g., 'gpt-4o')
                systemMessages:
                  type: array
                  items:
                    type: string
                  description: The system messages to define the assistant behavior
                assistantMessages:
                  type: array
                  items:
                    type: string
                  description: Messages to be sent by the assistant
                userMessages:
                  type: array
                  items:
                    type: string
                  description: Messages sent by the user
                maxTokens:
                  type: integer
                  description: Maximum number of tokens for the bot's responses
                triggerType:
                  type: string
                  enum:
                    - all
                    - keyword
                  description: The trigger type for the bot (e.g., 'keyword' or 'all')
                triggerOperator:
                  type: string
                  enum:
                    - equals
                    - contains
                    - startsWith
                    - endsWith
                    - regex
                    - none
                  description: The operator to match the trigger type
                triggerValue:
                  type: string
                  description: The value that triggers the bot (e.g., 'teste')
                expire:
                  type: integer
                  description: The expiration time of the bot instance in minutes
                keywordFinish:
                  type: string
                  description: Keyword to end the bot interaction
                delayMessage:
                  type: integer
                  description: Time in milliseconds to delay the message
                unknownMessage:
                  type: string
                  description: Message to send if the bot doesn't recognize the input
                listeningFromMe:
                  type: boolean
                  description: >-
                    Indicates if the bot should listen for messages from the
                    user
                stopBotFromMe:
                  type: boolean
                  description: Indicates if the bot can be stopped by the user
                keepOpen:
                  type: boolean
                  description: Indicates if the bot session should remain open
                debounceTime:
                  type: integer
                  description: Time in milliseconds for the debounce delay
                ignoreJids:
                  type: array
                  items:
                    type: string
                  description: List of JIDs to ignore
              required:
                - enabled
                - openaiCredsId
                - botType
                - model
      responses:
        '200':
          description: Ok
          content: {}
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
      description: Your authorization key header

````