Skip to content
Docs

Delete an authentication token

DELhttps://api.vercel.com/v3/user/tokens/{tokenId}
Invalidate an authentication token, such that it will no longer be valid for future HTTP requests.
https://api.vercel.com/v3/user/tokens/{tokenId}
const response = await fetch('https://api.vercel.com/v3/user/tokens/tokenId?reason=string&logoutSource=string', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
Response
{
"tokenId": "5d9f2ebd38ddca62e5d51e9c1704c72530bdc8bfdd41e782a6687c48399e8391"
}
AuthorizationbearerToken

Default authentication mechanism

tokenIdstringRequired
The identifier of the token to invalidate. The special value "current" may be supplied, which invalidates the token that the HTTP request was authenticated with.
reasonstringOptional
Identifies an explicit logout for the deletion event. Only applies when tokenId is current.
logoutSourcestringOptional
The product the caller is logging out of. Only applies when reason is logout and tokenId is current.
200Authentication token successfully deleted.
tokenIdstringRequired
The unique identifier of the token that was deleted.
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