Feature Flags
APIs to create and manage Feature Flags
Returns all the Feature Flag details for the given project
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment
PageNumber
PageSize
SortOrder
SortByField
Name of the field
Identifier of the field
Status of the feature flag
Kind of the feature flag
Identifier of a target
Identifier of the target to filter on
Comma separated identifiers for multiple Features
Comma separated identifiers to exclude from the response
Filter for flags based on their status (active,never-requested,recently-accessed,potentially-stale)
Filter for flags based on their lifetime (permanent/temporary)
Filter for flags based on if they are enabled or disabled
Returns counts for the different types of flags e.g num active, potentially-stale, recently-accessed etc
Returns summary info on flags if set to true
Filter for flags based on their tag values supplied as comma separated list
OK
The total number of items
1The total number of pages
100The current page
0The number of items per page
1The version of this object. The version will be incremented each time the object is modified
5Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
GET /gateway/cf/admin/features?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
"itemCount": 1,
"pageCount": 100,
"pageIndex": 0,
"pageSize": 1,
"version": 5,
"featureCounts": {
"totalActive": 5,
"totalAnomaly": 4,
"totalArchived": 10,
"totalEnabled": 2,
"totalFeatures": 10,
"totalPermanent": 7,
"totalPotentiallyStale": 3,
"totalRecentlyAccessed": 2
},
"features": [
{
"archived": false,
"createdAt": 1,
"defaultOffVariation": true,
"defaultOnVariation": true,
"description": "A flag to control a new feature in production",
"envProperties": {
"ccm": {
"anomalies": [
{
"acknowledgedAt": 0,
"anomalyId": "123456",
"costDifference": 123,
"createdAt": 0,
"foundAt": 0,
"isAcknowledged": false,
"status": "found"
}
],
"perspectiveIdentifier": "123456",
"perspectiveName": "myCluster"
},
"defaultServe": {
"distribution": {
"bucketBy": "text",
"variations": [
{
"variation": "off-variation",
"weight": 50
}
]
},
"variation": "text"
},
"environment": "text",
"jiraEnabled": true,
"jiraIssues": [
{
"issueKey": "FFM-7777",
"issueURL": "https://harness-dev1.atlassian.net"
}
],
"modifiedAt": 1,
"offVariation": "text",
"pipelineConfigured": true,
"pipelineDetails": {
"createdAt": 1,
"description": "text",
"identifier": "text",
"lastUpdatedAt": 1,
"name": "text"
},
"pipelineErrorReason": "text",
"pipelineErrorState": true,
"rules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text",
"serve": {
"distribution": {
"bucketBy": "text",
"variations": [
{
"variation": "off-variation",
"weight": 50
}
]
},
"variation": "text"
}
}
],
"state": "on",
"variationMap": [
{
"targetSegments": [
"text"
],
"targets": [
{
"identifier": "text",
"name": "text"
}
],
"variation": "off-variation"
}
],
"version": 1
},
"evaluation": true,
"evaluationIdentifier": "on-variation",
"identifier": "bool-flag",
"kind": "boolean",
"modifiedAt": 1,
"name": "My Boolean Flag",
"owner": "johndoe",
"permanent": true,
"prerequisites": [
{
"feature": "text",
"variations": [
"text"
]
}
],
"project": "test-project",
"results": [
{
"count": 1,
"variationIdentifier": "defaultOnVariation",
"variationName": "Default On Variation"
}
],
"services": [
{
"identifier": "text",
"name": "text"
}
],
"stale": false,
"staleReason": "matched-criteria",
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"variations": [
{
"description": "text",
"identifier": "off-variation",
"name": "Off VAriation",
"value": "true"
}
]
}
]
}Creates a Feature Flag in the Project
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}booleanPossible values: OK
Bad request
Unauthenticated
Unauthorized
The specified resource already exists
An error with git syncing
Internal server error
POST /gateway/cf/admin/features?accountIdentifier=text&orgIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 551
{
"archived": true,
"defaultOffVariation": "text",
"defaultOnVariation": "text",
"description": "text",
"gitDetails": {
"commitMsg": "Turning on flag test-flag for production"
},
"identifier": "text",
"kind": "boolean",
"name": "text",
"owner": "text",
"permanent": true,
"prerequisites": [
{
"feature": "text",
"variations": [
"text"
]
}
],
"project": "text",
"services": [
{
"identifier": "text",
"name": "text"
}
],
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"variations": [
{
"description": "text",
"identifier": "off-variation",
"name": "Off VAriation",
"value": "true"
}
]
}{
"details": {
"governanceMetadata": {},
"pipelineMetadata": {
"pipelineExecutionId": "text",
"pipelineTriggered": true
}
}
}Returns details such as Variation name, identifier etc for the given Feature Flag
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment
Status of the feature flag
OK
A Feature Flag response
Indicates if the flag has been archived and is no longer used
falseThe date the flag was created in milliseconds
The default value returned when a flag is off
trueThe default value returned when a flag is on
trueA description for this flag
A flag to control a new feature in productionThe value that the flag will return for the current user
trueThe identifier for the returned evaluation
on-variationThe Feature Flag identifier
bool-flagThe type of Feature flag
booleanPossible values: The date the flag was last modified in milliseconds
The name of the Feature Flag
My Boolean FlagThe user who created the flag
johndoeIndicates if this is a permanent flag, or one that should expire
trueThe project this Feature belongs to
test-projectWhether the flag is stale or not
falseThe reason that the flag was marked as stale
matched-criteriaUnauthenticated
Unauthorized
The specified resource was not found
Internal server error
GET /gateway/cf/admin/features/{identifier}?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
"archived": false,
"createdAt": 1,
"defaultOffVariation": true,
"defaultOnVariation": true,
"description": "A flag to control a new feature in production",
"envProperties": {
"ccm": {
"anomalies": [
{
"acknowledgedAt": 0,
"anomalyId": "123456",
"costDifference": 123,
"createdAt": 0,
"foundAt": 0,
"isAcknowledged": false,
"status": "found"
}
],
"perspectiveIdentifier": "123456",
"perspectiveName": "myCluster"
},
"defaultServe": {
"distribution": {
"bucketBy": "text",
"variations": [
{
"variation": "off-variation",
"weight": 50
}
]
},
"variation": "text"
},
"environment": "text",
"jiraEnabled": true,
"jiraIssues": [
{
"issueKey": "FFM-7777",
"issueURL": "https://harness-dev1.atlassian.net"
}
],
"modifiedAt": 1,
"offVariation": "text",
"pipelineConfigured": true,
"pipelineDetails": {
"createdAt": 1,
"description": "text",
"identifier": "text",
"lastUpdatedAt": 1,
"name": "text"
},
"pipelineErrorReason": "text",
"pipelineErrorState": true,
"rules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text",
"serve": {
"distribution": {
"bucketBy": "text",
"variations": [
{
"variation": "off-variation",
"weight": 50
}
]
},
"variation": "text"
}
}
],
"state": "on",
"variationMap": [
{
"targetSegments": [
"text"
],
"targets": [
{
"identifier": "text",
"name": "text"
}
],
"variation": "off-variation"
}
],
"version": 1
},
"evaluation": true,
"evaluationIdentifier": "on-variation",
"identifier": "bool-flag",
"kind": "boolean",
"modifiedAt": 1,
"name": "My Boolean Flag",
"owner": "johndoe",
"permanent": true,
"prerequisites": [
{
"feature": "text",
"variations": [
"text"
]
}
],
"project": "test-project",
"results": [
{
"count": 1,
"variationIdentifier": "defaultOnVariation",
"variationName": "Default On Variation"
}
],
"services": [
{
"identifier": "text",
"name": "text"
}
],
"stale": false,
"staleReason": "matched-criteria",
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"variations": [
{
"description": "text",
"identifier": "off-variation",
"name": "Off VAriation",
"value": "true"
}
]
}Updates a Feature Flag in the Project
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
OK
Bad request
Unauthenticated
Unauthorized
The specified resource was not found
The specified resource already exists
An error with git syncing
Internal server error
PUT /gateway/cf/admin/features/{identifier}?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 527
{
"defaultOffVariation": "text",
"defaultOnVariation": "text",
"description": "text",
"environments": [
{
"defaultOffVariation": "red",
"defaultOnVariation": "blue",
"identifier": "env1",
"rules": [
{
"targets": [
"target1",
"target2"
],
"variation": true
}
],
"state": "on"
}
],
"gitDetails": {
"commitMsg": "Turning on flag test-flag for production"
},
"name": "text",
"permanent": true,
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"variations": [
{
"description": "text",
"identifier": "off-variation",
"name": "Off VAriation",
"value": "true"
}
]
}{
"details": {
"governanceMetadata": {},
"pipelineMetadata": {
"pipelineExecutionId": "text",
"pipelineTriggered": true
}
}
}Delete Feature Flag for the given identifier and account ID
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Git commit message
Permanently deletes the the feature flag
No content
No content
Bad request
Unauthenticated
Unauthorized
The specified resource was not found
An error with git syncing
Internal server error
DELETE /gateway/cf/admin/features/{identifier}?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
No content
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" } }
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment
A comment explaining the reason for this patch operation
This is a comment stringTime of execution in unix epoch milliseconds when the scheduled changes will be applied
OK
Bad request
Unauthenticated
Unauthorized
The specified resource was not found
The specified resource already exists
An error with git syncing
Internal server error
PATCH /gateway/cf/admin/features/{identifier}?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 3477
{
"gitDetails": {
"commitMsg": "Making some changes"
},
"instructions": [
{
"kind": "updateName",
"parameters": {
"name": "Updated Name"
}
},
{
"kind": "updateDescription",
"parameters": {
"description": "Updated Description"
}
},
{
"kind": "addPrerequisite",
"parameters": {
"feature": "feature1",
"variations": [
"variation1",
"variation2"
]
}
},
{
"kind": "updatePrerequisite",
"parameters": {
"feature": "feature1",
"variations": [
"variation1"
]
}
},
{
"kind": "removePrerequisite",
"parameters": {
"feature": "feature1"
}
},
{
"kind": "addVariation",
"parameters": {
"description": "Variation 1 description",
"identifier": "variation_1",
"name": "variation1",
"value": "v1"
}
},
{
"kind": "updateVariation",
"parameters": {
"description": "Variation 1 description",
"identifier": "variation_1",
"name": "variation1",
"value": "v1"
}
},
{
"kind": "deleteVariation",
"parameters": {
"identifier": "variation_1"
}
},
{
"kind": "setDefaultOnVariation",
"parameters": {
"identifier": "variation_1"
}
},
{
"kind": "setDefaultOffVariation",
"parameters": {
"identifier": "variation_1"
}
},
{
"kind": "addTag",
"parameters": {
"name": "TagName",
"value": "TagValue"
}
},
{
"kind": "updateTag",
"parameters": {
"name": "TagName",
"value": "TagValue"
}
},
{
"kind": "removeTag",
"parameters": {
"name": "TagName",
"value": "TagValue"
}
},
{
"kind": "setFeatureFlagState",
"parameters": {
"state": "on"
}
},
{
"kind": "setFeatureFlagState",
"parameters": {
"state": "off"
}
},
{
"kind": "addTargetsToVariationTargetMap",
"parameters": {
"targets": [
"target1-identifier",
"target2-identifier"
],
"variation": "variation-identifier"
}
},
{
"kind": "removeTargetsToVariationTargetMap",
"parameters": {
"targets": [
"target1-identifier",
"target2-identifier"
],
"variation": "variation-identifier"
}
},
{
"kind": "addSegmentToVariationTargetMap",
"parameters": {
"targetSegments": [
"segment1",
"segment2"
],
"variation": "variation-identifier"
}
},
{
"kind": "removeSegmentToVariationTargetMap",
"parameters": {
"targetSegments": [
"segment3",
"segment4"
],
"variation": "variation-identifier"
}
},
{
"kind": "clearVariationTargetMapping",
"parameters": {
"variation": "variation-identifier"
}
},
{
"kind": "addRule",
"parameters": {
"clauses": [
{
"attribute": "email",
"op": "eq",
"values": [
"user1@gmail.com",
"user2@gmail.com"
]
}
],
"priority": 1,
"serve": {
"variation": "variation1"
},
"uuid": "fd2ebf1f-7efb-4324-a7ee-6de0a47bf826"
}
},
{
"kind": "removeRule",
"parameters": {
"ruleID": "testRuleID"
}
},
{
"kind": "addClause",
"parameters": {
"clause": {
"attribute": "email",
"op": "eq",
"values": [
"user1@gmail.com",
"user2@gmail.com"
]
},
"ruleID": "testRuleID"
}
},
{
"kind": "removeClause",
"parameters": {
"clauseID": "testClauseID",
"ruleID": "testRuleID"
}
},
{
"kind": "updateClause",
"parameters": {
"clause": [
{
"attribute": "email",
"op": "eq",
"values": [
"user1@gmail.com",
"user2@gmail.com"
]
}
],
"clauseID": "testClauseID",
"ruleID": "testRuleID"
}
},
{
"kind": "reorderRules",
"parameters": {
"rules": [
"rule1",
"rule2",
"rule3"
]
}
},
{
"kind": "updateDefaultServe",
"parameters": {
"bucketBy": "accountID",
"variations": [
{
"variation": "variation1",
"weight": 30
},
{
"variation": "variation2",
"weight": 60
},
{
"variation": "variation3",
"weight": 10
}
]
}
},
{
"kind": "updateRule",
"parameters": {
"ruleID": "testRuleID",
"variation": "variation1"
}
},
{
"kind": "updateRule",
"parameters": {
"bucketBy": "accountID",
"ruleID": "testRuleID",
"variations": [
{
"variation": "variation1",
"weight": 30
},
{
"variation": "variation2",
"weight": 60.66
},
{
"variation": "variation3",
"weight": 10.01
}
]
}
},
{
"kind": "updateDefaultServe",
"parameters": {
"variation": "variation1"
}
},
{
"kind": "updateOffVariation",
"parameters": {
"variation": "variation1"
}
},
{
"Kind": "updateArchived",
"parameters": {
"archived": true
}
},
{
"Kind": "updatePermanent",
"parameters": {
"permanent": true
}
}
]
}{
"details": {
"governanceMetadata": {},
"pipelineMetadata": {
"pipelineExecutionId": "text",
"pipelineTriggered": true
}
}
}Given identifier return list all the flags which depend on it.
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment
PageNumber
PageSize
SortOrder
SortByField
Name of the field
Status of the feature flag
Kind of the feature flag
Identifier of a target
Identifier of the target to filter on
Parameter to indicate if metrics data is requested in response
Comma separated identifiers for multiple Features
Comma separated identifiers to exclude from the response
Filter for flags based on their status (active,never-requested,recently-accessed,potentially-stale)
Filter for flags based on their lifetime (permanent/temporary)
Filter for flags based on if they are enabled or disabled
Returns counts for the different types of flags e.g num active, potentially-stale, recently-accessed etc
Returns summary info on flags if set to true
Filter for flags based on their tag values supplied as comma separated list
OK
The total number of items
1The total number of pages
100The current page
0The number of items per page
1The version of this object. The version will be incremented each time the object is modified
5Bad request
Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
GET /gateway/cf/admin/features/{identifier}/dependants?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
"itemCount": 1,
"pageCount": 100,
"pageIndex": 0,
"pageSize": 1,
"version": 5,
"featureCounts": {
"totalActive": 5,
"totalAnomaly": 4,
"totalArchived": 10,
"totalEnabled": 2,
"totalFeatures": 10,
"totalPermanent": 7,
"totalPotentiallyStale": 3,
"totalRecentlyAccessed": 2
},
"features": [
{
"archived": false,
"createdAt": 1,
"defaultOffVariation": true,
"defaultOnVariation": true,
"description": "A flag to control a new feature in production",
"envProperties": {
"ccm": {
"anomalies": [
{
"acknowledgedAt": 0,
"anomalyId": "123456",
"costDifference": 123,
"createdAt": 0,
"foundAt": 0,
"isAcknowledged": false,
"status": "found"
}
],
"perspectiveIdentifier": "123456",
"perspectiveName": "myCluster"
},
"defaultServe": {
"distribution": {
"bucketBy": "text",
"variations": [
{
"variation": "off-variation",
"weight": 50
}
]
},
"variation": "text"
},
"environment": "text",
"jiraEnabled": true,
"jiraIssues": [
{
"issueKey": "FFM-7777",
"issueURL": "https://harness-dev1.atlassian.net"
}
],
"modifiedAt": 1,
"offVariation": "text",
"pipelineConfigured": true,
"pipelineDetails": {
"createdAt": 1,
"description": "text",
"identifier": "text",
"lastUpdatedAt": 1,
"name": "text"
},
"pipelineErrorReason": "text",
"pipelineErrorState": true,
"rules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text",
"serve": {
"distribution": {
"bucketBy": "text",
"variations": [
{
"variation": "off-variation",
"weight": 50
}
]
},
"variation": "text"
}
}
],
"state": "on",
"variationMap": [
{
"targetSegments": [
"text"
],
"targets": [
{
"identifier": "text",
"name": "text"
}
],
"variation": "off-variation"
}
],
"version": 1
},
"evaluation": true,
"evaluationIdentifier": "on-variation",
"identifier": "bool-flag",
"kind": "boolean",
"modifiedAt": 1,
"name": "My Boolean Flag",
"owner": "johndoe",
"permanent": true,
"prerequisites": [
{
"feature": "text",
"variations": [
"text"
]
}
],
"project": "test-project",
"results": [
{
"count": 1,
"variationIdentifier": "defaultOnVariation",
"variationName": "Default On Variation"
}
],
"services": [
{
"identifier": "text",
"name": "text"
}
],
"stale": false,
"staleReason": "matched-criteria",
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"variations": [
{
"description": "text",
"identifier": "off-variation",
"name": "Off VAriation",
"value": "true"
}
]
}
]
}Restore Feature Flag for the given identifier and account ID
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Git commit message
No content
No content
Bad request
Unauthenticated
Unauthorized
The specified resource was not found
An error with git syncing
Internal server error
POST /gateway/cf/admin/features/{identifier}/restore?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
No content
Last updated
Was this helpful?