Tokens
The Tokens API provides the ability to list, update, and delete tokens linked to your account. You can enhance tokens by including a device name and/or a comment.
Endpoints
Attributes
- Name
id- Type
- string
- Description
Unique identifier of the token.
- Name
device_name- Type
- string
- Description
Your device name of this token.
- Name
key- Type
- string
- Description
The randomly generated key.
- Name
comment- Type
- string
- Description
Your internal comment.
- Name
created_at- Type
- number
- Description
Timestamp of the creation date.
List all tokens
This endpoint allows you to browse through all tokens associated with your account. See the device name and/or comments linked to each token.
Request
curl https://api.azirevpn.com/v3/tokens \
-H "Authorization: Bearer {token}"
Response
{
"status": "success",
"data": [
{
"id": "h3vm3nk1",
"device_name": "Gnu",
"key": "45da20592bf47321h039628985c5jc69cb5941ef6u30966d0dbb26718f81",
"comment": "My comment",
"created_at": 1687434503
},
{
"id": "B82u1akk",
"device_name": "Pingu",
// ...
}
// ...
]
}
Create token
This endpoint enables you to generate new tokens. You have the option to use either a device name or a comment for identification.
Optional attributes
- Name
device_name- Type
- string
- Description
The device name.
- Name
comment- Type
- string
- Description
The comment.
Request
curl https://api.azirevpn.com/v3/tokens \
-H "Authorization: Bearer {token}" \
--json '{
"device_name": "Zebra"
}'
Response
{
"status": "success",
"data": {
"id": "jbj2Ka81",
"device_name": "Zebra",
"key": "12da20592bf47321h039628985c5jc69cb5941ef6u30966d0dbb26718f82",
"comment": null,
"created_at": 1687434503
}
}
Update token
This endpoint allows you to modify the device name and/or comment of a token linked to your account.
Optional attributes
- Name
device_name- Type
- string
- Description
The device name.
- Name
comment- Type
- string
- Description
The comment.
Request
curl -X PUT https://api.azirevpn.com/v3/tokens/jbj2Ka81 \
-H "Authorization: Bearer {token}" \
--json '{
"device_name": "Python"
}'
Response
{
"status": "success",
"data": {
"id": "jbj2Ka81",
"device_name": "Python",
"key": "12da20592bf47321h039628985c5jc69cb5941ef6u30966d0dbb26718f82",
"comment": null,
"created_at": 1687434503
}
}
Delete current token
Use this endpoint to remove the token used in the request.
Optional attributes
- Name
purge_resources- Type
- bool
- Description
Resources created by this token will be purged.
Request
curl -X DELETE https://api.azirevpn.com/v3/tokens \
-H "Authorization: Bearer {token}" \
--json '{
"purge_resources": true
}'
Delete token
Use this endpoint to remove a token from your account.
Optional attributes
- Name
purge_resources- Type
- bool
- Description
Resources created by this token will be purged.
Request
curl -X DELETE https://api.azirevpn.com/v3/tokens/jbj2Ka81 \
-H "Authorization: Bearer {token}" \
--json '{
"purge_resources": true
}'