<aside> โ ๏ธ This document is being updated June 4, 2024. Please refer to the Zaia API Docs (Legacy) for an accurate content.
</aside>
Before attempting to call any APIs, you need a key. Ensure you have your API key readily available following the steps described in the Creating an API Key page.
Nothing fancy here. Just pass the API Key in the request headers like in the examples below.
curl --location '<https://api.zaia.app/><endpoint path>' \\
--header 'Authorization: Bearer <your api key here>'
To call any API, you need an API Key for the desired agent. To get yours, go through the following steps:
Our endpoints are grouped according to the main entity/action
.
For example: /v1.1/api/agent/retrieve
, agent being the entity
and retrieve
being the action.
Following this rule you'll be able to find anything around here.
Another important thing to mention, the base URL isAnother important thing to mention, the base URL is https://api.zaia.app
.
<aside> โ ๏ธ Be sure to prefix the endpoints with it.
</aside>
This is the entity responsible for managing all chats that were created outside of the Zaia's Platform.
Retrieve an external generative chat.
Request
curl --location '<https://api.zaia.app/v1.1/api/external-generative-chat/retrieve?id=1379951>' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key here>'
Responses
Retrieve multiples external generative chats.
Request
curl --location '<https://api.zaia.app/v1.1/api/external-generative-chat/retrieve-multiple?agentIds=456,3218&limit=10&offset=1>' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key here>'
Responses
Creates a new chat for future message exchanges.
curl --location '<https://api.zaia.app/v1.1/api/external-generative-chat/create>' \\
--header 'Authorization: Bearer <your_token_here>' \\
--header 'Content-Type: application/json' \\
--data '{
"agentId": 123,
"externalId": "zaiaChat777"
}'
Responses
This is the entity responsible for managing all messages that were created outside of the Zaia's Platform.
Generate a new message.
curl --location '<https://api.zaia.app/v1.1/api/external-generative-message/create>' \\
--header 'Authorization: Bearer <your_api_key_here>' \\
--header 'Content-Type: application/json' \\
--data '{
"agentId": 123,
"externalGenerativeChatId": 12345,
"externalGenerativeChatExternalId": "zaiaChat777",
"prompt": "Hi! I need help...",
"streaming": false,
"asMarkdown": false,
"custom": {
"whatsapp": "11999999999"
}
}'
Responses
Retrieve multiples external generative messages.
Request
curl --location '<https://api.zaia.app/v1.1/api/external-generative-message/retrieve-multiple?externalGenerativeChatIds=1379951,1087942>' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key here>'
Responses
Creates a new chat for future message exchanges.
curl --location '<https://api.zaia.app/v1.1/api/external-generative-chat/create>' \\
--header 'Authorization: Bearer <your_token_here>' \\
--header 'Content-Type: application/json' \\
--data '{
"id": 123
}'
Responses
This is the entity responsible for managing the Zaia Platform Agent.