{
    "variable": [
        {
            "id": "baseUrl",
            "key": "baseUrl",
            "type": "string",
            "name": "string",
            "value": "https:\/\/api.chatbot.logotel.cloud"
        }
    ],
    "info": {
        "name": "LogBot API Documentation",
        "_postman_id": "7c7088db-6ea9-4ee5-91ed-b7969370d9cb",
        "description": "",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json"
    },
    "item": [
        {
            "name": "Endpoints",
            "description": "",
            "item": [
                {
                    "name": "GET api\/health",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/health",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/health"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [
                                {
                                    "key": "cache-control",
                                    "value": "no-cache, private"
                                },
                                {
                                    "key": "content-type",
                                    "value": "application\/json"
                                },
                                {
                                    "key": "access-control-allow-origin",
                                    "value": "*"
                                }
                            ],
                            "code": 200,
                            "body": "{\"database\":{\"status\":true,\"description\":\"ok\"},\"cache\":{\"status\":true,\"description\":\"ok\"}}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Authenticate",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/authenticate",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/authenticate"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"jwt\":\"ea\"}"
                        },
                        "description": "Authenticate the user via jwt and return a key to be used instead of it"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n \"key\": \"somekey\",\n}",
                            "name": "success"
                        }
                    ]
                },
                {
                    "name": "Thread list",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/threads",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/threads"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Obtain the threads list"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "[\n {\n  \"uuid\": \"fdb07973-4955-40db-a8d1-d5b8547b4c9b\",\n  \"title\": \"the title of the thread\",\n  \"last_chat\": {\n      \"uuid\": \"dfrr67f7-s940-33dx-app9-ofpf7b4c9b\",\n      \"is_bot\": true,\n      \"order\": 1,\n      \"message\": \"This is a message\",\n      \"feedback\": \"positive\",\n      \"created_at\": \"10\/10\/2024 10:10:10\",\n      \"sources\": [\n          \"source1\",\n          \"source2\",\n      ]\n  }\n }\n]",
                            "name": "success"
                        }
                    ]
                },
                {
                    "name": "Create thread",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/threads",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/threads"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"question\":\"What's the meaning of life?\"}"
                        },
                        "description": "Create a new thread with a first chat message"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n \"uuid\": \"fdb07973-4955-40db-a8d1-d5b8547b4c9b\",\n \"last_chat\": {\n     \"uuid\": \"fdb07973-4955-40db-a8d1-d5b8547b4c9b\",\n     \"is_bot\": true,\n     \"order\": 1,\n     \"message\": \"This is a message\",\n     \"feedback\": \"positive\",\n     \"created_at\": \"10\/10\/2024 10:10:10\",\n     \"sources\": [\n         \"source1\",\n         \"source2\",\n     ]\n }\n}",
                            "name": "202"
                        }
                    ]
                },
                {
                    "name": "Get documents",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/document",
                            "query": [
                                {
                                    "key": "filter",
                                    "value": "nulla",
                                    "description": "Filter by document name.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/v1\/document?filter=nulla"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Obtain a list of document added to the bot"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "[\n  {\n     \"uuid\": \"fdb07973-4955-40db-a8d1-d5b8547b4c9b\",\n     \"name\": \"a-file-name\",\n     \"icon\": \"file-word\",\n     \"created_at\": \"10\/10\/2024 10:10:10\",\n   },\n   {\n     \"uuid\": \"fjsdfj43-4944-4jg5-mmf4-52fr34j3j4f\",\n     \"name\": \"another-file-name\",\n     \"icon\": \"file-pdf\",\n     \"created_at\": \"10\/10\/2024 11:11:11\",\n   },\n]",
                            "name": "success"
                        }
                    ]
                },
                {
                    "name": "Settings",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/settings",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/settings"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get the bot settings"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n \"disclaimer\": \"this is a disclaimer sentence\",\n}",
                            "name": "success"
                        }
                    ]
                },
                {
                    "name": "Speech to text",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/speech-to-text",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/speech-to-text"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "multipart\/form-data"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "formdata",
                            "formdata": [
                                {
                                    "key": "mimeType",
                                    "value": "et",
                                    "type": "text",
                                    "description": ""
                                },
                                {
                                    "key": "audio",
                                    "src": [],
                                    "type": "file"
                                }
                            ]
                        },
                        "description": "Obtain the audio file and convert it to text."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n \"text\": \"transcribed text\"\n}",
                            "name": "success"
                        }
                    ]
                },
                {
                    "name": "Text to speech",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/text-to-speech",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/text-to-speech"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"chat_id\":\"vqhnnzppqxcmia\"}"
                        },
                        "description": "Convert the text to an audio file."
                    },
                    "response": []
                },
                {
                    "name": "Realtime get token",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/realtime\/token",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/realtime\/token"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get the realtime token object"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n \"token\": \"12345678909876543212345678901234567890\",\n \"expires_at\": 1744019087,\n}",
                            "name": "success"
                        }
                    ]
                },
                {
                    "name": "Rag question",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/realtime\/rag",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/realtime\/rag"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"question\":\"ebqbiowsbfipklyknpn\"}"
                        },
                        "description": "Retrieve information from the bot knowledge base"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n \"context\": [\n     \"this is the context of the question\",\n     \"this is the context of the question\",\n     \"this is the context of the question\"\n ],\n \"links\": [\n     {\n         \"filename\": \"file1.pdf\",\n         \"link\": \"https:\/\/example.com\/file1.pdf\"\n     },\n     {\n         \"filename\": \"file2.pdf\",\n         \"link\": \"https:\/\/example.com\/file2.pdf\"\n     }\n ],\n}",
                            "name": "success"
                        }
                    ]
                },
                {
                    "name": "Delete thread",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/threads\/:thread_uuid",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/threads\/:thread_uuid",
                            "variable": [
                                {
                                    "id": "thread_uuid",
                                    "key": "thread_uuid",
                                    "value": "2b65fd1e-038e-3397-ab20-7a82ecb92274",
                                    "description": ""
                                }
                            ]
                        },
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Delete a thread"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 204,
                            "body": "{}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Chat messages",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/threads\/:thread_uuid\/chats",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/threads\/:thread_uuid\/chats",
                            "variable": [
                                {
                                    "id": "thread_uuid",
                                    "key": "thread_uuid",
                                    "value": "4d113338-5ce6-323c-a727-920765d5fb77",
                                    "description": ""
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Obtain the chat messages list in the thread"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "[\n  {\n     \"uuid\": \"fdb07973-4955-40db-a8d1-d5b8547b4c9b\",\n     \"is_bot\": true,\n     \"order\": 1,\n     \"message\": \"This is a message\",\n     \"feedback\": \"positive\",\n     \"created_at\": \"10\/10\/2024 10:10:10\",\n     \"sources\": [\n         \"source1\",\n         \"source2\",\n     ]\n   },\n]",
                            "name": "success"
                        }
                    ]
                },
                {
                    "name": "Create chat message",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/threads\/:thread_uuid\/chats",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/threads\/:thread_uuid\/chats",
                            "variable": [
                                {
                                    "id": "thread_uuid",
                                    "key": "thread_uuid",
                                    "value": "acde87cc-9f35-31f5-b27b-81c66e3227d1",
                                    "description": ""
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"question\":\"What's the meaning of life?\"}"
                        },
                        "description": "Create a chat message in the thread"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n \"uuid\": \"fdb07973-4955-40db-a8d1-d5b8547b4c9b\",\n \"is_bot\": false,\n \"order\": 1,\n \"message\": \"This is a message\",\n \"feedback\": \"\",\n \"created_at\": \"10\/10\/2024 10:10:10\",\n \"sources\": []\n}",
                            "name": "202"
                        }
                    ]
                },
                {
                    "name": "Check if AI reply",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/threads\/:thread_uuid\/chats\/pending",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/threads\/:thread_uuid\/chats\/pending",
                            "variable": [
                                {
                                    "id": "thread_uuid",
                                    "key": "thread_uuid",
                                    "value": "6ddadcf2-685e-3d89-ab04-aa34a9ef351b",
                                    "description": ""
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Check if the AI reply is ready and if is so, return the message"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n \"status\": \"pending\",\n}",
                            "name": "chat found but pending"
                        },
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n \"status\": \"ok\",\n \"data\": {\n     \"uuid\": \"fdb07973-4955-40db-a8d1-d5b8547b4c9b\",\n     \"is_bot\": false,\n     \"order\": 1,\n     \"message\": \"This is a message\",\n     \"feedback\": \"\",\n     \"created_at\": \"10\/10\/2024 10:10:10\",\n     \"sources\": [\n         \"source1\",\n         \"source2\",\n     ]\n }\n}",
                            "name": "chat found and ready"
                        },
                        {
                            "header": [],
                            "code": 204,
                            "body": "",
                            "name": "chat not found"
                        }
                    ]
                },
                {
                    "name": "Feedback",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/threads\/:thread_uuid\/chats\/:uuid",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/threads\/:thread_uuid\/chats\/:uuid",
                            "variable": [
                                {
                                    "id": "thread_uuid",
                                    "key": "thread_uuid",
                                    "value": "575ed74c-f09f-3480-8f02-d73df6fa8aeb",
                                    "description": ""
                                },
                                {
                                    "id": "uuid",
                                    "key": "uuid",
                                    "value": "3aa1d93b-2c4e-3dd2-81d7-f0c1a307e6ad",
                                    "description": ""
                                }
                            ]
                        },
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"feedback\":\"positive\"}"
                        },
                        "description": "Add feedback to the chat"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 204,
                            "body": "{}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "AI Search Engine",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/search-engine\/documents",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/search-engine\/documents"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"question\":\"What's the meaning of life?\",\"limit\":10,\"filter\":{\"0\":{\"date_from\":\"2020-01-01\"},\"date_from\":\"2025-04-07\"}}"
                        },
                        "description": "Search the query in the documents by similarity using vector search."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "[\n  {\n     \"uuid\": \"fdb07973-4955-40db-a8d1-d5b8547b4c9b\",\n     \"name\": \"my document\",\n     \"icon\": \"file-pdf\",\n     \"distance\": 0.953548767,\n     \"ratings\": {\n         \"distance\": \"0.8100819089838152\",\n         \"time_rating\": \"0.18356164383561646\",\n         \"document_rating\": \"0.3333333333333333\",\n         \"title_rating\": \"0,6666666666666666\"\n     },\n     \"link\": \"https:\/\/example.com\/something.pdf\",\n     \"metadata\": {\n         \"key\": \"value\",\n         \"key2\": \"value2\"\n     },\n     \"created_at\": \"10\/10\/2024 10:10:10\"\n   },\n]",
                            "name": "success"
                        }
                    ]
                }
            ]
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "jwt",
                "type": "string"
            }
        ]
    }
}