{
  "openapi": "3.1.0",
  "info": {
    "title": "NumberHub API",
    "version": "1.2.0",
    "description": "REST API for a prepaid USD wallet, SMS verification, number rentals, travel eSIMs, email OTP and residential proxy data packages. Catalogs and prices may change. Charge-on-receive applies to SMS/email; rentals, eSIMs and proxies are paid upfront. New orders and proxy data top-ups require Idempotency-Key. Action endpoints state their own retry semantics.",
    "termsOfService": "https://numberhub.io/terms/",
    "contact": {
      "name": "NumberHub support",
      "url": "https://numberhub.io/contact/",
      "email": "info@numberhub.io"
    },
    "x-logo": {
      "url": "https://numberhub.io/icon-512.png",
      "altText": "NumberHub"
    }
  },
  "externalDocs": {
    "description": "API reference, Postman collection and starter clients",
    "url": "https://numberhub.io/api-docs/"
  },
  "servers": [
    {
      "url": "https://api.numberhub.io/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/balance": {
      "get": {
        "summary": "Get wallet balance",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Balance"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_balance"
      }
    },
    "/orders": {
      "get": {
        "summary": "List recent orders",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "orders": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      }
                    }
                  },
                  "required": [
                    "orders"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_orders"
      }
    },
    "/services": {
      "get": {
        "summary": "List SMS services",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "services": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NamedCode"
                      }
                    }
                  },
                  "required": [
                    "services"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_services"
      }
    },
    "/countries": {
      "get": {
        "summary": "List countries, prices, and stock for an SMS service",
        "description": "The catalog is cached and may use the last successful price and stock list during a temporary outage. Stock is checked again when placing an order. Set max_price on POST /numbers to cap your spend.",
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "verification",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sms",
                "call"
              ],
              "default": "sms"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "verification": {
                      "type": "string"
                    },
                    "countries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          },
                          "price": {
                            "$ref": "#/components/schemas/Money"
                          },
                          "price_max": {
                            "$ref": "#/components/schemas/Money"
                          },
                          "in_stock": {
                            "type": "boolean"
                          },
                          "operators": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "rate": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "rate_low": {
                            "type": "boolean",
                            "description": "Delivery is firmly low FOR THIS APP: under 50% and well under the app's own average (apps that block most virtual numbers run low on every route)."
                          },
                          "rate_dead": {
                            "type": "boolean"
                          },
                          "collapsed": {
                            "type": "boolean"
                          },
                          "rank": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Position in NumberHub's own best-first order for this app (1 = the country most likely to deliver now: in stock, delivering well for this app, then the rest). The list itself stays alphabetical; sort by rank to show countries the way NumberHub's bot and web app do."
                          }
                        },
                        "required": [
                          "country",
                          "name",
                          "flag",
                          "price",
                          "price_max",
                          "in_stock",
                          "operators",
                          "rate",
                          "rate_low",
                          "rate_dead",
                          "collapsed"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "service",
                    "verification",
                    "countries"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_countries"
      }
    },
    "/top-countries": {
      "get": {
        "summary": "Country recommendations using demand, catalog stock, price, and delivery quality",
        "description": "Recommendations refresh about every 10 minutes. During a temporary outage, catalog stock and prices may come from the last successful update; they do not reserve stock or lock a purchase price.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "countries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "iso": {
                            "type": "string"
                          },
                          "from_price": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/Money"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "in_stock_services": {
                            "type": "integer"
                          },
                          "delivery_rate": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "delivery_sample": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "country",
                          "name",
                          "iso",
                          "from_price",
                          "in_stock_services",
                          "delivery_rate",
                          "delivery_sample"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "countries"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_top_countries"
      }
    },
    "/countries/{country}/operators": {
      "parameters": [
        {
          "name": "country",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "summary": "List carriers that can be requested by name for a country (?service= keeps only carriers with stock for that service)",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "country": {
                      "type": "string"
                    },
                    "operators": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "country",
                    "operators"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_countries_country_operators",
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/numbers": {
      "post": {
        "summary": "Buy or queue a temporary SMS number",
        "description": "409 purchase_failed with reason=low_delivery: new numbers are paused for this account because of bulk activity that isn't getting codes: numbers taken and cancelled in bulk with almost no codes, or a burst of buy attempts that found no number. Nothing is held or bought, and it lifts by itself as that activity rolls out of the last 24 hours (or the last hour, for buy attempts).",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "service",
                  "country"
                ],
                "properties": {
                  "service": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "max_price": {
                    "type": "string",
                    "description": "Optional cap in USD (e.g. \"2.40\"). A price above it answers 409 price_exceeded before your key's daily allowance is touched. The purchase is also capped at the amount reserved against that allowance: if the live price moves while the order is placed the answer is 409 price_changed, with nothing held and the allowance returned."
                  },
                  "queue": {
                    "type": "boolean",
                    "default": true
                  },
                  "verification": {
                    "type": "string",
                    "enum": [
                      "sms",
                      "call"
                    ],
                    "default": "sms"
                  },
                  "operator": {
                    "type": "string",
                    "description": "Carrier name(s) from GET /countries/{country}/operators, comma-separated for several"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "number": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "number"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_numbers"
      }
    },
    "/numbers/bulk": {
      "post": {
        "summary": "Buy several SMS numbers of one service and country",
        "description": "Bulk buy: 2 up to the account's per-batch limit (default 10) numbers of one service + country in one call. Each number is an ordinary order with its own hold and charge on receive; poll them like any other. Only for established accounts (account age, codes received, a paid top-up and a healthy delivery ratio), only routes in stock that deliver, one open batch at a time and a daily bulk limit. Each number reserves the key's daily spend allowance on its own. Stops at the first refusal and returns what it bought, with `stopped` giving the reason (stock, funds, price, limit, spend_limit or failed).",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "service",
                  "country",
                  "quantity"
                ],
                "properties": {
                  "service": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 2
                  },
                  "max_price": {
                    "type": "string",
                    "description": "Price per number. A refusal can return 409 price_exceeded without price fields; a partial batch returns 201 with purchased numbers and stopped=\"price\"."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batch_id": {
                      "type": "string"
                    },
                    "requested": {
                      "type": "integer"
                    },
                    "stopped": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "numbers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      }
                    }
                  },
                  "required": [
                    "batch_id",
                    "requested",
                    "numbers"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_numbers_bulk"
      }
    },
    "/numbers/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "get": {
        "summary": "Get an SMS number order",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "number": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Order"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "why_no_code": {
                              "type": "object",
                              "description": "Only on a number that ended (expired or cancelled) without a code: the likely reason and up to two countries delivering better for this app right now.",
                              "properties": {
                                "reason": {
                                  "type": "string",
                                  "enum": [
                                    "route_weak",
                                    "app_blocks",
                                    "unlucky",
                                    "unknown"
                                  ],
                                  "description": "route_weak: this country has stopped delivering well for the app; app_blocks: the app refuses many virtual numbers in every country; unlucky: the country usually works, this number did not; unknown: not enough history."
                                },
                                "alternatives": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "country": {
                                        "type": "string"
                                      },
                                      "country_name": {
                                        "type": "string"
                                      },
                                      "price": {
                                        "$ref": "#/components/schemas/Money"
                                      }
                                    },
                                    "required": [
                                      "country",
                                      "country_name",
                                      "price"
                                    ],
                                    "additionalProperties": true
                                  }
                                }
                              },
                              "required": [
                                "reason",
                                "alternatives"
                              ],
                              "additionalProperties": true
                            }
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "number"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_numbers_id",
        "description": "A number that ended without a code also carries why_no_code: the likely reason and the countries delivering better for this app right now."
      },
      "delete": {
        "summary": "Cancel an SMS number order",
        "description": "The number is released first and the hold only after. While it cannot be released yet the order stays open and the call answers 409 cancel_locked with seconds_remaining; retry then. If a code reached the number before the cancel, the order is not cancelled: it is delivered and charged as usual, and the answer carries ok=false with reason=code_received.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "number": {
                      "$ref": "#/components/schemas/Order"
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "code_received"
                      ],
                      "description": "Present when ok is false because a code arrived first (the order is now received)."
                    }
                  },
                  "required": [
                    "ok",
                    "number"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "delete_numbers_id"
      }
    },
    "/numbers/{id}/another": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "summary": "Request another code on the same number. Free: no hold and no charge; the number stays received and the next code is added to codes when it arrives",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "number": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "ok",
                    "number"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "State-dependent action; Idempotency-Key is not applied to this endpoint. After an uncertain response, fetch the order before deciding whether to make another request. A number that cannot receive another code answers 409 another_unsupported.",
        "operationId": "post_numbers_id_another"
      }
    },
    "/numbers/{id}/reactivate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "summary": "Reactivate an eligible SMS number",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "number": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "ok",
                    "number"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "An optional Idempotency-Key enables response replay. On an uncertain retry, reuse the same key, method, path and exact JSON bytes within 24 hours. Without a key, this is a state-dependent action: fetch the order before deciding whether to repeat it.",
        "operationId": "post_numbers_id_reactivate",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "max_price": {
                    "type": "string",
                    "description": "Optional cap in USD (e.g. \"2.40\"). A price above it answers 409 price_exceeded before your key's daily allowance is touched. The purchase is also capped at the amount reserved against that allowance: if the live price moves while the order is placed the answer is 409 price_changed, with nothing held and the allowance returned."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional for SMS reactivation. When supplied, reuse the same key, method, path and exact JSON bytes for uncertain retries within 24 hours. Without a key, fetch the order before deciding whether to repeat the action.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128,
              "pattern": "^[!-~]{8,128}$"
            }
          }
        ]
      }
    },
    "/numbers/{id}/replace": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "summary": "Swap a waiting number for a fresh one of the same app and country, on the same reserve",
        "description": "Only while the number is waiting for a code. The old number is released and a new order is returned (a different id) holding the same reserve, so nothing extra is charged. While the old number cannot be released yet the call answers 409 replace_locked with seconds_remaining. Idempotency-Key is not applied: after an uncertain response, list your orders before trying again.",
        "responses": {
          "201": {
            "description": "The new number",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "number": {
                      "$ref": "#/components/schemas/Order"
                    },
                    "replaced": {
                      "type": "integer",
                      "description": "The id of the number that was replaced."
                    }
                  },
                  "required": [
                    "number",
                    "replaced"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_numbers_id_replace"
      }
    },
    "/numbers/{id}/complete": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "summary": "Finish a number that received its code",
        "description": "Closes the number. It was charged when the code arrived; finishing changes nothing about the money. 409 not_completable unless the number has received a code and is still open.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "number": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "ok",
                    "number"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_numbers_id_complete"
      }
    },
    "/numbers/{id}/report": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "summary": "Report that the code which arrived did not work",
        "description": "Flags the number once and alerts our team, who review it. It is not an automatic refund. 409 not_reportable unless the number has received a code and is still open; 409 already_reported on a second report.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "number": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "ok",
                    "number"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_numbers_id_report"
      }
    },
    "/rent/durations": {
      "get": {
        "summary": "List rental durations",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "durations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "h": {
                            "type": "integer"
                          },
                          "label": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "h",
                          "label"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "durations"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_rent_durations"
      }
    },
    "/rent/{h}/countries": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Duration"
        }
      ],
      "get": {
        "summary": "List rental countries for a duration",
        "description": "During a temporary outage, this may show the last successful country list. Availability is checked again when buying.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "h": {
                      "type": "integer"
                    },
                    "countries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "country",
                          "name",
                          "flag"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "h",
                    "countries"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_rent_h_countries"
      }
    },
    "/rent/{h}/{country}/services": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Duration"
        },
        {
          "$ref": "#/components/parameters/Country"
        }
      ],
      "get": {
        "summary": "List rental services",
        "description": "During a temporary outage, this may show the last successful price list. Use the rental quote and max_price on POST /rentals to cap your spend.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "h": {
                      "type": "integer"
                    },
                    "country": {
                      "type": "string"
                    },
                    "services": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "price": {
                            "$ref": "#/components/schemas/Money"
                          },
                          "in_stock": {
                            "type": "boolean"
                          },
                          "popular": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "code",
                          "name",
                          "price",
                          "in_stock",
                          "popular"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "h",
                    "country",
                    "services"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_rent_h_country_services"
      }
    },
    "/rent/{h}/{country}/{code}/quote": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Duration"
        },
        {
          "$ref": "#/components/parameters/Country"
        },
        {
          "name": "code",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "summary": "Get a rental quote",
        "description": "Price and affordability from the latest available rental catalog. During a temporary outage, the quote may use cached prices. Send its price as max_price on POST /rentals to cap your spend. A quote does not reserve stock or lock the purchase price.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "h": {
                      "type": "integer"
                    },
                    "country": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "service_name": {
                      "type": "string"
                    },
                    "country_name": {
                      "type": "string"
                    },
                    "flag": {
                      "type": "string"
                    },
                    "duration_label": {
                      "type": "string"
                    },
                    "price": {
                      "$ref": "#/components/schemas/Money"
                    },
                    "available": {
                      "$ref": "#/components/schemas/Money"
                    },
                    "can_afford": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "h",
                    "country",
                    "code",
                    "service_name",
                    "country_name",
                    "flag",
                    "duration_label",
                    "price",
                    "available",
                    "can_afford"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_rent_h_country_code_quote"
      }
    },
    "/rentals": {
      "post": {
        "summary": "Create a number rental",
        "description": "country is the numeric id from GET /rent/{h}/countries (400 invalid_country otherwise). Purchases always use fresh prices, even when browsing or quotes use cached data. Send the accepted quote price as max_price: a higher refreshed price returns 409 price_exceeded before buying. 409 sold_out when the service is not offered; 409 purchase_failed with a message when the rental cannot be placed - nothing is charged; 503 rent_unavailable with Retry-After while rentals are temporarily unavailable.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "h",
                  "country",
                  "code"
                ],
                "properties": {
                  "h": {
                    "type": "integer"
                  },
                  "country": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "max_price": {
                    "type": "string",
                    "description": "Optional cap in USD (e.g. \"2.40\"). A price above it answers 409 price_exceeded before your key's daily allowance is touched. The purchase is also capped at the amount reserved against that allowance: if the live price moves while the order is placed the answer is 409 price_changed, with nothing held and the allowance returned."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rental": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "rental"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_rentals"
      }
    },
    "/rentals/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "get": {
        "summary": "Get a rental",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rental": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "rental"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_rentals_id"
      },
      "delete": {
        "summary": "Cancel a rental during its eligible window",
        "description": "Cancellation is available 2 to 20 minutes after start, only before any SMS arrives. A refund is issued once the cancellation is confirmed and returns to the NumberHub balance. Outside the window returns 409 cancel_window_closed. A response with ok=false means cancellation was refused and no refund was issued. Rentals otherwise continue until expiry; early termination is disabled.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "rental": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "ok",
                    "rental"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "delete_rentals_id"
      }
    },
    "/rentals/{id}/finish": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "deprecated": true,
        "summary": "Retired: rentals run for their full period and end automatically; always answers 409 finish_disabled",
        "responses": {
          "409": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_rentals_id_finish"
      }
    },
    "/esim/regions": {
      "get": {
        "summary": "List eSIM destinations and regions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "regions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "name",
                          "flag"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "regions"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_esim_regions"
      }
    },
    "/esim/regions/{region}/packages": {
      "parameters": [
        {
          "name": "region",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "summary": "List live eSIM packages for a destination or region",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "region": {
                      "type": "string"
                    },
                    "region_name": {
                      "type": "string"
                    },
                    "packages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "gb": {
                            "type": "string"
                          },
                          "duration": {
                            "type": "integer"
                          },
                          "unit": {
                            "type": "string"
                          },
                          "price": {
                            "$ref": "#/components/schemas/Money"
                          },
                          "scope": {
                            "type": "string"
                          },
                          "is_local": {
                            "type": "boolean"
                          },
                          "countries": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "code",
                          "name",
                          "gb",
                          "duration",
                          "unit",
                          "price",
                          "scope",
                          "is_local",
                          "countries"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "region",
                    "packages"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_esim_regions_region_packages"
      }
    },
    "/esims": {
      "post": {
        "summary": "Purchase an eSIM package",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "region",
                  "pkg"
                ],
                "properties": {
                  "region": {
                    "type": "string"
                  },
                  "pkg": {
                    "type": "string"
                  },
                  "max_price": {
                    "type": "string",
                    "description": "Optional cap in USD (e.g. \"2.40\"). A price above it answers 409 price_exceeded before your key's daily allowance is touched. The purchase is also capped at the amount reserved against that allowance: if the live price moves while the order is placed the answer is 409 price_changed, with nothing held and the allowance returned."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "esim": {
                      "$ref": "#/components/schemas/EsimOrder"
                    }
                  },
                  "required": [
                    "esim"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_esims"
      }
    },
    "/esims/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "get": {
        "summary": "Get an eSIM order and installation details",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "esim": {
                      "$ref": "#/components/schemas/EsimOrder"
                    }
                  },
                  "required": [
                    "esim"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_esims_id"
      }
    },
    "/email/sites": {
      "get": {
        "summary": "List supported email OTP sites",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sites": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "site": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "site",
                          "name"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "sites"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_email_sites"
      }
    },
    "/email/sites/{site}/domains": {
      "parameters": [
        {
          "name": "site",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "summary": "List live email domains and prices for a site",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site": {
                      "type": "string"
                    },
                    "site_name": {
                      "type": "string"
                    },
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "domain": {
                            "type": "string"
                          },
                          "price": {
                            "$ref": "#/components/schemas/Money"
                          },
                          "in_stock": {
                            "type": "boolean"
                          },
                          "delivery": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "high",
                              "low",
                              null
                            ]
                          }
                        },
                        "required": [
                          "domain",
                          "price",
                          "in_stock",
                          "delivery"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "site",
                    "site_name",
                    "domains"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_email_sites_site_domains"
      }
    },
    "/emails": {
      "post": {
        "summary": "Purchase an email OTP address",
        "description": "409 purchase_failed with a message when the address cannot be ordered - nothing is held. reason=domain_unavailable means this site and mail domain are temporarily unavailable: choose another domain or retry later.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "site"
                ],
                "properties": {
                  "site": {
                    "type": "string"
                  },
                  "domain": {
                    "type": "string"
                  },
                  "max_price": {
                    "type": "string",
                    "description": "Optional cap in USD (e.g. \"2.40\"). A price above it answers 409 price_exceeded before your key's daily allowance is touched. The purchase is also capped at the amount reserved against that allowance: if the live price moves while the order is placed the answer is 409 price_changed, with nothing held and the allowance returned."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "email": {
                      "$ref": "#/components/schemas/EmailOrder"
                    }
                  },
                  "required": [
                    "email"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_emails"
      }
    },
    "/emails/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "get": {
        "summary": "Get an email OTP order",
        "description": "Poll the inbox. Take the code from `email.code` and the link from `email.link`; `email.message` is the mail's own text. An order delivers one mail; a mail with no code and no verify or sign-in link (a \"new device\" notice, a welcome mail) is skipped: the order stays `waiting` on the same address, `expires_at` moves 20 minutes on, and you are charged for the next mail (at most 2 skips per order). On the website, an email order's page shows this exact response under \"View raw (API response)\".",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "email": {
                      "$ref": "#/components/schemas/EmailOrder"
                    }
                  },
                  "required": [
                    "email"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_emails_id"
      }
    },
    "/emails/{id}/reorder": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "summary": "Order the same mailbox again as a new order (allowed on received and completed email orders, also days later); charged only when the new mail arrives",
        "responses": {
          "201": {
            "description": "New email order on the same address",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "email": {
                      "$ref": "#/components/schemas/EmailOrder"
                    }
                  },
                  "required": [
                    "email"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "State-dependent action; Idempotency-Key is not applied to this endpoint. 409 not_reorderable when the order is waiting, cancelled or expired (a mailbox that never received its first mail cannot be reordered); 409 purchase_failed with a message when it cannot be reordered right now (for example an open request already exists on that address — wait a minute and retry). After an uncertain response, list your email orders before deciding whether to make another request.",
        "operationId": "post_emails_id_reorder",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "max_price": {
                    "type": "string",
                    "description": "Optional cap in USD (e.g. \"2.40\"). A price above it answers 409 price_exceeded before your key's daily allowance is touched. The purchase is also capped at the amount reserved against that allowance: if the live price moves while the order is placed the answer is 409 price_changed, with nothing held and the allowance returned."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "summary": "List active webhook endpoints",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    }
                  },
                  "required": [
                    "webhooks"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_webhooks"
      },
      "post": {
        "summary": "Create a signed webhook endpoint",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "pattern": "^https://"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "default": [
                      "order.*"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Webhook"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "secret": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "secret"
                          ],
                          "additionalProperties": true
                        }
                      ]
                    }
                  },
                  "required": [
                    "webhook"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_webhooks"
      }
    },
    "/webhooks/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "delete": {
        "summary": "Deactivate a webhook endpoint",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "delete_webhooks_id"
      }
    },
    "/webhooks/{id}/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "summary": "Queue a test webhook event",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "queued": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "queued"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_webhooks_id_test"
      }
    },
    "/email/suggest": {
      "get": {
        "summary": "Suggest email OTP sites",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "suggestions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "site": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "domain": {
                            "type": "string"
                          }
                        },
                        "required": [],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "suggestions"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_email_suggest"
      }
    },
    "/proxy/packages": {
      "get": {
        "summary": "List live residential proxy data packages",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProxyPackages"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_proxy_packages"
      }
    },
    "/proxy/countries": {
      "get": {
        "summary": "List residential proxy locations",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "residential"
              ],
              "default": "residential"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "countries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          },
                          "availability": {
                            "type": [
                              "number",
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "code",
                          "name",
                          "flag",
                          "availability"
                        ],
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "type",
                    "countries"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_proxy_countries"
      }
    },
    "/proxy/countries/{cc}/regions": {
      "get": {
        "summary": "List proxy regions",
        "parameters": [
          {
            "name": "cc",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "country": {
                      "type": "string"
                    },
                    "regions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NamedCode"
                      }
                    }
                  },
                  "required": [
                    "country",
                    "regions"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_proxy_countries_cc_regions"
      }
    },
    "/proxy/countries/{cc}/cities": {
      "get": {
        "summary": "List proxy cities",
        "parameters": [
          {
            "name": "cc",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "country": {
                      "type": "string"
                    },
                    "region": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cities": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NamedCode"
                      }
                    }
                  },
                  "required": [
                    "country",
                    "region",
                    "cities"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_proxy_countries_cc_cities"
      }
    },
    "/proxies": {
      "post": {
        "summary": "Purchase a proxy data package, charged upfront",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gb": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "country": {
                    "type": "string"
                  },
                  "max_price": {
                    "type": "string",
                    "description": "Optional cap in USD (e.g. \"2.40\"). A price above it answers 409 price_exceeded before your key's daily allowance is touched. The purchase is also capped at the amount reserved against that allowance: if the live price moves while the order is placed the answer is 409 price_changed, with nothing held and the allowance returned."
                  }
                },
                "required": [
                  "gb"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "proxy": {
                      "$ref": "#/components/schemas/ProxyOrder"
                    }
                  },
                  "required": [
                    "proxy"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_proxies"
      }
    },
    "/proxies/{id}": {
      "get": {
        "summary": "Get proxy credentials and order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "proxy": {
                      "$ref": "#/components/schemas/ProxyOrder"
                    }
                  },
                  "required": [
                    "proxy"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_proxies_id"
      }
    },
    "/proxies/{id}/usage": {
      "get": {
        "summary": "Get metered proxy usage",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "proxy": {
                      "$ref": "#/components/schemas/ProxyOrder"
                    }
                  },
                  "required": [
                    "proxy"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_proxies_id_usage"
      }
    },
    "/proxies/{id}/stats": {
      "get": {
        "summary": "Get proxy traffic time series",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "hours24",
                "7d",
                "30d"
              ],
              "default": "7d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "stats": {
                      "$ref": "#/components/schemas/ProxyStats"
                    }
                  },
                  "required": [
                    "id",
                    "stats"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_proxies_id_stats"
      }
    },
    "/proxies/{id}/lines": {
      "post": {
        "summary": "Generate connection lines without purchasing data",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LineOptions"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "options": {
                      "$ref": "#/components/schemas/LineOptions"
                    },
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "options",
                    "lines"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_proxies_id_lines"
      }
    },
    "/proxies/{id}/country": {
      "post": {
        "summary": "Set the default target country; empty string restores worldwide rotation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "country": {
                    "type": "string"
                  }
                },
                "required": [
                  "country"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "proxy": {
                      "$ref": "#/components/schemas/ProxyOrder"
                    }
                  },
                  "required": [
                    "proxy"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_proxies_id_country"
      }
    },
    "/proxies/{id}/topup": {
      "post": {
        "summary": "Add data to the same proxy login and restart its validity; charged upfront",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gb": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "max_price": {
                    "type": "string",
                    "description": "Optional cap in USD (e.g. \"2.40\"). A price above it answers 409 price_exceeded before your key's daily allowance is touched. The purchase is also capped at the amount reserved against that allowance: if the live price moves while the order is placed the answer is 409 price_changed, with nothing held and the allowance returned."
                  }
                },
                "required": [
                  "gb"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "proxy": {
                      "$ref": "#/components/schemas/ProxyOrder"
                    },
                    "topup": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "proxy",
                    "topup"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_proxies_id_topup"
      }
    },
    "/proxies/{id}/setup/{kind}": {
      "get": {
        "summary": "Download a private proxy setup file",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "clash",
                "windows",
                "macos"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Private download; Cache-Control: no-store. Treat the file as a credential.",
            "content": {
              "application/x-yaml": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-bat": {
                "schema": {
                  "type": "string"
                }
              },
              "text/x-shellscript": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_proxies_id_setup_kind"
      }
    },
    "/webhooks/{id}/rotate": {
      "post": {
        "summary": "Rotate the signing secret; returned only once",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook": {
                      "$ref": "#/components/schemas/Webhook"
                    },
                    "secret": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "webhook",
                    "secret"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_webhooks_id_rotate"
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "summary": "List webhook delivery attempts",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      }
                    }
                  },
                  "required": [
                    "deliveries"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_webhooks_id_deliveries"
      }
    },
    "/topups": {
      "post": {
        "summary": "Open a USDT deposit to top up the wallet",
        "description": "Returns an address and the exact USDT amount to send on BNB Smart Chain (BEP20) or Tron (TRC20). The balance is credited by itself a few minutes after the network confirms. Asking again for the same amount and network returns the open deposit (200, reused=true). Needs orders:write. At most 10 open deposits per account (429 too_many_open_topups). No Idempotency-Key is needed: a retry returns the same open deposit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount",
                  "method"
                ],
                "properties": {
                  "amount": {
                    "type": "string",
                    "description": "USD to add, e.g. \"50.00\" (1.00 to 10000.00). A JSON number works too."
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "usdt_bsc",
                      "usdt_tron"
                    ],
                    "description": "usdt_bsc = USDT on BNB Smart Chain (BEP20); usdt_tron = USDT on Tron (TRC20)."
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The open deposit for the same amount and network, shown again",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "topup": {
                      "$ref": "#/components/schemas/TopUp"
                    }
                  },
                  "required": [
                    "topup"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "A new deposit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "topup": {
                      "$ref": "#/components/schemas/TopUp"
                    }
                  },
                  "required": [
                    "topup"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_topups"
      }
    },
    "/topups/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "get": {
        "summary": "Get a deposit and its status",
        "description": "pending, paid (credited shows what was added) or expired. Answered from NumberHub's records, so it is cheap to poll every 30 to 60 seconds. Needs wallet:read.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "topup": {
                      "$ref": "#/components/schemas/TopUp"
                    }
                  },
                  "required": [
                    "topup"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_topups_id"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "NumberHub API key"
      }
    },
    "parameters": {
      "Id": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "Required for a new order or proxy data top-up; optional for SMS reactivation. When supplied, reuse the exact same key, method, path and JSON bytes when retrying within 24 hours. A changed request or an in-progress request returns 409. Free SMS another-code and email reorder actions do not use this middleware.",
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128,
          "pattern": "^[!-~]{8,128}$"
        }
      },
      "Duration": {
        "name": "h",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "description": "Rental duration in hours."
        }
      },
      "Country": {
        "name": "country",
        "in": "path",
        "required": true,
        "description": "Numeric country id exactly as the countries list returns it (for rentals: GET /rent/{h}/countries), for example \"187\". ISO codes such as \"US\" are not country ids; rental endpoints answer them with 400 invalid_country.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "description": "Why a 409 purchase_failed was refused, when known: low_delivery (new numbers paused for the account) or domain_unavailable (that email site and domain are unavailable for now)."
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "Money": {
        "type": "string",
        "pattern": "^-?[0-9]+\\.[0-9]{2}$",
        "description": "USD decimal amount without a currency symbol."
      },
      "Order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "sms",
              "rent",
              "esim",
              "email",
              "proxy"
            ]
          },
          "service": {
            "type": "string"
          },
          "service_name": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "country_name": {
            "type": "string"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "verification": {
            "type": "string",
            "enum": [
              "sms",
              "call"
            ]
          },
          "status": {
            "type": "string"
          },
          "status_label": {
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "operator": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancel_available_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "kind",
          "service",
          "service_name",
          "country",
          "country_name",
          "phone",
          "verification",
          "status",
          "status_label",
          "price",
          "code",
          "codes",
          "operator",
          "created_at",
          "expires_at",
          "cancel_available_at"
        ],
        "additionalProperties": true
      },
      "Balance": {
        "type": "object",
        "properties": {
          "balance": {
            "$ref": "#/components/schemas/Money"
          },
          "available": {
            "$ref": "#/components/schemas/Money"
          },
          "held": {
            "$ref": "#/components/schemas/Money"
          },
          "currency": {
            "const": "USD",
            "type": "string"
          }
        },
        "required": [
          "balance",
          "available",
          "held",
          "currency"
        ],
        "additionalProperties": true
      },
      "NamedCode": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "name"
        ],
        "additionalProperties": true
      },
      "EsimProfile": {
        "type": "object",
        "properties": {
          "ready": {
            "type": "boolean"
          },
          "qr": {
            "type": [
              "string",
              "null"
            ]
          },
          "ac": {
            "type": [
              "string",
              "null"
            ]
          },
          "smdp": {
            "type": [
              "string",
              "null"
            ]
          },
          "matchingId": {
            "type": [
              "string",
              "null"
            ]
          },
          "iccid": {
            "type": [
              "string",
              "null"
            ]
          },
          "short_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "install": {
            "type": "object",
            "properties": {
              "ios": {
                "type": "string"
              },
              "android": {
                "type": "string"
              }
            },
            "required": [],
            "additionalProperties": true
          }
        },
        "required": [
          "ready",
          "qr",
          "ac",
          "smdp",
          "matchingId",
          "iccid",
          "short_url",
          "install"
        ],
        "additionalProperties": true
      },
      "EsimOrder": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Order"
          },
          {
            "type": "object",
            "properties": {
              "esim": {
                "$ref": "#/components/schemas/EsimProfile"
              }
            },
            "required": [
              "esim"
            ],
            "additionalProperties": true
          }
        ]
      },
      "EmailOrder": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Order"
          },
          {
            "type": "object",
            "properties": {
              "email": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "code": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The verification code, or null. It is read from the mail on our side: a code next to a code word (\"Your code is 123456\", OTP, PIN, token, código, код and more), a code written in two groups (\"475-256\" is returned as written, \"475 256\" as \"475256\"), or a code alone on its own line in a mail about verification. Null for a mail that verifies with a link; use `link`. Take the code from this field instead of parsing `message`."
                  },
                  "link": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The mail's most likely action link (verify, activate, confirm, sign in, reset), with the mailbox's own redirect removed. Null when the mail has no link."
                  },
                  "links": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Links in the mail, best first; images, store badges and social icons are left out."
                  },
                  "message": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The mail as readable text (up to 4000 characters), each link written out after its text. Spacing and line breaks follow the sender's mail and can differ between inbox domains, so read the code from `code` rather than parsing this text. Null until a mail has arrived."
                  }
                },
                "required": [
                  "address",
                  "code"
                ],
                "additionalProperties": true
              }
            },
            "required": [
              "email"
            ],
            "additionalProperties": true
          }
        ]
      },
      "ProxyUsage": {
        "type": "object",
        "properties": {
          "used_bytes": {
            "type": "integer"
          },
          "limit_bytes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "left_bytes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "used": {
            "type": "string"
          },
          "total": {
            "type": "string"
          },
          "left": {
            "type": "string"
          },
          "left_pct": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "used_bytes",
          "limit_bytes",
          "left_bytes",
          "used",
          "total",
          "left",
          "left_pct"
        ],
        "additionalProperties": true
      },
      "ProxyStats": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "today",
              "hours24",
              "7d",
              "30d"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bytes": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "gb": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "total_bytes": {
            "type": "integer"
          },
          "total": {
            "type": "string"
          }
        },
        "required": [
          "period",
          "labels",
          "bytes",
          "gb",
          "total_bytes",
          "total"
        ],
        "additionalProperties": true
      },
      "ProxyDetails": {
        "type": "object",
        "properties": {
          "host": {
            "type": [
              "string",
              "null"
            ]
          },
          "http_port": {
            "type": [
              "integer",
              "null"
            ]
          },
          "socks_port": {
            "type": [
              "integer",
              "null"
            ]
          },
          "ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "The same server as host, as an IPv4 address, for apps that only accept an IP. The ready-made lines use it; null while it is unknown, and the lines then use host."
          },
          "username": {
            "type": [
              "string",
              "null"
            ]
          },
          "password": {
            "type": [
              "string",
              "null"
            ],
            "description": "Private credentials. Never log or publish."
          },
          "gb": {
            "type": [
              "integer",
              "null"
            ]
          },
          "validity_days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "type": "object",
            "properties": {
              "any": {
                "type": "string"
              },
              "country": {
                "type": "string"
              },
              "sticky": {
                "type": "string"
              },
              "socks": {
                "type": "string"
              }
            },
            "required": [],
            "additionalProperties": true
          },
          "telegram_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "setup": {
            "type": "object",
            "properties": {
              "clash": {
                "type": "string"
              },
              "windows": {
                "type": "string"
              },
              "macos": {
                "type": "string"
              }
            },
            "required": [],
            "additionalProperties": true
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProxyUsage"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "host",
          "ip",
          "http_port",
          "socks_port",
          "username",
          "password",
          "gb",
          "validity_days",
          "country",
          "lines",
          "telegram_url",
          "setup",
          "usage"
        ],
        "additionalProperties": true
      },
      "ProxyOrder": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Order"
          },
          {
            "type": "object",
            "properties": {
              "proxy": {
                "$ref": "#/components/schemas/ProxyDetails"
              }
            },
            "required": [
              "proxy"
            ],
            "additionalProperties": true
          }
        ]
      },
      "ProxyPackage": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "gb": {
            "type": "integer",
            "minimum": 1
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          },
          "per_gb": {
            "$ref": "#/components/schemas/Money"
          },
          "save_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "Percentage below this package's undiscounted retail price, rounded down. Not a reduction of cost or markup."
          },
          "popular": {
            "type": "boolean"
          }
        },
        "required": [
          "code",
          "gb",
          "price",
          "per_gb",
          "save_percent",
          "popular"
        ],
        "additionalProperties": true
      },
      "ProxyPackages": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "validity_days": {
            "type": "integer"
          },
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "from_per_gb": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "type": "null"
              }
            ]
          },
          "packages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProxyPackage"
            }
          }
        },
        "required": [
          "enabled",
          "validity_days",
          "packages"
        ],
        "additionalProperties": true
      },
      "LineOptions": {
        "type": "object",
        "properties": {
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "session": {
            "type": "string",
            "enum": [
              "rotating",
              "sticky"
            ],
            "default": "rotating"
          },
          "sid": {
            "type": [
              "string",
              "null"
            ]
          },
          "ttl": {
            "type": "string",
            "pattern": "^\\d{1,4}(s|m|h)$",
            "default": "24h"
          },
          "protocol": {
            "type": "string",
            "enum": [
              "http",
              "socks5"
            ],
            "default": "http"
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 1
          }
        },
        "required": [],
        "additionalProperties": true
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "active": {
            "type": "boolean"
          },
          "failure_count": {
            "type": "integer"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_success_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_failure_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "secret_hint": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "active",
          "failure_count",
          "created_at",
          "last_success_at",
          "last_failure_at",
          "secret_hint"
        ],
        "additionalProperties": true
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "event": {
            "type": "string"
          },
          "order_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pending": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "event",
          "order_id",
          "attempts",
          "delivered_at",
          "last_error",
          "created_at",
          "pending"
        ],
        "additionalProperties": true
      },
      "TopUp": {
        "type": "object",
        "description": "A USDT deposit to the wallet. address and pay_amount are present only while it can still be paid; money sent to an expired address is lost.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "paid",
              "expired"
            ]
          },
          "amount": {
            "$ref": "#/components/schemas/Money",
            "description": "USD requested."
          },
          "credited": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "type": "null"
              }
            ],
            "description": "USD added to the balance once paid; null until then."
          },
          "currency": {
            "const": "USD",
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "usdt_bsc",
              "usdt_tron"
            ]
          },
          "pay_currency": {
            "const": "USDT",
            "type": "string"
          },
          "network": {
            "type": "string",
            "description": "BNB Smart Chain (BEP20) or Tron (TRC20)."
          },
          "network_short": {
            "type": "string",
            "enum": [
              "BEP20",
              "TRC20"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send USDT to this address, on this network only. null once it can no longer be paid."
          },
          "pay_amount": {
            "type": [
              "string",
              "null"
            ],
            "description": "Exact USDT to send. Paying exactly this credits exactly amount; a smaller payment is credited in proportion."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reused": {
            "type": "boolean",
            "description": "POST only: true when the open deposit for the same amount and network is shown again."
          }
        },
        "required": [
          "id",
          "status",
          "amount",
          "credited",
          "currency",
          "method",
          "network_short",
          "address",
          "pay_amount",
          "expires_at"
        ],
        "additionalProperties": true
      }
    },
    "responses": {
      "Error": {
        "description": "Error response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
