APIs
Introduction

Introduction

ℹ️

The APIs are still in beta and are subject to change.
New API endpoints and features will be added over time.

API endpoint

The API is available at the following base endpoint:

https://api.aidbase.ai/v1/

Bearer token

All endpoints require a valid bearer token to be included in the Authorization header of the request.
See how you can obtain a bearer token in the get started guide.

Example request

curl --request GET \
 --url https://api.aidbase.ai/v1/knowledge \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]'

Pagination

All list endpoints are paginated. The default page size is 25 items.
You can specify the page number and page size using the limit query parameter.

Example request

curl --request GET \
 --url https://api.aidbase.ai/v1/knowledge?limit=50 \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]'

Example response

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "d38b8600-d708-40d9-a2a8-c178b84b30a0",
        "type": "website",
        "base_url": "https://www.mywebsite.com/",
        "trained_at": "2023-12-24T06:05:17.365Z",
        "is_training": false,
        "training_failed_at": null,
        "training_failed_with": null
      },
      ...
    ],
    "total": 120,
    "has_more": true,
    "next_cursor": "MjUuNTA9"
  }
}

If there are more items to fetch, the response will include a has_more with the value true, and a next_cursor field.

To fetch the next page of items, you can use the next_cursor query parameter in the next request.

Example request

curl --request GET \
 --url https://api.aidbase.ai/v1/knowledge?next_cursor=MjUuNTA9 \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]'

Response format

All responses are in JSON format.
The response will include a success field, and a data field with the response data.

Example response

{
  "success": true,
  "data": {
    ...
  }
}

If the request fails, the success field will be false and the response will include a message field with the error message.

Example response

{
  "success": false,
  "message": "Error message related to the request"
}

Aidbase Docs © 2024