<aside> โš ๏ธ This document is being updated June 4, 2024. Please refer to the Zaia API Docs (Legacy) for an accurate content.

</aside>

Authorization

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>'

Creating an API Key

To call any API, you need an API Key for the desired agent. To get yours, go through the following steps:

  1. Access platform.zaia.app.
  2. Select the option Gerenciar API Keys.

Untitled

  1. Now, on the page Gerenciar API keys, click in Gerar nova chave.
  2. Copy your key.
  3. Now that you have your API Key, you can go back to Authorization and check how to use it.

Untitled


API Reference

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>

External Generative Chat

This is the entity responsible for managing all chats that were created outside of the Zaia's Platform.

[GET] Retrieve

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


[GET] Retrieve Multiple

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


[POST] Create

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


External Generative Message

This is the entity responsible for managing all messages that were created outside of the Zaia's Platform.


[POST] Create

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


[GET] Retrieve Multiple

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

[PATCH] Resolve Takeover

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


Agent

This is the entity responsible for managing the Zaia Platform Agent.


[POST] Create