---
title: "Update OpenAI Bot"
method: PUT
path: "/openai/update/:openaiBotId/{instance}"
tags: ["OpenIA Controller"]
---

# Update OpenAI Bot

`PUT /openai/update/:openaiBotId/{instance}`

Update OpenAI bot with detailed configuration

## Path parameters

- `instance` string, required
- `openaiBotId` string, required

## Request body

- object
  - `enabled` boolean, required — Indicates if the bot is enabled
  - `openaiCredsId` string, required — The OpenAI credentials ID
  - `botType` 'assistant' | 'chatCompletion', required — The type of bot (either 'assistant' or 'chatCompletion')
  - `assistantId` string — The ID of the assistant (only if 'botType' is 'assistant')
  - `functionUrl` string — The function URL that the bot will call
  - `model` string, required — The OpenAI model to use for chat completion (e.g., 'gpt-4o')
  - `systemMessages` string[] — The system messages to define the assistant behavior
  - `assistantMessages` string[] — Messages to be sent by the assistant
  - `userMessages` string[] — Messages sent by the user
  - `maxTokens` integer — Maximum number of tokens for the bot's responses
  - `triggerType` 'all' | 'keyword' — The trigger type for the bot (e.g., 'keyword' or 'all')
  - `triggerOperator` 'equals' | 'contains' | 'startsWith' | 'endsWith' | 'regex' | 'none' — The operator to match the trigger type
  - `triggerValue` string — The value that triggers the bot (e.g., 'teste')
  - `expire` integer — The expiration time of the bot instance in minutes
  - `keywordFinish` string — Keyword to end the bot interaction
  - `delayMessage` integer — Time in milliseconds to delay the message
  - `unknownMessage` string — Message to send if the bot doesn't recognize the input
  - `listeningFromMe` boolean — Indicates if the bot should listen for messages from the user
  - `stopBotFromMe` boolean — Indicates if the bot can be stopped by the user
  - `keepOpen` boolean — Indicates if the bot session should remain open
  - `debounceTime` integer — Time in milliseconds for the debounce delay
  - `ignoreJids` string[] — List of JIDs to ignore

## Response `200`

Ok

---

[API](https://skmtc.net/evolution-foundation/apis/evolution-api-2.md) · [All operations](https://skmtc.net/evolution-foundation/apis/evolution-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/evolution-foundation/evolution-api-2/revisions/153363ee7f38/schema)
