Skip to content
Docs

Generate a project OIDC token

POSThttps://api.vercel.com/v1/projects/{idOrName}/token
Generates an OIDC token for the project and returns it.
https://api.vercel.com/v1/projects/{idOrName}/token
const response = await fetch('https://api.vercel.com/v1/projects/idOrName/token?teamId=string&slug=string', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"source": "vercel-cli:pull"
}),
});
const data = await response.json();
console.log(data);
Response
{
"token": "string"
}
AuthorizationbearerToken

Default authentication mechanism

idOrNamestringRequired
The project ID or name
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
application/json
sourcestringOptional
The source that is calling the endpoint.
200Success
tokenstringRequired
400One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error