Users
The users API lets you create, retrieve and delete your user account.
Endpoints
Properties
- Name
username- Type
- string
- Description
The user's username.
- Name
email- Type
- string
- Description
The user's email address.
- Name
currency- Type
- string
- Description
The user's currency. Available options are 'EUR', 'USD' and 'SEK'. Defaults to 'EUR'.
- Name
is_email_verified- Type
- boolean
- Description
Whether or not the email is verified.
- Name
is_active- Type
- boolean
- Description
Has the value
trueif the user has access to the service, otherwisefalse.
- Name
is_oldschool- Type
- boolean
- Description
Has the value
trueif the user has access to the old pricing, otherwisefalse.
- Name
is_subscribed- Type
- boolean
- Description
has the value
trueif the user has an active subscription, otherwisefalse.
- Name
ips- Type
- array
- Description
An array containing the amount of allocated and available IP addresses.
- Name
created_at- Type
- integer
- Description
The timestamp of when the user was created.
- Name
expires_at- Type
- integer
- Description
The timestamp of when the user's access expires unless renewed.
Create user
Use this endpoint to create a new user. Select a username and password, and optionally, include user's currency, an affiliate code or referral code if you have one available.
Required attributes
- Name
username- Type
- string
- Description
The user's username.
- Name
password- Type
- string
- Description
The user's password.
Optional attributes
- Name
email- Type
- string
- Description
The user's email address. When included, a verification email will be sent. The user must accept this email before gaining access to the account.
- Name
currency- Type
- string
- Description
The user's currency. Available options are 'EUR', 'USD' and 'SEK'. Defaults to 'EUR'.
- Name
affiliate_code- Type
- string
- Description
Affiliate code if one exists and if referral code is not set.
- Name
referral_code- Type
- string
- Description
Referral code if one exists.
Request
curl https://api.azirevpn.com/v3/users \
--json '{
"username": "david",
"password": "my_secure_password",
"referral_code": "1337"
}'
Response
{
"status": "success",
"data": {
"username": "david",
"email": null,
"currency": "EUR",
"is_email_verified": false,
"is_active": false,
"is_oldschool": false,
"is_subscribed": false,
"ips": [
"allocated": 0,
"available": 10,
],
"created_at": 1687434503,
"expires_at": 1617434503
}
}
Get authenticated user
This endpoint allows you to retrieve an user by using authorization header. Refer to the list at the top of this page to see which properties are included with user object.
Request
curl https://api.azirevpn.com/v3/users/me \
-H "Authorization: Bearer {token}"
Response
{
"status": "success",
"data": {
"username": "david",
"email": "david@my.email",
"currency": "EUR",
"is_email_verified": true,
"is_active": true,
"is_oldschool": false,
"is_subscribed": true,
"ips": [
"allocated": 2,
"available": 8,
],
"created_at": 1687434503,
"expires_at": 1617434503
}
}
Delete authenticated user
This endpoint enables you to remove a user's account. Please ensure you include the user's password as a required parameter.
Required attributes
- Name
password- Type
- string
- Description
The user's password.
Request
curl -X DELETE https://api.azirevpn.com/v3/users/me \
-H "Authorization: Bearer {token}" \
--json '{
"password": "my_secure_password"
}'
Generate OTP (One-Time Password)
This endpoint allows you to create a new OTP. The OTP token will remain valid for 10 minutes after creation. Valid redirect paths include "order," "wireguard," and "settings."
To use the OTP, navigate to the following URL: https://manager.azirevpn.com/auth/otp?token={token}&redirect=wireguard
Request
curl https://api.azirevpn.com/v3/users/me/otps \
-H "Authorization: Bearer {token}"
Response
{
"status": "success",
"data": {
"otp": "45da20592bf47321h039628985c5jc69cb5941ef6u30966d0dbb26718f81",
"expires_at": 1617434503
}
}
Update password
This endpoint allows you to modify the password linked to your account.
Required attributes
- Name
new_password- Type
- string
- Description
The user's password.
Request
curl -X PUT https://api.azirevpn.com/v3/users/me/password \
-H "Authorization: Bearer {token}" \
--json '{
"new_password": "password_secure_new"
}'
Response
{
"status": "success",
"data": {
"username": "david",
"email": "new@nice.email",
"currency": "EUR",
"is_email_verified": true,
"is_active": true,
"is_oldschool": false,
"is_subscribed": true,
"ips": [
"allocated": 2,
"available": 8,
],
"created_at": 1687434503,
"expires_at": 1617434503
}
}
Update username
This endpoint allows you to modify the username linked to your account.
Required attributes
- Name
new_username- Type
- string
- Description
The user's username.
Request
curl -X PUT https://api.azirevpn.com/v3/users/me/username \
-H "Authorization: Bearer {token}" \
--json '{
"new_username": "python"
}'
Response
{
"status": "success",
"data": {
"username": "python",
"email": "david@my.email",
"currency": "EUR",
"is_email_verified": true,
"is_active": true,
"is_oldschool": false,
"is_subscribed": true,
"ips": [
"allocated": 2,
"available": 8,
],
"created_at": 1687434503,
"expires_at": 1617434503
}
}
Update email
This endpoint allows you to modify the email linked to your account.
Required attributes
- Name
email- Type
- string
- Description
The user's email.
Request
curl -X PUT https://api.azirevpn.com/v3/users/me/email \
-H "Authorization: Bearer {token}" \
--json '{
"email": "new@nice.email"
}'
Response
{
"status": "success",
"data": {
"username": "david",
"email": "new@nice.email",
"currency": "EUR",
"is_email_verified": true,
"is_active": true,
"is_oldschool": false,
"is_subscribed": true,
"ips": [
"allocated": 2,
"available": 8,
],
"created_at": 1687434503,
"expires_at": 1617434503
}
}
Delete email
This endpoint enables you to remove a user's email.
Request
curl -X DELETE https://api.azirevpn.com/v3/users/me \
-H "Authorization: Bearer {token}"
Response
{
"status": "success",
"data": {
"username": "python",
"email": null,
"currency": "EUR",
"is_email_verified": true,
"is_active": true,
"is_oldschool": false,
"is_subscribed": true,
"ips": [
"allocated": 2,
"available": 8,
],
"created_at": 1687434503,
"expires_at": 1617434503
}
}