Introduction

Hi! โœ‹

This is the Zaia's API documentation!

Things are a little... out of the oven right now. But hang tight! We'll add a lot of cool things as soon as our Product Owner lets us.

By the wayโ€ฆ commenting is enabled and you're welcome to leave your suggestions, issues or comments here!


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 agent that you want to call through the API.

  3. Select the tab Onde Usar.

    Untitled

  4. Click the API Key card.

  5. Click in Gerar on the right end side.

  6. Copy your key.

  7. Now that you have your API Key, you can go back to Authorization and check how to use it.


API Reference

Our endpoints are grouped according to the main entity/action.

For example: /v1/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/api/external-generative-chat/retrieve?id=123>' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key here>'

Responses


[POST] Create

Creates a new chat for future message exchanges.

curl --location --request POST '<https://api.zaia.app/v1/api/external-generative-chat/create>' \\
--header 'Authorization: Bearer <your api key goes here>'

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 --request POST '<https://api.zaia.app/v1/api/external-generative-message/create>' \\
--header 'Content-Type: application/json' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key goes here>' \\
--data '{
    "externalGenerativeChatId": 123,
    "prompt": "Hi! I need help...",
    "streaming": false
}'

Responses


Agent

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


[POST] Create

Creates a new agent.

curl --location --request POST '<https://api.zaia.app/v1/api/agent/create>' \\
--header 'Content-Type: application/json' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key goes here>' \\
--data '{
    "name": 123,
    "template": "generic",
		"pictureURL": "*data:image/png;base64,iVBORw0KGโ€ฆ*"
}'

Responses


[PATCH] Update

Update an agent.

curl --location --request PATCH '<https://api.zaia.app/v1/api/agent/update>' \\
--header 'Content-Type: application/json' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key goes here>' \\
--data '{
    "agentId": 123,
    "behavior": "You are an artificial intelligence assistant...",
		"initialChatMessage": "Hi, Im your new assistant...",
		"name": "Agent Zaia",
		"pictureURL": "*data:image/png;base64,iVBORw0KGโ€ฆ*"
}'

Responses


[DELETE] Remove

Remove an agent.

curl --location --request DELETE '<https://api.zaia.app/v1/api/agent/remove/?agentId=123>' \\
--header 'Content-Type: application/json' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key goes here>'

Responses