{"openapi":"3.1.0","info":{"title":"okzvonok scoring API","version":"2.0.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Health Health Get"}}}}}}},"/live":{"get":{"summary":"Live","operationId":"live_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Live Live Get"}}}}}}},"/ready":{"get":{"summary":"Ready","operationId":"ready_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/metrics":{"get":{"summary":"Metrics","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/public-stats":{"get":{"summary":"Public Stats","description":"Агрегат базы для сайта: всего номеров, со спам-меткой, снятия за 24ч,\nистория снятых меток. Тяжёлые полные счётчики — оценка pg_class.reltuples;\nрезультат кэшируется на 10 минут. Только реальные значения, без выдумок.","operationId":"public_stats_public_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Public Stats Public Stats Get"}}}}}}},"/v1/unified-spam-check":{"post":{"summary":"Unified","operationId":"unified_v1_unified_spam_check_post","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnifiedReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Unified V1 Unified Spam Check Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/bulk-spam-check":{"post":{"summary":"Bulk","operationId":"bulk_v1_bulk_spam_check_post","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Bulk V1 Bulk Spam Check Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/lookup":{"get":{"summary":"Lookup","description":"Оператор, регион и часовой пояс одного номера — без спам-вердикта.\n\nСчитается по реестру нумерации (`number_meta`), спам-источники не\nподнимаются: отсюда и офлайн-тариф. Раньше здесь вызывался полный `score`\nс `do_online=False` — он поднимал все офлайн-базы и возвращал вердикт,\nкоторый этот метод всё равно выбрасывал.","operationId":"lookup_v1_lookup_get","parameters":[{"name":"number","in":"query","required":true,"schema":{"type":"string","title":"Number"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Lookup V1 Lookup Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/bulk-lookup":{"post":{"summary":"Bulk Lookup","description":"Оператор, регион и часовой пояс пачкой — без спам-вердикта.\n\nДля сегментации базы получателей: ей нужен только реестр нумерации, а не\nвердикты источников. Через `/v1/lookup` по одному номеру база на пятьдесят\nтысяч строк превратилась бы в пятьдесят тысяч HTTP-запросов.\n\nТарификация та же, что у одиночного `/v1/lookup`: офлайн-юнит за номер для\nключей, без учёта для внутреннего Bearer. Менять цену одиночного лукапа\nэтот метод не должен — он просто избавляет от лишних запросов.\n\nНераспознанный номер приходит с `error: invalid_number` и в квоту не\nпопадает: платить за опечатку в своей базе клиент не должен. Номер вне\nизвестных диапазонов — это ответ «не знаем» (`found: false`), он\nтарифицируется: диапазоны мы искали.","operationId":"bulk_lookup_v1_bulk_lookup_post","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupBulkReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Bulk Lookup V1 Bulk Lookup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/score":{"post":{"summary":"Score","operationId":"score_score_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Score Score Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mts-load":{"post":{"summary":"Mts Load","operationId":"mts_load_internal_mts_load_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Mts Load Internal Mts Load Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mts-status":{"get":{"summary":"Mts Status","operationId":"mts_status_internal_mts_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Mts Status Internal Mts Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mts-token":{"post":{"summary":"Mts Token Set","operationId":"mts_token_set_internal_mts_token_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Mts Token Set Internal Mts Token Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/mts-token-status":{"get":{"summary":"Mts Token Status","operationId":"mts_token_status_internal_mts_token_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Mts Token Status Internal Mts Token Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/register":{"post":{"tags":["account"],"summary":"Register","operationId":"register_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["account"],"summary":"Login","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/refresh":{"post":{"tags":["account"],"summary":"Refresh","operationId":"refresh_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"post":{"tags":["account"],"summary":"Logout","operationId":"logout_auth_logout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["account"],"summary":"Me","operationId":"me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/account/keys":{"get":{"tags":["account"],"summary":"List Keys","operationId":"list_keys_account_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["account"],"summary":"Create Key","operationId":"create_key_account_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreateReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/keys/{key_id}":{"patch":{"tags":["account"],"summary":"Update Key","operationId":"update_key_account_keys__key_id__patch","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyUpdateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/keys/{key_id}/revoke":{"post":{"tags":["account"],"summary":"Revoke Key","operationId":"revoke_key_account_keys__key_id__revoke_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/usage":{"get":{"tags":["account"],"summary":"Usage","operationId":"usage_account_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/org/members":{"get":{"tags":["account"],"summary":"Members","operationId":"members_org_members_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/org/invites":{"post":{"tags":["account"],"summary":"Create Invite","operationId":"create_invite_org_invites_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/org/invites/{token}/accept":{"post":{"tags":["account"],"summary":"Accept Invite","operationId":"accept_invite_org_invites__token__accept_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/org/members/{member_id}":{"patch":{"tags":["account"],"summary":"Set Member Role","operationId":"set_member_role_org_members__member_id__patch","parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"integer","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["account"],"summary":"Remove Member","operationId":"remove_member_org_members__member_id__delete","parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"integer","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/org/invites/{invite_id}":{"delete":{"tags":["account"],"summary":"Revoke Invite","operationId":"revoke_invite_org_invites__invite_id__delete","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/password":{"post":{"tags":["account"],"summary":"Change Password","operationId":"change_password_account_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/check":{"post":{"tags":["account"],"summary":"Account Check","operationId":"account_check_account_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/history":{"get":{"tags":["account"],"summary":"Check History","operationId":"check_history_account_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AcceptInviteReq":{"properties":{"password":{"type":"string","minLength":8,"title":"Password"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["password"],"title":"AcceptInviteReq"},"BulkReq":{"properties":{"numbers":{"items":{"type":"string"},"type":"array","maxItems":1000,"minItems":1,"title":"Numbers"},"mode":{"type":"string","title":"Mode","default":"offline"}},"type":"object","required":["numbers"],"title":"BulkReq"},"CheckReq":{"properties":{"numbers":{"items":{"type":"string"},"type":"array","maxItems":1000,"minItems":1,"title":"Numbers"},"mode":{"type":"string","title":"Mode","default":"offline"}},"type":"object","required":["numbers"],"title":"CheckReq"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InviteReq":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"developer"}},"type":"object","required":["email"],"title":"InviteReq"},"KeyCreateReq":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"plan":{"type":"string","title":"Plan","default":"free"},"features":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Features"},"quota_offline":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quota Offline"},"quota_online":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quota Online"}},"type":"object","title":"KeyCreateReq"},"KeyUpdateReq":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"quota_offline":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quota Offline"},"quota_online":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quota Online"}},"type":"object","title":"KeyUpdateReq"},"LoginReq":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginReq"},"LookupBulkReq":{"properties":{"numbers":{"items":{"type":"string"},"type":"array","maxItems":1000,"minItems":1,"title":"Numbers"}},"type":"object","required":["numbers"],"title":"LookupBulkReq"},"PasswordReq":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","minLength":8,"title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"PasswordReq"},"RefreshReq":{"properties":{"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"}},"type":"object","title":"RefreshReq"},"RegisterReq":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","minLength":8,"title":"Password"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"org_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Name"}},"type":"object","required":["email","password"],"title":"RegisterReq"},"RoleReq":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"RoleReq"},"ScoreRequest":{"properties":{"numbers":{"items":{"type":"string"},"type":"array","maxItems":5000,"minItems":1,"title":"Numbers"},"ttl_days":{"type":"integer","title":"Ttl Days","default":7},"online":{"type":"boolean","title":"Online","default":true}},"type":"object","required":["numbers"],"title":"ScoreRequest"},"UnifiedReq":{"properties":{"number":{"type":"string","title":"Number"},"mode":{"type":"string","title":"Mode","default":"offline"}},"type":"object","required":["number"],"title":"UnifiedReq"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}