Execute agent with code
POST/api/v2/agent/:agentCode/execute
Executes an agent with the given code. The request body must be either a JSON array of key/value input parameters, or a JSON object following the chat completions format.
Request
Path Parameters
Query Parameters
Use this param to override the culture of the response. Options: - en (default) - es
- application/json
Body
array
Array [
]
The key of the parameter (e.g., chatId, message)
The corresponding value (e.g., conversationId, message)
Volatile Knowledge
You can append Volatile Knowledge files to your execute request by adding the following key/value pair to the body of your request:
[
{
"Key": "volatileKnowledgeIds",
"Value": ["volatileKnowledgeId1", "volatileKnowledgeId2"]
}
]
Use the Upload endpoint to get the
volatileKnowledgeIdof your files.
Audio Transcription
You can pass an audio file for transcription in your execute request by adding the following key/value pair to the body of your request:
[
{
"Key": "audioInput",
"Value": {
"fileId": "[your audio file ID]",
}
}
]
Use the Upload File endpoint to get the
fileIdof your audio file.
Responses
- 200
- 400
- 401
- 403
- 500
Success
If the request body is not a JSON array of key/value input parameters, nor a JSON object following the chat completions format.
- application/json
- Schema
- Example (from schema)
Schema
errors
object
nullable
{
"message": "string",
"errors": {}
}
The user is unauthorized or the session expired
The user does not have permission
There was an unexpected error