Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
-
oAuth2 authentication.
-
Flow: password
-
Token URL = /api/v1/login
-
Scope | Scope Description |
---|
Code samples
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/', headers = headers)
print(r.json())
GET /
Root
Example responses
200 Response
null
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | Inline |
Code samples
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/v1/logout', headers = headers)
print(r.json())
GET /api/v1/logout
Logout
Example responses
200 Response
null
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | Inline |
404 | Not Found | Not found | None |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/user/edit', headers = headers)
print(r.json())
POST /api/v1/user/edit
Edit
Body parameter
{
"id": 0,
"username": "string",
"email": "string",
"full_name": "string",
"role": "string",
"password": "string"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | UserInDB | true | none |
Example responses
200 Response
{
"id": 0,
"username": "string",
"email": "string",
"full_name": "string",
"role": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | User |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
r = requests.post('/api/v1/login', headers = headers)
print(r.json())
POST /api/v1/login
Login
Body parameter
username: string
password: string
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Body_login_api_v1_login_post | true | none |
Example responses
200 Response
{
"access_token": "string",
"token_type": "string",
"user": {
"id": 0,
"username": "string",
"email": "string",
"full_name": "string",
"role": "string"
}
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | Token |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/users/create/', headers = headers)
print(r.json())
POST /api/v1/users/create/
Create User
Body parameter
{
"id": 0,
"username": "string",
"email": "string",
"full_name": "string",
"role": "string",
"password": "string"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | UserInDB | true | none |
Example responses
200 Response
null
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | Inline |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/v1/server/all', headers = headers)
print(r.json())
GET /api/v1/server/all
Servers All
Example responses
200 Response
[
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
]
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | Inline |
404 | Not Found | Not found | None |
Status Code 200
Response Servers All Api V1 Server All Get
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Response Servers All Api V1 Server All Get | [WGServer] | false | none | none |
» WGServer | WGServer | false | none | none |
»» id | integer | false | none | none |
»» address | string | false | none | none |
»» v6_address | string | false | none | none |
»» subnet | integer | false | none | none |
»» v6_subnet | integer | false | none | none |
»» interface | string | true | none | none |
»» listen_port | integer | false | none | none |
»» endpoint | string | false | none | none |
»» private_key | string | false | none | none |
»» public_key | string | false | none | none |
»» is_running | boolean | false | none | none |
»» configuration | string | false | none | none |
»» post_up | string | false | none | none |
»» post_down | string | false | none | none |
»» dns | string | false | none | none |
»» peers | [WGPeer] | false | none | none |
»»» WGPeer | WGPeer | false | none | none |
»»»» id | integer | false | none | none |
»»»» name | string | false | none | none |
»»»» address | string | false | none | none |
»»»» v6_address | string | false | none | none |
»»»» private_key | string | false | none | none |
»»»» public_key | string | false | none | none |
»»»» shared_key | string | false | none | none |
»»»» server_id | string | true | none | none |
»»»» dns | string | false | none | none |
»»»» allowed_ips | string | false | none | none |
»»»» configuration | string | false | none | none |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/server/add', headers = headers)
print(r.json())
POST /api/v1/server/add
Add Interface
Body parameter
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | WGServerAdd | true | none |
Example responses
200 Response
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | WGServer |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/server/stop', headers = headers)
print(r.json())
POST /api/v1/server/stop
Stop Server
Body parameter
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | WGServer | true | none |
Example responses
200 Response
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | WGServer |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/server/start', headers = headers)
print(r.json())
POST /api/v1/server/start
Start Server
Body parameter
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | WGServer | true | none |
Example responses
200 Response
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | WGServer |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/server/restart', headers = headers)
print(r.json())
POST /api/v1/server/restart
Restart Server
Body parameter
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | WGServer | true | none |
Example responses
200 Response
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | WGServer |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/server/delete', headers = headers)
print(r.json())
POST /api/v1/server/delete
Delete Server
Body parameter
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | WGServer | true | none |
Example responses
200 Response
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | WGServer |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/server/stats', headers = headers)
print(r.json())
POST /api/v1/server/stats
Stats Server
Body parameter
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | WGServer | true | none |
Example responses
200 Response
null
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | Inline |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/server/edit', headers = headers)
print(r.json())
POST /api/v1/server/edit
Edit Server
Body parameter
{}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
Example responses
200 Response
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | WGServer |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/v1/server/config/{server_id}', headers = headers)
print(r.json())
GET /api/v1/server/config/{server_id}
Server Config
Name | In | Type | Required | Description |
---|---|---|---|---|
server_id | path | integer | true | none |
Example responses
200 Response
"string"
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | string |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/peer/add', headers = headers)
print(r.json())
POST /api/v1/peer/add
Add Peer
Body parameter
{
"server_interface": "string"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | WGPeerAdd | true | none |
Example responses
200 Response
{
"id": 0,
"name": "string",
"address": "string",
"v6_address": "string",
"private_key": "string",
"public_key": "string",
"shared_key": "string",
"server_id": "string",
"dns": "string",
"allowed_ips": "string",
"configuration": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | WGPeer |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/peer/delete', headers = headers)
print(r.json())
POST /api/v1/peer/delete
Delete Peer
Body parameter
{
"id": 0,
"name": "string",
"address": "string",
"v6_address": "string",
"private_key": "string",
"public_key": "string",
"shared_key": "string",
"server_id": "string",
"dns": "string",
"allowed_ips": "string",
"configuration": "string"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | WGPeer | true | none |
Example responses
200 Response
{
"id": 0,
"name": "string",
"address": "string",
"v6_address": "string",
"private_key": "string",
"public_key": "string",
"shared_key": "string",
"server_id": "string",
"dns": "string",
"allowed_ips": "string",
"configuration": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | WGPeer |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('/api/v1/peer/edit', headers = headers)
print(r.json())
POST /api/v1/peer/edit
Edit Peer
Body parameter
{
"id": 0,
"name": "string",
"address": "string",
"v6_address": "string",
"private_key": "string",
"public_key": "string",
"shared_key": "string",
"server_id": "string",
"dns": "string",
"allowed_ips": "string",
"configuration": "string"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | WGPeer | true | none |
Example responses
200 Response
null
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | Inline |
404 | Not Found | Not found | None |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Code samples
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/v1/wg/generate_psk', headers = headers)
print(r.json())
GET /api/v1/wg/generate_psk
Generate Psk
Example responses
200 Response
{
"psk": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | PSK |
404 | Not Found | Not found | None |
Code samples
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/v1/wg/generate_keypair', headers = headers)
print(r.json())
GET /api/v1/wg/generate_keypair
Generate Key Pair
Example responses
200 Response
{
"public_key": "string",
"private_key": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | KeyPair |
404 | Not Found | Not found | None |
{
"username": "string",
"password": "string"
}
Body_login_api_v1_login_post
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
username | string | true | none | none |
password | string | true | none | none |
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
HTTPValidationError
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
detail | [ValidationError] | false | none | none |
{
"public_key": "string",
"private_key": "string"
}
KeyPair
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
public_key | string | true | none | none |
private_key | string | true | none | none |
{
"psk": "string"
}
PSK
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
psk | string | true | none | none |
{
"access_token": "string",
"token_type": "string",
"user": {
"id": 0,
"username": "string",
"email": "string",
"full_name": "string",
"role": "string"
}
}
Token
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
access_token | string | true | none | none |
token_type | string | true | none | none |
user | User | true | none | none |
{
"id": 0,
"username": "string",
"email": "string",
"full_name": "string",
"role": "string"
}
User
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | none |
username | string | true | none | none |
string | false | none | none | |
full_name | string | false | none | none |
role | string | false | none | none |
{
"id": 0,
"username": "string",
"email": "string",
"full_name": "string",
"role": "string",
"password": "string"
}
UserInDB
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | none |
username | string | true | none | none |
string | false | none | none | |
full_name | string | false | none | none |
role | string | false | none | none |
password | string | true | none | none |
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
ValidationError
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
loc | [string] | true | none | none |
msg | string | true | none | none |
type | string | true | none | none |
{
"id": 0,
"name": "string",
"address": "string",
"v6_address": "string",
"private_key": "string",
"public_key": "string",
"shared_key": "string",
"server_id": "string",
"dns": "string",
"allowed_ips": "string",
"configuration": "string"
}
WGPeer
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | none |
name | string | false | none | none |
address | string | false | none | none |
v6_address | string | false | none | none |
private_key | string | false | none | none |
public_key | string | false | none | none |
shared_key | string | false | none | none |
server_id | string | true | none | none |
dns | string | false | none | none |
allowed_ips | string | false | none | none |
configuration | string | false | none | none |
{
"server_interface": "string"
}
WGPeerAdd
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
server_interface | string | true | none | none |
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
WGServer
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | none |
address | string | false | none | none |
v6_address | string | false | none | none |
subnet | integer | false | none | none |
v6_subnet | integer | false | none | none |
interface | string | true | none | none |
listen_port | integer | false | none | none |
endpoint | string | false | none | none |
private_key | string | false | none | none |
public_key | string | false | none | none |
is_running | boolean | false | none | none |
configuration | string | false | none | none |
post_up | string | false | none | none |
post_down | string | false | none | none |
dns | string | false | none | none |
peers | [WGPeer] | false | none | none |
{
"id": 0,
"address": "string",
"v6_address": "string",
"subnet": 0,
"v6_subnet": 0,
"interface": "string",
"listen_port": 0,
"endpoint": "string",
"private_key": "string",
"public_key": "string",
"is_running": true,
"configuration": "string",
"post_up": "string",
"post_down": "string",
"dns": "string",
"peers": []
}
WGServerAdd
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | none |
address | string | true | none | none |
v6_address | string | false | none | none |
subnet | integer | false | none | none |
v6_subnet | integer | false | none | none |
interface | string | true | none | none |
listen_port | integer | true | none | none |
endpoint | string | false | none | none |
private_key | string | false | none | none |
public_key | string | false | none | none |
is_running | boolean | false | none | none |
configuration | string | false | none | none |
post_up | string | false | none | none |
post_down | string | false | none | none |
dns | string | false | none | none |
peers | [WGPeer] | false | none | none |