API Information

General Usage / Authentication

API:https://www.virtnumber.com/dev/api

Method: POST

Content Type: Include the header Content-Type: application/json

Authentication Headers:

x-api-user: Your user ID

x-api-token: Your API token

Receive SMS Webhook

1. Webhook (method: "POST",content-type: "application/json")

Example payload of an incoming SMS forwarded to your webhook URL.

You can set your webhook link usingaction: "addnumber"when buying a number or later in the panel under number settings.

JSON Body Example:
{
  "status": "ok",
  "from": "449900000002",
  "to": "449900000002",
  "text": "test message",
  "datetime": "2030-05-06 21:37:28"
}
Available Actions

1. Pricing (action: "pricing")

Retrieve pricing plans for phone numbers, grouped by country.

JSON Parameters:

action: "pricing"

2. Buy Number (action: "addnumber")

This action will order the first available dedicated phone number based on the specified country and plan id.

You can retrieve the current available countryid and id values from the pricing JSON response.

JSON Parameters:

action: "addnumber" (req)

countryid: (req)

id: The plan ID associated with the country (e.g., 51, 52, 53) (req)

webhook: (optional)

{
  "action": "addnumber",
  "countryid": "GB",
  "id": "51",
  "webhook": "https://localhost:3000"
}

3. My Numbers (action: "mynumbers")

List active numbers associated with your account.

JSON Parameters:

action: "mynumbers"

4. Delete Number (action: "deletenumber")

Delete an active number.

JSON Parameters:

action: "deletenumber"

number: The phone number to delete (e.g., 449942046789)

{
  "action": "deletenumber",
  "number": "449900000002"
}
Notes

Timestamps are in YYYY-MM-DD HH:MM:SS format.

Minimum balance required: 1 EUR

© 2019-2025 Virtnumber. All rights reserved.