{
  "openapi": "3.1.0",
  "info": {
    "title": "GlobeVerify REST API",
    "version": "1.0.0",
    "description": "Programmatic access to GlobeVerify virtual numbers, SMS verification, rentals, wallet, white-label and webhooks. Human-readable docs: https://www.globeverify.com/docs",
    "contact": {
      "email": "support@globeverify.com",
      "url": "https://www.globeverify.com"
    }
  },
  "externalDocs": {
    "description": "Public API documentation",
    "url": "https://www.globeverify.com/docs"
  },
  "servers": [
    {
      "url": "https://api.globeverify.com"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Developer API key from Dashboard → API Keys & Webhooks."
      }
    }
  },
  "paths": {
    "/v1/countries": {
      "get": {
        "tags": [
          "Services Catalog"
        ],
        "summary": "Get Countries",
        "description": "Fetch all countries currently supported by the provider. Each entry includes an integer ID (use this for other API calls), the full country name, a short_name ISO code, the international calling code (cc), and a region label for grouping. Available regions: Favourites, Europe, Asia, Africa, North America, South America, Central America, Carribeans, Oceania, Virtuals.",
        "operationId": "getCountries",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": [
                  {
                    "ID": 1,
                    "name": "United States",
                    "short_name": "US",
                    "cc": "1",
                    "region": "Favourites"
                  },
                  {
                    "ID": 14,
                    "name": "Nigeria",
                    "short_name": "NG",
                    "cc": "234",
                    "region": "Africa"
                  },
                  {
                    "ID": 9,
                    "name": "Indonesia",
                    "short_name": "ID",
                    "cc": "62",
                    "region": "Asia"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/v1/services": {
      "get": {
        "tags": [
          "Services Catalog"
        ],
        "summary": "Get Available Services",
        "description": "Fetch all services available on the platform (e.g., WhatsApp, Telegram, Google, Discord). Results are sorted with favourites (favourite: 1) at the top, followed by alphabetical listings. Use the integer ID when purchasing a number.",
        "operationId": "getAvailableServices",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": [
                  {
                    "ID": 273,
                    "name": "Discord",
                    "favourite": 1,
                    "successRate": null
                  },
                  {
                    "ID": 1012,
                    "name": "WhatsApp",
                    "favourite": 1,
                    "successRate": null
                  },
                  {
                    "ID": 907,
                    "name": "Telegram",
                    "favourite": 1,
                    "successRate": null
                  },
                  {
                    "ID": 395,
                    "name": "Google/Gmail",
                    "favourite": 1,
                    "successRate": null
                  }
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "Optional country ID or short_name to filter services by availability.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/stock": {
      "get": {
        "tags": [
          "Services Catalog"
        ],
        "summary": "Get Stock Levels",
        "description": "Fetch current inventory stock levels for a specific service in a specific country.",
        "operationId": "getStockLevels",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "amount": 17312,
                  "success": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "description": "Target country ID or short_name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service",
            "in": "query",
            "required": true,
            "description": "Target service ID.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/areacodes": {
      "get": {
        "tags": [
          "Services Catalog"
        ],
        "summary": "Get Area Codes",
        "description": "Fetch available area codes for the specified service and country. Returns a flat array of integer area codes. Used mainly for North American numbers.",
        "operationId": "getAreaCodes",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": [
                  201,
                  202,
                  212,
                  213,
                  310,
                  312,
                  404,
                  415
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "description": "Target country ID or short_name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service",
            "in": "query",
            "required": true,
            "description": "Target service ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pool",
            "in": "query",
            "required": false,
            "description": "Optional provider pool.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/price": {
      "get": {
        "tags": [
          "Services Catalog"
        ],
        "summary": "Get Instant Price",
        "description": "Calculate the exact billing cost for purchasing a service, accounting for the developer's specific discounts and multi-currency exchange rates.",
        "operationId": "getInstantPrice",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "price": 2898,
                  "currency": "NGN",
                  "formatted": "₦2898.00",
                  "supportsPoolSelection": true,
                  "successRate": 62
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "Target country ID or short_name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service",
            "in": "query",
            "required": false,
            "description": "Target service ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "description": "Optional desired output currency (e.g. NGN, USD).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pricing_option",
            "in": "query",
            "required": false,
            "description": "0 for Economy, 1 for High Success Rate.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "pool",
            "in": "query",
            "required": false,
            "description": "Optional explicit pool alias to lock pricing.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_price",
            "in": "query",
            "required": false,
            "description": "Optional maximum price budget. If the pool exceeds this, returns NO_POOL.",
            "schema": {
              "type": "number"
            }
          }
        ]
      }
    },
    "/v1/pools": {
      "get": {
        "tags": [
          "Services Catalog"
        ],
        "summary": "Get Available Pools",
        "description": "Fetch all available underlying provider pools for a specific service and country. Includes their unique aliases, pricing, and success rates.",
        "operationId": "getAvailablePools",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "supportsPoolSelection": true,
                  "pools": [
                    {
                      "alias": "Nova",
                      "price": 2884,
                      "formatted": "₦2884.00",
                      "currency": "NGN",
                      "success_rate": 64
                    },
                    {
                      "alias": "Standard",
                      "price": 2898,
                      "formatted": "₦2898.00",
                      "currency": "NGN",
                      "success_rate": 59
                    }
                  ]
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "description": "Target country ID or short_name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service",
            "in": "query",
            "required": true,
            "description": "Target service ID.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/numbers/purchase": {
      "post": {
        "tags": [
          "Virtual Numbers (OTP)"
        ],
        "summary": "Purchase a One-Time Number",
        "description": "Provision a number for a targeted service. Purchases are immediately debited from your wallet.",
        "operationId": "purchaseAOneTimeNumber",
        "responses": {
          "200": {
            "description": "Number Purchased Successfully",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Number purchased successfully",
                  "data": {
                    "_id": "6a1ac6d8511382ccc15007d6",
                    "user": "6abc0612b7d78e71d77fc81c",
                    "phoneNumber": "+1 5033051381",
                    "countryCode": "US",
                    "countryName": "United States",
                    "service": "273",
                    "serviceName": "Discord",
                    "status": "active",
                    "cost": 80.1,
                    "currency": "NGN",
                    "type": "sms",
                    "lineType": "non_voip",
                    "isFullAccess": false,
                    "autoRenew": false,
                    "orderSource": "api",
                    "isReactivated": false,
                    "enableVoicemail": false,
                    "forwardToNumber": "",
                    "expiresAt": "2026-05-30T11:35:36.000Z",
                    "transactionId": "6a1ac6d8511382ccc15007d5",
                    "otps": [],
                    "purchasedAt": "2026-05-30T11:15:36.469Z"
                  }
                }
              }
            }
          },
          "202": {
            "description": "Queued (Returned if internal stock is low)",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "pending": true,
                  "message": "Order queued due to high demand. You will receive an email when your number is ready.",
                  "orderId": "queue_817...",
                  "estimatedWait": "5-25 minutes"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "country": "US",
                "service": 273,
                "serviceName": "Discord",
                "pricing_option": 1,
                "pool": "Nova",
                "max_price": 500
              }
            }
          }
        }
      }
    },
    "/v1/numbers/{numberId}/otp": {
      "get": {
        "tags": [
          "Virtual Numbers (OTP)"
        ],
        "summary": "Check Inbox (OTP)",
        "description": "Poll this endpoint repeatedly to read incoming SMS OTPs for a specific active number. The numberId is the _id field returned from the purchase endpoint.",
        "operationId": "checkInboxOtp",
        "responses": {
          "200": {
            "description": "OTP Received",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "otps": [
                      {
                        "code": "849201",
                        "message": "Your Discord verification code is: 849201",
                        "sender": "Discord",
                        "receivedAt": "2026-05-30T11:20:00.000Z"
                      }
                    ],
                    "status": "completed"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "numberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/numbers/{numberId}/cancel": {
      "post": {
        "tags": [
          "Virtual Numbers (OTP)"
        ],
        "summary": "Cancel & Refund Number",
        "description": "Cancel an active number. If cancelled before OTP extraction, funds are refunded to your wallet. The full updated order object is returned.",
        "operationId": "cancelRefundNumber",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Number cancelled and refunded.",
                  "data": {
                    "_id": "6a1ac6d8511382ccc15007d6",
                    "user": "6abc0612b7d78e71d77fc81c",
                    "phoneNumber": "+1 5033051381",
                    "countryCode": "US",
                    "countryName": "United States",
                    "service": "273",
                    "serviceName": "Discord",
                    "status": "cancelled",
                    "cost": 80.1,
                    "currency": "NGN",
                    "type": "sms",
                    "lineType": "non_voip",
                    "isFullAccess": false,
                    "autoRenew": false,
                    "orderSource": "api",
                    "isReactivated": false,
                    "enableVoicemail": false,
                    "forwardToNumber": "",
                    "expiresAt": "2026-05-30T11:35:36.000Z",
                    "transactionId": "6a1ac6d8511382ccc15007d5",
                    "otps": [],
                    "purchasedAt": "2026-05-30T11:15:36.469Z"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "numberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/numbers/{numberId}/reuse": {
      "get": {
        "tags": [
          "Virtual Numbers (OTP)"
        ],
        "summary": "Retrieve Reuse Capability",
        "description": "Determine if a number can be reused (resent for free or reactivated for a fee).",
        "operationId": "retrieveReuseCapability",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "success": true,
                    "canResendForFree": true,
                    "message": "This phone number is available for resend!",
                    "resendCost": 0
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "numberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Virtual Numbers (OTP)"
        ],
        "summary": "Execute Number Reuse",
        "description": "Initiate a reactivation (paid) or resend trigger (free).",
        "operationId": "executeNumberReuse",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Number successfully reactivated to receive SMS.",
                  "phone": "+1 5033051381"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "numberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "payToReactivate": true
              }
            }
          }
        }
      }
    },
    "/v1/rentals/options": {
      "get": {
        "tags": [
          "Developer Rental API"
        ],
        "summary": "Get Rental Options",
        "description": "Fetch a live list of available phone numbers for rent, including pricing and supported durations.",
        "operationId": "getRentalOptions",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": [
                  {
                    "phoneNumber": "+19482417375",
                    "region": "US",
                    "pricing": {
                      "30": 8.5
                    },
                    "type": 1,
                    "currency": "USD"
                  },
                  {
                    "phoneNumber": "+19482417376",
                    "region": "US",
                    "pricing": {
                      "30": 8.5
                    },
                    "type": 1,
                    "currency": "USD"
                  }
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "countryCode",
            "in": "query",
            "required": false,
            "description": "The 2-letter ISO country code (e.g. US, GB, CA). Defaults to US.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "areaCode",
            "in": "query",
            "required": false,
            "description": "Optional 3-digit area code to filter numbers (e.g. 212).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "description": "Optional desired output currency (e.g. NGN, USD).",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/rentals/buy": {
      "post": {
        "tags": [
          "Developer Rental API"
        ],
        "summary": "Buy Rental Number",
        "description": "Purchase one of the available rental numbers returned from the Options endpoint. Pass the phoneNumber string into the rentalId field.",
        "operationId": "buyRentalNumber",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "id": "6a3c51705d305ae92f84a129",
                    "phoneNumber": "+19482417375",
                    "countryCode": "US",
                    "countryName": "United States",
                    "service": "global",
                    "serviceName": "Number Rental",
                    "status": "active",
                    "cost": 8.5,
                    "currency": "USD",
                    "purchasedAt": "2026-06-25T14:15:00.000Z",
                    "expiresAt": "2026-07-25T14:15:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Insufficient funds or unavailable number",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "message": "Insufficient balance"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "rentalId": "+19482417375",
                "days": 30,
                "serviceId": "global",
                "country": "US"
              }
            }
          }
        }
      }
    },
    "/v1/rentals/extend": {
      "post": {
        "tags": [
          "Developer Rental API"
        ],
        "summary": "Extend Rental Duration",
        "description": "Extend the expiration date of an active rental by 30 days. Uses the GlobeVerify rental ID (_id) of the number.",
        "operationId": "extendRentalDuration",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Rental extended by 30 days",
                  "data": {
                    "rentalId": "6a3c51705d305ae92f84a129",
                    "expiresAt": "2026-08-25T14:15:00.000Z"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "rentalId": "6a3c51705d305ae92f84a129",
                "days": 30
              }
            }
          }
        }
      }
    },
    "/v1/rentals": {
      "get": {
        "tags": [
          "Developer Rental API"
        ],
        "summary": "List Active Rentals",
        "description": "Retrieve a list of all your currently active rental numbers.",
        "operationId": "listActiveRentals",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "rentals": [
                    {
                      "id": "6a3c51705d305ae92f84a129",
                      "phoneNumber": "+19482417375",
                      "status": "active",
                      "country": "US",
                      "purchasedAt": "2026-06-25T14:15:00.000Z",
                      "expiresAt": "2026-07-25T14:15:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/rentals/{rentalId}/messages": {
      "get": {
        "tags": [
          "Developer Rental API"
        ],
        "summary": "Get Rental Messages",
        "description": "Fetch the SMS and voicemail history for a specific rental number using its GlobeVerify rental ID.",
        "operationId": "getRentalMessages",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "messages": [
                    {
                      "id": "7b4d62816e416bf83f95b230",
                      "direction": "inbound",
                      "from": "+15551234567",
                      "to": "+19482417375",
                      "body": "Your verification code is 123456",
                      "status": "received",
                      "createdAt": "2026-06-25T10:15:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "rentalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/rentals/{rentalId}/sms": {
      "post": {
        "tags": [
          "Developer Rental API"
        ],
        "summary": "Send Outbound SMS",
        "description": "Send an outbound SMS from your rental number. The cost per SMS is deducted natively from your active balance.",
        "operationId": "sendOutboundSms",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": {
                    "direction": "outbound",
                    "rentalPhoneNumber": "+19482417375",
                    "remotePhoneNumber": "+15551234567",
                    "text": "Hello from Globeverify!",
                    "status": "sent",
                    "costUSD": 0.05,
                    "timestamp": "2026-06-25T12:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Insufficient funds or bad number",
            "content": {
              "application/json": {
                "example": {
                  "success": false,
                  "message": "Insufficient telecom credits"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "rentalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "to": "+15551234567",
                "text": "Hello from Globeverify!"
              }
            }
          }
        }
      }
    },
    "/v1/balance": {
      "get": {
        "tags": [
          "Wallet API"
        ],
        "summary": "Get Wallet Balance",
        "description": "Fetch your current active wallet balance bounded by your active session currency.",
        "operationId": "getWalletBalance",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "balance": 2626.65,
                    "currency": "NGN",
                    "balances": {
                      "usd": 0,
                      "ngn": 2626.65
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/whitelabel/plans": {
      "get": {
        "tags": [
          "White-Label Provisioning"
        ],
        "summary": "Get Plans",
        "description": "Fetch available whitelabel plans and prices, applying your custom user discounts. Plans include mini, pro, and max tiers with both USD and NGN pricing.",
        "operationId": "getPlans",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": [
                    {
                      "_id": "69ab4c8de83636f9c8e086b7",
                      "tier": "mini",
                      "name": "Mini Plan",
                      "priceUSD": 5,
                      "priceNGN": 7500,
                      "currency": "NGN",
                      "isActive": true,
                      "features": []
                    },
                    {
                      "_id": "69ab4c8de83636f9c8e086b8",
                      "tier": "pro",
                      "name": "Pro Plan",
                      "priceUSD": 38,
                      "priceNGN": 57000,
                      "currency": "NGN",
                      "isActive": true,
                      "features": []
                    },
                    {
                      "_id": "69ab4c8ee83636f9c8e086b9",
                      "tier": "max",
                      "name": "Max Plan",
                      "priceUSD": 128.99,
                      "priceNGN": 193485,
                      "currency": "NGN",
                      "isActive": true,
                      "features": []
                    }
                  ],
                  "domainMarkup": 7500,
                  "currency": "NGN"
                }
              }
            }
          }
        }
      }
    },
    "/v1/whitelabel/check-domain": {
      "get": {
        "tags": [
          "White-Label Provisioning"
        ],
        "summary": "Check Domain Availability & Price",
        "description": "Check if a custom domain is available for registration and get its full cost breakdown including base price, markup, and totals in both USD and NGN.",
        "operationId": "checkDomainAvailabilityPrice",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "available": true,
                  "basePriceUSD": 12,
                  "basePriceNGN": 16800,
                  "markupNGN": 7000,
                  "totalPriceUSD": 17,
                  "totalPriceNGN": 23800,
                  "currency": "NGN"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Domain to check (e.g., example.com)",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/whitelabel/purchase": {
      "post": {
        "tags": [
          "White-Label Provisioning"
        ],
        "summary": "Purchase a White-Label Site",
        "description": "Provision a new white-label site. Pro/Enterprise users can purchase on loan up to a maximum debt of -$200.00 or -₦300,000.",
        "operationId": "purchaseAWhiteLabelSite",
        "responses": {
          "201": {
            "description": "201 Created",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "White-label site ordered. Your custom domain is being registered and configured. You will receive an email shortly.",
                  "data": {
                    "_id": "69d606c380db0a5972360435",
                    "siteName": "My Site",
                    "domain": "my-cool-site.com",
                    "isSubdomain": false,
                    "domainStatus": "pending",
                    "tier": "pro",
                    "status": "pending_setup",
                    "ownerEmail": "admin@my-cool-site.com",
                    "costUSD": 55,
                    "chargedAmount": 82500,
                    "currency": "NGN",
                    "createdOnLoan": true,
                    "createdAt": "2026-04-08T07:41:55.350Z"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "tier": "pro",
                "domain": "my-cool-site.com",
                "isSubdomain": false,
                "siteName": "My Site",
                "ownerEmail": "admin@my-cool-site.com",
                "ownerPassword": "secure123",
                "ownerFirstName": "John",
                "ownerLastName": "Doe"
              }
            }
          }
        }
      }
    },
    "/v1/whitelabel/sites": {
      "get": {
        "tags": [
          "White-Label Provisioning"
        ],
        "summary": "List My Sites",
        "description": "Fetch all white-label sites provisioned by your account.",
        "operationId": "listMySites",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": [
                    {
                      "_id": "69d606c380db0a5972360435",
                      "siteName": "My Site",
                      "domain": "mysite.getsms.site",
                      "isSubdomain": true,
                      "domainStatus": "active",
                      "tier": "mini",
                      "status": "active",
                      "ownerEmail": "admin@example.com",
                      "costUSD": 5,
                      "chargedAmount": 7500,
                      "currency": "NGN",
                      "createdAt": "2026-04-08T07:41:55.350Z"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/whitelabel/validate-coupon": {
      "post": {
        "tags": [
          "White-Label Provisioning"
        ],
        "summary": "Validate Coupon",
        "description": "Validate a discount coupon code before purchasing a white-label site.",
        "operationId": "validateCoupon",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "discountPercentage": 20
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "code": "SUMMER20"
              }
            }
          }
        }
      }
    },
    "/v1/whitelabel/upgrade": {
      "post": {
        "tags": [
          "White-Label Provisioning"
        ],
        "summary": "Upgrade/Downgrade Site Tier",
        "description": "Change the subscription tier of an existing white-label site. The price difference will be deducted from your balance.",
        "operationId": "upgradeDowngradeSiteTier",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Upgraded successfully",
                  "data": {
                    "tier": "pro",
                    "domain": "mysite.getsms.site"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "orderId": "6a20b55c8a85b55fa05c7a51",
                "newTier": "pro"
              }
            }
          }
        }
      }
    },
    "/v1/whitelabel/branding": {
      "put": {
        "tags": [
          "White-Label Provisioning"
        ],
        "summary": "Update Branding",
        "description": "Update the logo URL and theme colors of an existing white-label site.",
        "operationId": "updateBranding",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Branding updated successfully",
                  "data": {
                    "logo": "https://example.com/logo.png",
                    "primaryColor": "#ff0000",
                    "secondaryColor": "#06b6d4"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "orderId": "6a20b55c8a85b55fa05c7a51",
                "logo": "https://example.com/logo.png",
                "primaryColor": "#ff0000",
                "secondaryColor": "#06b6d4"
              }
            }
          }
        }
      }
    },
    "/v1/whitelabel/sync": {
      "post": {
        "tags": [
          "White-Label Provisioning"
        ],
        "summary": "Sync Site Data",
        "description": "Synchronize the status and tier of your white-label site with the upstream master network.",
        "operationId": "syncSiteData",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Site synced successfully",
                  "data": {
                    "status": "active",
                    "tier": "pro"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "orderId": "6a20b55c8a85b55fa05c7a51"
              }
            }
          }
        }
      }
    },
    "/v1/cheap/countries": {
      "get": {
        "tags": [
          "Cheap Verification Numbers (NGN)"
        ],
        "summary": "Get Countries",
        "description": "Fetch supported countries for cheap verification numbers.",
        "operationId": "getCountries2",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "us",
                      "code": "us",
                      "short_name": "USA",
                      "name": "United States"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/cheap/services": {
      "get": {
        "tags": [
          "Cheap Verification Numbers (NGN)"
        ],
        "summary": "Get Services & Live Pricing",
        "description": "Fetch all available services with live stock and current wholesale NGN pricing.",
        "operationId": "getServicesLivePricing",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "count": 71,
                  "data": [
                    {
                      "id": "whatsapp",
                      "serviceId": 3,
                      "name": "WhatsApp",
                      "price": 1350,
                      "currency": "NGN",
                      "available": 95
                    },
                    {
                      "id": "telegram",
                      "serviceId": 15,
                      "name": "Telegram",
                      "price": 950,
                      "currency": "NGN",
                      "available": 60
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/cheap/purchase": {
      "post": {
        "tags": [
          "Cheap Verification Numbers (NGN)"
        ],
        "summary": "Purchase Cheap Number",
        "description": "Purchase a single-use cheap verification number. The cost is deducted directly from your NGN wallet balance.",
        "operationId": "purchaseCheapNumber",
        "responses": {
          "201": {
            "description": "201 Created",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Number purchased successfully",
                  "data": {
                    "id": "6ad23972b5e181e762f5428e",
                    "phoneNumber": "+13364151656",
                    "countryCode": "us",
                    "countryName": "United States",
                    "service": "WhatsApp",
                    "serviceName": "WhatsApp",
                    "status": "waiting",
                    "cost": 1350,
                    "currency": "NGN",
                    "type": "cheap",
                    "isReused": false,
                    "expiresAt": "2026-10-17T15:35:00.000Z",
                    "purchasedAt": "2026-10-17T15:15:00.000Z"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "service": "whatsapp",
                "country": "us"
              }
            }
          }
        }
      }
    },
    "/v1/cheap/{orderId}/status": {
      "get": {
        "tags": [
          "Cheap Verification Numbers (NGN)"
        ],
        "summary": "Check Order Status & OTP",
        "description": "Poll for incoming SMS verification codes for an active cheap number.",
        "operationId": "checkOrderStatusOtp",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "id": "6ad23972b5e181e762f5428e",
                    "phoneNumber": "+13364151656",
                    "status": "completed",
                    "otps": [
                      {
                        "code": "232321",
                        "message": "Your WhatsApp code: 232-321",
                        "sender": "WhatsApp",
                        "receivedAt": "2026-10-17T15:18:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/cheap/{orderId}/cancel": {
      "post": {
        "tags": [
          "Cheap Verification Numbers (NGN)"
        ],
        "summary": "Cancel Order",
        "description": "Cancel a waiting cheap order and refund funds to your NGN wallet balance.",
        "operationId": "cancelOrder",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Order cancelled and refunded.",
                  "data": {
                    "id": "6ad23972b5e181e762f5428e",
                    "status": "cancelled",
                    "refunded": true,
                    "refundAmount": 1350,
                    "currency": "NGN"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/cheap/orders": {
      "get": {
        "tags": [
          "Cheap Verification Numbers (NGN)"
        ],
        "summary": "List My Orders",
        "description": "Retrieve a list of cheap numbers purchased by your developer account.",
        "operationId": "listMyOrders",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "6ad23972b5e181e762f5428e",
                      "phoneNumber": "+13364151656",
                      "countryCode": "us",
                      "countryName": "United States",
                      "service": "WhatsApp",
                      "status": "completed",
                      "cost": 1350,
                      "currency": "NGN",
                      "otps": [
                        {
                          "code": "232321",
                          "message": "Your WhatsApp code: 232-321",
                          "sender": "WhatsApp",
                          "receivedAt": "2026-10-17T15:18:00.000Z"
                        }
                      ],
                      "purchasedAt": "2026-10-17T15:15:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Optional status filter (waiting, completed, cancelled)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of orders to return (default: 50, max: 100)",
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/v1/cheap/reusable-numbers": {
      "get": {
        "tags": [
          "Cheap Verification Numbers (NGN)"
        ],
        "summary": "Get Reusable Numbers",
        "description": "Fetch previously purchased phone numbers that are currently eligible for number reuse.",
        "operationId": "getReusableNumbers",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": [
                    "+13364151656"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/cheap/reusable-services": {
      "get": {
        "tags": [
          "Cheap Verification Numbers (NGN)"
        ],
        "summary": "Get Reusable Services",
        "description": "Fetch services and discounted pricing available for a reusable phone number.",
        "operationId": "getReusableServices",
        "responses": {
          "200": {
            "description": "200 OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": [
                    {
                      "serviceId": 1,
                      "name": "Instagram",
                      "price": 1125,
                      "currency": "NGN",
                      "discountPercent": 10,
                      "previouslyUsed": false
                    }
                  ]
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "number",
            "in": "query",
            "required": true,
            "description": "The phone number to check (e.g. +13364151656)",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/cheap/reuse": {
      "post": {
        "tags": [
          "Cheap Verification Numbers (NGN)"
        ],
        "summary": "Execute Number Reuse",
        "description": "Reuse an eligible number for a new verification on a supported service.",
        "operationId": "executeNumberReuse2",
        "responses": {
          "201": {
            "description": "201 Created",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Number reused successfully",
                  "data": {
                    "id": "6ad23972b5e181e762f5428f",
                    "phoneNumber": "+13364151656",
                    "service": "Instagram",
                    "status": "waiting",
                    "cost": 1125,
                    "currency": "NGN",
                    "isReused": true,
                    "expiresAt": "2026-10-17T15:35:00.000Z"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "number": "+13364151656",
                "serviceId": 1
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "event-otp-received-otp-received": {
      "post": {
        "tags": [
          "Webhooks (Outbound Events)"
        ],
        "summary": "Event: OTP Received (otp.received)",
        "description": "Delivered in real-time when an SMS verification code is received for any standard or cheap verification number.",
        "operationId": "eventOtpReceivedOtpReceived",
        "responses": {
          "200": {
            "description": "Your server should return a 200 OK status code promptly.",
            "content": {
              "application/json": {
                "example": {
                  "received": true
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "event": "otp.received",
                "timestamp": "2026-10-17T15:30:00.000Z",
                "data": {
                  "orderId": "6ad23972b5e181e762f5428e",
                  "orderType": "cheap",
                  "phoneNumber": "+13364151656",
                  "service": "wa",
                  "serviceName": "WhatsApp",
                  "otp": {
                    "code": "232321",
                    "message": "Your WhatsApp verification code is: 232-321",
                    "sender": "WhatsApp"
                  }
                }
              }
            }
          }
        }
      }
    },
    "event-order-allocated-order-allocated": {
      "post": {
        "tags": [
          "Webhooks (Outbound Events)"
        ],
        "summary": "Event: Order Allocated (order.allocated)",
        "description": "Delivered when a queued pending order is successfully provisioned into an active number.",
        "operationId": "eventOrderAllocatedOrderAllocated",
        "responses": {
          "200": {
            "description": "Acknowledge receipt with 200 OK.",
            "content": {
              "application/json": {
                "example": {
                  "received": true
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "event": "order.allocated",
                "timestamp": "2026-10-17T15:30:00.000Z",
                "data": {
                  "orderId": "6a1ac6d8511382ccc15007d6",
                  "orderType": "standard",
                  "phoneNumber": "+15033051381",
                  "service": "273",
                  "serviceName": "Discord",
                  "cost": 80.1,
                  "currency": "NGN"
                }
              }
            }
          }
        }
      }
    },
    "event-order-expired-order-expired": {
      "post": {
        "tags": [
          "Webhooks (Outbound Events)"
        ],
        "summary": "Event: Order Expired (order.expired)",
        "description": "Delivered when an order times out without receiving an SMS code and is automatically refunded.",
        "operationId": "eventOrderExpiredOrderExpired",
        "responses": {
          "200": {
            "description": "Acknowledge receipt with 200 OK.",
            "content": {
              "application/json": {
                "example": {
                  "received": true
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "event": "order.expired",
                "timestamp": "2026-10-17T15:30:00.000Z",
                "data": {
                  "orderId": "6ad23972b5e181e762f5428e",
                  "orderType": "cheap",
                  "phoneNumber": "+13364151656",
                  "service": "wa",
                  "serviceName": "WhatsApp",
                  "refunded": true,
                  "refundAmount": 1350,
                  "currency": "NGN"
                }
              }
            }
          }
        }
      }
    },
    "event-order-cancelled-order-cancelled": {
      "post": {
        "tags": [
          "Webhooks (Outbound Events)"
        ],
        "summary": "Event: Order Cancelled (order.cancelled)",
        "description": "Delivered when a verification order is cancelled manually or fails provisioning.",
        "operationId": "eventOrderCancelledOrderCancelled",
        "responses": {
          "200": {
            "description": "Acknowledge receipt with 200 OK.",
            "content": {
              "application/json": {
                "example": {
                  "received": true
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "event": "order.cancelled",
                "timestamp": "2026-10-17T15:30:00.000Z",
                "data": {
                  "orderId": "6ad23972b5e181e762f5428e",
                  "orderType": "cheap",
                  "phoneNumber": "+13364151656",
                  "service": "wa",
                  "serviceName": "WhatsApp",
                  "refunded": true,
                  "refundAmount": 1350,
                  "currency": "NGN"
                }
              }
            }
          }
        }
      }
    },
    "event-rental-message-received-rental-message-received": {
      "post": {
        "tags": [
          "Webhooks (Outbound Events)"
        ],
        "summary": "Event: Rental Message Received (rental.message.received)",
        "description": "Delivered when an SMS arrives on a long-term rental number.",
        "operationId": "eventRentalMessageReceivedRentalMessageReceived",
        "responses": {
          "200": {
            "description": "Acknowledge receipt with 200 OK.",
            "content": {
              "application/json": {
                "example": {
                  "received": true
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "event": "rental.message.received",
                "timestamp": "2026-10-17T15:30:00.000Z",
                "data": {
                  "rentalId": "6a993972b5e181e762f5428a",
                  "phoneNumber": "+12025550198",
                  "from": "+18005550123",
                  "message": "Your security code is 782194.",
                  "code": "782194"
                }
              }
            }
          }
        }
      }
    }
  }
}