Authorization

Veeam Backup for Microsoft Azure REST API authorization process involves obtaining an access token - a string that represents authorization issued to the user and that must be sent in the Bearer <Access-Token> format in the Authorization header in all requests during the current log on session.

Bearer

Authenticates a user (client) who sends the request to the server. Must contain the access token for the current logon session in the Bearer \<JWT\> format.

Security Scheme Type: API Key
Header parameter name: Authorization

The /api/oauth2/token resource collection allows a Veeam Backup for Microsoft Azure user to authenticate himself and authorize his access to the Veeam Backup for Microsoft Azure REST API. To authenticate a user retrieved from the identity provider, see Authorization (Single Sign-On).
To learn more about the authorization process and security settings, see the Veeam Backup for Microsoft Azure REST API Reference Overview, section Authorization and Security.

Request Authorization Tokens

The HTTP POST request to the /api/oauth2/token endpoint allows you to authorize your access to the Veeam Backup for Microsoft Azure REST API.

x-codegen-request-body-name: userDto
x-not-versioned: true
SecurityBearer
Request
Request Body schema: application/x-www-form-urlencoded
username
string or null

[Required if the grant_type parameter value is Password] User name.

password
string or null <password>

[Required if the grant_type parameter value is Password] Password of the user.

refresh_token
string or null

[Required if the grant_type parameter value is Refresh_token] Refresh token.

grant_type
string (GrantType)

Grant type that will be used to authenticate a user.

Enum: "Password" "Refresh_token" "Mfa" "Updater_token" "Saml" "SsoToken" "Authentication_code" "Unknown"
x-external-type: Veeam.Azure.REST.Latest.GrantType
mfa_token
string or null

[Required if the grant_type parameter value is Mfa] MFA token.

mfa_code
string or null

[Required if the grant_type parameter value is Mfa] Verification code.

updater_token
string or null

[Required if the grant_type parameter value is Updater_token] Updater token.

saml_response
string or null

[Required if the grant_type parameter value is Saml] Saml response obtained from the identity provider.

sso_token
string or null

[Required if the grant_type parameter value is SsoToken] Single sign-on token.

authorization_code
string or null

[Required if the grant_type parameter value is Authorization_code] Short lived authorization code.

short_lived_refresh_token
boolean or null

Defines whether to decrease the refresh token lifetime to 60 minutes.

Responses
200

OK

400

Bad Request

401

Unauthorized

post/api/oauth2/token
Request samples
application/x-www-form-urlencoded
username=string&password=pa%24%24word&refresh_token=string&grant_type=Password&mfa_token=string&mfa_code=string&updater_token=string&saml_response=string&sso_token=string&authorization_code=string&short_lived_refresh_token=true
Response samples
application/json
{
  • "access_token": "string",
  • "token_type": "string",
  • "refresh_token": "string",
  • "expires_in": 0,
  • ".issued": "2019-08-24T14:15:22Z",
  • ".expires": "2019-08-24T14:15:22Z",
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "username": "string",
  • "roleName": "string",
  • "userType": "Internal",
  • "latestNewsShown": true,
  • "mfa_enabled": true,
  • "mfa_token": "string",
  • "redirectTo": "string",
  • "shortLived": true
}

Logout

The HTTP DELETE request to the /api/oauth2/token endpoint performs the logout operation for an authorized user.

SecurityBearer
Request
query Parameters
api-version
string

Specifies the current version of the Veeam Backup for Microsoft Azure REST API.

Responses
204

No Content

400

Bad Request

401

Unauthorized

403

Forbidden

delete/api/oauth2/token
Request samples
curl -i -X DELETE \
  'https://123.123.123.123/api/oauth2/token?api-version=string' \
  -H 'Authorization: YOUR_API_KEY_HERE'
Response samples
application/problem+json
{
  • "detail": "string",
  • "errors": {
    },
  • "status": 0,
  • "title": "string",
  • "traceId": "string",
  • "type": "string"
}