POST
/
openai
/
create
/
{instance}
Create OpenAI
curl --request POST \
  --url https://{server-url}/openai/create/{instance} \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "enabled": true,
  "openaiCredsId": "<string>",
  "botType": "<string>",
  "assistantId": "<string>",
  "functionUrl": "<string>",
  "model": "<string>",
  "systemMessages": [
    "<string>"
  ],
  "assistantMessages": [
    "<string>"
  ],
  "userMessages": [
    "<string>"
  ],
  "maxTokens": 123,
  "triggerType": "<string>",
  "triggerOperator": "<string>",
  "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

Body

application/json
enabled
boolean
required

Indicates whether the bot is enabled

openaiCredsId
string
required

ID of the OpenAI credentials

botType
string
required

Type of the bot (e.g., 'assistant')

assistantId
string
required

Unique identifier for the assistant

functionUrl
string
required

URL for additional bot functionality

model
string
required

Model to be used (e.g., 'gpt-4o')

systemMessages
string[]
required

Messages to define system behavior

assistantMessages
string[]
required

Predefined assistant messages

userMessages
string[]
required

Predefined user messages

maxTokens
integer
required

Maximum number of tokens per interaction

triggerType
string
required

Type of trigger for the bot

triggerOperator
string
required

Operator for trigger evaluation

triggerValue
string
required

Value to trigger the bot

expire
integer
required

Expiration time in seconds

keywordFinish
string
required

Keyword to terminate the bot interaction

delayMessage
integer
required

Delay before the bot responds, in milliseconds

unknownMessage
string
required

Message to display for unrecognized input

listeningFromMe
boolean
required

Indicates if the bot listens to messages from the user

stopBotFromMe
boolean
required

Indicates if the bot can be stopped by the user

keepOpen
boolean
required

Indicates if the bot session remains open

debounceTime
integer
required

Debounce time for message processing

ignoreJids
string[]
required

List of JIDs to ignore