Target Groups
APIs to create and manage Feature Flag Target Groups
Returns Target Group details for the given account
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}Environment Identifier
The Project identifier
PageNumber
PageSize
SortOrder
SortByField
Name of the field
Identifier of the field
When set to rules=v2 will return AND rule compatible serving_rules field. When not set or set to any other value will return old rules field only compatible with OR rules.
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
Internal server error
GET /gateway/cf/admin/segments?accountIdentifier=text&orgIdentifier=text&environmentIdentifier=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,
"segments": [
{
"createdAt": 1,
"environment": "Production",
"excluded": [
{
"account": "abcXDdffdaffd",
"anonymous": true,
"attributes": {
"age": 20,
"location": "Belfast"
},
"createdAt": 1,
"environment": "text",
"identifier": "john-doe",
"name": "John Doe",
"org": "text",
"project": "text",
"segments": "[Circular Reference]"
}
],
"identifier": "text",
"included": [
{
"account": "abcXDdffdaffd",
"anonymous": true,
"attributes": {
"age": 20,
"location": "Belfast"
},
"createdAt": 1,
"environment": "text",
"identifier": "john-doe",
"name": "John Doe",
"org": "text",
"project": "text",
"segments": "[Circular Reference]"
}
],
"modifiedAt": 1,
"name": "Beta Testers",
"rules": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"servingRules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text"
}
],
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"version": 1
}
]
}Creates a Target Group in the given Project
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}beta-testersName of the target segment.
Beta TestersCreated
No content
Bad request
Unauthenticated
Unauthorized
The specified resource already exists
Internal server error
POST /gateway/cf/admin/segments?accountIdentifier=text&orgIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 458
{
"environment": "text",
"excluded": [
"text"
],
"identifier": "beta-testers",
"included": [
"text"
],
"name": "Beta Testers",
"project": "text",
"rules": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"servingRules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text"
}
],
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
]
}No content
Returns Target Group details for the given ID
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment Identifier
When set to rules=v2 will return AND rule compatible serving_rules field. When not set or set to any other value will return old rules field only compatible with OR rules.
OK
A Target Group (Segment) response
The data and time in milliseconds when the group was created
The environment this target group belongs to
ProductionUnique identifier for the target group.
The data and time in milliseconds when the group was last modified
Name of the target group.
Beta TestersThe version of this group. Each time it is modified the version is incremented
1Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
GET /gateway/cf/admin/segments/{identifier}?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text&environmentIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
"createdAt": 1,
"environment": "Production",
"excluded": [
{
"account": "abcXDdffdaffd",
"anonymous": true,
"attributes": {
"age": 20,
"location": "Belfast"
},
"createdAt": 1,
"environment": "text",
"identifier": "john-doe",
"name": "John Doe",
"org": "text",
"project": "text",
"segments": [
{
"createdAt": 1,
"environment": "Production",
"excluded": [
"[Circular Reference]"
],
"identifier": "text",
"included": [
"[Circular Reference]"
],
"modifiedAt": 1,
"name": "Beta Testers",
"rules": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"servingRules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text"
}
],
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"version": 1
}
]
}
],
"identifier": "text",
"included": [
{
"account": "abcXDdffdaffd",
"anonymous": true,
"attributes": {
"age": 20,
"location": "Belfast"
},
"createdAt": 1,
"environment": "text",
"identifier": "john-doe",
"name": "John Doe",
"org": "text",
"project": "text",
"segments": [
{
"createdAt": 1,
"environment": "Production",
"excluded": [
"[Circular Reference]"
],
"identifier": "text",
"included": [
"[Circular Reference]"
],
"modifiedAt": 1,
"name": "Beta Testers",
"rules": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"servingRules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text"
}
],
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"version": 1
}
]
}
],
"modifiedAt": 1,
"name": "Beta Testers",
"rules": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"servingRules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text"
}
],
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"version": 1
}Deletes a Target Group for the given ID
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment Identifier
No content
No content
Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
DELETE /gateway/cf/admin/segments/{identifier}?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text&environmentIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
No content
Updates a Target Group for the given identifier
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment Identifier
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
A Target Group (Segment) response
The data and time in milliseconds when the group was created
The environment this target group belongs to
ProductionUnique identifier for the target group.
The data and time in milliseconds when the group was last modified
Name of the target group.
Beta TestersThe version of this group. Each time it is modified the version is incremented
1Bad request
Unauthenticated
Unauthorized
The specified resource was not found
The specified resource already exists
Internal server error
PATCH /gateway/cf/admin/segments/{identifier}?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text&environmentIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 633
{
"instructions": [
{
"kind": "addToIncludeList",
"parameters": {
"targets": [
"target1",
"target2"
]
}
},
{
"kind": "removeFromIncludeList",
"parameters": {
"targets": [
"target1",
"target2"
]
}
},
{
"kind": "addToExcludeList",
"parameters": {
"targets": [
"target3"
]
}
},
{
"kind": "removeFromExcludeList",
"parameters": {
"targets": [
"target4",
"target5"
]
}
},
{
"kind": "addClause",
"parameters": {
"attribute": "email",
"negate": false,
"op": "endsWith",
"values": [
"gmail.com"
]
}
},
{
"kind": "updateClause",
"parameters": {
"attribute": "email",
"clauseID": "test-clause-ID",
"op": "equals",
"value": [
"testuser@testcompany.com"
]
}
},
{
"kind": "removeClause",
"parameters": {
"clauseID": "test-clause-ID"
}
}
]
}{
"createdAt": 1,
"environment": "Production",
"excluded": [
{
"account": "abcXDdffdaffd",
"anonymous": true,
"attributes": {
"age": 20,
"location": "Belfast"
},
"createdAt": 1,
"environment": "text",
"identifier": "john-doe",
"name": "John Doe",
"org": "text",
"project": "text",
"segments": [
{
"createdAt": 1,
"environment": "Production",
"excluded": [
"[Circular Reference]"
],
"identifier": "text",
"included": [
"[Circular Reference]"
],
"modifiedAt": 1,
"name": "Beta Testers",
"rules": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"servingRules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text"
}
],
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"version": 1
}
]
}
],
"identifier": "text",
"included": [
{
"account": "abcXDdffdaffd",
"anonymous": true,
"attributes": {
"age": 20,
"location": "Belfast"
},
"createdAt": 1,
"environment": "text",
"identifier": "john-doe",
"name": "John Doe",
"org": "text",
"project": "text",
"segments": [
{
"createdAt": 1,
"environment": "Production",
"excluded": [
"[Circular Reference]"
],
"identifier": "text",
"included": [
"[Circular Reference]"
],
"modifiedAt": 1,
"name": "Beta Testers",
"rules": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"servingRules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text"
}
],
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"version": 1
}
]
}
],
"modifiedAt": 1,
"name": "Beta Testers",
"rules": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"servingRules": [
{
"clauses": [
{
"attribute": "identifier",
"id": 32434243,
"negate": false,
"op": "starts_with",
"values": [
"text"
]
}
],
"priority": 1,
"ruleId": "text"
}
],
"tags": [
{
"identifier": "feature-flag-tag-1",
"name": "feature-flag-tag-1"
}
],
"version": 1
}Returns the list of Feature Flags that the Target Group can be added to. This list will exclude any Feature Flag that the Target Group is already part of.
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment Identifier
PageNumber
PageSize
SortOrder
SortByField
Identifier of the feature flag
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/segments/{identifier}/available_flags?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text&environmentIdentifier=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,
"featureFlags": [
{
"identifier": "test-flag",
"name": "Test Flag"
}
]
}Returns the details of a Feature Flag in a Target Group for the given identifier
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment Identifier
OK
Details of a Feature Flag that has been included in a Target Group (Segment)
A description of the feature flag
The environment identifier for the feature flag
The identifier of the feature flag
simple-boolThe name of the feature flag
Simple BoolThe project identifier for the feature flag
The unique identifier for this rule
How the the flag has been included, either directly or via a custom rule
The identifier for the variation of the flag that should be served to members of the group
Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
GET /gateway/cf/admin/segments/{identifier}/flags?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text&environmentIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
[
{
"description": "text",
"environment": "text",
"identifier": "simple-bool",
"name": "Simple Bool",
"project": "text",
"ruleId": "text",
"type": "DIRECT",
"variation": "text"
}
]Last updated
Was this helpful?