Feature Flags

APIs to create and manage Feature Flags

Creates a Feature Flag

Creates a Feature Flag in the Project

SecurityApiKey
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 (GitDetails)

The commit message to use as part of a gitsync operation

identifier
required
string
kind
required
string
Enum: "boolean" "int" "string" "json"
name
required
string
owner
string
permanent
required
boolean
Array of objects (Prerequisite)
project
required
string
Array of objects (Service)
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

SecurityApiKey
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

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

SecurityApiKey
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

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": [
    ],
  • "status": {
    },
  • "tags": [
    ],
  • "variations": [
    ]
}

Returns all Feature Flags for the project

Returns all the Feature Flag details for the given project

SecurityApiKey
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

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": [
    ]
}

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" } }

SecurityApiKey
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 (GitDetails)

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": {
    }
}