PUT /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, or number).

Servers

Path parameters

Name Type Required Description
projectIdOrName String Yes

The project id or name

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Query parameters

Name Type Required Description
teamId String No

The Team identifier to perform the request on behalf of.

slug String No

The Team slug to perform the request on behalf of.

Request body fields

Name Type Required Description
environments Object Yes

The configuration for the flag in different environments

environments.name Object No
environments.name.rules[] Array Yes
environments.name.rules[].id String Yes
environments.name.rules[].conditions[] Array Yes
environments.name.rules[].conditions[].rhs No
environments.name.rules[].conditions[].cmp String Yes

Valid values:

  • "containsNoneOf"
  • "gt"
  • "gte"
  • "eq"
  • "!endsWith"
  • "after"
  • "regex"
  • "!regex"
  • "endsWith"
  • "lt"
  • "startsWith"
  • "containsAnyOf"
  • "before"
  • "lte"
  • "!eq"
  • "!oneOf"
  • "containsAllOf"
  • "oneOf"
  • "!startsWith"
  • "ex"
  • "!ex"
environments.name.rules[].conditions[].lhs Yes
environments.name.rules[].outcome Yes
environments.name.active Boolean Yes
environments.name.revision Number No

The revision of the environment config

environments.name.pausedOutcome Object Yes
environments.name.pausedOutcome.type Yes
environments.name.pausedOutcome.variantId String Yes
environments.name.targets Object No

Allows assigning targets to variants while bypassing the flag's rules

environments.name.fallthrough Yes
environments.name.reuse Object No

Allows linking this environment to another environment so this flag will be evaluated with the other flag's configuration

environments.name.reuse.active Boolean Yes

Whether the reuse is active or not

environments.name.reuse.environment String Yes

The environment to link to

seed Number No

A random seed to prevent split points in different flags from having the same targets

description String No

A description of the flag

slug String Yes

A unique (per project) key for the flag, composed of letters, numbers, dashes, and underscores

variants[] Array No

The variants of the flag

variants[].id String Yes

The id of the variant

variants[].description String No

A description of the variant

variants[].label String No

A label for the variant

variants[].value Yes
kind String Yes

The kind of flag

Valid values:

  • "string"
  • "boolean"
  • "number"
state String No

Valid values:

  • "active"
  • "archived"

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.