API Endpoints
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
Accept
application/json
Request Body
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)
Account Details
GET
/api/account
Retrieve general details of user account
Headers
Authorization*
String
Bearer Authorization-Token-Here
Accept*
String
application/json
Server List
GET
/api/servers
Get all VPN servers available
Headers
Authorization*
String
Bearer Authorization-Token-Here
Accept*
String
application/json
Request Body
paginate
Integer
The results with be paginated by set amount.
OpenVPN
OpenVPN Profile
GET
/api/openvpn/profile
Retrieve the OpenVPN profile for specific vpn server.
Headers
Authorization*
String
Bearer Authorization-Token-Here
Accept*
String
application/json
Request Body
server_id*
Integer
The server id that you want to retrieve OpenVPN profile data.
cert_only
Boolean
If you wish to retrieve only the ca.crt content instead of whole profile data, you can send this as True. By default it's False.
OpenVPN Authentication Details
GET
/api/openvpn/auth
Retrieve the required username and password to be used with OpenVPN profile files in order to connect to the vpn server.
Headers
Authorization*
String
Bearer Authorization-Token-Here
Accept*
String
application/json
WireGuard
WireGuard Configurations
GET
/api/wireguard/configs
Retrieve all WireGuard configurations for specific vpn server.
Headers
Authorization*
String
Bearer Authorization-Token-Here
Accept*
String
application/json
When a configuration status is "1" that means it was created on the server and it will set "config" data to connect WireGuard.
WireGuard Configuration
POST
/api/wireguard/create
Create a new WireGuard configuration on specific vpn server.
Headers
Authorization*
String
Bearer Authorization-Token-Here
Accept*
String
application/json
Request Body
server_id*
Integer
The server id that you want to create a new WireGuard configuration for user.
WireGuard Configuration
DELETE
/api/wireguard/delete
Delete a specific WireGuard configuration.
Headers
Authorization*
String
Bearer Authorization-Token-Here
Accept*
String
application/json
Request Body
config_id*
Integer
Pass the WireGuard configuration id you would like to delete.
Last updated