Authentication
Authorization is required for most API endpoints. In this guide, we'll cover two methods for authenticating API requests. We recommend using the authorization header for authentication.
Authorization header
To authenticate with the majority of API endpoints, it's best to use the authorization header when making API requests. You'll first need to create a token using your username and password. Here's how to include the token in the request authorization header using cURL.
Use of the authorization header, replace {token}, including the curly brackets.
curl -G https://api.azirevpn.com/v3/users/me \
-H "Authorization: Bearer {token}"
Never share tokens with anyone, and never include them in any public code repositories.
Username and password
Use your username and password to authenticate your API requests. Unless you have a very good reason, you probably shouldn't use this. Here's how to authenticate using cURL:
Example request with username and password
curl https://api.azirevpn.com/v3/tokens \
--json '{
"device_name": "Zebra"
"username": "my_username",
"password": "my_secure_password"
}'