# API

## Content Guide

The API section of the KAIO documentation provides a learning resource to become familiar with the platform and provides references for partner integrations. This page provides an overview of the KAIO platform, its users, what they can do, and the relationships between them. Each sub-section relates to a particular user type and contains:

* **\[User] How-Tos:** The how-to guides contain the most usual flows for each type of user, with explanations and lists of steps.
* **\[User] References:** The reference pages contain the complete list of API calls available to each type of user. Individual cards link to the corresponding API call on Postman for easy access, also containing a description and some examples for each one. An additional guide for the Postman content can be found in .

## KAIO API

{% hint style="info" %}
**NOTE**: We are in the process of moving our API documentation to Swagger at <https://api.librecapital.com/api>
{% endhint %}

The KAIO API enables users to interact with KAIO directly without using the KAIO Website. Once logged in, users can make certain API calls according to their user type.

## User Types

There are four user types, as described in the following table:

<table data-full-width="true"><thead><tr><th>User Type</th><th>Description</th><th>Main Viewing Calls</th><th>Main Interaction Calls</th></tr></thead><tbody><tr><td><strong>Investor</strong></td><td>Investors are clients of private banks. They mostly sign agreement contracts and let their Dealer manage their orders on their behalf. They can create orders on their own if allowed by the Dealer</td><td><p>→View access to Funds and Instruments</p><p>→View all past orders</p></td><td><p>→Create/Confirm/Lock/Cancel orders</p><p>→Submit general requests to the KAIO Admin</p></td></tr><tr><td><strong>Dealer</strong></td><td>Dealers are private banks and advisors that are responsible for onboarding investors, managing their profiles, and creating orders on their behalf.</td><td><p>→View Funds they have access to</p><p>→View orders of Investors they manage</p><p>→View information of Investors they manage</p></td><td><p>→Onboard Investors</p><p>→Update Investor data</p><p>→Create/Confirm/Lock/Cancel Investor orders</p><p>→Upload agreement contracts to be signed on DocuSign</p><p>→Submit general requests to the KAIO Admin</p></td></tr><tr><td><strong>Fund Admin</strong></td><td>Fund Admins are responsible for managing the Funds they control, and all the Instruments within the Fund.</td><td><p>→View Funds they manage</p><p>→View Instruments belonging to their Funds</p><p>→View orders submitted in their Instruments.</p><p>→View agreement contracts signed by Investors</p></td><td><p>→Update Fund information</p><p>→Update Instrument information</p><p>→Set up instrument configuration</p><p>→Update audited/unaudited Net Asset Value (NAV)</p><p>→Approve/Reject orders</p></td></tr><tr><td><strong>KAIO Admin</strong></td><td>The KAIO Admin has control of the KAIO platform. They are responsible for answering requests, onboarding new Dealers and Fund Admins, and creating new Funds and Instruments.</td><td><p>→View all Fund information</p><p>→View all Instrument information</p><p>→View all Investor information</p><p>→View all Dealer information</p></td><td><p>→Onboard Fund Admins and Dealers</p><p>→Set Roles</p><p>→Create Funds and Instruments</p><p>→Lock and Settle orders</p></td></tr></tbody></table>

## Object Definitions

* **Fund**: Houses a set of Instruments, and is managed by a Fund Admin.
* **Instrument**: Describes the tokenized asset itself, also containing the custom logic of the asset.
* **Order**: Request made to subscribe or redeem the tokenized asset, going through multiple stages before being finalized. An order's status can be one of the following:
  * CREATED
  * CONFIRMED
  * CANCELED
  * REJECTED
  * UNDER\_REVIEW
  * ACCEPTED
  * LOCKED SETTLED

## Examples

Below are some example sequence diagrams illustrating operation flows between users, in this case the most usual subscription and redemption lifecycles:

#### Subscriptions

<div data-full-width="false"><figure><img src="/files/ewWq76fI3kH3gROs2ujs" alt=""><figcaption><p><em><strong>Subscription Lifecycle</strong></em></p></figcaption></figure></div>

#### Redemptions

<figure><img src="/files/5S0Fr3cdnf7pOPdKuGg7" alt=""><figcaption><p><em><strong>Redemption Lifecycle</strong></em></p></figcaption></figure>

## Postman Content Guide

In the [Postman documentation](https://documenter.getpostman.com/view/26092879/2s93Xu36Mm) you can find the endpoints to use when interacting with KAIO using API calls. For each endpoint you can find a short description and some example requests. Some endpoints require requests to have a body, these additionally contain the raw body example and a table with the fields it contains, with additional information. Some endpoints also include path variables and/or parameters in the URL, in which case they contain sections with examples and descriptions for them. It is strongly encouraged to use the documentation on GitBook for navigation, where you can find links to the specific endpoints you want more details on (leading to Postman).

In order to improve navigation and readability, color codes have been used to represent the different types of users as follows:

* ⚪: **All Users**
* 🟡: **Investors**
* 🟠: **Dealers**
* 🔵: **Fund Admins**
* 🟣: **KAIO Admin**

These colors are used in a variety of contexts, and their meaning might change slightly in each one:

<table data-header-hidden data-full-width="true"><thead><tr><th>Name</th><th>Description</th><th>Color meaning</th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td><strong>Description</strong></td><td><strong>Color meaning</strong></td><td><strong>Location</strong></td></tr><tr><td><em>Endpoint Titles</em></td><td>Name of the endpoint that can be called using the API.</td><td>The color indicates which types of users can call the endpoint. Special authorization might be required in addition to the user being the correct type.</td><td>Can be found at the beginning of each endpoint section, on the top left.</td></tr><tr><td><em>Request Examples</em></td><td>Examples of requests made using the API. They show different scenarios and options when calling an endpoint, and the return values when they succeed or fail.</td><td>The color indicates which type of user performed the request in each particular example. Multiple ones mean the examples is the same for multiple kinds of users. ✔️ and ❌ are used to show if the request was successful or not.</td><td>Can be found to the right of each endpoint section. The dropdown to change between examples is at the top right.</td></tr><tr><td><em>Field Tables</em></td><td>Tables defining the body fields required to call an endpoint, and providing additional information such as constraints or the optionality of the field.</td><td>The color indicates if the fields are only available/required by a specific type of user.</td><td>Can be found below the description for each endpoint, for the ones that have a body.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kaio.xyz/guide-to-using-kaio/understanding-projects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
