{"openapi":"3.1.0","info":{"title":"TwilightCyber API","version":"1.0"},"paths":{"/auth/login":{"post":{"tags":["auth"],"summary":"Login","description":"Authenticate admin user with username and password.\n\nReturns a JWT token on success.","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["auth"],"summary":"Get Me","description":"Get the currently authenticated admin user info.","operationId":"get_me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMeResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/infections/{id}":{"get":{"tags":["infections"],"summary":"Search Data","description":"Get a single infection by ID.","operationId":"search_data_infections__id__get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfectionDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/infections/_search":{"post":{"tags":["infections"],"summary":"Search Data","description":"search for infections based on different criteria.\nThe result contains any infected machine that contains at least one of the criterias.<br>\nin case number of results is bigger then the current page size (total_items_count > items_count) - send more calls\nthat contains \"next\" field as extracted from the previous response.\nTime filters are in format yyyy-MM-dd'T'HH:mm:ss'Z' only!","operationId":"search_data_infections__search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfectionsSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/infections/_byassetsearch":{"post":{"tags":["infections"],"summary":"Search Data By Assets","description":"Search for infections based on assets or accounts.","operationId":"search_data_by_assets_infections__byassetsearch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssertSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfectionsSearchResponseDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/infections/{log_checksum}/cookies":{"get":{"tags":["infections"],"summary":"Get Infection Cookies","description":"Get infection cookies data from S3 for a given log_checksum ID.\n\nReturns the parsed cookies.json file from the raw infection data.","operationId":"get_infection_cookies_infections__log_checksum__cookies_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"log_checksum","in":"path","required":true,"schema":{"type":"string","title":"Log Checksum"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CookieDto"},"title":"Response Get Infection Cookies Infections  Log Checksum  Cookies Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/current":{"get":{"tags":["users"],"summary":"Get Current User","description":"Returns current user data and available credits.","operationId":"get_current_user_users_current_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentUserDto"}}}}},"security":[{"HTTPBearer":[]}]}},"/users/newApiKey":{"get":{"tags":["users"],"summary":"Renew Own Api Key","description":"Creates a new apiKey. Old ApiKey still works until first usage of the new apiKey.","operationId":"renew_own_api_key_users_newApiKey_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApiKey"}}}}},"security":[{"HTTPBearer":[]}]}},"/users/stats/usage":{"get":{"tags":["users"],"summary":"Get Usage Stats","description":"Get credit usage statistics per user for the last 30 days.\n\nReturns per-user aggregated credit consumption from the requests log,\nincluding 7-day total, 30-day total, and daily breakdown.\nAdmin-only endpoint.","operationId":"get_usage_stats_users_stats_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Usage Stats Users Stats Usage Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/users/daily_stats":{"get":{"tags":["users"],"summary":"Get Dashboard Stats","description":"Get dashboard statistics: daily totals, per-user totals, and low-credit users.\n\nReturns aggregated credit consumption for the requested date range plus\na list of users whose remaining credits are low relative to their recent usage.\nAdmin-only endpoint.","operationId":"get_dashboard_stats_users_daily_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":true,"schema":{"type":"string","description":"Start date inclusive (YYYY-MM-DD)","title":"Date From"},"description":"Start date inclusive (YYYY-MM-DD)"},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","description":"End date inclusive (YYYY-MM-DD)","title":"Date To"},"description":"End date inclusive (YYYY-MM-DD)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Dashboard Stats Users Daily Stats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_name}/stats":{"get":{"tags":["users"],"summary":"Get User Stats","description":"Get per-user statistics: API call counts, items in response, and top domains.\n\nReturns aggregated stats from the requests log for a single user\nover the requested date range. Admin-only endpoint.","operationId":"get_user_stats_users__user_name__stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_name","in":"path","required":true,"schema":{"type":"string","title":"User Name"}},{"name":"date_from","in":"query","required":true,"schema":{"type":"string","description":"Start date inclusive (YYYY-MM-DD)","title":"Date From"},"description":"Start date inclusive (YYYY-MM-DD)"},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","description":"End date inclusive (YYYY-MM-DD)","title":"Date To"},"description":"End date inclusive (YYYY-MM-DD)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users":{"get":{"tags":["users"],"summary":"List Users","description":"List all users. Admin-only endpoint.","operationId":"list_users_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserListResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["users"],"summary":"Create User","description":"Create a new user with auto-generated API key. Admin-only endpoint.","operationId":"create_user_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/users/{user_id}":{"patch":{"tags":["users"],"summary":"Update User","description":"Update user fields (credits, config, expiry). Admin-only endpoint.","operationId":"update_user_users__user_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Update User Users  User Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/_renew-key":{"post":{"tags":["users"],"summary":"Renew User Api Key","description":"Renew API key for a specific user. Admin-only endpoint.","operationId":"renew_user_api_key_users__user_id___renew_key_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenewKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leaked_creds/_search":{"get":{"tags":["Leaked credentials Search"],"summary":"Search","description":"Search for leaked credentials. Exactly one of domain, email, or username must be provided.\nResults are fetched from Dehashed and LeakCheck APIs with caching.","operationId":"search_leaked_creds__search_get","parameters":[{"name":"domain","in":"query","required":false,"schema":{"type":"string","description":"domain to search","title":"Domain"},"description":"domain to search"},{"name":"email","in":"query","required":false,"schema":{"type":"string","description":"email to search","title":"Email"},"description":"email to search"},{"name":"username","in":"query","required":false,"schema":{"type":"string","description":"username to search","title":"Username"},"description":"username to search"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","description":"page size","default":10000,"title":"Size"},"description":"page size"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","description":"page number (starts from 1)","default":1,"title":"Page"},"description":"page number (starts from 1)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["health"],"summary":"Health Check","description":"Check service health status including Elasticsearch and MongoDB connectivity.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AdminMeResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"}},"type":"object","required":["id","name","email","role"],"title":"AdminMeResponse","description":"DTO for GET /auth/me response."},"ApiCallsDto":{"properties":{"total":{"type":"integer","title":"Total"},"total_with_results":{"type":"integer","title":"Total With Results"},"weekly":{"items":{"$ref":"#/components/schemas/WeeklyCallsDto"},"type":"array","title":"Weekly"}},"type":"object","required":["total","total_with_results","weekly"],"title":"ApiCallsDto"},"AssertSearchRequest":{"properties":{"asset_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Asset Ids","description":"search for infections matching the assets definitions"},"account_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Account Ids","description":"search for infections matching the assets of these accounts"},"ips":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Ips","description":"filter infections containing any of these IP addresses"},"infection_date_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Infection Date From","description":"Infection date from (ISO 8601 format)"},"infection_date_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Infection Date To","description":"Infection date to (ISO 8601 format)"},"next":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next","description":"Token for pagination that should be the 'next' field returned in previous call"},"handled":{"anyOf":[{"$ref":"#/components/schemas/HandleFilter"},{"type":"null"}],"description":"Filter by account handling status of the machine"},"size":{"type":"integer","title":"Size","description":"Page size of the response","default":100}},"type":"object","title":"AssertSearchRequest"},"ComputerInformationDto":{"properties":{"build_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Build Id"},"infection_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Infection Date","description":"status of current account handling of the infection. If empty - not handled"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip","description":"machine IP address"},"malware_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Malware Path","description":"malware path on the infected machine"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"machine user name"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"country (2 letters)"},"os":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os","description":"operating system"},"hwid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hwid","description":"hardware id of the infected machine"},"computer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Computer Name","description":"computer name"},"host_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host Name","description":"hostname"},"netbios":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Netbios","description":"NetBIOS name"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"system language"},"ram_size_in_MB":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ram Size In Mb","description":"RAM size in megabytes"},"cpu_vendor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cpu Vendor","description":"CPU vendor"},"cpu_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cpu Name","description":"CPU name"},"cpu_threads":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cpu Threads","description":"number of CPU threads"},"cpu_cores":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cpu Cores","description":"number of CPU cores"},"gpu":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gpu","description":"GPU information"},"display_resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Resolution","description":"display resolution"},"time_zone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Time Zone","description":"time zone"},"timezone_offset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone Offset","description":"timezone offset"},"install_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Install Date","description":"OS install date (ISO8601 format)"},"lid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lid","description":"local identifier"}},"type":"object","title":"ComputerInformationDto"},"CookieDto":{"properties":{"domain":{"type":"string","title":"Domain","description":"Cookie domain"},"expirationDate":{"type":"integer","title":"Expirationdate","description":"Cookie expiration date as epoch timestamp"},"name":{"type":"string","title":"Name","description":"Cookie name"},"path":{"type":"string","title":"Path","description":"Cookie path"},"value":{"type":"string","title":"Value","description":"Cookie value"},"httpOnly":{"type":"boolean","title":"Httponly","description":"Whether cookie is HTTP only"},"secure":{"type":"boolean","title":"Secure","description":"Whether cookie requires secure connection"},"browser":{"type":"string","title":"Browser","description":"Browser the cookie was extracted from"}},"type":"object","required":["domain","expirationDate","name","path","value","httpOnly","secure","browser"],"title":"CookieDto"},"CreateUserConfigDto":{"properties":{"domain_price":{"type":"integer","title":"Domain Price","default":1},"email_domain_price":{"type":"integer","title":"Email Domain Price","default":1},"root_domain_price":{"type":"integer","title":"Root Domain Price","default":1},"email_price":{"type":"integer","title":"Email Price","default":1},"ip_price":{"type":"integer","title":"Ip Price","default":1},"max_page_size":{"type":"integer","title":"Max Page Size","default":20}},"type":"object","title":"CreateUserConfigDto","description":"Config fields for creating a new user."},"CreateUserRequest":{"properties":{"name":{"type":"string","title":"Name","description":"User display name"},"email":{"type":"string","title":"Email","description":"User email address"},"role":{"type":"string","title":"Role","description":"User role: USER or ADMIN","default":"USER"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password","description":"Password (required for ADMIN role)"},"config":{"anyOf":[{"$ref":"#/components/schemas/CreateUserConfigDto"},{"type":"null"}]}},"type":"object","required":["name","email"],"title":"CreateUserRequest","description":"DTO for POST /users (admin create user)."},"CreateUserResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"api_key":{"type":"string","title":"Api Key","description":"Full API key, shown only once"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password","description":"Password, shown only once"}},"type":"object","required":["id","name","api_key"],"title":"CreateUserResponse","description":"DTO for POST /users response."},"CredentialDto":{"properties":{"username":{"type":"string","title":"Username"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"},"credential_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credential Category","description":"category of the credential. Options: THIRD_PARTY_SERVICE, CUSTOMER_SERVICE, EMAIL_SERVICE"}},"type":"object","required":["username"],"title":"CredentialDto"},"CurrentUserDto":{"properties":{"name":{"type":"string","title":"Name","description":"user name"},"email":{"type":"string","title":"Email","description":"user email"},"credits":{"type":"integer","title":"Credits","description":"left credits"}},"type":"object","required":["name","email","credits"],"title":"CurrentUserDto"},"DomainDataDto":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"domain URL"},"creds":{"items":{"$ref":"#/components/schemas/CredentialDto"},"type":"array","title":"Creds","description":"credentials for the above URL"},"root_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Domain"},"email_domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Domains"}},"type":"object","required":["creds"],"title":"DomainDataDto"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HandleFilter":{"properties":{"account_id":{"type":"string","title":"Account Id","description":"Filter by account handling status"},"state":{"allOf":[{"$ref":"#/components/schemas/HandledFilterStatus"}],"description":"handle status"}},"type":"object","title":"HandleFilter"},"HandledFilterStatus":{"type":"string","enum":["DONE","IN_PROCESS","OPEN"],"title":"HandledFilterStatus"},"InfectionDto":{"properties":{"id":{"type":"string","title":"Id"},"log_checksum":{"type":"string","title":"Log Checksum"},"log_file_name":{"type":"string","title":"Log File Name"},"created_date":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created Date","description":"time loaded to the system"},"date":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Date","description":"first discovery of the information"},"stealer_type":{"type":"string","title":"Stealer Type","description":"stealer type"},"handle_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handle Status","description":"status of current account handling of the infection. If empty - not handled"},"computer_information":{"$ref":"#/components/schemas/ComputerInformationDto"},"credentials":{"items":{"$ref":"#/components/schemas/DomainDataDto"},"type":"array","title":"Credentials"},"emails":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Emails"}},"type":"object","required":["id","log_checksum","log_file_name","stealer_type","computer_information","credentials"],"title":"InfectionDto"},"InfectionsSearchRequest":{"properties":{"emails":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Emails","description":"search be email. Can't be mixed with other domain filters"},"domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Domains","description":"filter infections containing any of these domains"},"root_domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Root Domains","description":"filter infections containing any of these root domains"},"app_domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"App Domains","description":"filter infections containing any of these app domains"},"email_domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Domains","description":"filter infections containing any of these email domains"},"ips":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Ips","description":"filter infections containing any of these IP addresses"},"ip_filter":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Filter","description":"filter infections containing this IP. this filter is AND on all other filters"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"filter infections of machine from the country code (2 Letters)"},"hwid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hwid","description":"Fileter by machine's Hardware ID"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name","description":"Filter by machine user name"},"host_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host Name","description":"Filter by machine hostname"},"computer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Computer Name","description":"Filter by computer name"},"stealer_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stealer Type","description":"Filter by Type of stealer"},"infection_date_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Infection Date From","description":"Infection date from (ISO 8601 format)"},"infection_date_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Infection Date To","description":"Infection date to (ISO 8601 format)"},"created_date_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created Date From","description":"Created in DB date from (ISO 8601 format)"},"created_date_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created Date To","description":"Created in DB date to (ISO 8601 format)"},"next":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next","description":"Token for pagination that should be the 'next' field returned in previous call"},"handled":{"anyOf":[{"$ref":"#/components/schemas/HandleFilter"},{"type":"null"}],"description":"Handled filter"},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size","description":"Page size of the response"}},"type":"object","title":"InfectionsSearchRequest"},"InfectionsSearchResponseDto":{"properties":{"search_id":{"type":"string","title":"Search Id","description":"unique identifier of the search. need to be sent in the following pages requests"},"search_consumed_credits":{"type":"integer","title":"Search Consumed Credits","description":"Credits consumed for this call"},"credits_left":{"type":"integer","title":"Credits Left","description":"Credits left for this user after executing this call"},"next":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next","description":"For paging - value to set in the next call `next` field"},"total_items_count":{"type":"integer","title":"Total Items Count","description":"Total items in all pages match this query"},"items_count":{"type":"integer","title":"Items Count","description":"Total items in this page"},"data":{"items":{"$ref":"#/components/schemas/InfectionDto"},"type":"array","title":"Data","description":"Page with results for this query"}},"type":"object","required":["search_id","search_consumed_credits","credits_left","total_items_count","items_count","data"],"title":"InfectionsSearchResponseDto"},"ItemsInResponseDto":{"properties":{"total":{"type":"integer","title":"Total"},"weekly":{"items":{"$ref":"#/components/schemas/WeeklyItemsDto"},"type":"array","title":"Weekly"}},"type":"object","required":["total","weekly"],"title":"ItemsInResponseDto"},"LoginRequest":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"LoginRequest","description":"DTO for admin login request."},"LoginResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"user":{"$ref":"#/components/schemas/LoginUserInfo"}},"type":"object","required":["access_token","user"],"title":"LoginResponse","description":"DTO for admin login response."},"LoginUserInfo":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"}},"type":"object","required":["id","name","email"],"title":"LoginUserInfo","description":"User info included in login response."},"RenewKeyResponse":{"properties":{"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["api_key"],"title":"RenewKeyResponse","description":"DTO for POST /users/{user_id}/_renew-key response."},"TopDomainDto":{"properties":{"domain":{"type":"string","title":"Domain"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["domain","count"],"title":"TopDomainDto"},"TopSearchedDto":{"properties":{"domains":{"items":{"$ref":"#/components/schemas/TopDomainDto"},"type":"array","title":"Domains"},"email_domains":{"items":{"$ref":"#/components/schemas/TopDomainDto"},"type":"array","title":"Email Domains"},"root_domains":{"items":{"$ref":"#/components/schemas/TopDomainDto"},"type":"array","title":"Root Domains"},"app_domains":{"items":{"$ref":"#/components/schemas/TopDomainDto"},"type":"array","title":"App Domains"}},"type":"object","required":["domains","email_domains","root_domains","app_domains"],"title":"TopSearchedDto"},"UpdateUserConfigDto":{"properties":{"domain_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Domain Price"},"email_domain_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Email Domain Price"},"root_domain_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Root Domain Price"},"email_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Email Price"},"ip_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ip Price"},"max_page_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Page Size"},"credits_reload_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Reload Amount"},"next_credits_reload_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Credits Reload Time"}},"type":"object","title":"UpdateUserConfigDto","description":"Config fields for updating a user. All fields optional."},"UpdateUserRequest":{"properties":{"credits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits"},"leak_search_credits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Leak Search Credits"},"expire_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expire Date"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password","description":"New password (will be hashed)"},"config":{"anyOf":[{"$ref":"#/components/schemas/UpdateUserConfigDto"},{"type":"null"}]}},"type":"object","title":"UpdateUserRequest","description":"DTO for PATCH /users/{user_id} (admin update user)."},"UserApiKey":{"properties":{"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["api_key"],"title":"UserApiKey"},"UserConfigResponse":{"properties":{"domain_price":{"type":"integer","title":"Domain Price"},"email_domain_price":{"type":"integer","title":"Email Domain Price"},"root_domain_price":{"type":"integer","title":"Root Domain Price"},"email_price":{"type":"integer","title":"Email Price"},"ip_price":{"type":"integer","title":"Ip Price"},"max_page_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Page Size","default":20},"credits_reload_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Reload Amount"},"next_credits_reload_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Credits Reload Time"}},"type":"object","required":["domain_price","email_domain_price","root_domain_price","email_price","ip_price"],"title":"UserConfigResponse","description":"Config fields in user list response."},"UserListItemDto":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","description":"USER or ADMIN"},"credits":{"type":"integer","title":"Credits"},"leak_search_credits":{"type":"integer","title":"Leak Search Credits"},"api_key_preview":{"type":"string","title":"Api Key Preview","description":"First 4 and last 4 chars of API key"},"api_key":{"type":"string","title":"Api Key","description":"Full API key"},"expire_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expire Date"},"last_reload_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Reload Amount"},"config":{"$ref":"#/components/schemas/UserConfigResponse"}},"type":"object","required":["id","name","email","role","credits","leak_search_credits","api_key_preview","api_key","config"],"title":"UserListItemDto","description":"DTO for a single user in the list response."},"UserListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UserListItemDto"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"UserListResponse","description":"DTO for GET /users response."},"UserStatsResponse":{"properties":{"api_calls":{"$ref":"#/components/schemas/ApiCallsDto"},"items_in_response":{"$ref":"#/components/schemas/ItemsInResponseDto"},"top_searched":{"$ref":"#/components/schemas/TopSearchedDto"}},"type":"object","required":["api_calls","items_in_response","top_searched"],"title":"UserStatsResponse"},"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"},"WeeklyCallsDto":{"properties":{"week":{"type":"string","title":"Week"},"with_results":{"type":"integer","title":"With Results"},"without_results":{"type":"integer","title":"Without Results"}},"type":"object","required":["week","with_results","without_results"],"title":"WeeklyCallsDto"},"WeeklyItemsDto":{"properties":{"week":{"type":"string","title":"Week"},"items":{"type":"integer","title":"Items"}},"type":"object","required":["week","items"],"title":"WeeklyItemsDto"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"tags":[{"name":"auth","description":"Admin authentication (login, JWT)"},{"name":"infections","description":"API to search for infected machines using different criteria"},{"name":"users","description":"Access backend users data"},{"name":"assets","description":"Endpoints for managing Assets"},{"name":"servicerules","description":"manages the customer rules definitions"}],"security":[{"ApiKeyAuth":[]}]}