API: Complete Endpoint Reference

Last updated 11 May 2026 16 views 🔒 Dedicated WireGuard VPN

All Endpoints

MethodEndpointDescription
GET/api/wg/serversList your assigned servers
GET/api/wg/servers/{id}/usersList users with live status & bandwidth
POST/api/wg/servers/{id}/usersCreate user — returns config & all keys
GET/api/wg/servers/{id}/statusLive device status for all users
GET/api/wg/users/{id}Get user details, config, keys, status
DELETE/api/wg/users/{id}Remove user
GET/api/wg/users/{id}/port-forwardsList port forwards for a user
POST/api/wg/users/{id}/port-forwardsCreate port forward
DELETE/api/wg/port-forwards/{id}Remove port forward

Authentication

Every request requires a Bearer token:

Authorization: Bearer wg_your_api_key_here

Generate keys at: WireGuard Server → API Keys & Documentation

Rate Limits

60 requests per minute per API key. HTTP 429 returned if exceeded.

HTTP Status Codes

CodeMeaning
200Success
201Created (user or port forward)
401Invalid or missing API key
403Forbidden — resource belongs to another account
409Conflict — duplicate name or port already in use
422Validation error — invalid input
429Rate limit exceeded
500Server error — check the error message

Multi-Server Usage

One API key gives you access to all your assigned servers. You specify which server by its assignment_id (returned by GET /servers). You don't need separate keys per server.

If you need different keys for different applications or environments (e.g. production vs staging), you can create up to 5 active keys.

Example: Full Workflow

# 1. List servers to get assignment IDs
curl -s -H "Authorization: Bearer wg_KEY" \
  https://portal.premiervpn.net/api/wg/servers

# 2. Create a user on server 5
curl -s -X POST -H "Authorization: Bearer wg_KEY" \
  -H "Content-Type: application/json" \
  -d '{"client_name": "web-server"}' \
  https://portal.premiervpn.net/api/wg/servers/5/users
# Save the returned config to a .conf file

# 3. Add port forwarding for a web server
curl -s -X POST -H "Authorization: Bearer wg_KEY" \
  -H "Content-Type: application/json" \
  -d '{"external_port": 443, "internal_port": 443, "protocol": "tcp", "comment": "HTTPS"}' \
  https://portal.premiervpn.net/api/wg/users/NEW_USER_ID/port-forwards

# 4. Check if the user is online
curl -s -H "Authorization: Bearer wg_KEY" \
  https://portal.premiervpn.net/api/wg/servers/5/status

# 5. When done, clean up
curl -s -X DELETE -H "Authorization: Bearer wg_KEY" \
  https://portal.premiervpn.net/api/wg/port-forwards/PF_ID
curl -s -X DELETE -H "Authorization: Bearer wg_KEY" \
  https://portal.premiervpn.net/api/wg/users/USER_ID

Didn't find what you were looking for?

Our support team is happy to help.

Open a Ticket