For the complete documentation index, see llms.txt. This page is also available as Markdown.

Targets

APIs to create and manage Feature Flag Targets

Returns all Targets

get

Returns all the Targets for the given Account ID

Authorizations
x-api-keystringRequired
Query parameters
accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

pageNumberintegerOptional

PageNumber

pageSizeintegerOptional

PageSize

sortOrderstring · enumOptional

SortOrder

Possible values:
sortByFieldstring · enumOptional

SortByField

Possible values:
targetNamestringOptional

Name of the target

targetIdentifierstringOptional

Identifier of the target

Responses
200

OK

application/json
itemCountintegerRequired

The total number of items

Example: 1
pageCountintegerRequired

The total number of pages

Example: 100
pageIndexintegerRequired

The current page

Example: 0
pageSizeintegerRequired

The number of items per page

Example: 1
versionintegerOptional

The version of this object. The version will be incremented each time the object is modified

Example: 5
get/admin/targets
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
        }
      ]
    }
  ]
}

Creates a Target

post

Create Targets for the given identifier

Authorizations
x-api-keystringRequired
Query parameters
accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
Body

A Target object

accountstringRequired

The account ID that the target belongs to

Example: abcXDdffdaffd
anonymousbooleanOptional

Indicates if this target is anonymous

attributesobjectOptional

a JSON representation of the attributes for this target

Example: {"age":20,"location":"Belfast"}
createdAtinteger · int64Optional

The date and time in milliseconds when this Target was created

environmentstringRequired

The identifier for the environment that the target belongs to

identifierstringRequired

The unique identifier for this target

Example: john-doe
namestringRequired

The name of this Target

Example: John Doe
orgstringRequired

The identifier for the organization that the target belongs to

projectstringRequired

The identifier for the project that this target belongs to

Responses
201

Created

No content

post/admin/targets
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 Target details

post

Add targets by uploading a CSV file

Authorizations
x-api-keystringRequired
Query parameters
accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

Body
fileNamestring · binaryOptional
Responses
200

Created

No content

post/admin/targets/upload
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

get

Returns details of a Target for the given identifier

Authorizations
x-api-keystringRequired
Path parameters
identifierstringRequired

Unique identifier for the object in the API.

Query parameters
accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

Responses
200

OK

application/json

A Target object

accountstringRequired

The account ID that the target belongs to

Example: abcXDdffdaffd
anonymousbooleanOptional

Indicates if this target is anonymous

attributesobjectOptional

a JSON representation of the attributes for this target

Example: {"age":20,"location":"Belfast"}
createdAtinteger · int64Optional

The date and time in milliseconds when this Target was created

environmentstringRequired

The identifier for the environment that the target belongs to

identifierstringRequired

The unique identifier for this target

Example: john-doe
namestringRequired

The name of this Target

Example: John Doe
orgstringRequired

The identifier for the organization that the target belongs to

projectstringRequired

The identifier for the project that this target belongs to

get/admin/targets/{identifier}
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

put

Modifies a Target for the given account identifier

Authorizations
x-api-keystringRequired
Path parameters
identifierstringRequired

Unique identifier for the object in the API.

Query parameters
accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

Body

A Target object

accountstringRequired

The account ID that the target belongs to

Example: abcXDdffdaffd
anonymousbooleanOptional

Indicates if this target is anonymous

attributesobjectOptional

a JSON representation of the attributes for this target

Example: {"age":20,"location":"Belfast"}
createdAtinteger · int64Optional

The date and time in milliseconds when this Target was created

environmentstringRequired

The identifier for the environment that the target belongs to

identifierstringRequired

The unique identifier for this target

Example: john-doe
namestringRequired

The name of this Target

Example: John Doe
orgstringRequired

The identifier for the organization that the target belongs to

projectstringRequired

The identifier for the project that this target belongs to

Responses
200

OK

application/json

A Target object

accountstringRequired

The account ID that the target belongs to

Example: abcXDdffdaffd
anonymousbooleanOptional

Indicates if this target is anonymous

attributesobjectOptional

a JSON representation of the attributes for this target

Example: {"age":20,"location":"Belfast"}
createdAtinteger · int64Optional

The date and time in milliseconds when this Target was created

environmentstringRequired

The identifier for the environment that the target belongs to

identifierstringRequired

The unique identifier for this target

Example: john-doe
namestringRequired

The name of this Target

Example: John Doe
orgstringRequired

The identifier for the organization that the target belongs to

projectstringRequired

The identifier for the project that this target belongs to

put/admin/targets/{identifier}
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

delete

Deletes a Target for the given identifier

Authorizations
x-api-keystringRequired
Path parameters
identifierstringRequired

Unique identifier for the object in the API.

Query parameters
accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

Responses
204

No content

No content

delete/admin/targets/{identifier}
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

patch

Updates a Target for the given identifier

Authorizations
x-api-keystringRequired
Path parameters
identifierstringRequired

Unique identifier for the object in the API.

Query parameters
accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

Body
commentstringOptional

A comment explaining the reason for this patch operation

Example: This is a comment string
executionTimeintegerOptional

Time of execution in unix epoch milliseconds when the scheduled changes will be applied

Responses
200

OK

application/json

A Target object

accountstringRequired

The account ID that the target belongs to

Example: abcXDdffdaffd
anonymousbooleanOptional

Indicates if this target is anonymous

attributesobjectOptional

a JSON representation of the attributes for this target

Example: {"age":20,"location":"Belfast"}
createdAtinteger · int64Optional

The date and time in milliseconds when this Target was created

environmentstringRequired

The identifier for the environment that the target belongs to

identifierstringRequired

The unique identifier for this target

Example: john-doe
namestringRequired

The name of this Target

Example: John Doe
orgstringRequired

The identifier for the organization that the target belongs to

projectstringRequired

The identifier for the project that this target belongs to

patch/admin/targets/{identifier}
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 Target Groups for the given Target

get

Returns the Target Groups that the specified Target belongs to.

Authorizations
x-api-keystringRequired
Path parameters
identifierstringRequired

Unique identifier for the object in the API.

Query parameters
accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

Responses
200

OK

application/json

Details of which Target Groups (Segments) a target is included in or excluded from

identifierstringRequired

The unique identifier for the target

get/admin/targets/{identifier}/segments
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?