{
    "schemes": ["https"],
    "swagger": "2.0",
    "info": {
        "description": "2Extract Public API — programmatic access to proxy management, statistics, and geo data via API keys",
        "title": "2Extract Public API",
        "contact": {
            "name": "2Extract Support",
            "url": "https://2extract.com"
        },
        "version": "0.3.0"
    },
    "host": "api.2extract.com",
    "basePath": "/",
    "paths": {
        "/v1/geo/cities": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get a list of cities for a specific country and optional region",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Geo"
                ],
                "summary": "Get cities list",
                "parameters": [
                    {
                        "type": "string",
                        "example": "US",
                        "description": "Country code",
                        "name": "country_code",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "example": 77,
                        "description": "Region code",
                        "name": "region_code",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "Los",
                        "description": "City name search (min 2 chars)",
                        "name": "search",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/dto.GeoCityResponseDTO"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/geo/countries": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get a list of available countries",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Geo"
                ],
                "summary": "Get countries list",
                "parameters": [
                    {
                        "type": "string",
                        "example": "United",
                        "description": "Country name search (min 2 chars)",
                        "name": "search",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/dto.GeoCountryResponseDTO"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/geo/isp": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get a list of available ISPs with optional search query",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Geo"
                ],
                "summary": "Get ISP list",
                "parameters": [
                    {
                        "type": "string",
                        "example": "mobile",
                        "description": "ISP name search (min 3 chars)",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 100,
                        "description": "Limit (default 100, max 500)",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/dto.GeoIspResponseDTO"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/geo/states": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get a list of states or regions for a specific country",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Geo"
                ],
                "summary": "Get states/regions list",
                "parameters": [
                    {
                        "type": "string",
                        "example": "US",
                        "description": "Country code",
                        "name": "country_code",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "California",
                        "description": "Region name search (min 3 chars)",
                        "name": "search",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/dto.GeoRegionResponseDTO"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/geo/zip": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get a list of ZIP codes for a specific country with optional search by ZIP code substring",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Geo"
                ],
                "summary": "Get ZIP codes list",
                "parameters": [
                    {
                        "type": "string",
                        "example": "US",
                        "description": "Country code",
                        "name": "country_code",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "123",
                        "description": "ZIP code search (min 3 chars)",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 100,
                        "description": "Limit (default 100, max 500)",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/dto.GeoZipResponseDTO"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/plans": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get a list of available tariff plans",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Plans"
                ],
                "summary": "Get tariff plans list",
                "parameters": [
                    {
                        "enum": [
                            "residential",
                            "mobile"
                        ],
                        "type": "string",
                        "description": "Proxy type",
                        "name": "proxy_type",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "boolean",
                        "description": "Filter by enabled status",
                        "name": "enabled",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Filter by popular status",
                        "name": "popular",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/dto.TariffDTO"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/proxy": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "List proxies with tariff, limits, and usage; passwords are omitted",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Get user proxy lists with details",
                "parameters": [
                    {
                        "type": "string",
                        "example": "\"active,pending\"",
                        "description": "Filter by status (comma-separated)",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "myproxy",
                        "description": "Search by proxy name (partial match, case-insensitive)",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 100,
                        "description": "Items per page (default 100)",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 0,
                        "description": "Page number starting from 0 (default 0)",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "example": "desc",
                        "description": "Sort direction: asc|desc (default desc)",
                        "name": "order",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "created_at",
                        "description": "Sort field (name, status, tariff.name, traffic_used.total_used, total_spent, created_at)",
                        "name": "order_by",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "\"2024-01-01\"",
                        "description": "Start date for statistics period (YYYY-MM-DD)",
                        "name": "statistic_from",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "example": "\"2024-01-31\"",
                        "description": "End date for statistics period (YYYY-MM-DD)",
                        "name": "statistic_to",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/dto.ProxyListItemDTO"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pagination": {
                                                    "$ref": "#/definitions/dto.MetaPagination"
                                                },
                                                "totals": {
                                                    "$ref": "#/definitions/dto.MetaTotals"
                                                }
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Create a proxy and return its full canonical state, including the password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Create proxy list",
                "parameters": [
                    {
                        "description": "Proxy list data",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.CreateUserProxyListDTO"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/dto.ProxyListDetailsResponseDTO"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/proxy/{id}": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get the full canonical proxy state, including the password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Get proxy list details",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Proxy list ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/dto.ProxyListDetailsResponseDTO"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Update a proxy and return its full canonical state without the password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Update proxy list",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Proxy list ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Proxy list update data",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.UpdateUserProxyListDTO"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/dto.ProxyListDetailsResponseDTO"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Soft-delete a proxy and return its full snapshot with status deleted and no password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Delete proxy list",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Proxy list ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/dto.ProxyListDetailsResponseDTO"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            },
            "patch": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Update supplied fields and return the full canonical state without the password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Partially update proxy list",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Proxy list ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Proxy list fields to update",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.PatchUserProxyListDTO"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/dto.ProxyListDetailsResponseDTO"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/proxy/{id}/limits": {
            "put": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Update limits and return the full canonical proxy state without the password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Update proxy list limits",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Proxy list ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Limits data",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.UpdateProxyLimitsDTO"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/dto.ProxyListDetailsResponseDTO"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/proxy/{id}/password": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Regenerate the password and return the full canonical proxy state including the new password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Generate new proxy password",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Proxy list ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/dto.ProxyListDetailsResponseDTO"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/proxy/{id}/target-hosts-whitelist": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get the target hosts whitelist for a proxy list",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Get target hosts whitelist",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Proxy list ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/dto.TargetHostWhitelistItemDTO"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Set target hosts and return the full canonical proxy state without the password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Set target hosts whitelist",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Proxy list ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Target hosts whitelist data",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.SetTargetHostsWhitelistDTO"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/dto.ProxyListDetailsResponseDTO"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/proxy/{id}/usage/export": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Export usage statistics for a specific proxy list in CSV format",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "text/csv"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Export proxy usage statistics to CSV",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Proxy list ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "\"2024-01-01\"",
                        "description": "Start date (YYYY-MM-DD)",
                        "name": "date_from",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "\"2024-01-31\"",
                        "description": "End date (YYYY-MM-DD)",
                        "name": "date_to",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "file"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/proxy/{id}/whitelist": {
            "put": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Update the IP whitelist and return the full canonical proxy state without the password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Proxies"
                ],
                "summary": "Update proxy IP whitelist",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Proxy list ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "IP whitelist data",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.UpdateWhitelistDTO"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/dto.ProxyListDetailsResponseDTO"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/user/balance": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get the current balance of the authenticated user",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "User"
                ],
                "summary": "Get user balance",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/dto.UserBalanceDTO"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/user/balance-history": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get the balance transaction history of the authenticated user",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "User"
                ],
                "summary": "Get user balance history",
                "parameters": [
                    {
                        "type": "string",
                        "example": "\"2024-01-01\"",
                        "description": "Start date (YYYY-MM-DD)",
                        "name": "date_from",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "\"2024-01-31\"",
                        "description": "End date (YYYY-MM-DD)",
                        "name": "date_to",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "example": 100,
                        "description": "Items per page",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "example": 0,
                        "description": "Page number",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "example": "desc",
                        "description": "Sort direction: asc|desc",
                        "name": "order",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/dto.ResponseBody"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/dto.UserBalanceHistoryResponseDTO"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pagination": {
                                                    "$ref": "#/definitions/dto.MetaPagination"
                                                }
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        },
        "/v1/user/traffic": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get traffic usage statistics for the authenticated user",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "User"
                ],
                "summary": "Get user traffic statistics",
                "parameters": [
                    {
                        "type": "string",
                        "example": "\"2024-01-01\"",
                        "description": "Start date (YYYY-MM-DD)",
                        "name": "date_from",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "example": "\"2024-01-31\"",
                        "description": "End date (YYYY-MM-DD)",
                        "name": "date_to",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBody"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/dto.ResponseBodyError"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "dto.CreateUserProxyListDTO": {
            "type": "object",
            "properties": {
                "countries": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        225,
                        84
                    ]
                },
                "description": {
                    "type": "string",
                    "example": "My personal proxy list"
                },
                "ip_whitelist": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "192.168.1.1",
                        "10.0.0.1"
                    ]
                },
                "limits": {
                    "$ref": "#/definitions/dto.ProxyLimitsDTO"
                },
                "name": {
                    "type": "string",
                    "example": "myproxylist01"
                },
                "proxy_type": {
                    "type": "string",
                    "example": "residential"
                },
                "tariff_id": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "dto.GeoCityResponseDTO": {
            "type": "object",
            "properties": {
                "country_id": {
                    "type": "integer",
                    "example": 225
                },
                "extract_parameter": {
                    "type": "string",
                    "example": "moscow"
                },
                "id": {
                    "type": "integer",
                    "example": 213
                },
                "name": {
                    "type": "string",
                    "example": "Moscow"
                },
                "region_code": {
                    "type": "integer",
                    "example": 77
                }
            }
        },
        "dto.GeoCountryResponseDTO": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string",
                    "example": "RU"
                },
                "id": {
                    "type": "integer",
                    "example": 225
                },
                "name": {
                    "type": "string",
                    "example": "Russia"
                }
            }
        },
        "dto.GeoIspResponseDTO": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer",
                    "example": 1
                },
                "isp": {
                    "type": "string",
                    "example": "Vodafone"
                }
            }
        },
        "dto.GeoRegionResponseDTO": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer",
                    "example": 77
                },
                "extract_parameter": {
                    "type": "string",
                    "example": "california"
                },
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "California"
                }
            }
        },
        "dto.GeoZipResponseDTO": {
            "type": "object",
            "properties": {
                "zip": {
                    "type": "string",
                    "example": "12345"
                }
            }
        },
        "dto.MetaPagination": {
            "type": "object",
            "properties": {
                "count": {
                    "type": "integer"
                },
                "currentPage": {
                    "type": "integer"
                },
                "firstItem": {
                    "type": "integer"
                },
                "hasMorePages": {
                    "type": "boolean"
                },
                "lastItem": {
                    "type": "integer"
                },
                "lastPage": {
                    "type": "integer"
                },
                "perPage": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "dto.MetaTotals": {
            "type": "object",
            "properties": {
                "spent": {
                    "type": "number"
                },
                "traffic_bytes": {
                    "type": "integer"
                }
            }
        },
        "dto.PatchUserProxyListDTO": {
            "type": "object",
            "properties": {
                "countries": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        225,
                        84
                    ]
                },
                "description": {
                    "type": "string",
                    "example": "Updated description"
                },
                "ip_whitelist": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "192.168.1.1",
                        "10.0.0.1"
                    ]
                },
                "limits": {
                    "$ref": "#/definitions/dto.ProxyLimits"
                },
                "status": {
                    "type": "string",
                    "example": "active"
                }
            }
        },
        "dto.ProxyLimits": {
            "type": "object",
            "properties": {
                "limit_type": {
                    "type": "string",
                    "example": "traffic"
                },
                "time_period": {
                    "type": "string",
                    "example": "daily"
                },
                "total_limit": {
                    "type": "number",
                    "example": 1000000000
                }
            }
        },
        "dto.ProxyLimitsDTO": {
            "type": "object",
            "properties": {
                "limit_type": {
                    "type": "string",
                    "example": "money"
                },
                "time_period": {
                    "type": "string",
                    "example": "monthly"
                },
                "total_limit": {
                    "type": "number",
                    "example": 100
                }
            }
        },
        "dto.ProxyListDetailsResponseDTO": {
            "type": "object",
            "properties": {
                "countries": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        225,
                        84
                    ]
                },
                "created_at": {
                    "type": "string",
                    "example": "2025-01-11T00:00:00Z"
                },
                "description": {
                    "type": "string",
                    "example": "My personal proxy list"
                },
                "host": {
                    "type": "string",
                    "example": "mproxy.2extract.net"
                },
                "id": {
                    "type": "string",
                    "example": "86Rf07"
                },
                "ip_whitelist": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "192.168.1.1",
                        "10.0.0.1"
                    ]
                },
                "last_used_at": {
                    "type": "string",
                    "example": "2025-01-11T10:30:00Z"
                },
                "limits": {
                    "$ref": "#/definitions/dto.ProxyLimitsDTO"
                },
                "name": {
                    "type": "string",
                    "example": "myproxylist01"
                },
                "password": {
                    "type": "string",
                    "example": "qwerty"
                },
                "port": {
                    "type": "integer",
                    "example": 5555
                },
                "status": {
                    "type": "string",
                    "example": "active"
                },
                "target_hosts_whitelist": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "example.com",
                        "api.service.com"
                    ]
                },
                "tariff": {
                    "$ref": "#/definitions/dto.TariffDetailsDTO"
                },
                "total_spent": {
                    "type": "number",
                    "example": 25.5
                },
                "traffic_used": {
                    "$ref": "#/definitions/dto.TrafficUsageDTO"
                },
                "type": {
                    "type": "string",
                    "example": "residential"
                },
                "updated_at": {
                    "type": "string",
                    "example": "2025-01-11T00:00:00Z"
                }
            }
        },
        "dto.ProxyListItemDTO": {
            "type": "object",
            "properties": {
                "countries": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        225,
                        84
                    ]
                },
                "created_at": {
                    "type": "string",
                    "example": "2025-01-11T00:00:00Z"
                },
                "description": {
                    "type": "string",
                    "example": "My personal proxy list"
                },
                "host": {
                    "type": "string",
                    "example": "mproxy.2extract.net"
                },
                "id": {
                    "type": "string",
                    "example": "86Rf07"
                },
                "last_used_at": {
                    "type": "string",
                    "example": "2025-01-11T10:30:00Z"
                },
                "limits": {
                    "$ref": "#/definitions/dto.ProxyLimitsDTO"
                },
                "name": {
                    "type": "string",
                    "example": "myproxylist01"
                },
                "port": {
                    "type": "integer",
                    "example": 5555
                },
                "statistic_spent": {
                    "type": "number",
                    "example": 15.75
                },
                "statistic_traffic": {
                    "type": "integer",
                    "example": 1073741824
                },
                "status": {
                    "type": "string",
                    "example": "active"
                },
                "tariff": {
                    "$ref": "#/definitions/dto.TariffDetailsDTO"
                },
                "total_spent": {
                    "type": "number",
                    "example": 25.5
                },
                "traffic_used": {
                    "$ref": "#/definitions/dto.TrafficUsageDTO"
                },
                "type": {
                    "type": "string",
                    "example": "residential"
                },
                "updated_at": {
                    "type": "string",
                    "example": "2025-01-11T00:00:00Z"
                }
            }
        },
        "dto.ResponseBody": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object"
                },
                "error": {
                    "type": "string",
                    "example": ""
                },
                "error_type": {
                    "type": "string",
                    "example": ""
                },
                "meta": {
                    "type": "object"
                },
                "result": {
                    "type": "boolean",
                    "example": true
                }
            }
        },
        "dto.ResponseBodyError": {
            "type": "object",
            "properties": {
                "error": {
                    "type": "string",
                    "example": "Error message"
                },
                "error_type": {
                    "type": "string",
                    "example": "unauthorized"
                },
                "result": {
                    "type": "boolean",
                    "example": false
                }
            }
        },
        "dto.SetTargetHostsWhitelistDTO": {
            "type": "object",
            "properties": {
                "target_hosts": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "example.com",
                        "*.google.com"
                    ]
                }
            }
        },
        "dto.TargetHostWhitelistItemDTO": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "target_host": {
                    "type": "string"
                },
                "user_id": {
                    "type": "integer"
                },
                "user_proxy_list_id": {
                    "type": "string"
                }
            }
        },
        "dto.TariffDTO": {
            "type": "object",
            "properties": {
                "amount": {
                    "type": "number"
                },
                "currency": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "title": {
                    "type": "string"
                },
                "traffic_available": {
                    "type": "integer"
                },
                "traffic_type": {
                    "type": "string"
                }
            }
        },
        "dto.TariffDetailsDTO": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer",
                    "example": 1
                },
                "name": {
                    "type": "string",
                    "example": "Residential 1GB"
                },
                "price": {
                    "type": "number",
                    "example": 4.5
                },
                "traffic_available": {
                    "type": "integer",
                    "example": 1000000000
                },
                "traffic_type": {
                    "type": "string",
                    "example": "package"
                }
            }
        },
        "dto.TrafficUsageDTO": {
            "type": "object",
            "properties": {
                "daily_used": {
                    "type": "integer",
                    "example": 524288000
                },
                "monthly_used": {
                    "type": "integer",
                    "example": 5242880000
                },
                "total_used": {
                    "type": "integer",
                    "example": 15728640000
                }
            }
        },
        "dto.UpdateProxyLimitsDTO": {
            "type": "object",
            "properties": {
                "limit_type": {
                    "type": "string",
                    "example": "money"
                },
                "time_period": {
                    "type": "string",
                    "example": "monthly"
                },
                "total_limit": {
                    "type": "number",
                    "example": 100
                }
            }
        },
        "dto.UpdateUserProxyListDTO": {
            "type": "object",
            "properties": {
                "countries": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "example": [
                        225,
                        84
                    ]
                },
                "description": {
                    "type": "string",
                    "example": "Updated description"
                },
                "ip_whitelist": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "192.168.1.1",
                        "10.0.0.1"
                    ]
                },
                "limits": {
                    "$ref": "#/definitions/dto.ProxyLimits"
                },
                "name": {
                    "type": "string",
                    "example": "myproxylist01"
                },
                "proxy_type": {
                    "type": "string",
                    "example": "residential"
                },
                "status": {
                    "type": "string",
                    "example": "active"
                }
            }
        },
        "dto.UpdateWhitelistDTO": {
            "type": "object",
            "properties": {
                "ips": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "123.231.114.64"
                    ]
                }
            }
        },
        "dto.UserBalanceDTO": {
            "type": "object",
            "properties": {
                "can_create_proxy": {
                    "type": "boolean",
                    "example": true
                },
                "credit_limit": {
                    "type": "number",
                    "example": 0
                },
                "funds_available": {
                    "type": "number",
                    "example": 10
                },
                "prefix": {
                    "type": "string",
                    "example": "2xt-customer-yjiZi8IbMCH"
                }
            }
        },
        "dto.UserBalanceHistoryResponseDTO": {
            "type": "object",
            "properties": {
                "amount": {
                    "type": "number",
                    "example": 100
                },
                "created_at": {
                    "type": "string",
                    "example": "2023-01-15T10:30:00Z"
                },
                "currency": {
                    "type": "string",
                    "example": "USD"
                },
                "description": {
                    "type": "string",
                    "example": "Manual Top-up via Visa ****4242"
                },
                "id": {
                    "type": "integer",
                    "example": 1234567
                },
                "source": {
                    "type": "string",
                    "example": "payment"
                },
                "tx_id": {
                    "type": "integer",
                    "example": 1234567
                },
                "type": {
                    "type": "string",
                    "example": "Top-up"
                }
            }
        }
    },
    "securityDefinitions": {
        "ApiKeyAuth": {
            "description": "API key for authenticated requests. Format: \"2xt_{random}\"",
            "type": "apiKey",
            "name": "X-API-Key",
            "in": "header"
        }
    }
}