PUT
/
openai
/
update
/
:openaiBotId
/
{instance}
Update OpenAI Bot
curl --request PUT \
  --url https://{server-url}/openai/update/:openaiBotId/{instance} \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "enabled": true,
  "openaiCredsId": "<string>",
  "botType": "assistant",
  "assistantId": "<string>",
  "functionUrl": "<string>",
  "model": "<string>",
  "systemMessages": [
    "<string>"
  ],
  "assistantMessages": [
    "<string>"
  ],
  "userMessages": [
    "<string>"
  ],
  "maxTokens": 123,
  "triggerType": "all",
  "triggerOperator": "equals",
  "triggerValue": "<string>",
  "expire": 123,
  "keywordFinish": "<string>",
  "delayMessage": 123,
  "unknownMessage": "<string>",
  "listeningFromMe": true,
  "stopBotFromMe": true,
  "keepOpen": true,
  "debounceTime": 123,
  "ignoreJids": [
    "<string>"
  ]
}'

Authorizations

apikey
string
header
required

Your authorization key header

Path Parameters

instance
string
required

Name of the instance

openaiBotId
string
required

ID of the bot

Body

application/json

Configuration for the OpenAI bot instance

enabled
boolean
required

Indicates if the bot is enabled

openaiCredsId
string
required

The OpenAI credentials ID

botType
enum<string>
required

The type of bot (either 'assistant' or 'chatCompletion')

Available options:
assistant,
chatCompletion
model
string
required

The OpenAI model to use for chat completion (e.g., 'gpt-4o')

assistantId
string

The ID of the assistant (only if 'botType' is 'assistant')

functionUrl
string

The function URL that the bot will call

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
enum<string>

The trigger type for the bot (e.g., 'keyword' or 'all')

Available options:
all,
keyword
triggerOperator
enum<string>

The operator to match the trigger type

Available options:
equals,
contains,
startsWith,
endsWith,
regex,
none
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