Skip to main content

Personal Access Tokens

Personal access tokens (PATs) provide an easy way for an individual to connect to Dremio Cloud securely using client tools or JDBC. The PAT gets passed in in place of a password. If the client tool requires a username, enter $token as the username and the generated PAT in the password field.

Token Object
{
"label": "PATforAPI",
"createdAt": 1623837492475,
"expiresAt": 1624701492475,
"tid": "6c2cda83-f2be-43ea-bf51-adda9c101023",
"uid": "f3cf7b44-69c6-4008-b319-b297559c9040"
}

Token Attributes

{{< api-section file="data/api/personal-access-token.json" data="tokenAttributes" >}}

Listing All Tokens

List tokens associated with the specified user.

note:

You cannot view tokens for another user. Tokens may only be viewed for the user performing the API call.

Listing All Tokens
GET /v0/user/{user-id}/token

Parameters

{{< api-section file="data/api/personal-access-token.json" data="listingAllTokensParameters" >}}

Example Request
curl -X GET \
'https://api.dremio.cloud/v0/user/f3cf7b44-69c6-4008-b319-b297559c9040/token' \
-H 'Authorization: Bearer <personal access token>' \
-H 'Content-Type: application/json'
Example Response
{
"data": [
{
"label": "PATforAPI",
"createdAt": 1623837492475,
"expiresAt": 1624701492475,
"tid": "6c2cda83-f2be-43ea-bf51-adda9c101023",
"uid": "f3cf7b44-69c6-4008-b319-b297559c9040"
},
{
"label": "PAT for today",
"createdAt": 1623846858124,
"expiresAt": 1624710858124,
"tid": "f95ae8f7-5634-49d7-ba38-f77f3ce45341",
"uid": "f3cf7b44-69c6-4008-b319-b297559c9040"
},
{
"label": "PAT for the account",
"createdAt": 1623862177513,
"expiresAt": 1624294177513,
"tid": "0852f85f-394e-4ad8-9f05-f64955f4df3a",
"uid": "f3cf7b44-69c6-4008-b319-b297559c9040"
}
]
}

Creating a Token

Create a token associated with a specific user.

Creating a Token
POST /v0/user/{user-id}/token

Parameters

{{< api-section file="data/api/personal-access-token.json" data="creatingTokenParameters" >}}

Example Request
curl -X POST 'https://api.dremio.cloud/v0/user/f3cf7b44-69c6-4008-b319-b297559c9040/token' \
-H 'Authorization: Bearer <personal access token>' \
-H 'Content-Type: application/json' \
-d '{"label": "Pat for API", "millisecondsToExpire": 432000000 }'
Example Response
CFL4XzlOStifBfZJVfTfOrrop6hOJuM4DN6TPtnpwRzWB995+tWQbC/GLn2MCQ==

Responses

{{< api-responses file="data/api/personal-access-token.json" data="creatingTokenResponses" >}}

Deleting a Token

Delete a specific token for a user.

Deleting a Token
DELETE /v0/user/{user-id}/token/{id}

Parameters

{{< api-section file="data/api/personal-access-token.json" data="deletingTokenParameters" >}}

Example Request
curl -X DELETE \
'https://api.dremio.cloud/v0/user/f3cf7b44-69c6-4008-b319-b297559c9040/token/0852f85f-394e-4ad8-9f05-f64955f4df3a' \
-H 'Authorization: Bearer <personal access token>' \
-H 'Content-Type: application/json'
Example Response
No response

Responses

{{< api-responses file="data/api/personal-access-token.json" data="deletingTokenResponses" >}}

Deleting All Tokens

Delete all tokens associated with a user.

Deleting All Tokens
DELETE /v0/user/{user-id}/token

Parameters

{{< api-section file="data/api/personal-access-token.json" data="deletingAllTokensParameters" >}}

Example Request
curl -X DELETE \
'https://api.dremio.cloud/v0/user/f3cf7b44-69c6-4008-b319-b297559c9040/token' \
-H 'Authorization: Bearer <personal access token>' \
-H 'Content-Type: application/json'
Example Response
No response

Responses

{{< api-responses file="data/api/personal-access-token.json" data="deletingAllTokensResponses" >}}