VPN Script comes with API so you can create and integrate with your own applications. You have to use your VPN Script installation link as the base URL for the endpoints.
General
Authenticate User
POST/api/auth/token
You have to authenticate the client and retrieve Bearer token in order to send requests to API Endpoints.
Headers
Name
Type
Description
Accept
application/json
Request Body
Name
Type
Description
username*
String
Alphanumeric username of the client
password*
String
Password of the client
device_name*
String
The device name the user tries to authenticate from. (Ex: Liam's iPhone)
When a configuration status is "1" that means it was created on the server and it will set "config" data to connect WireGuard.
{"success": false,"message": "Unauthenticated."}
{"success": false,"message": "You do not have any service."}
{"success": false,"message": "Your service is not active."}
{"success": false,"message": "Your service is expired."}
{"success": false,"message": "The server is not using WireGuard protocol."}
{"success": false,"message": "The server is not found or enabled."}
{"success": false,"message": "No configuration found for this server."}
WireGuard Configuration
POST/api/wireguard/create
Create a new WireGuard configuration on specific vpn server.
Headers
Name
Type
Description
Authorization*
String
Bearer Authorization-Token-Here
Accept*
String
application/json
Request Body
Name
Type
Description
server_id*
Integer
The server id that you want to create a new WireGuard configuration for user.
{"status": true,"message": "WireGuard configuration create job dispatched. It will be completed shortly."}
{"success": false,"message": "You do not have any service."}
{"success": false,"message": "Your service is not active."}
{"success": false,"message": "Your service is expired."}
{"success": false,"message": "The server is not found or enabled."}
{"success": false,"message": "The server is not using WireGuard protocol."}
{"success": false, "message": "The server has reached the maximum allowed user limit. Please try again later or choose a different server."
}
{"success": false, "message": "Looks like you reached maximum allowed device limit on your plan. Please retry after disconnecting from OpenVPN or deleting WireGuard configurations that you have generated before."
}
{"success": false,"message": "Unauthenticated."}
WireGuard Configuration
DELETE/api/wireguard/delete
Delete a specific WireGuard configuration.
Headers
Name
Type
Description
Authorization*
String
Bearer Authorization-Token-Here
Accept*
String
application/json
Request Body
Name
Type
Description
config_id*
Integer
Pass the WireGuard configuration id you would like to delete.
{"success": true,"message": "WireGuard configuration delete job dispatched. It will be completed shortly."}
{"success": false,"message": "Unauthenticated."}
{"success": false,"message": "The WireGuard configuration is not found."}
{"success": false,"message": "The WireGuard configuration is pending creation or deletion."}