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

# Update OpenAI Bot

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

## Request

- Base URL: `https://evolution-example`
- URL: `https://evolution-example/openai/update/:openaiBotId/{instance}`
- Auth: API key in header `apikey`

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

## Changes

- **2024-11-25** (v2) `ad43c2b657d9`: 1 info
  - endpoint added
- **2024-11-25** (v2) `c153448703e5`: 1 breaking
  - api path removed without deprecation
- **2024-09-09** (v2) `0c4620ca5ed5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/evolution-foundation/apis/evolution-api-3/changes/openai/update/:openaiBotId/:instance/put.md)

---

[API](https://skmtc.dev/evolution-foundation/apis/evolution-api-3.md) - [All operations](https://skmtc.dev/evolution-foundation/apis/evolution-api-3/llms.txt) - [OpenAPI document](https://skmtc.dev/evolution-foundation/apis/evolution-api-3/revisions/153363ee7f38?raw)
