MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_API_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your api key by visiting your dashboard and clicking on api keys and Generate API key.

Endpoints

Get presigned url for bulk import

Obtain a presigned URL for uploading a zip file containing documents to be imported.

Example request:
curl --request GET \
    --get "https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/presigned-url" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/presigned-url"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, success):


{
    "url": "https://s3.amazonaws.com/bucketname/presigned-url",
    "expiration": 200
}
 

Request      

GET api/v1/integration/bulk-importer/presigned-url

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Import a file for bulk import

Unzip and import file previously uploaded to the presigned URL.

Example request:
curl --request POST \
    "https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/import" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/import"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200, success):


{
    "status": true
}
 

Example response (400):


{
    "error": "error message"
}
 

Request      

POST api/v1/integration/bulk-importer/import

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Import texts

Import text in the database

Example request:
curl --request POST \
    "https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/import-texts" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"data\": [
        {
            \"identifier\": \"text-001\",
            \"title\": \"Sample Text Title\",
            \"link\": \"https:\\/\\/example.com\\/text-001\",
            \"language\": \"it\",
            \"content\": \"This is the content of the text...\",
            \"permissions\": [
                \"admin\",
                \"editor\"
            ],
            \"metadata\": {
                \"author\": \"John Doe\",
                \"category\": \"Tutorial\"
            },
            \"document_date\": \"2024-01-15\",
            \"is_searchable\": true,
            \"is_generative\": false
        }
    ]
}"
const url = new URL(
    "https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/import-texts"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "data": [
        {
            "identifier": "text-001",
            "title": "Sample Text Title",
            "link": "https:\/\/example.com\/text-001",
            "language": "it",
            "content": "This is the content of the text...",
            "permissions": [
                "admin",
                "editor"
            ],
            "metadata": {
                "author": "John Doe",
                "category": "Tutorial"
            },
            "document_date": "2024-01-15",
            "is_searchable": true,
            "is_generative": false
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


{
    "status": true
}
 

Request      

POST api/v1/integration/bulk-importer/import-texts

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

data   object[]     

Array of texts to import.

identifier   string     

Unique identifier for the text. Must not be greater than 50 characters. Example: text-001

title   string     

Title of the text. Must not be greater than 200 characters. Example: Sample Text Title

link   string     

URL link to the text. Example: https://example.com/text-001

language   string     

Language code of the text. Example: it

Must be one of:
  • en
  • it
  • es
  • de
  • fr
  • ru
content   string     

The actual content/body of the text. Example: This is the content of the text...

permissions   string[]     

Individual permission string.

metadata   object  optional    

Optional metadata object containing additional information.

document_date   string     

Date of the document in Y-m-d format. Must be a valid date. Must be a valid date in the format Y-m-d. Example: 2024-01-15

is_searchable   boolean     

Whether the text should be searchable. Example: false

is_generative   boolean     

Whether the text can be used for generative purposes. Example: false

Delete a document

Delete a document associated with the bot and its embeddings.

Example request:
curl --request POST \
    "https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/delete-document" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"identifier\": \"text-001\"
}"
const url = new URL(
    "https://chatbot.logotel.cloud/api/v1/integration/bulk-importer/delete-document"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "identifier": "text-001"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


{
    "status": true,
    "message": "Document deleted successfully"
}
 

Request      

POST api/v1/integration/bulk-importer/delete-document

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

identifier   string     

Unique identifier of the document to delete. Must not be greater than 500 characters. Example: text-001