Skip to content
Docs

Get a flag

GEThttps://api.vercel.com/v1/projects/{projectIdOrName}/feature-flags/flags/{flagIdOrSlug}
Retrieve a specific feature flag by its ID or slug.
https://api.vercel.com/v1/projects/{projectIdOrName}/feature-flags/flags/{flagIdOrSlug}
const response = await fetch('https://api.vercel.com/v1/projects/projectIdOrName/feature-flags/flags/flagIdOrSlug?ifMatch=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
{
"createdAt": "123",
"createdBy": "string",
"description": "string",
"environments": "value",
"id": "icfg_1234567890",
"kind": "boolean",
"maintainerIds": [],
"ownerId": "example_id",
"permanent": "false",
"projectId": "example_id",
"revision": "123",
"seed": "123",
"slug": "string",
"state": "active",
"tags": [],
"typeName": "flag",
"updatedAt": "123",
"updatedBy": "string",
"variants": [
{
"description": "string",
"id": "icfg_1234567890",
"label": "string",
"value": "string"
}
],
"metadata": {
"creator": {
"id": "icfg_1234567890",
"name": "Example Name"
}
}
}
AuthorizationbearerToken

Default authentication mechanism

projectIdOrNamestringRequired
The project id or name
flagIdOrSlugstringRequired
The flag id or name
ifMatchstringOptional
Etag to match, can be used interchangeably with the if-match header
withMetadatabooleanOptional
Whether to include metadata in the response
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200Success
createdAtnumberRequired
createdBystringRequired
descriptionstringOptional
environmentsobjectRequired
idstringRequired
kindstringRequired
maintainerIdsarrayOptional
ownerIdstringRequired
permanentbooleanOptional
projectIdstringRequired
revisionnumberRequired
seednumberRequired
slugstringRequired
statestringRequired
tagsarrayOptional
typeNamestringRequired
updatedAtnumberRequired
updatedBystringOptional
variantsarrayRequired
metadataobjectOptional
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