Generate VPN Account

Estimated reading: 3 minutes

Generate

Use this API to create a VPN account by supplying a UUID as a mandatory parameter. If the UUID is found in the system, the details of the existing VPN account will be returned; otherwise, a new VPN account will be created and returned.

It returns a JSON object with the VPN username, password, and expiry date.

  • URL: <base url>/vam/v2/generate
  • 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_formatJSONBodyFormat 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

KeyTypeDescription
headerJSONJSON object that describes return code and message
bodyJSONJSON object that return username and password. Dedicated IP and dedicated host will also return if account would be dedicated

Possible API error codes

CodeMessageDescription
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.
11001The provided uuid already exists.The UUID provided already exists in the system.
60001Account containing this uuid is expiredThe account associated with this UUID has expired.
60002Account containing this uuid is disabledThe account associated with this UUID is disabled.
60003Accounts can not be exceed subscribed no of accountsThe number of accounts has exceeded the reseller’s subscription limit.
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

Generate VPN Account

Or copy link

On This Page