Get licenses
Returns tenant licenses with optional filters by user IDs and license status, sorting, and pagination.
Request
POST
https://api.datalens.tech/rpc/getLicenses
Headers
|
Name |
Description |
|
x-dl-api-version |
Type: string API version header. Const: Example: |
Body
application/json
{
"userIds": [
"example"
],
"status": "active",
"sortBy": "createdAt",
"order": "asc",
"limit": 1,
"pageToken": "example"
}
|
Name |
Description |
|
limit |
Type: number Maximum number of licenses to return. Min value: Max value: |
|
order |
Type: string License sort order. Enum: |
|
pageToken |
Type: string Token for the next page of licenses. Example: |
|
sortBy |
Type: string License field to sort by. Enum: |
|
status |
Type: string License status to filter by. Enum: |
|
userIds |
Type: string[] IDs of users whose licenses should be returned. Min items: Max items: Example
|
Responses
200 OK
Response
Body
application/json
{
"licenses": [
{
"licenseId": "example",
"meta": {},
"tenantId": "example",
"userId": "example",
"licenseType": "creator",
"isActive": true,
"expiresAt": "example",
"createdBy": "example",
"createdAt": "example",
"updatedBy": "example",
"updatedAt": "example",
"lastLoginAt": "example"
}
],
"nextPageToken": "example"
}
|
Name |
Description |
|
licenses |
Type: LicenseWithLastLogin[] Licenses matching the request. Example
|
|
nextPageToken |
Type: string Token for the next page of licenses. Example: |
LicenseWithLastLogin
|
Name |
Description |
||
|
createdAt |
Type: string Date and time when the license was created. Example: |
||
|
createdBy |
Type: string ID of the user who created the license. Example: |
||
|
expiresAt |
Type: string Date and time when the license expires. Example: |
||
|
isActive |
Type: boolean Whether the license is active. |
||
|
lastLoginAt |
Type: string | null Date and time when the licensed user last logged in. Example: |
||
|
licenseId |
Type: string Unique identifier of the license. Example: |
||
|
licenseType |
Type: string Type of the license. Const: Example: |
||
|
meta |
Type: object
Additional license metadata. Example
|
||
|
tenantId |
Type: string ID of the tenant that owns the license. Example: |
||
|
updatedAt |
Type: string Date and time when the license was last updated. Example: |
||
|
updatedBy |
Type: string ID of the user who last updated the license. Example: |
||
|
userId |
Type: string ID of the user assigned the license. Example: |
Example
{
"licenseId": "example",
"meta": {},
"tenantId": "example",
"userId": "example",
"licenseType": "creator",
"isActive": true,
"expiresAt": "example",
"createdBy": "example",
"createdAt": "example",
"updatedBy": "example",
"updatedAt": "example",
"lastLoginAt": "example"
}