---
title: entities.targetRelation
description: Read target relation records with the targetRelation repository, and change them with the target relation mutations. Same records as the REST TargetRelations entity.
canonical: https://developers.coevera.com/reference/graphql/target-relation/
section: graphql
verification: schema
generatedFrom: schema f155746 (2026-10-20)
publisher: Coevera
---

# entities.targetRelation

Read target relation records with the targetRelation repository, and change them with the target relation mutations. Same records as the REST TargetRelations entity.

REST: [TargetRelations](https://developers.coevera.com/reference/rest/target-relations.md).

## Queries

- `getById(entityId: ID!): TargetRelationEntity` Returns the record with the given id, or null when there is none. Deleted records are returned as well.
- `getByIds(entityIds: [ID!]!): [TargetRelationEntity!]!` Returns the records with the given ids; ids without a record are left out. Deleted records are returned as well.
- `getAll(limit: Int, offset: Int, filter: TargetRelationFilterInput, orderBy: [TargetRelationOrderByInput!], includeDeleted: Boolean): [TargetRelationEntity!]!` Returns the records that match the filter, paged with limit and offset.
- `getByCriteria(filter: TargetRelationFilterInput, orderBy: [TargetRelationOrderByInput!], includeDeleted: Boolean, before: String, after: String, first: Int, last: Int): TargetRelationEntityConnection` Returns the records that match the filter as a cursor-paginated connection.
- `getChangedFieldsSinceRevision(id: UUID!, revision: Int!): [UUID!]!` Returns the ids of the fields of a record that changed after the given revision. Returns an empty list for entities without change tracking.

## Mutations

- `createTargetRelation(input: CreateTargetRelationInput!, validationLevel: [ValidationLevel!]): CreateTargetRelationPayload` Create one record.
- `updateTargetRelation(input: UpdateTargetRelationInput!, validationLevel: [ValidationLevel!], sessionIdToUpdate: String): UpdateTargetRelationPayload` Update fields.
- `bulkUpdateTargetRelation(input: [CreateOrUpdateTargetRelationInput!]!, deleteInput: [DeleteTargetRelationInput!], validationLevel: [ValidationLevel!], rollbackMethod: RollbackMethod, match: MatchingInput): BulkUpdateTargetRelationPayload` Create or update many; per-item results.
- `deleteTargetRelation(input: DeleteTargetRelationInput!): DeleteTargetRelationPayload` Soft-delete.

## Types

### TargetRelationEntity (object)

Link between a group target and a user target that rolls up into it.

- `isDeleteProtected: Boolean!` True when the record is protected against deletion because it must always exist in the space. Deleting a record that is not protected can still fail on other checks. Read-only.
- `id: ID!` Unique identifier of entity.
- `isDeleted: Boolean` Specifies if the entity is considered deleted.
- `modified: DateTime` Last modification time.
- `created: DateTime` Creation time.
- `groupTarget: TargetEntity` Parent group target that aggregates the user target.
- `userTarget: TargetEntity` Child user target rolling up into the group target.
- `groupTargetId: ID!` Id of the parent group target that aggregates the user target.
- `userTargetId: ID!` Id of the user target that rolls up into the group target.
- `revision: Int` Revision when entity was lastly changed.
- `instancePermissions: [EntityPermsEnum!]! (1 args)` Permissions the current user has on this record, out of the requested ones.

### TargetRelationEntityConnection (object)

Paginated list of TargetRelation records.

- `pageInfo: PageInfo!` Pagination data for this connection.
- `edges: [TargetRelationEntityEdge]!` Contains the nodes in this connection.
- `totalCount: Int` Total number of items in the connection.

### TargetRelationEntityEdge (object)

A Relay edge containing a `TargetRelationEntity` and its cursor.

- `node: TargetRelationEntity` The item at the end of the edge
- `cursor: String!` A cursor for use in pagination

### TargetRelationFilterInput (input)

Filter conditions for TargetRelation records. Conditions on different fields are combined with AND; use OR, AND and NOT for other combinations.

- `OR: [TargetRelationFilterInput!]` Matches records that meet at least one of the listed filters.
- `AND: [TargetRelationFilterInput!]` Matches records that meet all of the listed filters.
- `NOT: TargetRelationFilterInput` Matches records that do not meet this filter.
- `globalSearchQuery: String` Search term matched against the fields that the global search covers for this entity.
- `id: EntityFilterStringField` Unique identifier of entity.
- `isDeleted: Boolean` Specifies if the entity is considered deleted.
- `modified: EntityFilterDateTimeField` Last modification time.
- `created: EntityFilterDateTimeField` Creation time.
- `groupTargetId: EntityFilterStringField` Id of the parent group target that aggregates the user target.
- `userTargetId: EntityFilterStringField` Id of the user target that rolls up into the group target.
- `revision: EntityFilterNumberField` Revision when entity was lastly changed.
- `groupTarget: TargetFilterInput` Parent group target that aggregates the user target. Matches records where a related record meets these conditions.
- `userTarget: TargetFilterInput` Child user target rolling up into the group target. Matches records where a related record meets these conditions.

### TargetRelationOrderByInput (input)

Sorting of TargetRelation records. Set exactly one field in each item; list several items to sort by more fields, in order of priority.

- `id: OrderByEnum` Unique identifier of entity.
- `isDeleted: OrderByEnum` Specifies if the entity is considered deleted.
- `modified: OrderByEnum` Last modification time.
- `created: OrderByEnum` Creation time.
- `groupTarget: [TargetOrderByNestedInput!]` Parent group target that aggregates the user target. Sorts by fields of the related record, listed in order of priority.
- `userTarget: [TargetOrderByNestedInput!]` Child user target rolling up into the group target. Sorts by fields of the related record, listed in order of priority.
- `groupTargetId: OrderByEnum` Id of the parent group target that aggregates the user target.
- `userTargetId: OrderByEnum` Id of the user target that rolls up into the group target.
- `revision: OrderByEnum` Revision when entity was lastly changed.

### CreateOrUpdateTargetRelationInput (input)

Field values of a TargetRelation record to create, or to update when its id is set.

- `clientMutationId: String` Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention).
- `id: ID` Unique identifier of entity.
- `modified: DateTime` Last modification time.
- `created: DateTime` Creation time.
- `groupTargetId: ID` Id of the parent group target that aggregates the user target.
- `userTargetId: ID` Id of the user target that rolls up into the group target.
- `revision: Int` Revision when entity was lastly changed.

### CreateTargetRelationInput (input)

Field values of a new TargetRelation record.

- `clientMutationId: String` Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention).
- `modified: DateTime` Last modification time.
- `created: DateTime` Creation time.
- `groupTargetId: ID!` Id of the parent group target that aggregates the user target.
- `userTargetId: ID!` Id of the user target that rolls up into the group target.
- `revision: Int` Revision when entity was lastly changed.

### DeleteTargetRelationInput (input)

Id of the TargetRelation record to delete.

- `clientMutationId: String` Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention).
- `id: ID!` Unique identifier of entity.

### TargetOrderByNestedInput (input)

Sorting by a field of the related Target record. Set exactly one field in each item.

- `id: OrderByEnum` Unique identifier of entity.
- `isDeleted: OrderByEnum` Specifies if the entity is considered deleted.
- `modified: OrderByEnum` Last modification time.
- `created: OrderByEnum` Creation time.
- `calculationType: OrderByEnum` What the target measures: revenue from opportunities won, or the number of leads qualified or created in the target period.
- `description: OrderByEnum` Free-text description shown alongside the target.
- `isActive: OrderByEnum` When true, the target is currently being tracked; when false, the target is a draft or has been deactivated.
- `name: OrderByEnum` Name of the entity and its default text representation.
- `ownerId: OrderByEnum` Id of the owning user.
- `periodFrom: OrderByEnum` First date of the active target period. Set when isActive is true; recomputed from settings.period when activated.
- `periodTo: OrderByEnum` Last date of the active target period.
- `targetClientId: OrderByEnum` Id of the assignee user.
- `type: OrderByEnum` Kind of target: a User target for targetClient, a group target that is split into or combines user targets, or a Simulated what-if target.
- `revision: OrderByEnum` Revision when entity was lastly changed.
- `target: OrderByEnum` Target value the user committed to for the current period.
- `virtualPeriodFrom: OrderByEnum` Start date of the target period, derived from periodType and periodYear.
- `virtualPeriodTo: OrderByEnum` End date of the target period, derived from periodType and periodYear.
- `daysLeft: OrderByEnum` Whole days remaining until the target period ends, or zero once the period is past.
- `status: OrderByEnum` Progress state of the target: Draft until it is activated, then NotStarted before its period begins, InProgress while the period runs, and Finished once it is marked finished or the period has ended.
- `finishedDate: OrderByEnum` Date the target was marked as finished. Empty until the target is closed.
- `estimatedTarget: OrderByEnum` Projected end-of-period value extrapolated from progress to date. Used to compare against the committed target.
- `periodYear: OrderByEnum` Calendar year the target period belongs to (e.g. 2026).
- `periodType: OrderByEnum` Whether the target period follows the calendar year (CalendarYear) or the space's financial year (FinancialYear). Combined with periodYear to determine virtualPeriodFrom / virtualPeriodTo.
- `hasParentGroupTarget: OrderByEnum` True when this target is rolled up into a parent group target (e.g. a team-level target aggregating its members). Read-only.
- `periodFragmentType: OrderByEnum` Length of the fragments the target period is split into: the whole year (Year), quarters (Quarter) or months (Month).
- `periodFragmentIndex: OrderByEnum` Zero-based position of the current fragment within the parent period (e.g. fragment index 2 for the 3rd month in a yearly target split into monthly fragments).

### UpdateTargetRelationInput (input)

Id of a TargetRelation record and the field values to change.

- `clientMutationId: String` Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention).
- `id: ID!` Unique identifier of entity.
- `modified: DateTime` Last modification time.
- `created: DateTime` Creation time.
- `groupTargetId: ID` Id of the parent group target that aggregates the user target.
- `userTargetId: ID` Id of the user target that rolls up into the group target.
- `revision: Int` Revision when entity was lastly changed.

### BulkUpdateTargetRelationPayload (object)

Result of the bulkUpdateTargetRelation mutation.

- `result: BulkUpdateResults!` Ids of the created, updated and deleted records, and the items that failed.

### CreateTargetRelationPayload (object)

Result of the createTargetRelation mutation.

- `targetRelation: TargetRelationEntity` The created record.
- `clientMutationId: String` Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention).

### DeleteTargetRelationPayload (object)

Result of the deleteTargetRelation mutation.

- `targetRelation: TargetRelationEntity` The deleted record.
- `clientMutationId: String` Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention).

### UpdateTargetRelationPayload (object)

Result of the updateTargetRelation mutation.

- `targetRelation: TargetRelationEntity` The updated record.
- `clientMutationId: String` Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention).

Types several repositories share, such as `PageInfo` and the filter fields, are in the [types index](https://developers.coevera.com/reference/graphql/types.md). The [SDL](https://developers.coevera.com/graphql/schema.graphql) has the whole schema in one file.

## Example

```graphql
query FirstTargetRelations {
  entities {
    targetRelation {
      getByCriteria(first: 3, orderBy: [{ modified: Desc }]) {
        totalCount
        edges { node { id modified } }
      }
    }
  }
}
```

```bash
curl 'https://{region}.api.coevera.com/api/v100/app/space/{space_id}/graphql/public' \
  --user "$COEVERA_API_KEY:$COEVERA_API_SECRET" \
  --header 'Content-Type: application/json' \
  --data '{"query":"query FirstTargetRelations { entities { targetRelation { getByCriteria(first: 3, orderBy: [{ modified: Desc }]) { totalCount edges { node { id modified } } } } } }"}'
```
