Create VPN Account

Estimated reading: 3 minutes

Creating VPN accounts programmatically through APIs allows for automated and scalable user management. This process is crucial for integrating VPN services into applications, providing users with secure and efficient access to VPN networks. This article provides a technical overview of how to implement VPN account creation via API.

Create

Use this API to create a VPN account by supplying a UUID as a mandatory parameter. It returns a JSON object with the VPN username, password, and expiry date.

  • URL: <base url>/vam/v3/create
  • Request Method: POST

Payload

KeyTypePass inDescription
X-AccessToken*StringHeader accessToken retrieved from Get Access Token endpoint
uuid*StringBodyA universally unique identifier can be any string, email, or unique word.
periodStringBodyAccount period. The maximum is 3700.
preferencesJSONBodyA structured JSON to specify allowed options such as multi-login limit and locations for the VPN account.
Sample JSON:  {“multi_login”:5,”session_limit”:50,”country”:[1,2,3],”city”:[1,2,3],”protocol”:[1,2,3]}
preferences_format JSONBody Format of the preferences and its value should always be key
isDedicatedBooleanBodyA boolean (True or False) that VPN account will be dedicated or shared
Default: false
dedicatedCountryStringBodyIf isDedicated is true, this parameter is mandatory and should contain the country ISO code, indicating that this VPN account will have a dedicated IP in that country. Supported countries include: US, UK, CA, DE, AU, HK, NL, SG , NZ and MT.
oneLoginSchemeBooleanBodyThis boolean (True or False) indicate that either you’ll provide username and password or it should be auto generate. Default is ‘False’
vpnUsernameStringBodyIf oneLoginScheme is true, then the VPN username is mandatory and must not exceed 20 characters.
vpnPasswordStringBodyIf oneLoginScheme is true then VPN password is mandatory to provide.
Length: Minimum 12, maximum 32 characters.
Complexity: Must contain at least one uppercase letter, one lowercase letter, one number, and one special character (!@#$%^&*,.:{}).
Character Restriction: Avoid using non-ASCII characters like (£, 你好).

(*) Required Parameter

Response

KeyDescription
headerA JSON object that details the return code and message.
bodyA JSON object containing the VPN username, password, and expiry date. If the account is dedicated, it will also include the dedicated IP and dedicated host.

Possible API error codes

CodeMessageDescription
11001The provided uuid already exists.The UUID provided already exists in the system.
11001The vpnUsername field is required when one login scheme is 1The vpnUsername field must be provided when the login scheme is set to 1.
11001Period must be a number between 1 and 10950The provided period is invalid and must be between 1 and 10,950.
60003Accounts can not be exceed subscribed no of accountsThe number of accounts has exceeded the reseller’s subscription limit.
60004Couldn’t Verify UUIDThe UUID could not be verified.
100028This username is not available. Please try again with different usernameThe username is already in use. Please choose a different one.

Sample Response

{
  "header": {
    "response_code": 1,
    "message": "VPN account has been created successfully"
  },
  "body": {
    "vpnUsername": "xxxxxxxx",
    "vpnPassword": "xxxxxxxx",
    "expiryDate": "xxxxxxxx",
  }
}
Share this Doc

Create VPN Account

Or copy link

On This Page