Targets
APIs to create and manage Feature Flag Targets
Returns all the Targets for the given Account ID
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment Identifier
PageNumber
PageSize
SortOrder
SortByField
Name of the target
Identifier of the target
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/targets?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,
"targets": [
{
"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
}
]
}
]
}Create Targets for the given identifier
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}A Target object
The account ID that the target belongs to
abcXDdffdaffdIndicates if this target is anonymous
a JSON representation of the attributes for this target
{"age":20,"location":"Belfast"}The date and time in milliseconds when this Target was created
The identifier for the environment that the target belongs to
The unique identifier for this target
john-doeThe name of this Target
John DoeThe identifier for the organization that the target belongs to
The identifier for the project that this target belongs to
Created
No content
Bad request
Unauthenticated
Unauthorized
The specified resource already exists
Internal server error
POST /gateway/cf/admin/targets?accountIdentifier=text&orgIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1142
{
"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": [
{
"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
}
]
}No content
Add targets by uploading a CSV file
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment Identifier
Created
No content
Bad request
Unauthenticated
Unauthorized
The specified resource already exists
Internal server error
POST /gateway/cf/admin/targets/upload?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text&environmentIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 21
{
"fileName": "binary"
}No content
Returns details of a Target 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
A Target object
The account ID that the target belongs to
abcXDdffdaffdIndicates if this target is anonymous
a JSON representation of the attributes for this target
{"age":20,"location":"Belfast"}The date and time in milliseconds when this Target was created
The identifier for the environment that the target belongs to
The unique identifier for this target
john-doeThe name of this Target
John DoeThe identifier for the organization that the target belongs to
The identifier for the project that this target belongs to
Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
GET /gateway/cf/admin/targets/{identifier}?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text&environmentIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
"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": [
{
"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
}
]
}Modifies a Target for the given account identifier
Unique identifier for the object in the API.
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment Identifier
A Target object
The account ID that the target belongs to
abcXDdffdaffdIndicates if this target is anonymous
a JSON representation of the attributes for this target
{"age":20,"location":"Belfast"}The date and time in milliseconds when this Target was created
The identifier for the environment that the target belongs to
The unique identifier for this target
john-doeThe name of this Target
John DoeThe identifier for the organization that the target belongs to
The identifier for the project that this target belongs to
OK
A Target object
The account ID that the target belongs to
abcXDdffdaffdIndicates if this target is anonymous
a JSON representation of the attributes for this target
{"age":20,"location":"Belfast"}The date and time in milliseconds when this Target was created
The identifier for the environment that the target belongs to
The unique identifier for this target
john-doeThe name of this Target
John DoeThe identifier for the organization that the target belongs to
The identifier for the project that this target belongs to
Bad request
Unauthenticated
Unauthorized
The specified resource was not found
The specified resource already exists
Internal server error
PUT /gateway/cf/admin/targets/{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: 1142
{
"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": [
{
"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
}
]
}{
"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": [
{
"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
}
]
}Deletes a Target 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
No content
No content
Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
DELETE /gateway/cf/admin/targets/{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 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 object
The account ID that the target belongs to
abcXDdffdaffdIndicates if this target is anonymous
a JSON representation of the attributes for this target
{"age":20,"location":"Belfast"}The date and time in milliseconds when this Target was created
The identifier for the environment that the target belongs to
The unique identifier for this target
john-doeThe name of this Target
John DoeThe identifier for the organization that the target belongs to
The identifier for the project that this target belongs to
Bad request
Unauthenticated
Unauthorized
The specified resource was not found
The specified resource already exists
Internal server error
PATCH /gateway/cf/admin/targets/{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: 748
{
"gitDetails": {
"commitMsg": "Making some changes"
},
"instructions": [
{
"kind": "addToIncludeList",
"parameters": {
"segments": [
"alpha-testers",
"beta-testers"
]
}
},
{
"kind": "removeFromIncludeList",
"parameters": {
"segments": [
"alpha-testers",
"beta-testers"
]
}
},
{
"kind": "addToExcludeList",
"parameters": {
"segments": [
"alpha-testers",
"beta-testers"
]
}
},
{
"kind": "removeFromExcludeList",
"parameters": {
"segments": [
"alpha-testers",
"beta-testers"
]
}
},
{
"kind": "addTargetToFlagsVariationTargetMap",
"parameters": {
"features": [
{
"identifier": "flag1",
"variation": "true"
},
{
"identifier": "flag2",
"variation": "false"
}
]
}
},
{
"kind": "removeTargetFromFlagsVariationTargetMap",
"parameters": {
"features": [
{
"identifier": "flag1",
"variation": "true"
},
{
"identifier": "flag2",
"variation": "false"
}
]
}
}
]
}{
"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": [
{
"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
}
]
}Returns the Target Groups that the specified Target belongs to.
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 which Target Groups (Segments) a target is included in or excluded from
The unique identifier for the target
Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
GET /gateway/cf/admin/targets/{identifier}/segments?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text&environmentIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
"excludedSegments": [
{
"identifier": "text",
"name": "text"
}
],
"identifier": "text",
"includedSegments": [
{
"identifier": "text",
"name": "text"
}
],
"ruleSegments": [
{
"identifier": "text",
"name": "text"
}
]
}Last updated
Was this helpful?