Skip to main content
POST
/
v1
/
flags
Create Flag
curl --request POST \
  --url https://flags.eu.confidence.dev/v1/flags \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "displayName": "<string>",
  "state": {},
  "createTime": {},
  "updateTime": {},
  "creator": "<string>",
  "updater": "<string>",
  "name": "<string>",
  "description": "<string>",
  "schema": {},
  "variants": [
    {
      "name": "<string>",
      "value": {},
      "createTime": {},
      "updateTime": {},
      "creator": "<string>",
      "updater": "<string>",
      "labels": [
        {}
      ],
      "description": "<string>",
      "imageUri": "<string>"
    }
  ],
  "rules": [
    {
      "segment": "<string>",
      "assignmentSpec": {},
      "usageMetadata": {},
      "enabled": true,
      "createTime": {},
      "updateTime": {},
      "creator": "<string>",
      "updater": "<string>",
      "name": "<string>",
      "description": "<string>",
      "targetingKeySelector": "<string>",
      "environments": [
        "<string>"
      ],
      "labels": [
        {}
      ],
      "materializationSpec": {}
    }
  ],
  "clients": [
    "<string>"
  ],
  "archiveTime": {},
  "labels": [
    {}
  ],
  "usageMetadata": {},
  "owner": "<string>"
}

Authorizations

Authorization
string
header
required

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

Query Parameters

flagId
string
required

The ID to use for the flag, which will become the final component of the flag's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.

Body

application/json

The body is of type object.

Response

200 - application/json

OK

A flag controlling how entities are assigned variants.

displayName
string
required

The display name of the flag. For example: my-flag

state
object
required

The current state of the flag.

createTime
object
required

Time when the flag was first created.

updateTime
object
required

Time when the flag was last updated.

creator
string
required

Reference to the identity that created this flag.

updater
string
required

Reference to the identity that last updated this flag.

name
string

The resource name of the flag. For example: flags/my-flag

description
string

A description for the flag.

schema
object

Schema for the value of each variant.

variants
object[]

List of variants for this flag. When a client resolves this flag, it will be assigned exactly one of the variants in this list along with its value.

rules
object[]

List of ordered rules that determines how entities are assigned to variants. When a client resolves this flag, each rule will be tried in order, the first rule that match, will provide a variant assignment. If not rule matches, no variant will be assigned.

clients
string[]

List of clients that this flag is enabled for.

archiveTime
object

Time when the flag was archived.

labels
object[]

General labels for this flag.

usageMetadata
object

Semi-realtime usage statistics for the flag.

owner
string

The owner of the resource. If not set will default to the creator.