# Updates a Target

Updates a Target for the given identifier

Endpoint: PATCH /cf/admin/targets/{identifier}
Version: 1.0
Security: x-api-key

## Query parameters:

  - `accountIdentifier` (string, required)
    Account Identifier

  - `orgIdentifier` (string, required)
    Organization Identifier

  - `projectIdentifier` (string, required)
    The Project identifier

  - `environmentIdentifier` (string, required)
    Environment Identifier

## Path parameters:

  - `identifier` (string, required)
    Unique identifier for the object in the API.

## Request fields (application/json):

  - `comment` (string)
    A comment explaining the reason for this patch operation
    Example: "This is a comment string"

  - `executionTime` (integer)
    Time of execution in unix epoch milliseconds when the scheduled changes will be applied

  - `gitDetails` (object)
    The commit message to use as part of a gitsync operation

  - `gitDetails.commitMsg` (string, required)
    A description of the change or action
    Example: "Turning on flag test-flag for production"

  - `instructions` (array, required)
    A list of Patch Instructions

  - `instructions.kind` (string, required)
    The name of the modification you would like to perform on a resource.
    Example: "enableFeatureFlag"

  - `instructions.parameters` (object, required)
    Example: {"ruleId":"TestRule","variationID":"TestVariation"}

## Response 200 fields (application/json):

  - `account` (string, required)
    The account ID that the target belongs to
    Example: "abcXDdffdaffd"

  - `anonymous` (boolean)
    Indicates if this target is anonymous

  - `attributes` (object)
    a JSON representation of the attributes for this target
    Example: {"age":20,"location":"Belfast"}

  - `createdAt` (integer)
    The date and time in milliseconds when this Target was created

  - `environment` (string, required)
    The identifier for the environment that the target belongs to

  - `identifier` (string, required)
    The unique identifier for this target
    Example: "john-doe"

  - `name` (string, required)
    The name of this Target
    Example: "John Doe"

  - `org` (string, required)
    The identifier for the organization that the target belongs to

  - `project` (string, required)
    The identifier for the project that this target belongs to

  - `segments` (array)
    A list of Target Groups (Segments) that this Target belongs to

  - `segments.createdAt` (integer)
    The data and time in milliseconds when the group was created

  - `segments.environment` (string)
    The environment this target group belongs to
    Example: "Production"

  - `segments.excluded` (array)
    A list of Targets who are excluded from this target group

  - `segments.identifier` (string, required)
    Unique identifier for the target group.

  - `segments.included` (array)
    A list of Targets who belong to this target group

  - `segments.modifiedAt` (integer)
    The data and time in milliseconds when the group was last modified

  - `segments.name` (string, required)
    Name of the target group.
    Example: "Beta Testers"

  - `segments.rules` (array)

  - `segments.rules.attribute` (string, required)
    The attribute to use in the clause.  This can be any target attribute
    Example: "identifier"

  - `segments.rules.id` (string)
    The unique ID for the clause
    Example: 32434243

  - `segments.rules.negate` (boolean, required)
    Is the operation negated?

  - `segments.rules.op` (string, required)
    The type of operation such as equals, starts_with, contains
    Example: "starts_with"

  - `segments.rules.values` (array, required)
    The values that are compared against the operator

  - `segments.servingRules` (array)
    An array of rules that can cause a user to be included in this segment.

  - `segments.servingRules.clauses` (array, required)
    A list of clauses to use in the rule

  - `segments.servingRules.priority` (integer, required)
    The rules priority relative to other rules.  The rules are evaluated in order with 1 being the highest
    Example: 1

  - `segments.servingRules.ruleId` (string, required)
    The unique identifier for this rule

  - `segments.tags` (array)
    Tags for this target group

  - `segments.tags.identifier` (string, required)
    The identifier of the tag
    Example: "feature-flag-tag-1"

  - `segments.tags.name` (string, required)
    The name of the tag
    Example: "feature-flag-tag-1"

  - `segments.version` (integer)
    The version of this group.  Each time it is modified the version is incremented
    Example: 1

## Response 400 fields (application/json):

  - `code` (string, required)
    The http error code
    Example: 404

  - `details` (object)
    Additional details about the error

  - `message` (string, required)
    The reason the request failed
    Example: "Error retrieving projects, organization 'default_org' does not exist"


