POST
/
api
/
v1
/
namespaces
/
{namespaceKey}
/
flags
/
{flagKey}
/
rules
curl --request POST \
  --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rules \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data '{
  "rank": 1,
  "segmentKey": "<segmentkey>"
}'
{
  "id": "<string>",
  "namespaceKey": "<string>",
  "flagKey": "<string>",
  "segmentKey": "<string>",
  "segmentKeys": [
    "<string>"
  ],
  "segmentOperator": "OR_SEGMENT_OPERATOR",
  "distributions": [
    {
      "id": "<string>",
      "ruleId": "<string>",
      "variantId": "<string>",
      "rollout": 123,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "rank": 123,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
headerrequired

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

Path Parameters

namespaceKey
string
required
flagKey
string
required

Body

application/json
segmentKey
string
required
segmentKeys
string[]
segmentOperator
enum<string>
Available options:
OR_SEGMENT_OPERATOR,
AND_SEGMENT_OPERATOR
rank
integer
required

Response

200 - application/json
id
string
required
namespaceKey
string
required
flagKey
string
required
segmentKey
string
required
segmentKeys
string[]
segmentOperator
enum<string>
required
Available options:
OR_SEGMENT_OPERATOR,
AND_SEGMENT_OPERATOR
distributions
object[]
required
rank
integer
required
createdAt
string
required
updatedAt
string
required