Skip to content
Docs

Create a trace session token for a deployment

POSThttps://api.vercel.com/v1/projects/traces/session
Mints a short-lived HS256 JWT scoped to a deployment hostname. The Vercel CLI presents this JWT to the Vercel proxy on requests it wants traced.
https://api.vercel.com/v1/projects/traces/session
const response = await fetch('https://api.vercel.com/v1/projects/traces/session?teamId=string&slug=string', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"projectId": "example_id",
"hostname": "Example Name"
}),
});
const data = await response.json();
console.log(data);
Response
{
"token": "string"
}
AuthorizationbearerToken

Default authentication mechanism

teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
application/json
projectIdstringRequired
The project ID the deployment belongs to.
hostnamestringRequired
The deployment hostname to scope the trace session to.
200Success
tokenstringRequired
400One of the provided values in the request body is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error
422Error