Skip to content
Docs

List flag versions

GEThttps://api.vercel.com/v1/projects/{projectIdOrName}/feature-flags/flags/{flagIdOrSlug}/versions
Lists flag versions for a given flag.
https://api.vercel.com/v1/projects/{projectIdOrName}/feature-flags/flags/{flagIdOrSlug}/versions
const response = await fetch('https://api.vercel.com/v1/projects/projectIdOrName/feature-flags/flags/flagIdOrSlug/versions?limit=123&cursor=string&environment=string&withMetadata=true&teamId=string&slug=string', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
Response
{
"pagination": "value",
"versions": [
{
"changedEnvironments": [],
"createdAt": "123",
"createdBy": "string",
"flagId": "example_id",
"id": "icfg_1234567890",
"message": "string",
"revision": "123",
"data": {
"description": "string",
"environments": "value",
"maintainerIds": [],
"permanent": "false",
"seed": "123",
"state": "active",
"tags": [],
"variants": [
{
"description": "string",
"id": "icfg_1234567890",
"label": "string",
"value": "string"
}
]
},
"metadata": {
"creator": {
"id": "icfg_1234567890",
"name": "Example Name"
}
}
}
]
}
AuthorizationbearerToken

Default authentication mechanism

projectIdOrNamestringRequired
flagIdOrSlugstringRequired
limitnumberOptional
cursorstringOptional
Pagination cursor
environmentstringOptional
Environment to filter by
withMetadatabooleanOptional
Whether to include metadata
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200Success
versionsarrayRequired
400One of the provided values in the request query is invalid.
401The request is not authorized.
402The account is missing a payment so payment method must be updated
403You do not have permission to access this resource.
404Error
410Error