Skip to content
Docs

Get Auth Token Metadata

GEThttps://api.vercel.com/v5/user/tokens/{tokenId}
Retrieve metadata about an authentication token belonging to the currently authenticated User.
https://api.vercel.com/v5/user/tokens/{tokenId}
const response = await fetch('https://api.vercel.com/v5/user/tokens/tokenId', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
Response
{
"token": {
"activeAt": "1632816536002",
"createdAt": "1632816536002",
"expiresAt": "1632816536002",
"id": "5d9f2ebd38ddca62e5d51e9c1704c72530bdc8bfdd41e782a6687c48399e8391",
"leakedAt": "1632816536002",
"leakedUrl": "https://example.com",
"name": "Example Name",
"origin": "github",
"prefix": "vcp_",
"revokedAt": "1632816536002",
"scopes": [
{
"createdAt": "123",
"expiresAt": "123",
"origin": "app",
"sudo": {
"expiresAt": "123",
"origin": "email-otp",
"verifiedAt": "123"
},
"type": "user"
}
],
"suffix": "abc123",
"type": "oauth2-token"
}
}
AuthorizationbearerToken

Default authentication mechanism

tokenIdstringRequired
The identifier of the token to retrieve. The special value "current" may be supplied, which returns the metadata for the token that the current HTTP request is authenticated with.
200Successful response.
tokenobjectRequired
Authentication token metadata.
400One of the provided values in the request query is invalid.
403You do not have permission to access this resource.
404Token not found with the requested `tokenId`.
410Error