Feature Flags

Create Feature Flag

POST
/v0/project/{idOrSlug}/feature-flags

Authorization

apiKeyAuth
x-api-key<token>

FastStats API key. Pass it in the x-api-key header or as a Bearer token in the Authorization header.

In: header

Path Parameters

idOrSlug*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v0/project/string/feature-flags" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "key": "string"  }'
{  "id": "string",  "name": "string",  "key": "string",  "projectId": "string",  "description": "string",  "enabled": true,  "archived": true,  "dataType": "boolean",  "fallbackBehavior": "default",  "hashVersion": 0,  "hashSeed": 0,  "value": "string",  "allowSpecificOptIn": true,  "saveToAuthenticatedUser": true,  "userGrantRevalidateConditions": true,  "userGrantResult": "force_enabled",  "rolloutSeed": 0,  "enabledIdentifierCount": 0,  "disabledIdentifierCount": 0,  "conditionSets": [    {      "id": "string",      "featureFlagId": "string",      "resultOptionKey": "string",      "sortOrder": 0,      "createdAt": "string",      "conditions": [        {          "id": "string",          "conditionSetId": "string",          "key": "string",          "value": "string",          "operator": "string",          "createdAt": "string"        }      ]    }  ],  "variants": [    {      "id": "string",      "featureFlagId": "string",      "key": "string",      "label": "string",      "value": "string",      "weight": 0,      "isDefault": true,      "sortOrder": 0,      "createdAt": "string"    }  ],  "groupAccess": [    {      "id": "string",      "featureFlagId": "string",      "groupId": "string",      "createdAt": "string"    }  ],  "createdAt": "string",  "updatedAt": "string"}
{  "_tag": "FeatureFlagValidationError",  "message": "string"}
{  "_tag": "UnauthorizedError",  "message": "string"}
{  "_tag": "ForbiddenError",  "message": "string",  "code": "string"}
{  "_tag": "NotFoundError",  "message": "string"}
{  "_tag": "TinybirdError",  "message": "string",  "cause": null}