Skip to main content
PUT
/
projects
/
{projectId}
/
flags
/
{flagId}
/
variations
cURL
curl --request PUT \
  --url http://localhost:3000/projects/{projectId}/flags/{flagId}/variations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "updates": [
    {
      "key": "<string>",
      "name": "<string>",
      "type": "boolean",
      "value": "<string>",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "description": "<string>",
      "is_default": false,
      "order_index": 0
    }
  ],
  "deletedIds": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "offVariationId": "<string>",
  "environmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'
{
  "statusCode": 123,
  "message": "OK",
  "data": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "flag_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "key": "<string>",
      "name": "<string>",
      "description": "<string>",
      "type": "boolean",
      "value": "<string>",
      "is_default": true,
      "order_index": 123,
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "deleted_at": "2023-11-07T05:31:56Z"
    }
  ]
}

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
flagId
string<uuid>
required

Body

application/json
updates
object[]
required

Array of variations to create or update

deletedIds
string<uuid>[]

Array of variation IDs to soft-delete

offVariationId
string

ID of the variation to use when the flag is off

environmentId
string<uuid>

Environment ID for validating offVariationId

Response

Default Response

statusCode
number
message
string
default:OK
data
object[]