Portforwardings
The Portforwardings API lets you manage port settings within your VPN connection. You can view your portforwarding details, create new with custom expiration times, modify existing settings (currently limited to the 'hidden' attribute), and delete portforwarding configurations from the connected VPN server. Please note that you must be connected to a VPN server to use these endpoints, as we don't retain any data on our web servers.
Endpoints
Attributes
- Name
internal_ipv4- Type
- string
- Description
Your internal IPv4 address.
- Name
internal_ipv6- Type
- string
- Description
Your internal IPv6 address.
- Name
port- Type
- number
- Description
The assigned port.
- Name
hidden- Type
- bool
- Description
Boolean value indicating whether the port is hidden from API responses. Default to false.
- Name
expires_in- Type
- string
- Description
The expiration time of the portforwarding in days. Default to 365.
Retrieve portforwardings
This API endpoint enables you to fetch details about your portforwarding configurations from the VPN server you are currently connected to. You can refer to the list provided at the beginning of this page to learn about the properties included within port forwarding objects. In this endpoint, the port details are encapsulated in an array with the key "ports".
Required attributes
- Name
internal_ipv4- Type
- string
- Description
Your internal IPv4 address.
Request
curl -G https://api.azirevpn.com/v3/portforwardings?internal_ipv4=10.0.16.181 \
-H "Authorization: Bearer {token}"
Response
{
"status": "success",
"data": {
"internal_ipv4": "10.0.16.181",
"internal_ipv6": "2a0e:1c80:1337:1:10:0:16:181",
"ports": [
{
"port": 58216,
"hidden": false,
"expires_at": 1687434503
}
]
}
}
Create portforwarding
Use this endpoint to establish a new portforwarding on the connected VPN location. Customize the configuration by setting an expiration time and specifying whether retrieval is permitted after creation.
Required attributes
- Name
internal_ipv4- Type
- string
- Description
Your internal IPv4 address.
Optional attributes
- Name
expires_in- Type
- number
- Description
Number of days until expiration. Defaults to 30 days.
- Name
hidden- Type
- bool
- Description
If set to true, the portforwarding will not be retrievable.
Request
curl https://api.azirevpn.com/v3/portforwardings \
-H "Authorization: Bearer {token}" \
--json '{
"internal_ipv4": "10.0.16.181",
"hidden": false,
"expires_in": 0
}'
Response
{
"status": "success",
"data": {
"internal_ipv4": "10.0.16.181",
"internal_ipv6": "2a0e:1c80:1337:1:10:0:16:181",
"port": 58216,
"hidden": false,
"expires_at": 1687434503
}
}
Update portforwarding
This endpoint enables you to make updates to a portforwarding configuration on the VPN server you are currently connected to. Currently, you can specifically set the hidden attribute to "true."
Required attributes
- Name
internal_ipv4- Type
- string
- Description
Your internal IPv4 address.
- Name
port- Type
- number
- Description
Your assigned port.
- Name
hidden- Type
- bool
- Description
Only "true" is allowed.
Request
curl -X PUT https://api.azirevpn.com/v3/portforwardings \
-H "Authorization: Bearer {token}" \
--json '{
"internal_ipv4": "10.0.16.181",
"hidden": false,
"expires_in": 0
}'
Response
{
"status": "success",
"data": {
"internal_ipv4": "10.0.16.181",
"internal_ipv6": "2a0e:1c80:1337:1:10:0:16:181",
"port": null,
"hidden": true,
"expires_at": 1687434503
}
}
Delete portforwarding
Use this endpoint to remove a portforwarding configuration from the VPN server you are currently connected to.
Required attributes
- Name
internal_ipv4- Type
- string
- Description
Your internal IPv4 address.
- Name
port- Type
- number
- Description
Your assigned port.
Request
curl -X DELETE https://api.azirevpn.com/v3/portforwardings \
-H "Authorization: Bearer {token}" \
--json '{
"internal_ipv4": "10.0.16.181",
"port": 58532
}'
Check portforwarding
Use this endpoint to check if you have successfully opened the assigned port on your side.
Required attributes
- Name
port- Type
- string
- Description
Your assigned port.
Request
curl -G https://api.azirevpn.com/v3/portforwardings/check/1337
Response
{
"status": "success",
"message": "Port is open",
"data": {
"source_ip": "123.123.123.123",
"port": 1337
}
}
Check portforwarding
Use this endpoint to check if you have successfully opened the assigned port on your side.
Required attributes
- Name
port- Type
- string
- Description
Your assigned port.
Request
curl -G https://api.azirevpn.com/v3/portforwardings/check/1336 \
-d port=1336 \
Response
{
"status": "error",
"message": "Port is closed",
"data": {
"source_ip": "123.123.123.123",
"port": 1336
}
}