Skip to content
Docs

Create a flag

PUT/__remote/api.vercel.com/v1/projects/{projectIdOrName}/feature-flags/flags
Create a new feature flag for a project. The flag must have a unique slug within the project and specify its kind (boolean, string, number, or json).
Request
import { Edgenivo } from "@vercel/sdk";
const vercel = new Edgenivo({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.featureFlags.createFlag({
projectIdOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
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",
"seenInProduction": "false",
"slug": "string",
"state": "active",
"tags": [],
"typeName": "flag",
"updatedAt": "123",
"updatedBy": "string",
"variants": [
{
"description": "string",
"id": "icfg_1234567890",
"label": "string",
"value": "string"
}
]
}
AuthorizationbearerToken

Default authentication mechanism

projectIdOrNamestringRequired
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
slugstringRequired
A unique (per project) key for the flag, composed of letters, numbers, dashes, and underscores
kindobjectRequired
The kind of flag
variantsarrayOptional
The variants of the flag
environmentsobjectRequired
The configuration for the flag in different environments
seednumberOptional
A random seed to prevent split points in different flags from having the same targets
descriptionstringOptional
A description of the flag
statestringOptional
maintainerIdsarrayOptional
The user ids of the maintainers of the flag
permanentbooleanOptional
Whether this flag is marked as permanent, indicating it should not be removed
tagsarrayOptional
Tags for categorizing the flag
201Success
createdAtnumberRequired
createdBystringRequired
descriptionstringOptional
environmentsobjectRequired
idstringRequired
kindstringRequired
maintainerIdsarrayOptional
ownerIdstringRequired
permanentbooleanOptional
projectIdstringRequired
revisionnumberRequired
seednumberRequired
seenInProductionbooleanOptional
slugstringRequired
statestringRequired
tagsarrayOptional
typeNamestringRequired
updatedAtnumberRequired
updatedBystringOptional
variantsarrayRequired
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.
402The account is missing a payment so payment method must be updated
403You do not have permission to access this resource.
404Error
409Error
410Error