{
  "openapi": "3.0.3",
  "info": {
    "title": "Selarti public api",
    "description": "🇬🇧 To get an API key, click on your avatar in the panel, then get api key. The key will be sent to telegram\n\n🇷🇺 Чтобы получить API ключ, нажмите на свой аватар в панели, затем получить api ключ. Ключ будет отправлен в telegram\n\n🇺🇿 API kalitini olish uchun panelda o'z avataringizni bosing, keyin API kalitini oling. Kalit telegramga yuboriladi.\n\n<img src=\"https://content.pstmn.io/9cfbb482-6d0d-41aa-9079-0c5703898170/aW1hZ2UucG5n\" width=\"270\" height=\"165\">\n## 🔐 Authentication Flow / Процесс аутентификации / Autentifikatsiya jarayoni\n\n**🇬🇧 For `/api/1.1/wf/*` endpoints:**\n1. First, call `/api/1.1/wf/auth` with your API key\n2. Use the returned bearer token for subsequent requests\n3. Add token to `Authorization: Bearer {token}` header\n\n**🇷🇺 Для `/api/1.1/wf/*` эндпоинтов:**\n1. Сначала вызовите `/api/1.1/wf/auth` с вашим API ключом\n2. Используйте полученный bearer токен для последующих запросов\n3. Добавьте токен в заголовок `Authorization: Bearer {token}`\n\n**🇺🇿 `/api/1.1/wf/*` endpointlar uchun:**\n1. Avval `/api/1.1/wf/auth` ni API kalitingiz bilan chaqiring\n2. Qaytgan bearer tokenni keyingi so'rovlar uchun ishlating\n3. Tokenni `Authorization: Bearer {token}` sarlavhasiga qo'shing\n\n",
    "version": "1.0.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://selarti.com",
      "description": "Main API server (for /api/1.1/wf/* endpoints)"
    },
    {
      "url": "https://api.selarti.com",
      "description": "Advanced API server (for /v1/* endpoints)"
    }
  ],
  "paths": {
    "/api/1.1/wf/get_gpt_version": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "get": {
        "tags": [
          "Data Retrieval"
        ],
        "summary": "get gpt version",
        "description": "🇬🇧 Retrieving a list of all available AI models\n\n🇷🇺 Получение списка всех доступных моделей ИИ\n\n🇺🇿 Barcha mavjud AI modellarining ro'yxatini olish",
        "operationId": "getGptVersion",
        "responses": {
          "200": {
            "description": "get gpt version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "response": {
                      "type": "object",
                      "properties": {
                        "gpt-version": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "gpt-5"
                          },
                          "example": [
                            "gpt-5",
                            "gpt-5-mini",
                            "gpt-5-nano",
                            "gpt-4.1",
                            "gpt-4.1-mini",
                            "gpt-4.1-nano",
                            "gpt-4.5 preview",
                            "gpt-o3",
                            "gpt-o3-deep-research",
                            "gpt-o4-mini",
                            "gpt-o4-mini-deep-research",
                            "gpt-o3-pro",
                            "gpt-o1-pro",
                            "gpt-o1",
                            "gpt-o3-mini",
                            "gpt-4o",
                            "gpt-4o-mini",
                            "gpt-4-turbo",
                            "gpt-4-turbo-preview"
                          ]
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "example": "success"
                    }
                  }
                },
                "examples": {
                  "get gpt version": {
                    "value": {
                      "response": {
                        "gpt-version": [
                          "gpt-5",
                          "gpt-5-mini",
                          "gpt-5-nano",
                          "gpt-4.1",
                          "gpt-4.1-mini",
                          "gpt-4.1-nano",
                          "gpt-4.5 preview",
                          "gpt-o3",
                          "gpt-o3-deep-research",
                          "gpt-o4-mini",
                          "gpt-o4-mini-deep-research",
                          "gpt-o3-pro",
                          "gpt-o1-pro",
                          "gpt-o1",
                          "gpt-o3-mini",
                          "gpt-4o",
                          "gpt-4o-mini",
                          "gpt-4-turbo",
                          "gpt-4-turbo-preview"
                        ]
                      },
                      "status": "success"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/1.1/wf/get_ai": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "get": {
        "tags": [
          "Data Retrieval"
        ],
        "summary": "get ai",
        "description": "🇬🇧 Getting AI settings\n\n🇷🇺 Получение настроек ИИ\n\n🇺🇿 AI sozlamalarini olish",
        "operationId": "getAi",
        "parameters": [
          {
            "name": "company_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{company_id}"
            }
          },
          {
            "name": "ai_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{ai_id}"
            },
            "description": "optional. if empty, then get all ai of this company"
          }
        ],
        "responses": {
          "200": {
            "description": "get ai",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "response": {
                      "type": "object",
                      "properties": {
                        "ai": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "Created By": {
                                "type": "string",
                                "example": "4827391658201x947362851049736284"
                              },
                              "Created Date": {
                                "type": "number",
                                "example": 5938274610592
                              },
                              "Modified Date": {
                                "type": "number",
                                "example": 5938274610592
                              },
                              "_id": {
                                "type": "string",
                                "example": "5938274610592x284739562018473926"
                              },
                              "company": {
                                "type": "string",
                                "example": "5938274610592x284739562018473926"
                              },
                              "functions": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "example": "1758891292333x930006135988551700"
                                },
                                "example": [
                                  "1758891292333x930006135988551700"
                                ]
                              },
                              "instruction_history": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "example": "1758898258280x851693232977870800"
                                },
                                "example": [
                                  "1758898258280x851693232977870800",
                                  "1758894473695x787132469676605400"
                                ]
                              },
                              "name": {
                                "type": "string",
                                "example": "AI Name"
                              },
                              "reasoning_effort": {
                                "type": "string",
                                "example": "medium"
                              },
                              "start_message": {
                                "type": "string",
                                "example": "{Hello | Hi| Wassup}"
                              },
                              "temperature": {
                                "type": "number",
                                "example": 1
                              },
                              "top_p": {
                                "type": "number",
                                "example": 1
                              },
                              "verbosity": {
                                "type": "string",
                                "example": "medium"
                              },
                              "version": {
                                "type": "string",
                                "example": "gpt-5"
                              },
                              "work option": {
                                "type": "string",
                                "example": "Incoming communication"
                              }
                            }
                          },
                          "example": [
                            {
                              "Created By": "4827391658201x947362851049736284",
                              "Created Date": 5938274610592,
                              "Modified Date": 5938274610592,
                              "_id": "5938274610592x284739562018473926",
                              "company": "5938274610592x284739562018473926",
                              "functions": [
                                "1758891292333x930006135988551700"
                              ],
                              "instruction_history": [
                                "1758898258280x851693232977870800",
                                "1758894473695x787132469676605400"
                              ],
                              "name": "AI Name",
                              "reasoning_effort": "medium",
                              "start_message": "{Hello | Hi| Wassup}",
                              "temperature": 1,
                              "top_p": 1,
                              "verbosity": "medium",
                              "version": "gpt-5",
                              "work option": "Incoming communication"
                            }
                          ]
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "example": "success"
                    }
                  }
                },
                "examples": {
                  "get ai": {
                    "value": {
                      "response": {
                        "ai": [
                          {
                            "Created By": "4827391658201x947362851049736284",
                            "Created Date": 5938274610592,
                            "Modified Date": 5938274610592,
                            "_id": "5938274610592x284739562018473926",
                            "company": "5938274610592x284739562018473926",
                            "functions": [
                              "1758891292333x930006135988551700"
                            ],
                            "instruction_history": [
                              "1758898258280x851693232977870800",
                              "1758894473695x787132469676605400"
                            ],
                            "name": "AI Name",
                            "reasoning_effort": "medium",
                            "start_message": "{Hello | Hi| Wassup}",
                            "temperature": 1,
                            "top_p": 1,
                            "verbosity": "medium",
                            "version": "gpt-5",
                            "work option": "Incoming communication"
                          }
                        ]
                      },
                      "status": "success"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/get_task": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "get": {
        "tags": [
          "Data Retrieval"
        ],
        "summary": "get task",
        "description": "🇬🇧 Get task information\n\n🇷🇺 Получить информацию о задаче\n\n🇺🇿 Vazifa haqida ma'lumot olish",
        "operationId": "getTask",
        "parameters": [
          {
            "name": "company_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{company_id}"
            }
          },
          {
            "name": "task_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{task_id}"
            },
            "description": "optional. if empty, then get all task of this company"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/get_company": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "get": {
        "tags": [
          "Data Retrieval"
        ],
        "summary": "get company",
        "description": "🇬🇧 Get company information\n\n🇷🇺 Получить информацию о компании\n\n🇺🇿 Kompaniya haqida ma'lumot olish",
        "operationId": "getCompany",
        "parameters": [
          {
            "name": "company_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{company_id}"
            },
            "description": "optional. if empty, then get all company"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/get_thread": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "get": {
        "tags": [
          "Data Retrieval"
        ],
        "summary": "get thread",
        "description": "🇬🇧 Get thread information\n\n🇷🇺 Получить информацию о диалоге\n\n🇺🇿 Suhbat haqida ma’lumot olish",
        "operationId": "getThread",
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{task_id}"
            },
            "required": true,
            "description": "required. get thread of this task"
          },
          {
            "name": "thread_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{thread_id}"
            },
            "description": "optional. if empty, then get all thread of this task"
          },
          {
            "name": "external_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{external_id}"
            },
            "description": "optional. external id from messaging platform, this ID can also be set via the add_target method"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "20"
            },
            "description": "optional. if empty, it will return 20 threads"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "0"
            },
            "description": "optional. if empty, it will return 20 threads"
          }
        ],
        "responses": {
          "200": {
            "description": "get thread",
            "headers": {
              "CF-Cache-Status": {
                "schema": {
                  "type": "string",
                  "example": "DYNAMIC"
                }
              },
              "CF-RAY": {
                "schema": {
                  "type": "string",
                  "example": "8ddd924eea5e9d2e-DME"
                }
              },
              "Connection": {
                "schema": {
                  "type": "string",
                  "example": "keep-alive"
                }
              },
              "Date": {
                "schema": {
                  "type": "string",
                  "example": "Tue, 05 Nov 2024 14:35:40 GMT"
                }
              },
              "Server": {
                "schema": {
                  "type": "string",
                  "example": "cloudflare"
                }
              },
              "Transfer-Encoding": {
                "schema": {
                  "type": "string",
                  "example": "chunked"
                }
              },
              "access-control-allow-origin": {
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "alt-svc": {
                "schema": {
                  "type": "string",
                  "example": "h3=\":443\"; ma=86400"
                }
              },
              "content-encoding": {
                "schema": {
                  "type": "string",
                  "example": "gzip"
                }
              },
              "vary": {
                "schema": {
                  "type": "string",
                  "example": "Accept-Encoding"
                }
              },
              "x-bubble-capacity-limit": {
                "schema": {
                  "type": "string",
                  "example": "0 ms slower"
                }
              },
              "x-bubble-capacity-used": {
                "schema": {
                  "type": "string",
                  "example": "0.12 unit-seconds used"
                }
              },
              "x-bubble-perf": {
                "schema": {
                  "type": "string",
                  "example": "{\"total\":555.5,\"percents\":{\"top\":{\"bubble_cpu\":7,\"block\":91.5,\"capacity_rl\":0,\"other_pause\":0,\"pre_fiber\":0.8},\"sub\":{\"pp_userdb\":1.1,\"pp_wait_userdb\":0,\"http_request\":0,\"serverjson\":117.1,\"appserver_cache_misses_time\":0,\"redis\":69.6,\"fiber_queue\":20.1,\"capacity_wait\":0}},\"counts\":{\"pp_userdb\":1,\"http_request\":0,\"derived_build\":0,\"derived_cache_attempts\":2,\"derived_cache_memory_misses\":2,\"serverjson\":32,\"appserver_cache_attempts\":1,\"appserver_mem_cache_hits\":0,\"appserver_cache_hits\":1,\"appserver_cache_misses\":0,\"redis\":34,\"fiber_queue\":36,\"blocks\":35},\"misc\":{\"userdb_results\":4,\"userdb_data\":3955,\"spent_time\":7824453}}"
                }
              },
              "x-powered-by": {
                "schema": {
                  "type": "string",
                  "example": "Express"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "response": {
                      "type": "object",
                      "properties": {
                        "thread": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "Created By": {
                                "type": "string",
                                "example": "no_user"
                              },
                              "Created Date": {
                                "type": "number",
                                "example": 1721810009008
                              },
                              "Modified Date": {
                                "type": "number",
                                "example": 1724310220845
                              },
                              "_id": {
                                "type": "string",
                                "example": "1827394658203x947362851049736284"
                              },
                              "ai_thread_id": {
                                "type": "string",
                                "example": "thread_3jzvqhqjfZbWHzksEBZwt9Ql"
                              },
                              "channel": {
                                "type": "string",
                                "example": "1827394658203x947362851049736284"
                              },
                              "close": {
                                "type": "boolean",
                                "example": false
                              },
                              "company": {
                                "type": "string",
                                "example": "1827394658203x947362851049736284"
                              },
                              "count_message": {
                                "type": "number",
                                "example": 3
                              },
                              "date_close": {
                                "type": "number",
                                "example": 1724310968659
                              },
                              "date_contact": {
                                "type": "number",
                                "example": 1724310220844
                              },
                              "date_interest": {
                                "type": "number",
                                "example": 1724310220688
                              },
                              "date_success": {
                                "type": "number",
                                "example": 1724310220734
                              },
                              "get_contact": {
                                "type": "boolean",
                                "example": true
                              },
                              "interest": {
                                "type": "boolean",
                                "example": true
                              },
                              "is_bot": {
                                "type": "boolean",
                                "example": false
                              },
                              "last_message_date": {
                                "type": "number",
                                "example": 1721810016865
                              },
                              "last_message_text": {
                                "type": "string",
                                "example": "сообщение 3"
                              },
                              "success": {
                                "type": "boolean",
                                "example": true
                              },
                              "task": {
                                "type": "string",
                                "example": "1827394658203x947362851049736284"
                              },
                              "title": {
                                "type": "string",
                                "example": "Frame user"
                              },
                              "user_replied": {
                                "type": "boolean",
                                "example": false
                              },
                              "wh_get_contact": {
                                "type": "boolean",
                                "example": true
                              },
                              "wh_interest": {
                                "type": "boolean",
                                "example": true
                              },
                              "wh_success": {
                                "type": "boolean",
                                "example": true
                              }
                            }
                          },
                          "example": [
                            {
                              "Created By": "no_user",
                              "Created Date": 1721810009008,
                              "Modified Date": 1724310220845,
                              "_id": "1827394658203x947362851049736284",
                              "ai_thread_id": "thread_3jzvqhqjfZbWHzksEBZwt9Ql",
                              "channel": "1827394658203x947362851049736284",
                              "close": false,
                              "company": "1827394658203x947362851049736284",
                              "count_message": 3,
                              "date_contact": 1724310220844,
                              "date_interest": 1724310220688,
                              "date_success": 1724310220734,
                              "get_contact": true,
                              "interest": true,
                              "is_bot": false,
                              "last_message_date": 1721810016865,
                              "last_message_text": "сообщение 3",
                              "success": true,
                              "task": "1827394658203x947362851049736284",
                              "title": "Frame user",
                              "user_replied": false,
                              "wh_get_contact": true,
                              "wh_interest": true,
                              "wh_success": true
                            },
                            {
                              "Created By": "no_user",
                              "Created Date": 1721717808238,
                              "Modified Date": 1724310973734,
                              "_id": "1827394658203x947362851049736284",
                              "ai_thread_id": "thread_30nzKqokrXfPbM45tOtdUm4p",
                              "channel": "1827394658203x947362851049736284",
                              "close": false,
                              "company": "1827394658203x947362851049736284",
                              "count_message": 3,
                              "date_close": 1724310968659,
                              "date_contact": 1724310968820,
                              "date_interest": 1724310968679,
                              "date_success": 1724310968793,
                              "get_contact": false,
                              "interest": false,
                              "is_bot": false,
                              "last_message_date": 1721717815864,
                              "last_message_text": "сообщение 3",
                              "success": false,
                              "task": "1827394658203x947362851049736284",
                              "title": "Frame user",
                              "user_replied": false,
                              "wh_get_contact": true,
                              "wh_interest": true,
                              "wh_success": true
                            }
                          ]
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "example": "success"
                    }
                  }
                },
                "examples": {
                  "get thread": {
                    "value": {
                      "response": {
                        "thread": [
                          {
                            "Created By": "no_user",
                            "Created Date": 1721810009008,
                            "Modified Date": 1724310220845,
                            "_id": "1827394658203x947362851049736284",
                            "ai_thread_id": "thread_3jzvqhqjfZbWHzksEBZwt9Ql",
                            "channel": "1827394658203x947362851049736284",
                            "close": false,
                            "company": "1827394658203x947362851049736284",
                            "count_message": 3,
                            "date_contact": 1724310220844,
                            "date_interest": 1724310220688,
                            "date_success": 1724310220734,
                            "get_contact": true,
                            "interest": true,
                            "is_bot": false,
                            "last_message_date": 1721810016865,
                            "last_message_text": "сообщение 3",
                            "success": true,
                            "task": "1827394658203x947362851049736284",
                            "title": "Frame user",
                            "user_replied": false,
                            "wh_get_contact": true,
                            "wh_interest": true,
                            "wh_success": true
                          },
                          {
                            "Created By": "no_user",
                            "Created Date": 1721717808238,
                            "Modified Date": 1724310973734,
                            "_id": "1827394658203x947362851049736284",
                            "ai_thread_id": "thread_30nzKqokrXfPbM45tOtdUm4p",
                            "channel": "1827394658203x947362851049736284",
                            "close": false,
                            "company": "1827394658203x947362851049736284",
                            "count_message": 3,
                            "date_close": 1724310968659,
                            "date_contact": 1724310968820,
                            "date_interest": 1724310968679,
                            "date_success": 1724310968793,
                            "get_contact": false,
                            "interest": false,
                            "is_bot": false,
                            "last_message_date": 1721717815864,
                            "last_message_text": "сообщение 3",
                            "success": false,
                            "task": "1827394658203x947362851049736284",
                            "title": "Frame user",
                            "user_replied": false,
                            "wh_get_contact": true,
                            "wh_interest": true,
                            "wh_success": true
                          }
                        ]
                      },
                      "status": "success"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/get_message": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "get": {
        "tags": [
          "Data Retrieval"
        ],
        "summary": "get message",
        "description": "🇬🇧 Get message information\n\n🇷🇺 Получить информацию о сообщении\n\n🇺🇿 Xabar haqida ma'lumot olish",
        "operationId": "getMessage",
        "parameters": [
          {
            "name": "thread_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{thread_id}"
            }
          },
          {
            "name": "message_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{message_id}"
            },
            "description": "optional. if empty, then get all message of this thread"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "20"
            },
            "description": "optional. if empty, it will return 20 messages"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "0"
            },
            "description": "optional. if empty, it will return 20 messages"
          },
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "1729580592315"
            },
            "description": "optional. Created Date > start_date"
          }
        ],
        "responses": {
          "200": {
            "description": "get message",
            "headers": {
              "CF-Cache-Status": {
                "schema": {
                  "type": "string",
                  "example": "DYNAMIC"
                }
              },
              "CF-RAY": {
                "schema": {
                  "type": "string",
                  "example": "8de3693e5f129d6b-DME"
                }
              },
              "Connection": {
                "schema": {
                  "type": "string",
                  "example": "keep-alive"
                }
              },
              "Date": {
                "schema": {
                  "type": "string",
                  "example": "Wed, 06 Nov 2024 07:36:11 GMT"
                }
              },
              "Server": {
                "schema": {
                  "type": "string",
                  "example": "cloudflare"
                }
              },
              "Transfer-Encoding": {
                "schema": {
                  "type": "string",
                  "example": "chunked"
                }
              },
              "access-control-allow-origin": {
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "alt-svc": {
                "schema": {
                  "type": "string",
                  "example": "h3=\":443\"; ma=86400"
                }
              },
              "content-encoding": {
                "schema": {
                  "type": "string",
                  "example": "gzip"
                }
              },
              "vary": {
                "schema": {
                  "type": "string",
                  "example": "Accept-Encoding"
                }
              },
              "x-bubble-capacity-limit": {
                "schema": {
                  "type": "string",
                  "example": "0 ms slower"
                }
              },
              "x-bubble-capacity-used": {
                "schema": {
                  "type": "string",
                  "example": "0.139 unit-seconds used"
                }
              },
              "x-bubble-perf": {
                "schema": {
                  "type": "string",
                  "example": "{\"total\":104.5,\"percents\":{\"top\":{\"bubble_cpu\":44.9,\"block\":51.7,\"capacity_rl\":0,\"other_pause\":0,\"pre_fiber\":0.8},\"sub\":{\"pp_userdb\":5.7,\"pp_wait_userdb\":1,\"http_request\":0,\"serverjson\":66,\"appserver_cache_misses_time\":0,\"redis\":42.9,\"fiber_queue\":2.4,\"capacity_wait\":0}},\"counts\":{\"pp_userdb\":1,\"http_request\":0,\"derived_build\":0,\"derived_cache_attempts\":2,\"derived_cache_memory_misses\":2,\"serverjson\":38,\"appserver_cache_attempts\":1,\"appserver_mem_cache_hits\":0,\"appserver_cache_hits\":1,\"appserver_cache_misses\":0,\"redis\":44,\"fiber_queue\":45,\"blocks\":44},\"misc\":{\"userdb_results\":16,\"userdb_data\":9773,\"spent_time\":9046850}}"
                }
              },
              "x-powered-by": {
                "schema": {
                  "type": "string",
                  "example": "Express"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "response": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "Created By": {
                                "type": "string",
                                "example": "1827394658203x947362851049736284"
                              },
                              "Created Date": {
                                "type": "number",
                                "example": 1827394658203
                              },
                              "Modified Date": {
                                "type": "number",
                                "example": 1827394658203
                              },
                              "_id": {
                                "type": "string",
                                "example": "1827394658203x947362851049736284"
                              },
                              "ai_message_id": {
                                "type": "string",
                                "example": "msg_TFZ3bLIdi5khgzech63arcNU"
                              },
                              "company": {
                                "type": "string",
                                "example": "1827394658203x947362851049736284"
                              },
                              "message_status": {
                                "type": "string",
                                "example": "failed"
                              },
                              "message_type": {
                                "type": "string",
                                "example": "bot"
                              },
                              "task": {
                                "type": "string",
                                "example": "1827394658203x947362851049736284"
                              },
                              "text": {
                                "type": "string",
                                "example": "Test message 123"
                              },
                              "thread": {
                                "type": "string",
                                "example": "1827394658203x947362851049736284"
                              }
                            }
                          },
                          "example": [
                            {
                              "Created By": "1827394658203x947362851049736284",
                              "Created Date": 1827394658203,
                              "Modified Date": 1827394658203,
                              "_id": "1827394658203x947362851049736284",
                              "ai_message_id": "msg_TFZ3bLIdi5khgzech63arcNU",
                              "company": "1827394658203x947362851049736284",
                              "message_status": "failed",
                              "message_type": "bot",
                              "task": "1827394658203x947362851049736284",
                              "text": "Test message 123",
                              "thread": "1827394658203x947362851049736284"
                            },
                            {
                              "Created By": "1827394658203x947362851049736284",
                              "Created Date": 1827394658203,
                              "Modified Date": 1827394658203,
                              "_id": "1827394658203x947362851049736284",
                              "ai_message_id": "msg_oz7efc7mYVcrEilllIf3GEtl",
                              "company": "1827394658203x947362851049736284",
                              "message_status": "failed",
                              "message_type": "bot",
                              "task": "1827394658203x947362851049736284",
                              "text": "Test message 123",
                              "thread": "1827394658203x947362851049736284"
                            },
                            {
                              "Created By": "1827394658203x947362851049736284",
                              "Created Date": 1827394658203,
                              "Modified Date": 1827394658203,
                              "_id": "1827394658203x947362851049736284",
                              "ai_message_id": "msg_WvfJwCruCY5hkysJa9T0ooTq",
                              "company": "1827394658203x947362851049736284",
                              "message_status": "failed",
                              "message_type": "operator",
                              "task": "1827394658203x947362851049736284",
                              "text": "Test message 123",
                              "thread": "1827394658203x947362851049736284"
                            },
                            {
                              "Created By": "1827394658203x947362851049736284",
                              "Created Date": 1827394658203,
                              "Modified Date": 1827394658203,
                              "_id": "1827394658203x947362851049736284",
                              "ai_message_id": "msg_nYFYTF2jY4LsPGXo6bsp7JVU",
                              "company": "1827394658203x947362851049736284",
                              "message_status": "failed",
                              "message_type": "operator",
                              "task": "1827394658203x947362851049736284",
                              "text": "привет",
                              "thread": "1827394658203x947362851049736284"
                            },
                            {
                              "Created By": "1827394658203x947362851049736284",
                              "Created Date": 1827394658203,
                              "Modified Date": 1827394658203,
                              "_id": "1827394658203x947362851049736284",
                              "ai_message_id": "msg_TjvnlUhS5u4JHda8NXIwmJsv",
                              "company": "1827394658203x947362851049736284",
                              "message_status": "failed",
                              "message_type": "operator",
                              "task": "1827394658203x947362851049736284",
                              "text": "Test message 123",
                              "thread": "1827394658203x947362851049736284"
                            },
                            {
                              "Created By": "1827394658203x947362851049736284",
                              "Created Date": 1827394658203,
                              "Modified Date": 1827394658203,
                              "_id": "1827394658203x947362851049736284",
                              "company": "1827394658203x947362851049736284",
                              "message_type": "operator",
                              "task": "1827394658203x947362851049736284",
                              "text": "hi",
                              "thread": "1827394658203x947362851049736284"
                            },
                            {
                              "Created By": "1827394658203x947362851049736284",
                              "Created Date": 1827394658203,
                              "Modified Date": 1827394658203,
                              "_id": "1827394658203x947362851049736284",
                              "company": "1827394658203x947362851049736284",
                              "message_type": "bot",
                              "task": "1827394658203x947362851049736284",
                              "text": "привет",
                              "thread": "1827394658203x947362851049736284"
                            },
                            {
                              "Created By": "admin_user_selarti_test",
                              "Created Date": 1728548445919,
                              "Modified Date": 1728548445919,
                              "_id": "1728548445918x395778606576680640",
                              "company": "1708251850060x460863640434700",
                              "message_type": "bot",
                              "task": "1728544908612x185748016875438100",
                              "text": "1 + 1 будет равно 2.",
                              "thread": "1728545696102x349363422913789200"
                            }
                          ]
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "example": "success"
                    }
                  }
                },
                "examples": {
                  "get message": {
                    "value": {
                      "response": {
                        "message": [
                          {
                            "Created By": "1827394658203x947362851049736284",
                            "Created Date": 1827394658203,
                            "Modified Date": 1827394658203,
                            "_id": "1827394658203x947362851049736284",
                            "ai_message_id": "msg_TFZ3bLIdi5khgzech63arcNU",
                            "company": "1827394658203x947362851049736284",
                            "message_status": "failed",
                            "message_type": "bot",
                            "task": "1827394658203x947362851049736284",
                            "text": "Test message 123",
                            "thread": "1827394658203x947362851049736284"
                          },
                          {
                            "Created By": "1827394658203x947362851049736284",
                            "Created Date": 1827394658203,
                            "Modified Date": 1827394658203,
                            "_id": "1827394658203x947362851049736284",
                            "ai_message_id": "msg_oz7efc7mYVcrEilllIf3GEtl",
                            "company": "1827394658203x947362851049736284",
                            "message_status": "failed",
                            "message_type": "bot",
                            "task": "1827394658203x947362851049736284",
                            "text": "Test message 123",
                            "thread": "1827394658203x947362851049736284"
                          },
                          {
                            "Created By": "1827394658203x947362851049736284",
                            "Created Date": 1827394658203,
                            "Modified Date": 1827394658203,
                            "_id": "1827394658203x947362851049736284",
                            "ai_message_id": "msg_WvfJwCruCY5hkysJa9T0ooTq",
                            "company": "1827394658203x947362851049736284",
                            "message_status": "failed",
                            "message_type": "operator",
                            "task": "1827394658203x947362851049736284",
                            "text": "Test message 123",
                            "thread": "1827394658203x947362851049736284"
                          },
                          {
                            "Created By": "1827394658203x947362851049736284",
                            "Created Date": 1827394658203,
                            "Modified Date": 1827394658203,
                            "_id": "1827394658203x947362851049736284",
                            "ai_message_id": "msg_nYFYTF2jY4LsPGXo6bsp7JVU",
                            "company": "1827394658203x947362851049736284",
                            "message_status": "failed",
                            "message_type": "operator",
                            "task": "1827394658203x947362851049736284",
                            "text": "привет",
                            "thread": "1827394658203x947362851049736284"
                          },
                          {
                            "Created By": "1827394658203x947362851049736284",
                            "Created Date": 1827394658203,
                            "Modified Date": 1827394658203,
                            "_id": "1827394658203x947362851049736284",
                            "company": "1827394658203x947362851049736284",
                            "message_type": "operator",
                            "task": "1827394658203x947362851049736284",
                            "text": "hi",
                            "thread": "1827394658203x947362851049736284"
                          },
                          {
                            "Created By": "1827394658203x947362851049736284",
                            "Created Date": 1827394658203,
                            "Modified Date": 1827394658203,
                            "_id": "1827394658203x947362851049736284",
                            "company": "1827394658203x947362851049736284",
                            "message_type": "bot",
                            "task": "1827394658203x947362851049736284",
                            "text": "привет",
                            "thread": "1827394658203x947362851049736284"
                          },
                          {
                            "Created By": "admin_user_selarti_test",
                            "Created Date": 1728548445919,
                            "Modified Date": 1728548445919,
                            "_id": "1728548445918x395778606576680640",
                            "company": "1708251850060x460863640434700",
                            "message_type": "bot",
                            "task": "1728544908612x185748016875438100",
                            "text": "1 + 1 будет равно 2.",
                            "thread": "1728545696102x349363422913789200"
                          }
                        ]
                      },
                      "status": "success"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/get_channel": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "get": {
        "tags": [
          "Data Retrieval"
        ],
        "summary": "get channel",
        "description": "🇬🇧 Get channel information\n\n🇷🇺 Получить информацию о канале\n\n🇺🇿 Kanal haqida ma'lumot olish",
        "operationId": "getChannel",
        "parameters": [
          {
            "name": "company_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{company_id}"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/api/1.1/wf/userLogin": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Telegram user login"
        ],
        "summary": "Telegram userlogin",
        "description": "🇬🇧 Telegram user login\n\n🇷🇺 Вход пользователя Telegram\n\n🇺🇿 Telegram foydalanuvchi kirishi",
        "operationId": "telegramUserlogin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company": {
                    "type": "string",
                    "example": ""
                  },
                  "phone_number": {
                    "type": "string",
                    "example": ""
                  }
                }
              },
              "examples": {
                "Telegram userlogin": {
                  "value": {
                    "company": "",
                    "phone_number": ""
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/authcode": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Telegram user login"
        ],
        "summary": "Telegram authcode",
        "description": "🇬🇧 Telegram authentication code\n\n🇷🇺 Код аутентификации Telegram\n\n🇺🇿 Telegram autentifikatsiya kodi",
        "operationId": "telegramAuthcode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "number",
                    "example": 12345
                  },
                  "company": {
                    "type": "string",
                    "example": ""
                  },
                  "phone": {
                    "type": "string",
                    "example": "79018510315"
                  },
                  "token": {
                    "type": "string",
                    "example": "79018510315:abcd"
                  }
                }
              },
              "examples": {
                "Telegram authcode": {
                  "value": {
                    "code": 12345,
                    "company": "",
                    "phone": "79018510315",
                    "token": "79018510315:abcd"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/authPassword": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Telegram user login"
        ],
        "summary": "Telegram authPassword",
        "description": "🇬🇧 Telegram authentication password\n\n🇷🇺 Пароль аутентификации Telegram\n\n🇺🇿 Telegram autentifikatsiya paroli",
        "operationId": "telegramAuthpassword",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company": {
                    "type": "string",
                    "example": ""
                  },
                  "password": {
                    "type": "string",
                    "example": "112233"
                  },
                  "phone": {
                    "type": "string",
                    "example": "79018510315"
                  },
                  "token": {
                    "type": "string",
                    "example": "79018510315:abcd"
                  }
                }
              },
              "examples": {
                "Telegram authPassword": {
                  "value": {
                    "company": "",
                    "password": "112233",
                    "phone": "79018510315",
                    "token": "79018510315:abcd"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/auth": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "auth",
        "description": "🇬🇧 Authentication\n\n🇷🇺 Аутентификация\n\n🇺🇿 Autentifikatsiya",
        "operationId": "auth",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "example": "{{key}}"
                  }
                }
              },
              "examples": {
                "auth": {
                  "value": {
                    "key": "{{key}}"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/api/1.1/wf/create_ai": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Other"
        ],
        "summary": "create ai",
        "description": "🇬🇧 Create AI\n\n🇷🇺 Создать ИИ\n\n🇺🇿 AI yaratish",
        "operationId": "createAi",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_id": {
                    "type": "string",
                    "example": "1727272792085x807585043098198500"
                  },
                  "instruction": {
                    "type": "string",
                    "example": "Test instruction"
                  },
                  "name": {
                    "type": "string",
                    "example": "Test ai"
                  },
                  "start_message": {
                    "type": "string",
                    "example": "Hello"
                  },
                  "version": {
                    "type": "string",
                    "example": "GPT-4o"
                  },
                  "work_option": {
                    "type": "string",
                    "example": "incoming and outgoing communication"
                  }
                }
              },
              "examples": {
                "create ai": {
                  "value": {
                    "company_id": "1727272792085x807585043098198500",
                    "instruction": "Test instruction",
                    "name": "Test ai",
                    "start_message": "Hello",
                    "version": "GPT-4o",
                    "work_option": "incoming and outgoing communication"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/send_message": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Send message"
        ],
        "summary": "send message",
        "description": "🇬🇧 Send message\n\n🇷🇺 Отправить сообщение\n\n🇺🇿 Xabar yuborish",
        "operationId": "sendMessage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "thread": {
                    "type": "string",
                    "description": "thread_id",
                    "example": "1728545696102x349363422913789200"
                  },
                  "message": {
                    "type": "string",
                    "description": "message that will be sent to the user",
                    "example": "Test message 123"
                  },
                  "message_type": {
                    "type": "string",
                    "description": "operator or bot",
                    "example": "bot"
                  }
                },
                "required": [
                  "thread",
                  "message",
                  "message_type"
                ]
              },
              "examples": {
                "send message": {
                  "value": {
                    "thread": "1728545696102x349363422913789200",
                    "message": "Test message 123",
                    "message_type": "bot"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/send_message_list": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Send message"
        ],
        "summary": "send message list",
        "description": "🇬🇧 Send message list\n\n🇷🇺 Отправить список сообщений\n\n🇺🇿 Xabarlar ro'yxatini yuborish",
        "operationId": "sendMessageList",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "thread_list": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "list thread_id (interval 15 sec)",
                    "example": [
                      "1732278936892x679120003157196800",
                      "1721231916159x926265886929059800"
                    ]
                  },
                  "start_date": {
                    "type": "string",
                    "description": "format ISO 8601 or unixtime",
                    "example": "2025-01-09T12:00:00+03:00"
                  },
                  "message": {
                    "type": "string",
                    "description": "message that will be sent to the user",
                    "example": "Test"
                  },
                  "message_type": {
                    "type": "string",
                    "description": "operator or bot",
                    "example": "bot"
                  }
                },
                "required": [
                  "thread_list",
                  "message",
                  "message_type"
                ]
              },
              "examples": {
                "send message list": {
                  "value": {
                    "thread_list": [
                      "1732278936892x679120003157196800",
                      "1721231916159x926265886929059800"
                    ],
                    "start_date": "2025-01-09T12:00:00+03:00",
                    "message": "Test",
                    "message_type": "bot"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/create_thread": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Other"
        ],
        "summary": "create_thread",
        "description": "🇬🇧 Create thread\n\n🇷🇺 Создать поток\n\n🇺🇿 Ip yaratish",
        "operationId": "createThread",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "task_id": {
                    "type": "string",
                    "example": "1736844036728x319592979904856060"
                  },
                  "chat_id": {
                    "type": "string",
                    "description": "unique chat_id in your system (optional)",
                    "example": "1"
                  }
                },
                "required": [
                  "task_id"
                ]
              },
              "examples": {
                "create_thread": {
                  "value": {
                    "task_id": "1736844036728x319592979904856060",
                    "chat_id": "1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/send_message_external": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Send message"
        ],
        "summary": "send message external",
        "description": "🇬🇧 Send external message\n\n🇷🇺 Отправить внешнее сообщение\n\n🇺🇿 Tashqi xabar yuborish",
        "operationId": "sendMessageExternal",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "task_id": {
                    "type": "string",
                    "example": "1721129985149x478019552540622850"
                  },
                  "chat_id": {
                    "type": "string",
                    "description": "unique chat_id in your system",
                    "example": "123456789"
                  },
                  "message": {
                    "type": "string",
                    "example": "Test message via api"
                  }
                },
                "required": [
                  "task_id",
                  "chat_id",
                  "message"
                ]
              },
              "examples": {
                "send message external": {
                  "value": {
                    "task_id": "1721129985149x478019552540622850",
                    "chat_id": "123456789",
                    "message": "Test message via api"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "example",
            "headers": {
              "CF-Cache-Status": {
                "schema": {
                  "type": "string",
                  "example": "DYNAMIC"
                }
              },
              "CF-RAY": {
                "schema": {
                  "type": "string",
                  "example": "8e0f14eb1bc79da7-DME"
                }
              },
              "Connection": {
                "schema": {
                  "type": "string",
                  "example": "keep-alive"
                }
              },
              "Content-Encoding": {
                "schema": {
                  "type": "string",
                  "example": "br"
                }
              },
              "Date": {
                "schema": {
                  "type": "string",
                  "example": "Mon, 11 Nov 2024 14:48:11 GMT"
                }
              },
              "Server": {
                "schema": {
                  "type": "string",
                  "example": "cloudflare"
                }
              },
              "Transfer-Encoding": {
                "schema": {
                  "type": "string",
                  "example": "chunked"
                }
              },
              "access-control-allow-origin": {
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "alt-svc": {
                "schema": {
                  "type": "string",
                  "example": "h3=\":443\"; ma=86400"
                }
              },
              "vary": {
                "schema": {
                  "type": "string",
                  "example": "Accept-Encoding"
                }
              },
              "x-bubble-capacity-limit": {
                "schema": {
                  "type": "string",
                  "example": "0 ms slower"
                }
              },
              "x-bubble-capacity-used": {
                "schema": {
                  "type": "string",
                  "example": "0.449 unit-seconds used"
                }
              },
              "x-bubble-perf": {
                "schema": {
                  "type": "string",
                  "example": "{\"total\":859.4,\"percents\":{\"top\":{\"bubble_cpu\":14.1,\"block\":85.9,\"capacity_rl\":0,\"other_pause\":0,\"pre_fiber\":0.1},\"sub\":{\"pp_userdb\":2.2,\"pp_wait_userdb\":0,\"http_request\":16.2,\"serverjson\":102.4,\"appserver_cache_misses_time\":0,\"redis\":327.5,\"fiber_queue\":5.2,\"capacity_wait\":0.6}},\"counts\":{\"pp_userdb\":3,\"http_request\":1,\"derived_build\":1,\"derived_cache_attempts\":3,\"derived_cache_memory_misses\":3,\"derived_cache_redis_misses\":1,\"derived_cache_postgres_misses\":1,\"serverjson\":437,\"appserver_cache_attempts\":2,\"appserver_mem_cache_hits\":0,\"appserver_cache_hits\":1,\"appserver_cache_misses\":1,\"redis\":559,\"fiber_queue\":193,\"blocks\":192},\"misc\":{\"userdb_results\":4,\"userdb_data\":2472,\"spent_time\":29194081,\"derived_build_time_spent\":26}}"
                }
              },
              "x-powered-by": {
                "schema": {
                  "type": "string",
                  "example": "Express"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "response": {
                      "type": "object",
                      "properties": {
                        "thread": {
                          "type": "object",
                          "properties": {
                            "Created By": {
                              "type": "string",
                              "example": "1708251849975x447112648674775600"
                            },
                            "Created Date": {
                              "type": "number",
                              "example": 1731336491590
                            },
                            "Modified Date": {
                              "type": "number",
                              "example": 1731336491593
                            },
                            "_id": {
                              "type": "string",
                              "example": "1731336491572x316716105037601100"
                            },
                            "ai_thread_id": {
                              "type": "string",
                              "example": "thread_zZ32RNJ0WIH6rzBLS719LylE"
                            },
                            "chat_id": {
                              "type": "string",
                              "example": "123456789"
                            },
                            "close": {
                              "type": "boolean",
                              "example": false
                            },
                            "company": {
                              "type": "string",
                              "example": "1708251850060x460235863640434700"
                            },
                            "contact": {
                              "type": "string",
                              "example": "123456789"
                            },
                            "count_message": {
                              "type": "number",
                              "example": 0
                            },
                            "get_contact": {
                              "type": "boolean",
                              "example": false
                            },
                            "interest": {
                              "type": "boolean",
                              "example": false
                            },
                            "is_bot": {
                              "type": "boolean",
                              "example": false
                            },
                            "operator": {
                              "type": "boolean",
                              "example": false
                            },
                            "success": {
                              "type": "boolean",
                              "example": false
                            },
                            "task": {
                              "type": "string",
                              "example": "1827394658203x947362851049736284"
                            },
                            "title": {
                              "type": "string",
                              "example": "API chat 123456789"
                            },
                            "user_replied": {
                              "type": "boolean",
                              "example": false
                            },
                            "wh_get_contact": {
                              "type": "boolean",
                              "example": false
                            },
                            "wh_interest": {
                              "type": "boolean",
                              "example": false
                            },
                            "wh_success": {
                              "type": "boolean",
                              "example": false
                            }
                          }
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "example": "success"
                    }
                  }
                },
                "examples": {
                  "example": {
                    "value": {
                      "response": {
                        "thread": {
                          "Created By": "1708251849975x447112648674775600",
                          "Created Date": 1731336491590,
                          "Modified Date": 1731336491593,
                          "_id": "1731336491572x316716105037601100",
                          "ai_thread_id": "thread_zZ32RNJ0WIH6rzBLS719LylE",
                          "chat_id": "123456789",
                          "close": false,
                          "company": "1708251850060x460235863640434700",
                          "contact": "123456789",
                          "count_message": 0,
                          "get_contact": false,
                          "interest": false,
                          "is_bot": false,
                          "operator": false,
                          "success": false,
                          "task": "1827394658203x947362851049736284",
                          "title": "API chat 123456789",
                          "user_replied": false,
                          "wh_get_contact": false,
                          "wh_interest": false,
                          "wh_success": false
                        }
                      },
                      "status": "success"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/update_tag": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Other"
        ],
        "summary": "update tag",
        "description": "🇬🇧 Update tag\n\n🇷🇺 Обновить тег\n\n🇺🇿 Tegni yangilash",
        "operationId": "updateTag",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "thread": {
                    "type": "string",
                    "description": "thread_id",
                    "example": "1728545696102x349363422913789200"
                  },
                  "success": {
                    "type": "boolean",
                    "description": "optional, true/false",
                    "example": true
                  },
                  "interest": {
                    "type": "boolean",
                    "description": "optional, true/false",
                    "example": true
                  },
                  "get_contact": {
                    "type": "boolean",
                    "description": "optional, true/false",
                    "example": true
                  },
                  "operator": {
                    "type": "boolean",
                    "description": "optional, true/false",
                    "example": true
                  },
                  "is_bot": {
                    "type": "boolean",
                    "description": "optional, true/false",
                    "example": true
                  },
                  "close": {
                    "type": "boolean",
                    "description": "optional, true/false",
                    "example": true
                  }
                },
                "required": [
                  "thread"
                ]
              },
              "examples": {
                "update tag": {
                  "value": {
                    "thread": "1728545696102x349363422913789200",
                    "success": true,
                    "interest": true,
                    "get_contact": true,
                    "operator": true,
                    "is_bot": true,
                    "close": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/1.1/wf/add_target": {
      "servers": [
        {
          "url": "https://selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Other"
        ],
        "summary": "add target audience",
        "description": "🇬🇧 Add target audience\n\n🇷🇺 Добавить целевую аудиторию\n\n🇺🇿 Maqsadli auditoriyani qo'shish",
        "operationId": "addTarget",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "task": {
                    "type": "string",
                    "description": "task_id",
                    "example": "1827394658203x947362851049736284"
                  },
                  "target": {
                    "type": "string",
                    "description": "phone, username, id (depending on the communication channel). For more than one, use \"1111\\n2222\\n3333...\"",
                    "example": "79018510315"
                  }
                },
                "required": [
                  "task",
                  "target"
                ]
              },
              "examples": {
                "add target": {
                  "value": {
                    "task": "1827394658203x947362851049736284",
                    "target": "79018510315"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/add_target": {
      "servers": [
        {
          "url": "https://api.selarti.com"
        }
      ],
      "post": {
        "tags": [
          "Advanced API"
        ],
        "summary": "add target with context",
        "description": "🇬🇧 Advanced Method for Target Audience Transmission\n\n🇷🇺 Продвинутый метод передачи целевой аудитории\n\n🇺🇿 Maqsadli auditoriyani uzatish uchun ilg'or usul",
        "operationId": "addTargetWithContext",
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "{{task_id}}"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target": {
                    "type": "string",
                    "description": "phone, username, id (depending on the communication channel)",
                    "example": "@selarti_support"
                  },
                  "first_name": {
                    "type": "string",
                    "description": "optional",
                    "example": "Ivan"
                  },
                  "last_name": {
                    "type": "string",
                    "description": "optional",
                    "example": "Smit"
                  },
                  "context": {
                    "type": "string",
                    "description": "optional. is used in AI",
                    "example": "text"
                  },
                  "external_id": {
                    "type": "string",
                    "description": "optional. sent in webhook",
                    "example": "1122"
                  },
                  "start_message": {
                    "type": "string",
                    "description": "optional. if empty, then used from AI. Format spintax or regular string",
                    "example": "{hi|hello}!"
                  }
                },
                "required": [
                  "target"
                ]
              },
              "examples": {
                "add target with context": {
                  "value": {
                    "target": "@selarti_support",
                    "first_name": "Ivan",
                    "last_name": "Smit",
                    "context": "text",
                    "external_id": "1122",
                    "start_message": "{hi|hello}!"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "Authentication",
      "description": "**Base URL:** https://selarti.com"
    },
    {
      "name": "Data Retrieval",
      "description": "**Base URL:** https://selarti.com"
    },
    {
      "name": "Telegram user login",
      "description": "**Base URL:** https://selarti.com"
    },
    {
      "name": "Send message",
      "description": "**Base URL:** https://selarti.com"
    },
    {
      "name": "Other",
      "description": "**Base URL:** https://selarti.com"
    },
    {
      "name": "Advanced API",
      "description": "**Base URL:** https://api.selarti.com"
    }
  ]
}