User Tokens Enterprise
Use the User API to create and retrieve personal access tokens for the current Dremio user and delete personal access tokens for any Dremio user.
You must enable the use of personal access tokens to make API requests for user tokens.
{
"data": [
{
"tid": "98ec8f42-7764-4d9d-af5a-693f1f1cc444",
"uid": "b9dbebc7-bc3b-4d56-9154-31762ab65a43",
"label": "Tableau",
"createdAt": "2023-02-19T15:41:15.323Z",
"expiresAt": "2023-03-21T15:41:15.323Z"
},
{
"tid": "3b76a1e4-6539-46de-8f06-b7c41c71b61e",
"uid": "b9dbebc7-bc3b-4d56-9154-31762ab65a43",
"label": "Test Nessie Source",
"createdAt": "2023-03-02T19:39:52.159Z",
"expiresAt": "2023-04-01T19:39:52.159Z"
},
{
"tid": "9376ef58-7b4c-2419-b1cb-a4ce4c53dfa7",
"uid": "b9dbebc7-bc3b-4d56-9154-31762ab65a43",
"label": "Feature Testing",
"createdAt": "2023-03-07T14:47:08.211Z",
"expiresAt": "2023-09-03T14:47:08.211Z"
}
]
}
User Tokens Attributes
{{< api-section file="data/software-api/user.json" data="userTokenAttributes" >}}
data
{{< api-section file="data/software-api/user.json" data="dataTokenAttributes" >}}
Creating a Token for a User
Create a personal access token for the current user.
You can create personal access tokens only for your own user account, and only you may use the tokens you create. Administrators cannot create tokens for other users or distribute tokens to other users.
POST /api/v3/user/{id}/token
Parameters
{{< api-section file="data/software-api/user.json" data="createUserTokenParameters" >}}
Example Request
curl -X POST 'https://{DREMIO_ORIGIN}/api/v3/user/b9dbebc7-bc3b-4d56-9154-31762ab65a43/token' \
--header 'Authorization: _dremio{tokenstring}' \
--header 'Content-Type: application/json' \
--data-raw '{
"label": "Feature Testing",
"millisecondsToExpire": 15552000000
}'
The response contains the personal access token:
Example ResponseEXAMPLETOKEN7TjB3mfPS6AZQ5aPcXPmJS2ofXpLL86dmpDXRbKKi52BQdthnk==
Response Status Codes
{{< api-responses file="data/software-api/user.json" data="createUserTokenResponses" >}}
Retrieving All Tokens for a User
Retrieve all tokens for the current user.
You can only retrieve personal access tokens for your own user account. Administrators cannot retrieve other users' tokens.
GET /api/v3/user/{id}/token
Parameters
{{< api-section file="data/software-api/user.json" data="retrieveUserTokenParameters" >}}
Example Request
curl -X GET 'https://{DREMIO_ORIGIN}/api/v3/user/b9dbebc7-bc3b-4d56-9154-31762ab65a43/token' \
--header 'Authorization: _dremio{tokenstring}' \
--header 'Content-Type: application/json'
{
"data": [
{
"tid": "98ec8f42-7764-4d9d-af5a-693f1f1cc444",
"uid": "b9dbebc7-bc3b-4d56-9154-31762ab65a43",
"label": "Tableau",
"createdAt": "2023-02-19T15:41:15.323Z",
"expiresAt": "2023-03-21T15:41:15.323Z"
},
{
"tid": "3b76a1e4-6539-46de-8f06-b7c41c71b61e",
"uid": "b9dbebc7-bc3b-4d56-9154-31762ab65a43",
"label": "Test Nessie Source",
"createdAt": "2023-03-02T19:39:52.159Z",
"expiresAt": "2023-04-01T19:39:52.159Z"
},
{
"tid": "9376ef58-7b4c-2419-b1cb-a4ce4c53dfa7",
"uid": "b9dbebc7-bc3b-4d56-9154-31762ab65a43",
"label": "Feature Testing",
"createdAt": "2023-03-07T14:47:08.211Z",
"expiresAt": "2023-09-03T14:47:08.211Z"
}
]
}
If the user has no personal access tokens, the response contains an empty data array.
Response Status Codes
{{< api-responses file="data/software-api/user.json" data="retrieveUserTokenResponses" >}}
Deleting All Tokens for a User
Delete all tokens for the specified user.
You must be a member of the ADMIN role to delete other users' tokens.
DELETE /api/v3/user/{id}/token
Parameters
{{< api-section file="data/software-api/user.json" data="deleteAllUserTokenParameters" >}}
Example Request
curl -X DELETE 'https://{DREMIO_ORIGIN}/api/v3/user/b9dbebc7-bc3b-4d56-9154-31762ab65a43/token' \
--header 'Authorization: _dremio{tokenstring}' \
--header 'Content-Type: application/json'
No response
Response Status Codes
{{< api-responses file="data/software-api/user.json" data="deleteAllUserTokenResponses" >}}
Deleting a Token for a User
Delete the specified token for the specified user.
You must be a member of the ADMIN role to delete other users's tokens.
DELETE /api/v3/user/{id}/token/{token-id}
Parameters
{{< api-section file="data/software-api/user.json" data="deleteOneUserTokenParameters" >}}
Example Request
curl -X DELETE 'https://{DREMIO_ORIGIN}/api/v3/user/b9dbebc7-bc3b-4d56-9154-31762ab65a43/token/98ec8f42-7764-4d9d-af5a-693f1f1cc444' \
--header 'Authorization: _dremio{tokenstring}' \
--header 'Content-Type: application/json'
No response
Response Status Codes
{{< api-responses file="data/software-api/user.json" data="deleteOneUserTokenResponses" >}}