Skip to content

Get OAuth tokens

Request

Retrieves the account's live OAuth tokens: those whose row is not revoked, including tokens whose access half has expired, because a refreshable one can be exchanged for a new access token until the row is revoked -- a refresh token never expires. Administrators only, authenticated by an apikey or a session; an OAuth bearer token is refused. Token and refresh token strings are never returned.

Requires the eng-lc-oauth-token-management launch control flag on the account.

The response is always paged. sorted_by accepts created_at:asc and created_at:desc; without it the page is ordered by id ascending.

A client that still holds a token revokes it itself at POST /oauth/revoke (RFC 7009), which needs no administrator.

Security
ApiKeyAuth
Query
user_idinteger(id)

only list the tokens owned by this user. An empty value is no filter at all; a value that is not a plain decimal id, or that names a user outside the account, matches nothing rather than being an error

Example:user_id=123
page[size]integer, [ 1 .. 100 ]

Max number of results.

Default:25
Example:page[size]=30
page[after]string, (base64)

Cursor for the current page. If omitted, the first page is returned. It must be a Base64-encoded JSON string, including an object with a single entry. For example, the cursor eyJpZCI6IjEyMyJ9 is decoded to {"id":"123"}.

Example:page[after]=eyJpZCI6IjEyMyJ9
sorted_bystring

Sort order for the results. If omitted, the default sort order is applied. Format: <key>:asc or <key>:desc

Example:sorted_by=created_at:desc
curl -i -X GET \
  'https://api.treasuredata.com/v3/oauth_token/list?user_id=123&page%5Bsize%5D=30&page%5Bafter%5D=eyJpZCI6IjEyMyJ9&sorted_by=created_at%3Adesc' \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'

Responses

OK

Bodyapplication/json
oauth_tokensArray of objects(OAuth Token)required
paginationobject(pagination)required

Pagination metadata.

Response
{ "oauth_tokens": [ { … } ], "pagination": { "next_page": "/resources?page[after]=eyJpZCI6IjEyMyJ9" } }