MENU navbar-image

Introduction

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

Authenticating requests

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

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

You can retrieve your token with the bot private key. More info here https://github.com/Logotel/logobot-php-integration.

Endpoints

GET api/health

requires authentication

Example request:
curl --request GET \
    --get "https://api.chatbot.logotel.cloud/api/health" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/health';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/health"
);

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

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

url = 'https://api.chatbot.logotel.cloud/api/health'
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "database": {
        "status": true,
        "description": "ok"
    },
    "cache": {
        "status": true,
        "description": "ok"
    }
}
 

Request      

GET api/health

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

Authenticate

requires authentication

Authenticate the user via jwt and return a key to be used instead of it

Example request:
curl --request POST \
    "https://api.chatbot.logotel.cloud/api/v1/authenticate" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"jwt\": \"ea\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/authenticate';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'jwt' => 'ea',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/authenticate"
);

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

let body = {
    "jwt": "ea"
};

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

url = 'https://api.chatbot.logotel.cloud/api/v1/authenticate'
payload = {
    "jwt": "ea"
}
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):


{
 "key": "somekey",
}
 

Request      

POST api/v1/authenticate

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

jwt   string   

Example: ea

Thread list

requires authentication

Obtain the threads list

Example request:
curl --request GET \
    --get "https://api.chatbot.logotel.cloud/api/v1/threads" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/threads"
);

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

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

url = 'https://api.chatbot.logotel.cloud/api/v1/threads'
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


[
 {
  "uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
  "title": "the title of the thread",
  "last_chat": {
      "uuid": "dfrr67f7-s940-33dx-app9-ofpf7b4c9b",
      "is_bot": true,
      "order": 1,
      "message": "This is a message",
      "feedback": "positive",
      "created_at": "10/10/2024 10:10:10",
      "sources": [
          "source1",
          "source2",
      ]
  }
 }
]
 

Request      

GET api/v1/threads

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

Create thread

requires authentication

Create a new thread with a first chat message

Example request:
curl --request POST \
    "https://api.chatbot.logotel.cloud/api/v1/threads" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"question\": \"What\'s the meaning of life?\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'question' => 'What\'s the meaning of life?',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/threads"
);

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

let body = {
    "question": "What's the meaning of life?"
};

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

url = 'https://api.chatbot.logotel.cloud/api/v1/threads'
payload = {
    "question": "What's the meaning of life?"
}
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, 202):


{
 "uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
 "last_chat": {
     "uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
     "is_bot": true,
     "order": 1,
     "message": "This is a message",
     "feedback": "positive",
     "created_at": "10/10/2024 10:10:10",
     "sources": [
         "source1",
         "source2",
     ]
 }
}
 

Request      

POST api/v1/threads

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

question   string   

The question to be asked in the chat. Must not be greater than 5000 characters. Example: What's the meaning of life?

Get documents

requires authentication

Obtain a list of document added to the bot

Example request:
curl --request GET \
    --get "https://api.chatbot.logotel.cloud/api/v1/document?filter=nulla" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/document';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'filter' => 'nulla',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/document"
);

const params = {
    "filter": "nulla",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

url = 'https://api.chatbot.logotel.cloud/api/v1/document'
params = {
  'filter': 'nulla',
}
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, success):


[
  {
     "uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
     "name": "a-file-name",
     "icon": "file-word",
     "created_at": "10/10/2024 10:10:10",
   },
   {
     "uuid": "fjsdfj43-4944-4jg5-mmf4-52fr34j3j4f",
     "name": "another-file-name",
     "icon": "file-pdf",
     "created_at": "10/10/2024 11:11:11",
   },
]
 

Request      

GET api/v1/document

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

filter   string  optional  

Filter by document name. Example: nulla

Settings

requires authentication

Get the bot settings

Example request:
curl --request GET \
    --get "https://api.chatbot.logotel.cloud/api/v1/settings" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/settings';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/settings"
);

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

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

url = 'https://api.chatbot.logotel.cloud/api/v1/settings'
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
 "disclaimer": "this is a disclaimer sentence",
}
 

Request      

GET api/v1/settings

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

Speech to text

requires authentication

Obtain the audio file and convert it to text.

Example request:
curl --request POST \
    "https://api.chatbot.logotel.cloud/api/v1/speech-to-text" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "mimeType=et"\
    --form "audio=@/tmp/phpIDFBML" 
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/speech-to-text';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'mimeType',
                'contents' => 'et'
            ],
            [
                'name' => 'audio',
                'contents' => fopen('/tmp/phpIDFBML', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/speech-to-text"
);

const headers = {
    "Authorization": "Bearer {USER_SIGNED_JWT}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('mimeType', 'et');
body.append('audio', document.querySelector('input[name="audio"]').files[0]);

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

url = 'https://api.chatbot.logotel.cloud/api/v1/speech-to-text'
files = {
  'mimeType': (None, 'et'),
  'audio': open('/tmp/phpIDFBML', 'rb')}
payload = {
    "mimeType": "et"
}
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, files=files)
response.json()

Example response (200, success):


{
    "text": "transcribed text"
}
 

Request      

POST api/v1/speech-to-text

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

audio   file   

Must be a file. Must not be greater than 10240 kilobytes. Example: /tmp/phpIDFBML

mimeType   string  optional  

Example: et

Text to speech

requires authentication

Convert the text to an audio file.

Example request:
curl --request POST \
    "https://api.chatbot.logotel.cloud/api/v1/text-to-speech" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"chat_id\": \"vqhnnzppqxcmia\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/text-to-speech';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'chat_id' => 'vqhnnzppqxcmia',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/text-to-speech"
);

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

let body = {
    "chat_id": "vqhnnzppqxcmia"
};

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

url = 'https://api.chatbot.logotel.cloud/api/v1/text-to-speech'
payload = {
    "chat_id": "vqhnnzppqxcmia"
}
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/v1/text-to-speech

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

chat_id   string   

Must not be greater than 5000 characters. Example: vqhnnzppqxcmia

Realtime get token

requires authentication

Get the realtime token object

Example request:
curl --request GET \
    --get "https://api.chatbot.logotel.cloud/api/v1/realtime/token" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/realtime/token';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/realtime/token"
);

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

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

url = 'https://api.chatbot.logotel.cloud/api/v1/realtime/token'
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
 "token": "12345678909876543212345678901234567890",
 "expires_at": 1744019087,
}
 

Request      

GET api/v1/realtime/token

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

Rag question

requires authentication

Retrieve information from the bot knowledge base

Example request:
curl --request POST \
    "https://api.chatbot.logotel.cloud/api/v1/realtime/rag" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"question\": \"ebqbiowsbfipklyknpn\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/realtime/rag';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'question' => 'ebqbiowsbfipklyknpn',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/realtime/rag"
);

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

let body = {
    "question": "ebqbiowsbfipklyknpn"
};

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

url = 'https://api.chatbot.logotel.cloud/api/v1/realtime/rag'
payload = {
    "question": "ebqbiowsbfipklyknpn"
}
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):


{
 "context": [
     "this is the context of the question",
     "this is the context of the question",
     "this is the context of the question"
 ],
 "links": [
     {
         "filename": "file1.pdf",
         "link": "https://example.com/file1.pdf"
     },
     {
         "filename": "file2.pdf",
         "link": "https://example.com/file2.pdf"
     }
 ],
}
 

Request      

POST api/v1/realtime/rag

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

question   string   

Must be at least 1 character. Must not be greater than 5000 characters. Example: ebqbiowsbfipklyknpn

Delete thread

requires authentication

Delete a thread

Example request:
curl --request DELETE \
    "https://api.chatbot.logotel.cloud/api/v1/threads/2b65fd1e-038e-3397-ab20-7a82ecb92274" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads/2b65fd1e-038e-3397-ab20-7a82ecb92274';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/threads/2b65fd1e-038e-3397-ab20-7a82ecb92274"
);

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

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

url = 'https://api.chatbot.logotel.cloud/api/v1/threads/2b65fd1e-038e-3397-ab20-7a82ecb92274'
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204):

Empty response
 

Request      

DELETE api/v1/threads/{thread_uuid}

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

thread_uuid   string   

Example: 2b65fd1e-038e-3397-ab20-7a82ecb92274

Chat messages

requires authentication

Obtain the chat messages list in the thread

Example request:
curl --request GET \
    --get "https://api.chatbot.logotel.cloud/api/v1/threads/4d113338-5ce6-323c-a727-920765d5fb77/chats" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads/4d113338-5ce6-323c-a727-920765d5fb77/chats';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/threads/4d113338-5ce6-323c-a727-920765d5fb77/chats"
);

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

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

url = 'https://api.chatbot.logotel.cloud/api/v1/threads/4d113338-5ce6-323c-a727-920765d5fb77/chats'
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


[
  {
     "uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
     "is_bot": true,
     "order": 1,
     "message": "This is a message",
     "feedback": "positive",
     "created_at": "10/10/2024 10:10:10",
     "sources": [
         "source1",
         "source2",
     ]
   },
]
 

Request      

GET api/v1/threads/{thread_uuid}/chats

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

thread_uuid   string   

Example: 4d113338-5ce6-323c-a727-920765d5fb77

Create chat message

requires authentication

Create a chat message in the thread

Example request:
curl --request POST \
    "https://api.chatbot.logotel.cloud/api/v1/threads/acde87cc-9f35-31f5-b27b-81c66e3227d1/chats" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"question\": \"What\'s the meaning of life?\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads/acde87cc-9f35-31f5-b27b-81c66e3227d1/chats';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'question' => 'What\'s the meaning of life?',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/threads/acde87cc-9f35-31f5-b27b-81c66e3227d1/chats"
);

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

let body = {
    "question": "What's the meaning of life?"
};

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

url = 'https://api.chatbot.logotel.cloud/api/v1/threads/acde87cc-9f35-31f5-b27b-81c66e3227d1/chats'
payload = {
    "question": "What's the meaning of life?"
}
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, 202):


{
    "uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
    "is_bot": false,
    "order": 1,
    "message": "This is a message",
    "feedback": "",
    "created_at": "10/10/2024 10:10:10",
    "sources": []
}
 

Request      

POST api/v1/threads/{thread_uuid}/chats

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

thread_uuid   string   

Example: acde87cc-9f35-31f5-b27b-81c66e3227d1

Body Parameters

question   string   

The question to be asked in the chat. Must not be greater than 5000 characters. Example: What's the meaning of life?

Check if AI reply

requires authentication

Check if the AI reply is ready and if is so, return the message

Example request:
curl --request GET \
    --get "https://api.chatbot.logotel.cloud/api/v1/threads/6ddadcf2-685e-3d89-ab04-aa34a9ef351b/chats/pending" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads/6ddadcf2-685e-3d89-ab04-aa34a9ef351b/chats/pending';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/threads/6ddadcf2-685e-3d89-ab04-aa34a9ef351b/chats/pending"
);

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

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

url = 'https://api.chatbot.logotel.cloud/api/v1/threads/6ddadcf2-685e-3d89-ab04-aa34a9ef351b/chats/pending'
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, chat found but pending):


{
 "status": "pending",
}
 

Example response (200, chat found and ready):


{
 "status": "ok",
 "data": {
     "uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
     "is_bot": false,
     "order": 1,
     "message": "This is a message",
     "feedback": "",
     "created_at": "10/10/2024 10:10:10",
     "sources": [
         "source1",
         "source2",
     ]
 }
}
 

Example response (204, chat not found):

Empty response
 

Request      

GET api/v1/threads/{thread_uuid}/chats/pending

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

thread_uuid   string   

Example: 6ddadcf2-685e-3d89-ab04-aa34a9ef351b

Feedback

requires authentication

Add feedback to the chat

Example request:
curl --request PUT \
    "https://api.chatbot.logotel.cloud/api/v1/threads/575ed74c-f09f-3480-8f02-d73df6fa8aeb/chats/3aa1d93b-2c4e-3dd2-81d7-f0c1a307e6ad" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"feedback\": \"positive\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/threads/575ed74c-f09f-3480-8f02-d73df6fa8aeb/chats/3aa1d93b-2c4e-3dd2-81d7-f0c1a307e6ad';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'feedback' => 'positive',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/threads/575ed74c-f09f-3480-8f02-d73df6fa8aeb/chats/3aa1d93b-2c4e-3dd2-81d7-f0c1a307e6ad"
);

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

let body = {
    "feedback": "positive"
};

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

url = 'https://api.chatbot.logotel.cloud/api/v1/threads/575ed74c-f09f-3480-8f02-d73df6fa8aeb/chats/3aa1d93b-2c4e-3dd2-81d7-f0c1a307e6ad'
payload = {
    "feedback": "positive"
}
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (204):

Empty response
 

Request      

PUT api/v1/threads/{thread_uuid}/chats/{uuid}

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

thread_uuid   string   

Example: 575ed74c-f09f-3480-8f02-d73df6fa8aeb

uuid   string   

Example: 3aa1d93b-2c4e-3dd2-81d7-f0c1a307e6ad

Body Parameters

feedback   string  optional  

The feedback for the AI response. Example: positive

Must be one of:
  • positive
  • negative

AI Search Engine

requires authentication

Search the query in the documents by similarity using vector search.

Example request:
curl --request POST \
    "https://api.chatbot.logotel.cloud/api/v1/search-engine/documents" \
    --header "Authorization: Bearer {USER_SIGNED_JWT}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"question\": \"What\'s the meaning of life?\",
    \"limit\": 10,
    \"filter\": {
        \"0\": {
            \"date_from\": \"2020-01-01\"
        },
        \"date_from\": \"2025-04-07\"
    }
}"
$client = new \GuzzleHttp\Client();
$url = 'https://api.chatbot.logotel.cloud/api/v1/search-engine/documents';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {USER_SIGNED_JWT}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'question' => 'What\'s the meaning of life?',
            'limit' => 10,
            'filter' => [
                [
                    'date_from' => '2020-01-01',
                ],
                'date_from' => '2025-04-07',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.chatbot.logotel.cloud/api/v1/search-engine/documents"
);

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

let body = {
    "question": "What's the meaning of life?",
    "limit": 10,
    "filter": {
        "0": {
            "date_from": "2020-01-01"
        },
        "date_from": "2025-04-07"
    }
};

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

url = 'https://api.chatbot.logotel.cloud/api/v1/search-engine/documents'
payload = {
    "question": "What's the meaning of life?",
    "limit": 10,
    "filter": {
        "0": {
            "date_from": "2020-01-01"
        },
        "date_from": "2025-04-07"
    }
}
headers = {
  'Authorization': 'Bearer {USER_SIGNED_JWT}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):


[
  {
     "uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
     "name": "my document",
     "icon": "file-pdf",
     "distance": 0.953548767,
     "ratings": {
         "distance": "0.8100819089838152",
         "time_rating": "0.18356164383561646",
         "document_rating": "0.3333333333333333",
         "title_rating": "0,6666666666666666"
     },
     "link": "https://example.com/something.pdf",
     "metadata": {
         "key": "value",
         "key2": "value2"
     },
     "created_at": "10/10/2024 10:10:10"
   },
]
 

Request      

POST api/v1/search-engine/documents

Headers

Authorization      

Example: Bearer {USER_SIGNED_JWT}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

question   string   

The question to ask to the search engine. Must be at least 10 characters. Must not be greater than 5000 characters. Example: What's the meaning of life?

limit   integer  optional  

The maximum number of results to return. Must be at least 1. Must not be greater than 100. Example: 10

filter   object  optional  

The filters to apply to the search engine.

date_from   string  optional  

Must be a valid date. Must be a valid date in the format Y-m-d. Example: 2025-04-07