Share via


Generate - Access Token

Generate an Azure Video Indexer access token.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/generateAccessToken?api-version=2025-04-01

URI Parameters

Name In Required Type Description
accountName
path True

string

minLength: 3
maxLength: 50
pattern: ^[A-Za-z0-9-]+$

The name of the Azure Video Indexer account.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Required Type Description
permissionType True

permissionType

The requested permission

scope True

scope

The requested media type

projectId

string

The project ID

videoId

string

The video ID

Responses

Name Type Description
200 OK

AccessToken

The Azure Video Indexer account's access token properties were retrieved successfully.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Generate accessToken for account contributor
Generate accessToken for account reader
Generate accessToken for project contributor
Generate accessToken for project reader
Generate accessToken for video contributor
Generate accessToken for video reader

Generate accessToken for account contributor

Sample request

POST https://management.azure.com/subscriptions/b04775c3-63fa-40f3-9430-139d2e5522d3/resourceGroups/contosto-videoanalyzer-rg/providers/Microsoft.VideoIndexer/accounts/contosto-videoanalyzer/generateAccessToken?api-version=2025-04-01

{
  "permissionType": "Contributor",
  "scope": "Account"
}

Sample response

{
  "accessToken": "<jwt token of 1260 characters length>"
}

Generate accessToken for account reader

Sample request

POST https://management.azure.com/subscriptions/b04775c3-63fa-40f3-9430-139d2e5522d3/resourceGroups/contosto-videoanalyzer-rg/providers/Microsoft.VideoIndexer/accounts/contosto-videoanalyzer/generateAccessToken?api-version=2025-04-01

{
  "permissionType": "Reader",
  "scope": "Account"
}

Sample response

{
  "accessToken": "<jwt token of 1260 characters length>"
}

Generate accessToken for project contributor

Sample request

POST https://management.azure.com/subscriptions/b04775c3-63fa-40f3-9430-139d2e5522d3/resourceGroups/contosto-videoanalyzer-rg/providers/Microsoft.VideoIndexer/accounts/contosto-videoanalyzer/generateAccessToken?api-version=2025-04-01

{
  "permissionType": "Contributor",
  "scope": "Project",
  "projectId": "07ec9e38d4"
}

Sample response

{
  "accessToken": "<jwt token of 1260 characters length>"
}

Generate accessToken for project reader

Sample request

POST https://management.azure.com/subscriptions/b04775c3-63fa-40f3-9430-139d2e5522d3/resourceGroups/contosto-videoanalyzer-rg/providers/Microsoft.VideoIndexer/accounts/contosto-videoanalyzer/generateAccessToken?api-version=2025-04-01

{
  "permissionType": "Reader",
  "scope": "Project",
  "projectId": "07ec9e38d4"
}

Sample response

{
  "accessToken": "<jwt token of 1260 characters length>"
}

Generate accessToken for video contributor

Sample request

POST https://management.azure.com/subscriptions/b04775c3-63fa-40f3-9430-139d2e5522d3/resourceGroups/contosto-videoanalyzer-rg/providers/Microsoft.VideoIndexer/accounts/contosto-videoanalyzer/generateAccessToken?api-version=2025-04-01

{
  "permissionType": "Contributor",
  "scope": "Video",
  "videoId": "07ec9e38d4"
}

Sample response

{
  "accessToken": "<jwt token of 1260 characters length>"
}

Generate accessToken for video reader

Sample request

POST https://management.azure.com/subscriptions/b04775c3-63fa-40f3-9430-139d2e5522d3/resourceGroups/contosto-videoanalyzer-rg/providers/Microsoft.VideoIndexer/accounts/contosto-videoanalyzer/generateAccessToken?api-version=2025-04-01

{
  "permissionType": "Reader",
  "scope": "Video",
  "videoId": "07ec9e38d4"
}

Sample response

{
  "accessToken": "<jwt token of 1260 characters length>"
}

Definitions

Name Description
AccessToken

Azure Video Indexer access token.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

GenerateAccessTokenParameters

Access token generation request's parameters

permissionType

The requested permission

scope

The requested media type

AccessToken

Azure Video Indexer access token.

Name Type Description
accessToken

string

The access token.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

GenerateAccessTokenParameters

Access token generation request's parameters

Name Type Description
permissionType

permissionType

The requested permission

projectId

string

The project ID

scope

scope

The requested media type

videoId

string

The video ID

permissionType

The requested permission

Value Description
Contributor
Reader

scope

The requested media type

Value Description
Video
Account
Project