Skip to main content
POST
/
projects
/
{projectId}
/
flags
cURL
curl --request POST \
  --url http://localhost:3000/projects/{projectId}/flags \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "key": "<string>",
  "type": "boolean",
  "description": "<string>",
  "is_active": true,
  "client_side_enabled": true,
  "analytics_enabled": true,
  "metadata": {},
  "envId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "template": "gradual_rollout",
  "flavor": "<string>"
}
'
{
  "statusCode": 123,
  "message": "OK",
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "key": "<string>",
    "type": "boolean",
    "description": "<string>",
    "is_active": true,
    "client_side_enabled": true,
    "analytics_enabled": true,
    "metadata": {},
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "archived_at": "2023-11-07T05:31:56Z",
    "deleted_at": "2023-11-07T05:31:56Z",
    "environments": []
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

projectId
string<uuid>
required

Body

application/json
name
string
required
Minimum string length: 1
key
string
Minimum string length: 1
type

Data type of the flag value

Available options:
boolean
description
string | null
is_active
boolean
client_side_enabled
boolean
analytics_enabled
boolean
metadata
object
envId
string<uuid>
template

Pre-configured flag template. Use "gradual_rollout" to create a boolean flag with gradual rollout records pre-seeded for every environment, "kill_switch" to create a boolean flag that is on by default and can be disabled instantly, or "ab_test" to create a multivariate flag pre-configured for experimentation.

Available options:
gradual_rollout
flavor
string

Required when template is "ab_test". Determines the data type of the flag variations.

Response

Default Response

statusCode
number
message
string
default:OK
data
object