Skip to main content

Account Management API

Use this API to create and manage VPN accounts and aliases.

Important Notes​

  1. Successful responses are marked as {"status":"success"}.

    Error responses are marked as {"status":"error"} together with an error code and a detailed error message.

  2. A strong password must contain at least 10 characters from three of the following categories:

    2.1. Must have at least one digit

    2.2. Must have at least one letter

    2.3. Must have at least one uppercase letter

    2.4. Must have at least one special character

  3. Except AddClient, all requests must meet one of the following conditions:

    3.1. Include the end-user's password in the request

    3.2. Pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value

    3.3. Include your server-side secret key in the request (it must never be sent from the client-side!)

    3.4. Send the request from a white-listed IP address

AddClient​

Create a new account for an end-user together with a new active product

caution

The AddClient endpoint is rate-limited for 1 client per 10 seconds unless it is sent from a whitelisted IP address or together with secret key (remember - never send a secret key from the client-side!).

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/AddClient

Request Parameters:

  • apikey - Your API key
  • country - The end-user country's code (2 letter ISO code)
  • type - Product type ID to create - you can find the ID’s listed under the Plans page (1/6/12/24/36)
  • email - The end-user’s email address
  • password (optional) - A strong password. If this field is not specified, then the platform will auto-generate a password.
  • first_name (optional) - The end-user's first name
  • last_name (optional) - The end-user's last name
  • company_name (optional) - The end-user's company name
  • state (optional) - The end-user's state
  • zip_code (optional) - The end-user's postal code
  • auto_terminate (optional) - Place 1 to disable automatic plan renewal.
  • test_user (optional) - Place 1 to create a non-billable testing user (only for QA and Development purposes).

Response:

Successful response for a request sent from a Whitelisted IP address
{
"status": "success",
"username": "email@example.com",
"password": "Strong_Password!123",
"vpn_username": "openvpn_user",
"vpn_password": "openvpn_pass",
"short_token": "0x12908c192d1374006e4e38bec50597682",
"short_token_expire": "2022-01-26 03:45:34",
"short_token_expire_ts": 1643168734,
"long_token": "0x2342b73638cd4258667e61f955f6ce73f",
"long_token_expire": "2022-06-30 00:00:00",
"long_token_expire_ts": 1656547200
}

TokenRefresh​

Creates new tokens for the account

https://{vpn-brand}.vpngn.com/api/amapi/TokenRefresh
POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/TokenRefresh

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • long_token - pass an Authorization header carrying the Bearer <Long-Token-Here>, with the end-user’s current long-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success",
"last_product_change_ts": 1643133080,
"short_token": "0x1f206afdacae2dc0174bf6ee08069bc18",
"short_token_expire": "2022-01-26 03:46:18",
"short_token_expire_ts": 1643168778,
"long_token": "0x29b6fc951f5afd10a40e3497646b60059",
"long_token_expire": "2022-11-05 00:00:00",
"long_token_expire_ts": 1667606400,
"last_product_change_ts": 1643303863
}

CloseClient​

Terminate the end-user's main account immediately, including all products and aliases.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/CloseClient

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • short_token - pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success"
}

CancelRequest​

Terminate the end-user's main account at next cron run (midnight) or at the end of the billing period (at_due_date), including all products and aliases.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/CancelRequest

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address
  • type - Apply cancellation in the next cron run (midnight) or at the end of the billing period (at_due_date)
  • reason (optional) - The cancellation reason
  • product_id (optional) - Specify a product in case that the User's Account has more than one Active product

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • short_token - pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success"
}

GetProducts​

Get a list of all products associated with the main end-user's account.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/GetProducts

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • short_token - pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success",
"result": "success",
"response": [
{
"product_id": "12345",
"product_type": "1 Month",
"product_status": "Active",
"username": "openvpn_user",
"password": "openvpn_pass",
"nextduedate":"2024-02-27"
}
]
}

NewProduct​

Create a new product and associate it with the end-user's account.

Do not use this endpoint on existing clients with an active product

A VPN client should only have a maximum of one active VPN product at any given time. Therefore, please use UpgradeProduct in case that the client already has an active product.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/NewProduct

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address
  • type - Create this product type ID (listed under the Plans page - 1/6/12/24/36)
  • force_upgrade - If active products already exist, use this argument to upgrade the most recent existing active product rather than returning an error.
  • auto_terminate (optional) - Place 1 to disable automatic plan renewal.

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • short_token - pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response for a request sent from a Whitelisted IP address
{
"status": "success",
"username": "user@example.com",
"vpn_username": "openvpn_new_prod",
"vpn_password": "openvpn_new_pass",
"short_token": "0x12908c192d1374006e5e38bec60592682",
"short_token_expire": "2022-01-26 03:45:34",
"short_token_expire_ts": 1643168734,
"long_token": "0x2342b73638cd4258667e71f955f7ce63f",
"long_token_expire": "2022-06-30 00:00:00",
"long_token_expire_ts": 1656547200

UpgradeProduct​

Upgrade or downgrade an existing product ID to a new product type.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/UpgradeProduct

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address
  • product_id - Product ID to update (retrieved using the GetProducts endpoint)
  • new_product_plan - Upgrade to this product type ID (listed under the Plans page - 1/6/12/24/36)
  • auto_terminate (optional) - Place 1 to disable automatic plan renewal.

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • short_token - pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response for a request sent from a Whitelisted IP address
{
"status": "success",
"short_token": "0x12908c192d1374006e4e38bec50597682",
"short_token_expire": "2022-01-26 03:45:34",
"short_token_expire_ts": 1643168734,
"long_token": "0x2342b73638cd4258667e61f955f6ce73f",
"long_token_expire": "2022-06-30 00:00:00",
"long_token_expire_ts": 1656547200
}

SetPassword​

Set a new password for the main account.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/SetPassword

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address
  • setpassword - New strong password to use

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • short_token - pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success"
}

ResetPassword​

Send a password reset email to the email address associated with the account. Note: this endpoint must be used from white-listed IP address.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/ResetPassword

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address

Unless the request is sent from a white-listed IP address, the request will need to meet the condition below:

  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success"
}

ListAliases​

List all aliases associated with the end-user's main account.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/ListAliases

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • short_token - pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success",
"response": [
{
"email": "alias@example.com",
"first_name": "First",
"last_name": "Last"
}
]
}

AddAlias​

Add an alias to the end-user's account.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/AddAlias

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address
  • setemail - New alias email address
  • setpassword (Optional) - New strong password for the alias. A random password will be created if value is not set.
  • auto_passreset (Optional) - Send in a password reset request immediately after the add alias request is successful.
  • first_name - (Optional) - New alias first name
  • last_name - (Optional) - New alias last name

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • short_token - pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success"
}

DelAlias​

Delete an alias from the end-user's main account.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/DelAlias

Request Parameters:

  • apikey - Your API key
  • email - The end-user’s email address
  • alias - The email address associated with the alias to delete

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • short_token - pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success"
}

SetAliasPassword​

Change the password for an alias.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/SetAliasPassword

Request Parameters:

  • apikey - Your API key
  • email - The ALIAS email address
  • setpassword - New strong password for the alias

Unless the request is sent from a white-listed IP address, the request will need to meet one of the conditions below:

  • password - include the end-user's password in the request
  • short_token - pass an Authorization header carrying the Bearer <Short-Token-Here> with the end-user’s current short-token value
  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success"
}

ResetAliasPassword​

Send a password reset email to the email address associated with the alias. Note: this endpoint must be used from white-listed IP address.

POST Request
    https://{vpn-brand}.vpngn.com/api/amapi/ResetAliasPassword

Request Parameters:

  • apikey - Your API key
  • email - The alias's email address

Unless the request is sent from a white-listed IP address, the request will need to meet the condition below:

  • secret_key - include your server-side secret key in the request (never send this key from the client-side!)

Response:

Successful response
{
"status": "success"
}