{
  "info": {
    "name": "NumberHub API v1",
    "description": "Starter collection for all five product lines. Set api_key and IDs before sending requests. Purchases spend real balance. Set a NEW idempotency_key for each intentional purchase or proxy top-up; KEEP that key and identical body for a retry. Do not run the whole collection against a funded account.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.numberhub.io/v1"
    },
    {
      "key": "api_key",
      "value": "nh_live_replace_me"
    },
    {
      "key": "order_id",
      "value": "1"
    },
    {
      "key": "idempotency_key",
      "value": "replace-with-a-new-uuid"
    },
    {
      "key": "webhook_id",
      "value": "1"
    },
    {
      "key": "rental_id",
      "value": "replace-with-your-rental-id"
    },
    {
      "key": "rental_hours",
      "value": "24"
    },
    {
      "key": "rental_country",
      "value": "0"
    },
    {
      "key": "rental_service",
      "value": "tg"
    },
    {
      "key": "rental_max_price",
      "value": "replace-with-accepted-quote-price"
    }
  ],
  "item": [
    {
      "name": "Account",
      "item": [
        {
          "name": "Balance",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/balance"
          }
        },
        {
          "name": "Recent orders",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/orders?limit=40"
          }
        }
      ]
    },
    {
      "name": "SMS numbers",
      "item": [
        {
          "name": "Services",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/services"
          }
        },
        {
          "name": "Countries",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/countries?service=tg"
          }
        },
        {
          "name": "Buy number",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\"service\":\"tg\",\"country\":\"0\",\"max_price\":\"1.00\"}"
            },
            "url": "{{base_url}}/numbers"
          }
        },
        {
          "name": "Get number",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/numbers/{{order_id}}"
          }
        }
      ]
    },
    {
      "name": "Number rentals",
      "description": "Browse durations, countries and services, then request a fresh quote. Purchase is paid upfront. Cancellation is available only 2 to 20 minutes after start, before any SMS, once the cancellation is confirmed. Early termination is retired. The public v1 API does not expose extension; use the available extension controls in the web app or Telegram. GET /rentals/{id} provides status and received codes; no separate messages route exists. Do not run this folder as a batch against real funds.",
      "item": [
        {
          "name": "Rental durations",
          "request": {
            "method": "GET",
            "description": "Choose rental_hours from this response.",
            "url": "{{base_url}}/rent/durations"
          }
        },
        {
          "name": "Rental countries",
          "request": {
            "method": "GET",
            "description": "Choose rental_country from the available catalog. During a temporary outage, this may show the last successful country list; a purchase checks availability again.",
            "url": "{{base_url}}/rent/{{rental_hours}}/countries"
          }
        },
        {
          "name": "Rental services and prices",
          "request": {
            "method": "GET",
            "description": "Choose rental_service from the available services. During a temporary outage, prices may come from the last successful list.",
            "url": "{{base_url}}/rent/{{rental_hours}}/{{rental_country}}/services"
          }
        },
        {
          "name": "Rental quote",
          "request": {
            "method": "GET",
            "description": "Review the quote and set rental_max_price to the price you accept. During a temporary outage, the quote may use cached prices. A quote does not reserve stock or lock the purchase price.",
            "url": "{{base_url}}/rent/{{rental_hours}}/{{rental_country}}/{{rental_service}}/quote"
          }
        },
        {
          "name": "Buy rental (spends balance)",
          "request": {
            "method": "POST",
            "description": "Replace rental_max_price with the quote price you accept. The starter placeholder is rejected as bad_max_price; an empty value would remove the cap. A higher refreshed price returns 409 price_exceeded before buying, and when fresh prices cannot be checked the request returns 503 rent_unavailable. Set a new idempotency_key for an intentional purchase. Keep the same key and body for a retry. Save the returned rental.id as rental_id.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\"h\":{{rental_hours}},\"country\":\"{{rental_country}}\",\"code\":\"{{rental_service}}\",\"max_price\":\"{{rental_max_price}}\"}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{base_url}}/rentals"
          },
          "response": [
            {
              "name": "Illustrative response, not a live order",
              "status": "OK",
              "code": 201,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"rental\": {\n    \"id\": 10590,\n    \"kind\": \"rent\",\n    \"status\": \"waiting\",\n    \"price\": \"3.20\",\n    \"codes\": [],\n    \"expires_at\": \"2026-09-10T12:00:00+00:00\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Rental status and received codes",
          "request": {
            "method": "GET",
            "description": "The rental object includes codes received during the rental. Poll this route for status and message codes.",
            "url": "{{base_url}}/rentals/{{rental_id}}"
          },
          "response": [
            {
              "name": "Illustrative response, not a live order",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"rental\": {\n    \"id\": 10590,\n    \"kind\": \"rent\",\n    \"status\": \"received\",\n    \"price\": \"3.20\",\n    \"codes\": [\n      \"123456\"\n    ],\n    \"expires_at\": \"2026-09-10T12:00:00+00:00\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Cancel eligible rental (refund request)",
          "request": {
            "method": "DELETE",
            "description": "Only 2 to 20 minutes after start and before any SMS. A refund is made only after the cancellation is confirmed. Outside the window returns 409 cancel_window_closed. Check ok: a 200 response with ok=false means no refund. The rental continues when cancellation is refused.",
            "url": "{{base_url}}/rentals/{{rental_id}}"
          },
          "response": [
            {
              "name": "Illustrative response, not a live order",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"ok\": true,\n  \"rental\": {\n    \"id\": 10590,\n    \"kind\": \"rent\",\n    \"status\": \"canceled\",\n    \"price\": \"3.20\",\n    \"codes\": [],\n    \"expires_at\": \"2026-09-10T12:00:00+00:00\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Rental history via all orders",
          "request": {
            "method": "GET",
            "description": "This route returns recent orders across all products, not only rentals. Filter the returned orders locally by kind === \"rent\". This is a recent-order view, not a complete account-history export.",
            "url": "{{base_url}}/orders?limit=100"
          },
          "response": [
            {
              "name": "Illustrative response, not a live order",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"orders\": [\n    {\n      \"id\": 10590,\n      \"kind\": \"rent\",\n      \"status\": \"waiting\",\n      \"price\": \"3.20\",\n      \"codes\": [],\n      \"expires_at\": \"2026-09-10T12:00:00+00:00\"\n    }\n  ]\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "eSIM",
      "item": [
        {
          "name": "Regions",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/esim/regions"
          }
        },
        {
          "name": "Packages",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/esim/regions/US/packages"
          }
        }
      ]
    },
    {
      "name": "Email OTP",
      "item": [
        {
          "name": "Sites",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/email/sites"
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "List webhooks",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/webhooks"
          }
        },
        {
          "name": "Create webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\"url\":\"https://example.com/numberhub-events\",\"events\":[\"order.*\"]}"
            },
            "url": "{{base_url}}/webhooks"
          }
        },
        {
          "name": "Send test webhook",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/webhooks/{{webhook_id}}/test"
          }
        },
        {
          "name": "Remove webhook",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/webhooks/{{webhook_id}}"
          }
        }
      ]
    },
    {
      "name": "Residential proxies",
      "item": [
        {
          "name": "List live residential proxy data packages",
          "request": {
            "method": "GET",
            "description": "List live residential proxy data packages",
            "url": "{{base_url}}/proxy/packages"
          }
        },
        {
          "name": "List residential proxy locations",
          "request": {
            "method": "GET",
            "description": "List residential proxy locations",
            "url": "{{base_url}}/proxy/countries"
          }
        },
        {
          "name": "List proxy regions",
          "request": {
            "method": "GET",
            "description": "List proxy regions",
            "url": "{{base_url}}/proxy/countries/us/regions"
          }
        },
        {
          "name": "List proxy cities",
          "request": {
            "method": "GET",
            "description": "List proxy cities",
            "url": "{{base_url}}/proxy/countries/us/cities"
          }
        },
        {
          "name": "Purchase a proxy data package, charged upfront",
          "request": {
            "method": "POST",
            "description": "Purchase a proxy data package, charged upfront",
            "url": "{{base_url}}/proxies",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"gb\": 5\n}"
            }
          }
        },
        {
          "name": "Get proxy credentials and order",
          "request": {
            "method": "GET",
            "description": "Get proxy credentials and order",
            "url": "{{base_url}}/proxies/{{order_id}}"
          }
        },
        {
          "name": "Get metered proxy usage",
          "request": {
            "method": "GET",
            "description": "Get metered proxy usage",
            "url": "{{base_url}}/proxies/{{order_id}}/usage"
          }
        },
        {
          "name": "Get proxy traffic time series",
          "request": {
            "method": "GET",
            "description": "Get proxy traffic time series",
            "url": "{{base_url}}/proxies/{{order_id}}/stats"
          }
        },
        {
          "name": "Generate connection lines without purchasing data",
          "request": {
            "method": "POST",
            "description": "Generate connection lines without purchasing data",
            "url": "{{base_url}}/proxies/{{order_id}}/lines",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"country\": \"us\",\n  \"protocol\": \"http\",\n  \"session\": \"rotating\",\n  \"count\": 1\n}"
            }
          }
        },
        {
          "name": "Set the default target country; empty string restores worldwide rotation",
          "request": {
            "method": "POST",
            "description": "Set the default target country; empty string restores worldwide rotation",
            "url": "{{base_url}}/proxies/{{order_id}}/country",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"country\": \"us\"\n}"
            }
          }
        },
        {
          "name": "Add data to the same proxy login and restart its validity; charged upfront",
          "request": {
            "method": "POST",
            "description": "Add data to the same proxy login and restart its validity; charged upfront",
            "url": "{{base_url}}/proxies/{{order_id}}/topup",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"gb\": 5\n}"
            }
          }
        },
        {
          "name": "Download a private proxy setup file",
          "request": {
            "method": "GET",
            "description": "Download a private proxy setup file",
            "url": "{{base_url}}/proxies/{{order_id}}/setup/clash"
          }
        }
      ]
    }
  ]
}
