{"openapi": "3.1.0", "info": {"title": "Dowo API", "version": "1.1", "description": "Dowo AI qo'ng'iroq markazining ochiq API si. Kalit: admin panel, Sozlamalar, API kalitlari. Har so'rovda `Authorization: Bearer dwk_...`.\n\nTezlik: kalitga daqiqasiga 120 so'rov. Xato javobi: `{\"error\": {\"code\", \"message\"}}`. Vaqtlar ISO 8601 (+05:00).\n\nWebhooklar: call.started, call.answered, call.transferred, call.ended, call.failed, call.completed, lead.created, callback.created, appointment.created. Har so'rov `X-Dowo-Signature: t=<unix>,v1=<HMAC-SHA256(secret, \"<t>.<tana>\")>` bilan imzolanadi; tanadagi `id` bo'yicha takrorni tashlab yuboring."}, "servers": [{"url": "http://app.dowo.normatov.uz"}], "security": [{"bearer": []}], "components": {"securitySchemes": {"bearer": {"type": "http", "scheme": "bearer", "bearerFormat": "dwk_..."}}, "responses": {"Error": {"description": "Xato", "content": {"application/json": {"schema": {"type": "object", "properties": {"error": {"type": "object", "properties": {"code": {"type": "string"}, "message": {"type": "string"}}}}}}}}}, "schemas": {"Call": {"type": "object", "properties": {"id": {"type": "string"}, "started": {"type": "string", "format": "date-time"}, "duration": {"type": "integer"}, "direction": {"enum": ["in", "out"]}, "outcome": {"type": "string", "description": "ai, operator, no_operator, abandoned, no_answer..."}, "caller": {"type": "string"}, "summary": {"type": "string"}, "sentiment": {"type": "string"}, "topics": {"type": "array", "items": {"type": "string"}}, "rating": {"type": ["integer", "null"]}, "extracted": {"type": ["object", "null"], "description": "Kompaniya sozlagan maydonlar (panel: Kompaniya, 'Qo'ng'iroqdan keyin ma'lumot yig'ish'); qiymat aytilmagan bo'lsa null", "additionalProperties": true}}}, "CallDetail": {"allOf": [{"$ref": "#/components/schemas/Call"}, {"type": "object", "properties": {"transcript": {"type": "string"}, "language": {"type": "string"}, "transferred": {"type": "boolean"}, "messages": {"type": "array", "items": {"type": "object", "properties": {"at_sec": {"type": "number"}, "role": {"enum": ["user", "ai", "tool", "system"]}, "text": {"type": "string"}, "reply_ms": {"type": "integer"}}}}, "kb_sources": {"type": "array", "items": {"type": "object", "properties": {"title": {"type": "string"}, "text": {"type": "string"}}}}, "feedback": {"type": "string"}}}]}, "Lead": {"type": "object", "properties": {"id": {"type": "integer"}, "name": {"type": "string"}, "phone": {"type": "string"}, "note": {"type": "string"}, "status": {"type": "string"}, "call_id": {"type": ["string", "null"]}, "created": {"type": "string"}}}, "Task": {"type": "object", "properties": {"id": {"type": "integer"}, "call_id": {"type": "string", "nullable": true}, "kind": {"type": "string", "enum": ["callback", "send_info", "complaint", "appointment", "payment", "other"]}, "title": {"type": "string"}, "detail": {"type": "string"}, "quote": {"type": "string", "description": "Transkriptdan aynan iqtibos (AI vazifalari uchun majburiy)"}, "phone": {"type": "string"}, "name": {"type": "string"}, "due": {"type": "string", "nullable": true, "description": "ISO, Toshkent vaqti"}, "overdue": {"type": "boolean"}, "priority": {"type": "string", "enum": ["low", "normal", "high"]}, "status": {"type": "string", "enum": ["open", "done", "dismissed"]}, "assignee": {"type": "string", "nullable": true}, "assignee_id": {"type": "integer", "nullable": true}, "created": {"type": "string"}, "done_at": {"type": "string", "nullable": true}, "source": {"type": "string", "enum": ["ai", "manual"]}}}, "Callback": {"type": "object", "properties": {"id": {"type": "integer"}, "phone": {"type": "string"}, "name": {"type": "string"}, "reason": {"type": "string"}, "note": {"type": "string"}, "status": {"type": "string"}}}, "Customer": {"type": "object", "properties": {"id": {"type": "integer"}, "name": {"type": "string"}, "phone": {"type": "string"}, "calls_count": {"type": "integer"}}}, "Appointment": {"type": "object", "properties": {"id": {"type": "integer"}, "name": {"type": "string"}, "phone": {"type": "string"}, "when": {"type": "string"}}}, "Agent": {"type": "object", "properties": {"id": {"type": "integer"}, "name": {"type": "string"}, "role": {"type": "string"}, "company": {"type": "string"}, "tone": {"enum": ["friendly", "formal"]}, "languages": {"type": "array", "items": {"type": "string"}}, "model": {"type": "string"}, "models": {"type": "array", "items": {"type": "object"}}, "speech_rate": {"type": "number", "minimum": 0.8, "maximum": 1.2}, "max_sentences": {"type": "integer", "minimum": 0, "maximum": 8}, "barge_in": {"type": "boolean"}, "record_calls": {"type": "boolean"}}}, "AgentItem": {"type": "object", "properties": {"id": {"type": "integer"}, "default": {"type": "boolean"}, "name": {"type": "string"}, "role": {"type": "string"}, "tone": {"enum": ["friendly", "formal", ""]}, "instructions": {"type": "string"}, "doc_ids": {"type": "array", "items": {"type": "integer"}}, "dids": {"type": "array", "items": {"type": "string"}}, "active": {"type": "boolean"}}}, "Document": {"type": "object", "properties": {"id": {"type": "integer"}, "name": {"type": "string"}, "kind": {"type": "string"}, "category": {"type": "string"}, "language": {"enum": ["uz", "ru", "mixed"]}, "active": {"type": "boolean"}, "size": {"type": "integer"}, "chars": {"type": "integer"}, "updated": {"type": "string"}, "created": {"type": "string"}}}, "Stats": {"type": "object", "properties": {"calls": {"type": "integer"}, "ai_resolved": {"type": "integer"}, "to_operator": {"type": "integer"}, "missed": {"type": "integer"}, "ai_success_rate": {"type": ["number", "null"]}, "avg_duration_sec": {"type": ["integer", "null"]}, "minutes": {"type": "number"}, "avg_rating": {"type": ["number", "null"]}}}}}, "paths": {"/api/v1/me": {"get": {"tags": ["Hisob"], "summary": "Kalit egasi kompaniya va tarif holati", "description": "", "parameters": [], "responses": {"200": {"description": "OK"}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}}, "/api/v1/agent": {"get": {"tags": ["AI agent"], "summary": "AI agent sozlamalari", "description": "", "parameters": [], "responses": {"200": {"description": "Agent", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Agent"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}, "put": {"tags": ["AI agent"], "summary": "AI agent sozlamalarini o'zgartirish", "description": "Maydonlar ixtiyoriy: name, role, tone, model, speech_rate, max_sentences.\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"200": {"description": "Yangilangan agent", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Agent"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Agent"}}}}}}, "/api/v1/agents": {"get": {"tags": ["AI agent"], "summary": "Agentlar ro'yxati", "description": "id 0 - asosiy agent (kompaniya sozlamalari); qolganlari qo'shimcha agentlar: har biri o'z telefon raqamlari (dids), hujjatlari (doc_ids, bo'sh = hammasi) va ko'rsatmasi bilan.", "parameters": [], "responses": {"200": {"description": "Agentlar", "content": {"application/json": {"schema": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/AgentItem"}}}}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}, "post": {"tags": ["AI agent"], "summary": "Qo'shimcha agent yaratish", "description": "\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"201": {"description": "Yaratildi", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentItem"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentItem"}}}}}}, "/api/v1/agents/{id}": {"get": {"tags": ["AI agent"], "summary": "Agent", "description": "", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "integer"}}], "responses": {"200": {"description": "Agent", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentItem"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}, "put": {"tags": ["AI agent"], "summary": "Agentni tahrirlash", "description": "id 0 bo'lsa asosiy agent (PUT /api/v1/agent bilan bir xil).\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"200": {"description": "Agent", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentItem"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentItem"}}}}}, "delete": {"tags": ["AI agent"], "summary": "Qo'shimcha agentni o'chirish", "description": "\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"200": {"description": "OK"}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}}, "/api/v1/knowledge/documents": {"get": {"tags": ["Bilimlar bazasi"], "summary": "Hujjatlar ro'yxati", "description": "", "parameters": [], "responses": {"200": {"description": "Hujjatlar", "content": {"application/json": {"schema": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Document"}}}}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}}, "/api/v1/knowledge/upload": {"post": {"tags": ["Bilimlar bazasi"], "summary": "Hujjat yuklash", "description": "Fayl (PDF, DOCX, XLSX, CSV, TXT, JSON, rasm; 10 MB gacha) multipart orqali, yoki matn JSON orqali. Fayl xavfsizlik tekshiruvidan o'tadi (turi, makros, skript, antivirus).\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"201": {"description": "Yaratildi", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Document"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "properties": {"file": {"type": "string", "format": "binary"}, "name": {"type": "string"}, "category": {"type": "string"}, "language": {"type": "string"}}, "required": ["file"]}}, "application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string"}, "text": {"type": "string"}, "category": {"type": "string"}, "language": {"type": "string"}, "active": {"type": "boolean"}}, "required": ["name", "text"]}}}}}}, "/api/v1/knowledge/documents/{id}": {"get": {"tags": ["Bilimlar bazasi"], "summary": "Hujjat matni bilan", "description": "", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "integer"}}], "responses": {"200": {"description": "Hujjat", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Document"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}, "post": {"tags": ["Bilimlar bazasi"], "summary": "Hujjatni tahrirlash yoki faol/nofaol qilish", "description": "Maydonlar: name, text, category, language, active.\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"200": {"description": "Hujjat", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Document"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}}, "delete": {"tags": ["Bilimlar bazasi"], "summary": "Hujjatni o'chirish", "description": "\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"200": {"description": "OK"}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}}, "/api/v1/calls": {"get": {"tags": ["Qo'ng'iroqlar"], "summary": "Qo'ng'iroqlar tarixi", "description": "", "parameters": [{"name": "limit", "in": "query", "required": false, "description": "1-100, standart 50", "schema": {"type": "integer"}}, {"name": "before", "in": "query", "required": false, "description": "Oldingi javobdagi next qiymati", "schema": {"type": "string"}}, {"name": "since", "in": "query", "required": false, "description": "unix yoki ISO sana", "schema": {"type": "string"}}, {"name": "direction", "in": "query", "required": false, "description": "", "schema": {"type": "string", "enum": ["in", "out"]}}, {"name": "outcome", "in": "query", "required": false, "description": "", "schema": {"type": "string"}}], "responses": {"200": {"description": "Ro'yxat", "content": {"application/json": {"schema": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Call"}}, "next": {"description": "Keyingi sahifa uchun before qiymati (yo'q bo'lsa null)"}}}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}}, "/api/v1/calls/{id}": {"get": {"tags": ["Qo'ng'iroqlar"], "summary": "Qo'ng'iroq tafsilotlari", "description": "Transkript, mijoz va AI xabarlari vaqt belgilari bilan, AI foydalangan baza bo'limlari.", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "string"}}], "responses": {"200": {"description": "Qo'ng'iroq", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CallDetail"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}}, "/api/v1/calls/{id}/transfer": {"post": {"tags": ["Qo'ng'iroqlar"], "summary": "Davom etayotgan qo'ng'iroqni operatorga yo'naltirish", "description": "\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"200": {"description": "OK"}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"reason": {"type": "string"}}}}}}}}, "/api/v1/analytics": {"get": {"tags": ["Statistika"], "summary": "Statistika (jami va kunlar bo'yicha)", "description": "Standart: oxirgi 30 kun. Oraliq 366 kungacha.", "parameters": [{"name": "from", "in": "query", "required": false, "description": "ISO sana yoki unix", "schema": {"type": "string"}}, {"name": "to", "in": "query", "required": false, "description": "ISO sana yoki unix", "schema": {"type": "string"}}], "responses": {"200": {"description": "Statistika", "content": {"application/json": {"schema": {"type": "object", "properties": {"total": {"$ref": "#/components/schemas/Stats"}, "by_day": {"type": "array", "items": {"$ref": "#/components/schemas/Stats"}}}}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}}, "/api/v1/feedback": {"post": {"tags": ["Qo'ng'iroqlar"], "summary": "Suhbatga baho berish", "description": "\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"200": {"description": "OK"}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"call_id": {"type": "string"}, "rating": {"type": "integer", "minimum": 1, "maximum": 5}, "comment": {"type": "string"}}, "required": ["call_id", "rating"]}}}}}}, "/api/v1/leads": {"get": {"tags": ["Lidlar"], "summary": "Lidlar", "description": "", "parameters": [{"name": "limit", "in": "query", "required": false, "description": "1-100, standart 50", "schema": {"type": "integer"}}, {"name": "before", "in": "query", "required": false, "description": "Oldingi javobdagi next qiymati", "schema": {"type": "string"}}, {"name": "since", "in": "query", "required": false, "description": "", "schema": {"type": "string"}}], "responses": {"200": {"description": "Ro'yxat", "content": {"application/json": {"schema": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Lead"}}, "next": {"description": "Keyingi sahifa uchun before qiymati (yo'q bo'lsa null)"}}}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}, "post": {"tags": ["Lidlar"], "summary": "Lid yaratish", "description": "\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"201": {"description": "Yaratildi"}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string"}, "phone": {"type": "string"}, "note": {"type": "string"}}, "required": ["phone"]}}}}}}, "/api/v1/callbacks": {"get": {"tags": ["Qayta qo'ng'iroqlar"], "summary": "Qayta qo'ng'iroq navbati", "description": "", "parameters": [{"name": "limit", "in": "query", "required": false, "description": "1-100, standart 50", "schema": {"type": "integer"}}, {"name": "before", "in": "query", "required": false, "description": "Oldingi javobdagi next qiymati", "schema": {"type": "string"}}, {"name": "status", "in": "query", "required": false, "description": "", "schema": {"type": "string", "enum": ["open", "done"]}}], "responses": {"200": {"description": "Ro'yxat", "content": {"application/json": {"schema": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Callback"}}, "next": {"description": "Keyingi sahifa uchun before qiymati (yo'q bo'lsa null)"}}}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}, "post": {"tags": ["Qayta qo'ng'iroqlar"], "summary": "Qayta qo'ng'iroqqa yozish", "description": "\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"201": {"description": "Yaratildi"}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"phone": {"type": "string"}, "name": {"type": "string"}, "note": {"type": "string"}}, "required": ["phone"]}}}}}}, "/api/v1/callbacks/{id}/done": {"post": {"tags": ["Qayta qo'ng'iroqlar"], "summary": "Bajarildi deb belgilash", "description": "\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"200": {"description": "OK"}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"result": {"type": "string"}}}}}}}}, "/api/v1/customers": {"get": {"tags": ["Mijozlar"], "summary": "Mijozlar", "description": "", "parameters": [{"name": "limit", "in": "query", "required": false, "description": "1-100, standart 50", "schema": {"type": "integer"}}, {"name": "before", "in": "query", "required": false, "description": "Oldingi javobdagi next qiymati", "schema": {"type": "string"}}, {"name": "q", "in": "query", "required": false, "description": "Ism yoki telefon bo'lagi", "schema": {"type": "string"}}], "responses": {"200": {"description": "Ro'yxat", "content": {"application/json": {"schema": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Customer"}}, "next": {"description": "Keyingi sahifa uchun before qiymati (yo'q bo'lsa null)"}}}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}}, "/api/v1/tasks": {"get": {"tags": ["Vazifalar"], "summary": "Qo'ng'iroqlardan chiqqan vazifalar", "description": "AI transkriptdan ajratadi; har vazifada `quote` (aynan iqtibos) bor.", "parameters": [{"name": "limit", "in": "query", "required": false, "description": "1-100, standart 50", "schema": {"type": "integer"}}, {"name": "before", "in": "query", "required": false, "description": "Oldingi javobdagi next qiymati", "schema": {"type": "string"}}, {"name": "status", "in": "query", "required": false, "description": "", "schema": {"type": "string", "enum": ["open", "done", "dismissed"]}}, {"name": "assignee", "in": "query", "required": false, "description": "", "schema": {"type": "string"}}, {"name": "overdue", "in": "query", "required": false, "description": "", "schema": {"type": "string", "enum": ["1"]}}, {"name": "kind", "in": "query", "required": false, "description": "", "schema": {"type": "string"}}, {"name": "call_id", "in": "query", "required": false, "description": "", "schema": {"type": "string"}}], "responses": {"200": {"description": "Ro'yxat", "content": {"application/json": {"schema": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Task"}}, "next": {"description": "Keyingi sahifa uchun before qiymati (yo'q bo'lsa null)"}}}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}}, "/api/v1/tasks/{id}": {"get": {"tags": ["Vazifalar"], "summary": "Bitta vazifa", "description": "", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "integer"}}], "responses": {"200": {"description": "Vazifa", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Task"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}, "patch": {"tags": ["Vazifalar"], "summary": "Vazifani yangilash (holat, muhimlik, muddat, mas'ul)", "description": "\n\nYozish ruxsatli kalit kerak. `Idempotency-Key` sarlavhasi takror yozuvdan himoya qiladi (24 soat).", "parameters": [{"name": "id", "in": "path", "required": true, "description": "", "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 80}}], "responses": {"200": {"description": "Vazifa", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Task"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"status": {"type": "string", "enum": ["open", "done", "dismissed"]}, "priority": {"type": "string"}, "due": {"type": "string", "nullable": true}, "assignee_id": {"type": "integer", "nullable": true}}}}}}}}, "/api/v1/appointments": {"get": {"tags": ["Band qilishlar"], "summary": "Band qilishlar", "description": "", "parameters": [{"name": "limit", "in": "query", "required": false, "description": "1-100, standart 50", "schema": {"type": "integer"}}, {"name": "before", "in": "query", "required": false, "description": "Oldingi javobdagi next qiymati", "schema": {"type": "string"}}], "responses": {"200": {"description": "Ro'yxat", "content": {"application/json": {"schema": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Appointment"}}, "next": {"description": "Keyingi sahifa uchun before qiymati (yo'q bo'lsa null)"}}}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "403": {"$ref": "#/components/responses/Error"}, "404": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}}}}}