Creates a Feature Flag in the Project
read
write
) Created
Bad request
Unauthenticated
Unauthorized
The specified resource already exists
An error with git syncing
Internal server error
{- "archived": true,
- "defaultOffVariation": "string",
- "defaultOnVariation": "string",
- "description": "string",
- "gitDetails": {
- "commitMsg": "Turning on flag test-flag for production"
}, - "identifier": "string",
- "kind": "boolean",
- "name": "string",
- "owner": "string",
- "permanent": true,
- "prerequisites": [
- {
- "feature": "string",
- "variations": [
- "string"
]
}
], - "project": "string",
- "tags": [
- {
- "name": "string",
- "value": "string"
}
], - "variations": [
- {
- "description": "string",
- "identifier": "off-variation",
- "name": "Off VAriation",
- "value": true
}, - {
- "description": "string",
- "identifier": "off-variation",
- "name": "Off VAriation",
- "value": true
}
]
}
{- "code": 404,
- "details": { },
- "message": "Error retrieving projects, organization 'default_org' does not exist"
}
Delete Feature Flag for the given identifier and account ID
read
write
) No content
Unauthenticated
Unauthorized
The specified resource was not found
An error with git syncing
Internal server error
curl -i -X DELETE \ 'https://app.harness.io/gateway/cf/admin/features/{identifier}?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&commitMsg=string' \ -H 'x-api-key: YOUR_API_KEY_HERE'
{- "code": 404,
- "details": { },
- "message": "Error retrieving projects, organization 'default_org' does not exist"
}
Returns details such as Variation name, identifier etc for the given Feature Flag
read
write
) OK
Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
curl -i -X GET \ 'https://app.harness.io/gateway/cf/admin/features/{identifier}?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&environmentIdentifier=string' \ -H 'x-api-key: YOUR_API_KEY_HERE'
{- "archived": false,
- "createdAt": 0,
- "defaultOffVariation": true,
- "defaultOnVariation": true,
- "description": "A flag to control a new feature in production",
- "envProperties": {
- "defaultServe": {
- "distribution": {
- "bucketBy": "string",
- "variations": [
- {
- "variation": "off-variation",
- "weight": 50
}
]
}, - "variation": "string"
}, - "environment": "string",
- "modifiedAt": 0,
- "offVariation": "string",
- "rules": [
- {
- "clauses": [
- {
- "attribute": "identifier",
- "id": 32434243,
- "negate": false,
- "op": "starts_with",
- "values": [
- "string"
]
}
], - "priority": 1,
- "ruleId": "string",
- "serve": {
- "distribution": {
- "bucketBy": "string",
- "variations": [
- {
- "variation": null,
- "weight": null
}
]
}, - "variation": "string"
}
}
], - "state": "on",
- "variationMap": [
- {
- "targetSegments": [
- "string"
], - "targets": [
- {
- "identifier": "string",
- "name": "string"
}
], - "variation": "off-variation"
}
], - "version": 0
}, - "evaluation": true,
- "evaluationIdentifier": "on-variation",
- "identifier": "bool-flag",
- "kind": "boolean",
- "modifiedAt": 0,
- "name": "My Boolean Flag",
- "owner": "johndoe",
- "permanent": true,
- "prerequisites": [
- {
- "feature": "string",
- "variations": [
- "string"
]
}
], - "project": "test-project",
- "results": [
- {
- "count": 0,
- "variationIdentifier": "defaultOnVariation",
- "variationName": "Default On Variation"
}
], - "status": {
- "lastAccess": 0,
- "status": "active"
}, - "tags": [
- {
- "name": "string",
- "value": "string"
}
], - "variations": [
- {
- "description": "string",
- "identifier": "off-variation",
- "name": "Off VAriation",
- "value": true
}, - {
- "description": "string",
- "identifier": "off-variation",
- "name": "Off VAriation",
- "value": true
}
]
}
Returns all the Feature Flag details for the given project
read
write
) OK
Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
curl -i -X GET \ 'https://app.harness.io/gateway/cf/admin/features?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&environmentIdentifier=string&pageNumber=0&pageSize=0&sortOrder=ASCENDING&sortByField=name&name=string&identifier=string&archived=true&kind=json&targetIdentifier=string&metrics=true&featureIdentifiers=string&excludedFeatures=string' \ -H 'x-api-key: YOUR_API_KEY_HERE'
{- "itemCount": 1,
- "pageCount": 100,
- "pageIndex": 0,
- "pageSize": 1,
- "version": 5,
- "features": [
- {
- "archived": false,
- "createdAt": 0,
- "defaultOffVariation": true,
- "defaultOnVariation": true,
- "description": "A flag to control a new feature in production",
- "envProperties": {
- "defaultServe": {
- "distribution": {
- "bucketBy": "string",
- "variations": [
- {
- "variation": null,
- "weight": null
}
]
}, - "variation": "string"
}, - "environment": "string",
- "modifiedAt": 0,
- "offVariation": "string",
- "rules": [
- {
- "clauses": [
- {
- "attribute": null,
- "id": null,
- "negate": null,
- "op": null,
- "values": [ ]
}
], - "priority": 1,
- "ruleId": "string",
- "serve": {
- "distribution": {
- "bucketBy": null,
- "variations": [ ]
}, - "variation": "string"
}
}
], - "state": "on",
- "variationMap": [
- {
- "targetSegments": [
- "string"
], - "targets": [
- {
- "identifier": null,
- "name": null
}
], - "variation": "off-variation"
}
], - "version": 0
}, - "evaluation": true,
- "evaluationIdentifier": "on-variation",
- "identifier": "bool-flag",
- "kind": "boolean",
- "modifiedAt": 0,
- "name": "My Boolean Flag",
- "owner": "johndoe",
- "permanent": true,
- "prerequisites": [
- {
- "feature": "string",
- "variations": [
- "string"
]
}
], - "project": "test-project",
- "results": [
- {
- "count": 0,
- "variationIdentifier": "defaultOnVariation",
- "variationName": "Default On Variation"
}
], - "status": {
- "lastAccess": 0,
- "status": "active"
}, - "tags": [
- {
- "name": "string",
- "value": "string"
}
], - "variations": [
- {
- "description": "string",
- "identifier": "off-variation",
- "name": "Off VAriation",
- "value": true
}, - {
- "description": "string",
- "identifier": "off-variation",
- "name": "Off VAriation",
- "value": true
}
]
}
]
}
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" } }
read
write
) OK
Bad request
Unauthenticated
Unauthorized
The specified resource was not found
The specified resource already exists
An error with git syncing
Internal server error
{- "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": {
- "priority": 1,
- "serve": {
- "variation": "variation1"
}, - "uuid": "fd2ebf1f-7efb-4324-a7ee-6de0a47bf826"
}
}, - {
- "kind": "removeRule",
- "parameters": {
- "ruleID": "testRuleID"
}
}, - {
- "kind": "addClause",
- "parameters": {
- "ruleID": "testRuleID"
}
}, - {
- "kind": "removeClause",
- "parameters": {
- "clauseID": "testClauseID",
- "ruleID": "testRuleID"
}
}, - {
- "kind": "updateClause",
- "parameters": {
- "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
}
}
]
}
{- "archived": false,
- "createdAt": 0,
- "defaultOffVariation": true,
- "defaultOnVariation": true,
- "description": "A flag to control a new feature in production",
- "envProperties": {
- "defaultServe": {
- "distribution": {
- "bucketBy": "string",
- "variations": [
- {
- "variation": "off-variation",
- "weight": 50
}
]
}, - "variation": "string"
}, - "environment": "string",
- "modifiedAt": 0,
- "offVariation": "string",
- "rules": [
- {
- "clauses": [
- {
- "attribute": "identifier",
- "id": 32434243,
- "negate": false,
- "op": "starts_with",
- "values": [
- "string"
]
}
], - "priority": 1,
- "ruleId": "string",
- "serve": {
- "distribution": {
- "bucketBy": "string",
- "variations": [
- {
- "variation": null,
- "weight": null
}
]
}, - "variation": "string"
}
}
], - "state": "on",
- "variationMap": [
- {
- "targetSegments": [
- "string"
], - "targets": [
- {
- "identifier": "string",
- "name": "string"
}
], - "variation": "off-variation"
}
], - "version": 0
}, - "evaluation": true,
- "evaluationIdentifier": "on-variation",
- "identifier": "bool-flag",
- "kind": "boolean",
- "modifiedAt": 0,
- "name": "My Boolean Flag",
- "owner": "johndoe",
- "permanent": true,
- "prerequisites": [
- {
- "feature": "string",
- "variations": [
- "string"
]
}
], - "project": "test-project",
- "results": [
- {
- "count": 0,
- "variationIdentifier": "defaultOnVariation",
- "variationName": "Default On Variation"
}
], - "status": {
- "lastAccess": 0,
- "status": "active"
}, - "tags": [
- {
- "name": "string",
- "value": "string"
}
], - "variations": [
- {
- "description": "string",
- "identifier": "off-variation",
- "name": "Off VAriation",
- "value": true
}, - {
- "description": "string",
- "identifier": "off-variation",
- "name": "Off VAriation",
- "value": true
}
]
}