NAV Navbar
shell

Introduction

API Endpoints

https://api.wlvpn.com

Welcome to the White Label VPN API! In order to access our API, you must have a Reseller account. To get started with a reseller account, please contact our support team. As a reseller, you will be able to use this API to manage your accounts.

This API uses JSON for a response format for all API endpoints including errors.

Authentication

To authorize, use this code:

$ curl -u 'api-key:<api-key>' https://api.wlvpn.com/

Make sure to replace <api-key> with your API key.

WLVPN utilizes API keys to authenticate valid requests. To request an API Key please contact support.

Authentication against the WLVPN API is performed via HTTP Basic Auth. When making API requests, pass the API Key as the password and api-key as the username.

Errors

All API endpoints in the /v2 API will return a api_status field that will have a value of 0 or 1. This field can be used to determine the success or a failure of an API call. When an error is returned from the API, indicated by api_status = 0, an error key will be sent in the response to indicate why the error occurred.

The API uses the following error codes:

Status Code Meaning
200 - OK Everything worked as expected.
400 - Bad Request The request was unacceptable.
401 - Unauthorized No valid API key was provided.
404 - Not Found The requested resource does not exist.
410 - Gone The requested resource has been removed from our servers.
429 - Too Many Requests You are sending too many requests! Slow down!
500, 502, 503 - Server Errors We had a problem with our server. Try again later.

Accounts

The Accounts API allows you to manage the users that have access to the VPN Platform through your reseller account. With this API, you can retrieve and update your Reseller accounts. You can also check to see if a username already exists on your account.

The Account object

Example Account object

{
    "cust_id": 24952,
    "cust_user_id": "account_124x",
    "cust_password": null,
    "open_date": "2017-03-24",
    "close_date": "0000-00-00",
    "acct_status_id": 1,
    "acct_group_id": 123,
    "user_throttled": 0,
    "metadata": {
        "internal_account_id": "your-account-id",
        "internal_subscription_id": "your-subscription-id"
    },
    "plans_info": null
}
Attributes
cust_id
integer

The internal ID given to the account. This ID can be used to retrieve the account in future requests or update the account.

cust_user_id
string

The account username that should be used when authenticating the account to the VPN platform and APIs. This value must be a unique across all usernames tied to your Reseller account, and be no more than 60 characters in length.

cust_password
string

The password that should be used for authentication against the VPN Platform and the APIs. This value is a write-only value and will not be provided when fetching an existing account. We use a one-way hash algorithm to secure the value in our system and to ensure the value cannot be read by any internal systems.

open_date
string

The date in our internal system that the account was opened. This value is read-only and cannot be updated.

close_date
string

The date in our internal system that the account was closed. This value can be updated. This value is automatically set when an account's status is changed to closed. When the account is active, this value will be 0000-00-00.

acct_status_id
integer

The status of the account in our system. Possible values:

  • 1 - "active"
  • 2 - "suspended"
  • 3 - "closed"
  • 5 - "cap reached"

This value is updatable.

acct_group_id
integer

The group to which this account belongs. This is a way to organize and restrict accounts in the platform. Groups can be created in the Control Panel.

user_throttled
integer

This flag is set to 1 if the account's bandwidth is currently throttled, otherwise it's set to 0

metadata
dictonary

A dictionary of additional key value pairs to be stored against the account, for example an account id or subscription id from your own systems.

plans_info
object

Information about the user's plans, the PlansInfo object. It's set to null if user doesn't use plans.

The PlansInfo object

Example PlansInfo object

{
    "current_plan": {
        "id": 733,
        "is_unlimited": true,
        "code": "premium_1y",
        "name": "Premium 1 year",
        "short_desc": "Premium 1 year",
        "source": "manual",
        "purchase_id": 636,
        "created_at": null,
        "starts_at": 1703090682,
        "expires_at": 1734626682,
        "bytes_used": null,
        "bytes_max": null,
        "refilling_interval_days": 0,
        "is_revoked": false
    },
    "pending_plans": [
        {
            "id": 731,
            "is_unlimited": false,
            "code": "30_gb_1mo",
            "name": "30GB for 1 month",
            "short_desc": "30GB for 1 month",
            "source": "manual",
            "purchase_id": 637,
            "created_at": 1700498142,
            "starts_at": null,
            "expires_at": null,
            "bytes_used": 0,
            "bytes_max": 32212254720,
            "refilling_interval_days": 0,
            "is_revoked": false
        }
    ],
    "spent_plans": [
        {
            "id": 732,
            "is_unlimited": true,
            "code": "1mo_unlimited",
            "name": "1 Month Unlimited",
            "short_desc": "1 Month Unlimited",
            "source": "manual",
            "purchase_id": 638,
            "created_at": null,
            "starts_at": 1700498682,
            "expires_at": 1603090682,
            "bytes_used": null,
            "bytes_max": null,
            "refilling_interval_days": 0,
            "is_revoked": false
        },
        {
            "id": 730,
            "is_unlimited": false,
            "code": "freemium_1gb_per_day",
            "name": "Freemium 1GB per day",
            "short_desc": "Freemium 1GB per day",
            "source": "manual",
            "purchase_id": 639,
            "created_at": 1700498967,
            "starts_at": null,
            "expires_at": 1699366946,
            "bytes_used": 0,
            "bytes_max": 1073741824,
            "refilling_interval_days": 1,
            "is_revoked": false
        }
    ]
}
Attributes
current_plan
object

The current active plan of the user, a PlanInfoItem object

pending_plans
array

A list of plans that are pending, array of PlanInfoItem objects.

spent_plans
array

A list of plans that the user has already used (or that are expired / revoked), array of PlanInfoItem objects.

The PlanInfoItem object

Example PlanInfoItem object

{
    "id": 733,
    "is_unlimited": true,
    "code": "premium_1y",
    "name": "Premium 1 year",
    "short_desc": "Premium 1 year",
    "source": "manual",
    "purchase_id": 636,
    "created_at": null,
    "starts_at": 1703090682,
    "expires_at": 1734626682,
    "bytes_used": null,
    "bytes_max": null,
    "refilling_interval_days": 0,
    "is_revoked": false
}
Attributes
id
integer

Unique identifier of the plan. It will be null for manually allocated bandwidth and initial freemium bandwidth.

is_unlimited
boolean

Indicates whether the plan is unlimited (time-based)

code
string

Unique code identifier of the plan. It will be null for manually allocated bandwidth and initial freemium bandwidth.

name
string

Name of the plan. It will be null for manually allocated bandwidth and initial freemium bandwidth.

short_desc
string

Short description of the plan. It will be null for manually allocated bandwidth and initial freemium bandwidth.

source
string

Source of the plan. It will be free trial for initial freemium bandwidth, manual for manually allocated plans or purchase for plans from In-App purchases.

purchase_id
integer

Unique identifier of the purchase.

created_at
integer

Timestamp when the plan was created. It's set for bandwidth-based plans only.

starts_at
integer

Timestamp when the plan starts. Will be null if not set.

expires_at
integer

Timestamp when the plan expires. Will be null if not set.

bytes_used
integer

Number of bytes used. It will be null for time-based plans.

bytes_max
integer

Maximum number of bytes that can be transferred before the plan expires. Will be null for time-based plans.

refilling_interval_days
integer

The number of days after which the bandwidth plan will be automatically refilled. This field is set to 0 if refilling is disabled and for time-based plans.

is_revoked
boolean

Indicates whether the plan is revoked

The UsageReport Object

Example UsageReport object

{
    "usage": [
        {
            "name": "bandwidth",
            "namespace": "vpn",
            "value": 124912012412424,
            "unit": "Bytes"
        },
        {
            "name": "connections",
            "namespace": "vpn",
            "value": 10,
            "unit": "None"
        }
    ]
}
Attributes
usage
array

Usage datapoints for the requested time period. Each datapoint will contain a type that indicates what the value represents

Creating an account

Example Request

$ curl https://api.wlvpn.com/v2/customers/ \
    -H 'Content-Type: application/json' \
    -u 'api-key:<api-key>' \
    -d '{
        "cust_user_id": "account_xqst335",
        "cust_password": "<token-value>",
        "acct_group_id": 54,
        "metadata": {
            "internal_account_id": "your-account-id",
            "internal_subscription_id": "your-subscription-id"
        }
    }'

Example response

{
    "api_status": 1,
    "cust_id": 2423
}

Creates an account that can be used to authenticate against the VPN Platform.

Request Object

Attributes
cust_user_id
string
Required

Customer's username.
Allowed characters: a-z, A-Z, 0-9, @.-_:/~+

cust_password
string
Required

Customer's password

acct_group_id
integer
Required

Account group ID to create the customer with. These are found within your reseller dashboard.

close_date
string

If given, causes the customer to be created with an explicit close date (e.g. "YYYY-MM-DD").

metadata
dictionary

Any additional metadata to store against the account, up to a maximum of 5 keys

Returns

When a request is successful and the account is created, the cust_id will be returned in the response body with the ID that was created for the account. When the request fails, the error key in the response will have more information on why the request failed.

Updating an account

Example request #1 (updating an account by ID)

$ curl -X PUT https://api.wlvpn.com/v2/customers/2432 \
    -H 'Content-Type: application/json' \
    -u 'api-key:<api-key>' \
    -d '{
        "cust_password": "newpassword",
        "close_date": "2020-01-01",
        "acct_status_id": 1,
        "acct_group_id": 32,
        "metadata": {
            "subscription_type": "Free"
        }
    }'

Example request #2 (updating an account by username)

$ curl -X PUT https://api.wlvpn.com/v2/customers/username/demoAndroid \
    -H 'Content-Type: application/json' \
    -u 'api-key:<api-key>' \
    -d '{
        "cust_password": "newpassword",
        "acct_status_id": 1
    }'

Example response

{
    "api_status": 1
}

Updates information for an account in the VPN Platform by ID or username. The only properties that we support updating are close_date, cust_password, acct_status_id, acct_group_id and metadata. All other properties are considered read-only.

To close an account, set acct_status_id to 3. You can set it back to 1 to re-open a closed account.

Use close_date if you want to have an account automatically closed by some specific date in the future. By default, all accounts have value 0000-00-00, which means "not set".

Note that metadata is always overwritten with this request, please include any existing keys you want to retain

Returns

When the request is successful, no parameters besides api_status are returned. In the event the request fails, the response will contain an error field that can be used to determine the error.

Anonymising a customer

Example Request

$ curl -X PUT https://api.wlvpn.com/v2/customers/2432/anonymise \
    -H 'Content-Type: application/json' \
    -u 'api-key:<api-key>'

Example response

{
    "api_status": 1
}

This will close the account, anonymise the username and remove any associated metadata.

We recommend you call this function once a customer has been closed and the account won't be reopened again in the future

Returns

When the request is successful, no parameters besides api_status are returned. In the event the request fails, the response will contain an error field that can be used to determine the error.

Retrieving a customer

Example request #1 (retrieving a customer by ID)

$ curl -X GET https://api.wlvpn.com/v2/customers/32749318/ \
    -u 'api-key:<api-key>'

Example request #2 (retrieving a customer by username)

$ curl -X GET https://api.wlvpn.com/v2/customers/username/demoAndroid/ \
    -u 'api-key:<api-key>'

Example response

{
    "api_status": 1,
    "customer":
    {
        "cust_id": 160669345,
        "cust_user_id": "demoAndroid",
        "close_date": "0000-00-00",
        "open_date": "2020-06-11",
        "acct_status_id": 1,
        "acct_group_id": 2052,
        "user_throttled": 0,
        "used_service": 0,
        "metadata": {
            "internal_account_id": "your-account-id",
            "internal_subscription_id": "your-subscription-id"
        },
        "plans_info": {
            "current_plan": {
                "id": 733,
                "is_unlimited": true,
                "code": "premium_1y",
                "name": "Premium 1 year",
                "short_desc": "Premium 1 year",
                "source": "manual",
                "purchase_id": 636,
                "created_at": null,
                "starts_at": 1703090682,
                "expires_at": 1734626682,
                "bytes_used": null,
                "bytes_max": null,
                "refilling_interval_days": 0,
                "is_revoked": false
            },
            "pending_plans": [
                {
                    "id": 731,
                    "is_unlimited": false,
                    "code": "30_gb_1mo",
                    "name": "30GB for 1 month",
                    "short_desc": "30GB for 1 month",
                    "source": "manual",
                    "purchase_id": 637,
                    "created_at": 1700498142,
                    "starts_at": null,
                    "expires_at": null,
                    "bytes_used": 0,
                    "bytes_max": 32212254720,
                    "refilling_interval_days": 0,
                    "is_revoked": false
                }
            ],
            "spent_plans": [
                {
                    "id": 732,
                    "is_unlimited": true,
                    "code": "1mo_unlimited",
                    "name": "1 Month Unlimited",
                    "short_desc": "1 Month Unlimited",
                    "source": "manual",
                    "purchase_id": 638,
                    "created_at": null,
                    "starts_at": 1700498682,
                    "expires_at": 1603090682,
                    "bytes_used": null,
                    "bytes_max": null,
                    "refilling_interval_days": 0,
                    "is_revoked": false
                }
            ]
        }
    }
}

It allows retrieving account info by customer ID or username.

Returns

When the request is successful, it returns account info. In the event the request fails, the response will contain an error field that can be used to determine the error.

Retrieving a list of customers

Example request

$ curl -X GET https://api.wlvpn.com/v2/customers/paged/?page=1&page_size=100&open_date=2024-12-04 \
    -u 'api-key:<api-key>'

Example response

{
    "api_status": 1,
    "result_count": 2,
    "page": 1,
    "page_size": 100,
    "customers": [
        {
            "cust_id": 12749638,
            "cust_user_id": "account_xqst335",
            "close_date": "2025-05-21",
            "open_date": "2024-12-04",
            "acct_status_id": 5,
            "acct_group_id": 1525,
            "user_throttled": 0,
            "used_service": 0
        },
        {
            "cust_id": 12749639,
            "cust_user_id": "account_xqst336",
            "close_date": "2025-05-21",
            "open_date": "2024-12-04",
            "acct_status_id": 1,
            "acct_group_id": 1525,
            "user_throttled": 0,
            "used_service": 0
        },
    ]

It allows retrieving a list of customers split by pages. It also allows filtering records by some fields.

Optional query parameters:

You can filter records by the following fields:

Returns

When the request is successful, it returns a list of customers.
In the event the request fails, the response will contain an error field that can be used to determine the error.

Check username exists

Example request

$ curl 'https://api.wlvpn.com/v2/customers/username_exists/account_x213' \
    -u 'api-key:<api-key>'

Example response

{
    "api_status": 1,
    "username_exists": 1
}

This API endpoint provides a way of checking if a username is already taken in your accounts. This can be used to ensure that the accounts you attempt to create are unique.

Returns

Returns whether an account with the provided username exists. This can be checked using the username_exists field returned from the API.

Create usage report

Example request

$ curl -X POST 'https://api.wlvpn.com/v2/customers/1242/usage-report' \
    -u 'api-key:<api-key>' \
    -d '{
        "start_date": "2017-01-02",
        "end_date": "2017-02-02",
        "metrics": [
            {
                "name": "bandwidth",
                "namespace": "vpn"
            },
            {
                "name": "connections",
                "namespace": "vpn"
            }
        ]
    }'

Example response

{
    "usage": [
        {
            "name": "bandwidth",
            "namespace": "vpn",
            "value": 12492350235,
            "unit": "Bytes"
        },
        {
            "name": "connections",
            "namespace": "vpn",
            "value": 35,
            "unit": "None"
        }
    ]
}

This API endpoint allows you to retrieve total usage information for a customer based on a specified time period.

Request Object

Attributes
start_date
string
Required

The start date that should be used when gathering reporting data. This date should be in UTC. The value is inclusive. For example, requesting the bandwidth data for a customer with a start date of 2017-01-01 will include any bandwidth information from 2017-01-01.

end_date
string

This value will be the end date of the data that should be used when gathering reporting data. The date should be in UTC. This value is inclusive. For example, requesting bandwidth data for a customer with an end date of 2018-01-01 will include any bandwidth information that occurred on that date. The end_date must be before the current date, platform metrics are not available on a customer level until the following day. If no value is provided then the previous day will be used.

metrics
array

This value should be an array of metrics that you wish to get back from the API.

Create bulk usage report

Example request

$ curl -X GET https://api.wlvpn.com/v2/customers/usage-report/?start_date=2025-06-07&max_results=2&cust_id_offset=32749850 \
    -u 'api-key:<api-key>'

Example response

{
    "customers": [
        {
            "cust_id": 32749851,
            "bandwidth": 0,
            "connections": 1
        },
        {
            "cust_id": 32749853,
            "bandwidth": 214292803,
            "connections": 3
        }
    ],
    "last_cust_id": 32749853,
    "result_count": 2,
    "total_count": 27875
}

This API endpoint allows you to retrieve total usage information based on a specified time period in bulk. It returns data in chunks of 5000 customers (this value can be changed). In addition to usage records, it contains some metadata such as last_cust_id (the last cust_id in the result, which can be used in the next query to get the next chunk of data), result_count (the number of report records returned), and total_count (the total number of records available).

Request Object

Attributes
start_date
string
Required

The start date that should be used when gathering reporting data. The date should be in UTC. This value is inclusive. For example, requesting the bandwidth data for customers with a start date of 2025-01-01 will include any bandwidth information from 2025-01-01. It cannot be older than 18 months from the current date.

end_date
string

This value will be the end date of the data that should be used when gathering reporting data. The date should be in UTC. This value is inclusive. For example, requesting bandwidth data for customers with an end date of 2025-01-01 will include any bandwidth information that occurred on that date. If no value is provided then the current day will be used.

max_results
integer

This parameter specifies the number of customers you want to retrieve in one request. It is optional and by default equals 5000. The maximum value is 5000.

cust_id_offset
integer

This parameter specifies the cust_id after which the endpoint should retrieve data. By default, it is not specified, which means it will start from the very first customer. You should use the last_cust_id from the last response to get the next chunk of data.

bandwidth_gte
integer

Filter results with total bandwidth greater than or equal to the specified value (in bytes). This filter uses OR logic with other filters - metrics matching ANY of the specified filter conditions will be included in results. Can be 0 or any positive integer.

bandwidth_lte
integer

Filter results with total bandwidth less than or equal to the specified value (in bytes). This filter uses OR logic with other filters - metrics matching ANY of the specified filter conditions will be included in results. Can be 0 or any positive integer.

connections_gte
integer

Filter results with number of connections greater than or equal to the specified value. This filter uses OR logic with other filters - metrics matching ANY of the specified filter conditions will be included in results. Can be 0 or any positive integer.

connections_lte
integer

Filter results with number of connections less than or equal to the specified value. This filter uses OR logic with other filters - metrics matching ANY of the specified filter conditions will be included in results. Can be 0 or any positive integer.

Create limitations

Example request

$ curl -X POST https://api.wlvpn.com/v2/customers/3525/limitations \
    -H 'Content-Type: application/json' \
    -u 'api-key:<api-key>' \
    -d '{
        "limitations": [
            {
                "type": "rate-limit",
                "value": 41294102
            }
        ]
    }'

Example response

HTTP/1.1 204 No Content

This API endpoint allows you to apply a set of limitations on a customers account.

Request Object

Attributes
type
string
Required

This is the type of limitation that should be placed on the account. Currently, the only supported option is rate-limit.

value
number
Required

This is the value of the limitation. For the rate-limit limitation, this value should be the Kilobytes per second that the account should be limited to.

Response

On a successful request, this endpoint will return an empty response.

Update limitation

Example request

$ curl -X PUT https://api.wlvpn.com/v2/customers/3525/limitations \
    -H 'Content-Type: application/json' \
    -u 'api-key:<api-key>' \
    -d '{
        "limitations": [
            {
                "type": "rate-limit",
                "value": 41294102
            }
        ]
    }'

Example response

HTTP/1.1 204 No Content

This API endpoint allows you to update a set of limitations on a customers account.

Request Object

Attributes
type
string
Required

This is the type of limitation that should be placed on the account. Currently, the only supported option is rate-limit.

value
number
Required

This is the value of the limitation. For the rate-limit limitation, this value should be the Kilobytes per second that the account should be limited to.

Response

On a successful request, this endpoint will return an empty response.

Delete limitations

Example request

$ curl -X DELETE https://api.wlvpn.com/v2/customers/3525/limitations \
    -u 'api-key:<api-key>'

Example response

HTTP/1.1 204 No Content

This API endpoint allows you to remove all limitations on a customer's account

Request Parameters

No parameters!

Response

A successful request will return an empty response.

Expire or delete auth tokens

Example request

$ curl -X PUT https://api.wlvpn.com/v2/customers/3525/tokens \
    -H 'Content-Type: application/json' \
    -u 'api-key:<api-key>' \
    -d '{
        "token_action": "Expire"
    }'

Example response

{
    "api_status": 1
}

This API endpoint allows you to remove all customer's auth tokens or expire access tokens.

Request Parameters

Attributes
token_action
string
Required

The action to be performed on customer's auth tokens currently supports two values:

  • Expire - expire all access tokens
  • Delete - delete all access and refresh tokens

Response

A successful request will return {"api_status": 1} with HTTP status 200 OK.

Plans

The Plans API allows you:

  1. to retrieve a list of plans which were created via the dashboard for your account
  2. to allocate bandwidth or unlimited service to users based on some plan
  3. to revoke allocated service

There are two types of plans:

  1. Time-based plans (subscriptions) - for such plans only interval_days is valuable and bandwidth_mb / bandwidth_gb are null
  2. Bandwidth-based plans, for them bandwidth_mb / bandwidth_gb are valuable and interval_days is null

The Plan object

Example plan object

    {
        "plan_code": "coolvpn_one_month_unlimited",
        "name": "One month service",
        "short_desc": "Unlimited usage",
        "price": "0",
        "bandwidth_gb": null,
        "bandwidth_mb": null,
        "interval_days": 30,
        "expire_after_days": null,
        "requires_receipt": false,
        "is_auto_renewing": false,
        "refilling_interval_days": 0
    }
Attributes
plan_code
string

Unique identifier

name
string

Plan name

short_desc
string

Short plan description

price
string

Price in USD, e.g "4.99". It is only used for display purposes inside responses to the Client API to allow applications to display purchase information.

bandwidth_gb
integer

Amount of GB for bandwidth-based plans (null for time-based plans), read-only (it is only converted value of bandwidth_mb)

bandwidth_mb
integer

Amount of MB for bandwidth-based plans (null for time-based plans)

interval_days
integer

Time-based plan duration in days (null for a bandwidth-based plan)

expire_after_days
integer

Bandwidth-based plan lifetime in days

requires_receipt
boolean

It should be true only if the plan is being offered via the app with In-App purchases support

is_auto_renewing
boolean

true for auto-renewable time-based plans

refilling_interval_days
integer

The number of days after which the bandwidth plan will be automatically refilled. This field is set to 0 if refilling is disabled and for time-based plans.

List all plans

Example request

$ curl 'https://api.wlvpn.com/v2/plans' \
    -u 'api-key:<api-key>'

Example response

{
    "api_status": 1,
    "plans": [
        {
            "plan_code": "coolvpn_one_month_unlimited",
            "name": "One month service",
            "short_desc": "Unlimited usage",
            "price": "0",
            "bandwidth_gb": null,
            "bandwidth_mb": null,
            "interval_days": 30,
            "expire_after_days": null,
            "requires_receipt": false,
            "is_auto_renewing": false,
            "refilling_interval_days": 0
        },
        {
            "plan_code": "coolvpn_default",
            "name": "Default",
            "short_desc": "Default",
            "price": "0",
            "bandwidth_gb": null,
            "bandwidth_mb": 51200,
            "interval_days": null,
            "expire_after_days": null,
            "requires_receipt": false,
            "is_auto_renewing": false,
            "refilling_interval_days": 30
        }
    ]
}

Retrieves a list of plans that you can allocate to users.

Returns

On a successful request, the plans field will contain a map of plans.

Allocate purchase to a customer

Example Request

$ curl https://api.wlvpn.com/v2/customers/12749163/purchase/ \
    -H 'Content-Type: application/json' \
    -u 'api-key:<api-key>' \
    -d '{
        "plan_code": "30_gb_1mo",
        "refilling_time": "17:00",
        "refilling_time_offset": "+03:00"
    }'

Example response

{
    "api_status": 1,
    "plan_info": {
         "id": 731,
         "is_unlimited": false,
         "code": "30_gb_1mo",
         "name": "30GB for 1 month",
         "short_desc": "30GB for 1 month",
         "source": "manual",
         "purchase_id": 637,
         "created_at": 1700498142,
         "starts_at": null,
         "expires_at": null,
         "bytes_used": 0,
         "bytes_max": 32212254720,
         "refilling_interval_days": 0,
         "is_revoked": false
    }
}

Allocates service to a customer based on one of the available plans

Request Parameters

Returns

When the request is successful, it will return api_status and the plan info as PlanInfoItem object. In the event the request fails, the response will contain an error field that can be used to determine the error.

Revoke allocated purchase

Example Request

$ curl https://api.wlvpn.com/v2/customers/12749163/revoke/ \
    -H 'Content-Type: application/json' \
    -u 'api-key:<api-key>' \
    -d '{
        "plan_code": "coolvpn_one_month_unlimited"
    }'

Example response

{
    "api_status": 1
}

Revokes earlier allocated service

Request Parameters

Returns

When the request is successful, no parameters besides api_status are returned. In the event the request fails, the response will contain an error field that can be used to determine the error.

Servers

The Servers API allows you to retrieve the list of servers that are enabled for your account. These servers are the only servers that your Accounts will work with.

The Server object

Example server object

{
    "country": "FR",
    "city": "Paris",
    "ip": "80.24.24.52",
    "capacity": "4"
}
Attributes
country
string

Country location of the server

city
string

City location of the server

ip
string

IP Address of the server

capacity
string

Current capacity of the server. This value will be between 0 and 100. A value of 0 being lightly used, and a value of 100 being fully utilized.

List all servers

Example request

$ curl 'https://api.wlvpn.com/v2/servers' \
    -u 'api-key:<api-key>'
Attributes
country
string

Comma-separated values of ISO 3166 country code that filters servers based on region

Example response

{
    "api_status": 1,
    "server": {
        "par-a01.wlvpn.com": {
            "country": "FR",
            "city": "Paris",
            "capacity": 5,
            "ip": "0.0.0.0"
        },
        "atl-a01.wlvpn.com": {
            "country": "US",
            "city": "Atlanta",
            "capacity": 35,
            "ip": "0.0.0.0"
        }
        ...,
        ...
    }
}

Retrieves a list of servers that your Reseller accounts will have access to.

Returns

On a successful request, the server field will contain a map of servers. The key in the map will be the FQDN of the server.

Metrics

The Metrics API allows you to retrieve statistics around the platforms usage and customer behavior for your Reseller account. With this API, you can retrieve the available metrics for your account and generate statistical reports based on these metrics.

Retrieving usage metrics

Example request

$ curl -X GET https://api.wlvpn.com/v2/metrics/usage/pop_and_country/?start_date=2023-10-01&end_date=2023-10-31
-u 'api-key:<api-key>'

Example response

{
    "data": {
        "acc": {
            "TR": {
                "bandwidth": 19996,
                "connections": 1,
                "customers": 1
            }
        },
        "lax": {
            "AU": {
                "bandwidth": 223,
                "connections": 1,
                "customers": 1
            },
            "US": {
                "bandwidth": 212304205666,
                "connections": 2,
                "customers": 2
            }
        }
    }
}

This API endpoint retrieves total usage information for a specified time period. It returns three metrics grouped by pop and country_code:

Request Parameters

Required query parameters:

The date range is fully inclusive. Example: ?start_date=2023-10-01&end_date=2023-10-31 covers the entire month of October. The start and end dates must be within the same month.