Feature Flags

APIs to create and manage Feature Flags

Returns all Feature Flags for the project

Returns all the Feature Flag details for the given project

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier

Examples:
accountIdentifier=default
orgIdentifier
required
string

Organization Identifier

Examples:
orgIdentifier=default_org
projectIdentifier
required
string

The Project identifier

environmentIdentifier
string

Environment

pageNumber
integer

PageNumber

pageSize
integer

PageSize

sortOrder
string

SortOrder

Enum: "ASCENDING" "DESCENDING"
sortByField
string

SortByField

Enum: "name" "identifier" "archived" "kind" "modifiedAt"
name
string

Name of the field

identifier
string

Identifier of the field

archived
boolean

Status of the feature flag

kind
string

Kind of the feature flag

Enum: "json" "string" "int" "boolean"
targetIdentifier
string

Identifier of a target

targetIdentifierFilter
string

Identifier of the target to filter on

metrics
boolean

Parameter to indicate if metrics data is requested in response

featureIdentifiers
string

Comma separated identifiers for multiple Features

excludedFeatures
string

Comma separated identifiers to exclude from the response

status
string

Filter for flags based on their status (active,never-requested,recently-accessed,potentially-stale)

lifetime
string

Filter for flags based on their lifetime (permanent/temporary)

enabled
boolean

Filter for flags based on if they are enabled or disabled

flagCounts
boolean

Returns counts for the different types of flags e.g num active, potentially-stale, recently-accessed etc

summary
boolean

Returns summary info on flags if set to true

tags
string

Filter for flags based on their tag values supplied as comma separated list

Responses
200

OK

401

Unauthenticated

403

Unauthorized

404

The specified resource was not found

500

Internal server error

get/cf/admin/features
Request samples
Response samples
application/json
{
  • "itemCount": 1,
  • "pageCount": 100,
  • "pageIndex": 0,
  • "pageSize": 1,
  • "version": 5,
  • "featureCounts": {
    },
  • "features": [
    ]
}

Creates a Feature Flag

Creates a Feature Flag in the Project

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier

Examples:
accountIdentifier=default
orgIdentifier
required
string

Organization Identifier

Examples:
orgIdentifier=default_org
Request Body schema: application/json
archived
boolean
defaultOffVariation
required
string
defaultOnVariation
required
string
description
string
object (CfGitDetails)

The commit message to use as part of a gitsync operation

identifier
required
string
kind
required
string (FeatureFlagRequestKind)
Enum: "boolean" "int" "string" "json"
name
required
string
owner
string
permanent
required
boolean
Array of objects (Prerequisite)
project
required
string
Array of objects (CfService)
Array of objects (Tag)
required
Array of objects (Variation) >= 2 items
Responses
201

OK

400

Bad request

401

Unauthenticated

403

Unauthorized

409

The specified resource already exists

424

An error with git syncing

500

Internal server error

post/cf/admin/features
Request samples
application/json
{
  • "archived": true,
  • "defaultOffVariation": "string",
  • "defaultOnVariation": "string",
  • "description": "string",
  • "gitDetails": {
    },
  • "identifier": "string",
  • "kind": "boolean",
  • "name": "string",
  • "owner": "string",
  • "permanent": true,
  • "prerequisites": [
    ],
  • "project": "string",
  • "services": [
    ],
  • "tags": [
    ],
  • "variations": [
    ]
}
Response samples
application/json
{
  • "details": {
    }
}

Delete a Feature Flag

Delete Feature Flag for the given identifier and account ID

Securityx-api-key
Request
path Parameters
identifier
required
string

Unique identifier for the object in the API.

query Parameters
accountIdentifier
required
string

Account Identifier

Examples:
accountIdentifier=default
orgIdentifier
required
string

Organization Identifier

Examples:
orgIdentifier=default_org
projectIdentifier
required
string

The Project identifier

commitMsg
string

Git commit message

forceDelete
boolean

Permanently deletes the the feature flag

Responses
204

No content

400

Bad request

401

Unauthenticated

403

Unauthorized

404

The specified resource was not found

424

An error with git syncing

500

Internal server error

delete/cf/admin/features/{identifier}
Request samples
Response samples
application/json
{
  • "code": 404,
  • "details": { },
  • "message": "Error retrieving projects, organization 'default_org' does not exist"
}

Returns a Feature Flag

Returns details such as Variation name, identifier etc for the given Feature Flag

Securityx-api-key
Request
path Parameters
identifier
required
string

Unique identifier for the object in the API.

query Parameters
accountIdentifier
required
string

Account Identifier

Examples:
accountIdentifier=default
orgIdentifier
required
string

Organization Identifier

Examples:
orgIdentifier=default_org
projectIdentifier
required
string

The Project identifier

environmentIdentifier
string

Environment

metrics
boolean

Parameter to indicate if metrics data is requested in response

archived
boolean

Status of the feature flag

Responses
200

OK

401

Unauthenticated

403

Unauthorized

404

The specified resource was not found

500

Internal server error

get/cf/admin/features/{identifier}
Request samples
Response samples
application/json
{
  • "archived": false,
  • "createdAt": 0,
  • "defaultOffVariation": true,
  • "defaultOnVariation": true,
  • "description": "A flag to control a new feature in production",
  • "envProperties": {
    },
  • "evaluation": true,
  • "evaluationIdentifier": "on-variation",
  • "identifier": "bool-flag",
  • "kind": "boolean",
  • "modifiedAt": 0,
  • "name": "My Boolean Flag",
  • "owner": "johndoe",
  • "permanent": true,
  • "prerequisites": [
    ],
  • "project": "test-project",
  • "results": [
    ],
  • "services": [
    ],
  • "stale": false,
  • "staleReason": "matched-criteria",
  • "status": {
    },
  • "tags": [
    ],
  • "variations": [
    ]
}

Updates a Feature Flag

This operation is used to modify a Feature Flag. The request body can include one or more instructions that can modify flag attributes such as the state (off|on), the variations that are returned and serving rules. For example if you want to turn a flag off you can use this opeartion and send the setFeatureFlagState

{ "kind": "setFeatureFlagState", "parameters": { "state": "off" } }

Securityx-api-key
Request
path Parameters
identifier
required
string

Unique identifier for the object in the API.

query Parameters
accountIdentifier
required
string

Account Identifier

Examples:
accountIdentifier=default
orgIdentifier
required
string

Organization Identifier

Examples:
orgIdentifier=default_org
projectIdentifier
required
string

The Project identifier

environmentIdentifier
string

Environment

Request Body schema: application/json
comment
string

A comment explaining the reason for this patch operation

executionTime
integer

Time of execution in unix epoch milliseconds when the scheduled changes will be applied

object (CfGitDetails)

The commit message to use as part of a gitsync operation

required
Array of objects (PatchInstruction)

A list of Patch Instructions

Responses
200

OK

400

Bad request

401

Unauthenticated

403

Unauthorized

404

The specified resource was not found

409

The specified resource already exists

424

An error with git syncing

500

Internal server error

patch/cf/admin/features/{identifier}
Request samples
application/json
{
  • "gitDetails": {
    },
  • "instructions": [
    ]
}
Response samples
application/json
{
  • "details": {
    }
}

Updates a Feature Flag

Updates a Feature Flag in the Project

Securityx-api-key
Request
path Parameters
identifier
required
string

Unique identifier for the object in the API.

query Parameters
accountIdentifier
required
string

Account Identifier

Examples:
accountIdentifier=default
orgIdentifier
required
string

Organization Identifier

Examples:
orgIdentifier=default_org
projectIdentifier
required
string

The Project identifier

Request Body schema: application/json
defaultOffVariation
string
defaultOnVariation
string
description
string
Array of objects (ActivationUpdate)
object (CfGitDetails)

The commit message to use as part of a gitsync operation

name
string
permanent
boolean
Array of objects (Tag)
Array of objects (Variation) >= 2 items
Responses
200

OK

400

Bad request

401

Unauthenticated

403

Unauthorized

404

The specified resource was not found

409

The specified resource already exists

424

An error with git syncing

500

Internal server error

put/cf/admin/features/{identifier}
Request samples
application/json
{
  • "defaultOffVariation": "string",
  • "defaultOnVariation": "string",
  • "description": "string",
  • "environments": [
    ],
  • "gitDetails": {
    },
  • "name": "string",
  • "permanent": true,
  • "tags": [
    ],
  • "variations": [
    ]
}
Response samples
application/json
{
  • "details": {
    }
}

Return a list of dependant flags

Given identifier return list all the flags which depend on it.

Securityx-api-key
Request
path Parameters
identifier
required
string

Unique identifier for the object in the API.

query Parameters
accountIdentifier
required
string

Account Identifier

Examples:
accountIdentifier=default
orgIdentifier
required
string

Organization Identifier

Examples:
orgIdentifier=default_org
projectIdentifier
required
string

The Project identifier

environmentIdentifier
string

Environment

pageNumber
integer

PageNumber

pageSize
integer

PageSize

sortOrder
string

SortOrder

Enum: "ASCENDING" "DESCENDING"
sortByField
string

SortByField

Enum: "name" "identifier" "archived" "kind" "modifiedAt"
name
string

Name of the field

archived
boolean

Status of the feature flag

kind
string

Kind of the feature flag

Enum: "json" "string" "int" "boolean"
targetIdentifier
string

Identifier of a target

targetIdentifierFilter
string

Identifier of the target to filter on

metrics
boolean

Parameter to indicate if metrics data is requested in response

featureIdentifiers
string

Comma separated identifiers for multiple Features

excludedFeatures
string

Comma separated identifiers to exclude from the response

status
string

Filter for flags based on their status (active,never-requested,recently-accessed,potentially-stale)

lifetime
string

Filter for flags based on their lifetime (permanent/temporary)

enabled
boolean

Filter for flags based on if they are enabled or disabled

flagCounts
boolean

Returns counts for the different types of flags e.g num active, potentially-stale, recently-accessed etc

summary
boolean

Returns summary info on flags if set to true

tags
string

Filter for flags based on their tag values supplied as comma separated list

Responses
200

OK

400

Bad request

401

Unauthenticated

403

Unauthorized

404

The specified resource was not found

500

Internal server error

get/cf/admin/features/{identifier}/dependants
Request samples
Response samples
application/json
{
  • "itemCount": 1,
  • "pageCount": 100,
  • "pageIndex": 0,
  • "pageSize": 1,
  • "version": 5,
  • "featureCounts": {
    },
  • "features": [
    ]
}

Restore a Feature Flag

Restore Feature Flag for the given identifier and account ID

Securityx-api-key
Request
path Parameters
identifier
required
string

Unique identifier for the object in the API.

query Parameters
accountIdentifier
required
string

Account Identifier

Examples:
accountIdentifier=default
orgIdentifier
required
string

Organization Identifier

Examples:
orgIdentifier=default_org
projectIdentifier
required
string

The Project identifier

commitMsg
string

Git commit message

Responses
204

No content

400

Bad request

401

Unauthenticated

403

Unauthorized

404

The specified resource was not found

424

An error with git syncing

500

Internal server error

post/cf/admin/features/{identifier}/restore
Request samples
Response samples
application/json
{
  • "code": 404,
  • "details": { },
  • "message": "Error retrieving projects, organization 'default_org' does not exist"
}