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

# entities.tagRelation

Read tag relation records with the tagRelation repository, and change them with the tag relation mutations. Same records as the REST TagRelations entity.

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

## Queries

- `getById(entityId: ID!): TagRelationEntity` Returns the record with the given id, or null when there is none. Deleted records are returned as well.
- `getByIds(entityIds: [ID!]!): [TagRelationEntity!]!` 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: TagRelationFilterInput, orderBy: [TagRelationOrderByInput!], includeDeleted: Boolean): [TagRelationEntity!]!` Returns the records that match the filter, paged with limit and offset.
- `getByCriteria(filter: TagRelationFilterInput, orderBy: [TagRelationOrderByInput!], includeDeleted: Boolean, before: String, after: String, first: Int, last: Int): TagRelationEntityConnection` 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

- `createTagRelation(input: CreateTagRelationInput!, validationLevel: [ValidationLevel!]): CreateTagRelationPayload` Create one record.
- `updateTagRelation(input: UpdateTagRelationInput!, validationLevel: [ValidationLevel!], sessionIdToUpdate: String): UpdateTagRelationPayload` Update fields.
- `bulkUpdateTagRelation(input: [CreateOrUpdateTagRelationInput!]!, deleteInput: [DeleteTagRelationInput!], validationLevel: [ValidationLevel!], rollbackMethod: RollbackMethod, match: MatchingInput): BulkUpdateTagRelationPayload` Create or update many; per-item results.
- `deleteTagRelation(input: DeleteTagRelationInput!): DeleteTagRelationPayload` Soft-delete.

## Types

### TagRelationEntity (object)

Assignment of a tag to a record.

- `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.
- `account: AccountEntity` Account the tag is attached to, or empty when not attached to an account.
- `appointment: AppointmentEntity` Appointment the tag is attached to, or empty when not attached to an appointment.
- `contact: ContactEntity` Contact the tag is attached to, or empty when not attached to a contact.
- `customEntity: CustomEntityEntity` Custom entity record the tag is attached to, or empty when not attached to a custom entity record.
- `email: EmailEntity` Email the tag is attached to, or empty when not attached to an email.
- `lead: LeadEntity` Lead the tag is attached to, or empty when not attached to a lead.
- `oppty: OpportunityEntity` Opportunity the tag is attached to, or empty when not attached to an opportunity.
- `process: ProcessEntity` Sales process the tag is attached to, or empty when not attached to a process.
- `project: ProjectEntity` Project the tag is attached to, or empty when not attached to a project.
- `quote: QuoteEntity` Quote the tag is attached to, or empty when not attached to a quote.
- `solution: SolutionEntity` Solution the tag is attached to, or empty when not attached to a solution.
- `tag: TagEntity` Tag being attached to the record.
- `task: TaskEntity` Task the tag is attached to, or empty when not attached to a task.
- `accountId: ID` Id of the linked account.
- `appointmentId: ID` Id of the linked appointment.
- `contactId: ID` Id of the linked contact.
- `customEntityId: ID` Id of the linked custom entity record.
- `emailId: ID` Id of the linked email.
- `leadId: ID` Id of the linked lead.
- `opptyId: ID` Id of the linked opportunity.
- `processId: ID` Id of the linked sales process.
- `projectId: ID` Id of the linked project.
- `quoteId: ID` Id of the linked quote.
- `solutionId: ID` Id of the linked solution.
- `tagId: ID!` Id of the tag attached to the record.
- `taskId: ID` Id of the linked task.
- `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.

### TagRelationEntityConnection (object)

Paginated list of TagRelation records.

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

### TagRelationEntityEdge (object)

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

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

### TagRelationFilterInput (input)

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

- `OR: [TagRelationFilterInput!]` Matches records that meet at least one of the listed filters.
- `AND: [TagRelationFilterInput!]` Matches records that meet all of the listed filters.
- `NOT: TagRelationFilterInput` 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.
- `accountId: EntityFilterStringField` Id of the linked account.
- `appointmentId: EntityFilterStringField` Id of the linked appointment.
- `contactId: EntityFilterStringField` Id of the linked contact.
- `customEntityId: EntityFilterStringField` Id of the linked custom entity record.
- `emailId: EntityFilterStringField` Id of the linked email.
- `leadId: EntityFilterStringField` Id of the linked lead.
- `opptyId: EntityFilterStringField` Id of the linked opportunity.
- `processId: EntityFilterStringField` Id of the linked sales process.
- `projectId: EntityFilterStringField` Id of the linked project.
- `quoteId: EntityFilterStringField` Id of the linked quote.
- `solutionId: EntityFilterStringField` Id of the linked solution.
- `tagId: EntityFilterStringField` Id of the tag attached to the record.
- `taskId: EntityFilterStringField` Id of the linked task.
- `revision: EntityFilterNumberField` Revision when entity was lastly changed.
- `account: AccountFilterInput` Account the tag is attached to, or empty when not attached to an account. Matches records where a related record meets these conditions.
- `appointment: AppointmentFilterInput` Appointment the tag is attached to, or empty when not attached to an appointment. Matches records where a related record meets these conditions.
- `contact: ContactFilterInput` Contact the tag is attached to, or empty when not attached to a contact. Matches records where a related record meets these conditions.
- `customEntity: CustomEntityFilterInput` Custom entity record the tag is attached to, or empty when not attached to a custom entity record. Matches records where a related record meets these conditions.
- `email: EmailFilterInput` Email the tag is attached to, or empty when not attached to an email. Matches records where a related record meets these conditions.
- `lead: LeadFilterInput` Lead the tag is attached to, or empty when not attached to a lead. Matches records where a related record meets these conditions.
- `oppty: OpportunityFilterInput` Opportunity the tag is attached to, or empty when not attached to an opportunity. Matches records where a related record meets these conditions.
- `process: ProcessFilterInput` Sales process the tag is attached to, or empty when not attached to a process. Matches records where a related record meets these conditions.
- `project: ProjectFilterInput` Project the tag is attached to, or empty when not attached to a project. Matches records where a related record meets these conditions.
- `quote: QuoteFilterInput` Quote the tag is attached to, or empty when not attached to a quote. Matches records where a related record meets these conditions.
- `solution: SolutionFilterInput` Solution the tag is attached to, or empty when not attached to a solution. Matches records where a related record meets these conditions.
- `tag: TagFilterInput` Tag being attached to the record. Matches records where a related record meets these conditions.
- `task: TaskFilterInput` Task the tag is attached to, or empty when not attached to a task. Matches records where a related record meets these conditions.

### TagRelationOrderByInput (input)

Sorting of TagRelation 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.
- `account: [AccountOrderByNestedInput!]` Account the tag is attached to, or empty when not attached to an account. Sorts by fields of the related record, listed in order of priority.
- `appointment: [AppointmentOrderByNestedInput!]` Appointment the tag is attached to, or empty when not attached to an appointment. Sorts by fields of the related record, listed in order of priority.
- `contact: [ContactOrderByNestedInput!]` Contact the tag is attached to, or empty when not attached to a contact. Sorts by fields of the related record, listed in order of priority.
- `customEntity: [CustomEntityOrderByNestedInput!]` Custom entity record the tag is attached to, or empty when not attached to a custom entity record. Sorts by fields of the related record, listed in order of priority.
- `email: [EmailOrderByNestedInput!]` Email the tag is attached to, or empty when not attached to an email. Sorts by fields of the related record, listed in order of priority.
- `lead: [LeadOrderByNestedInput!]` Lead the tag is attached to, or empty when not attached to a lead. Sorts by fields of the related record, listed in order of priority.
- `oppty: [OpportunityOrderByNestedInput!]` Opportunity the tag is attached to, or empty when not attached to an opportunity. Sorts by fields of the related record, listed in order of priority.
- `process: [ProcessOrderByNestedInput!]` Sales process the tag is attached to, or empty when not attached to a process. Sorts by fields of the related record, listed in order of priority.
- `project: [ProjectOrderByNestedInput!]` Project the tag is attached to, or empty when not attached to a project. Sorts by fields of the related record, listed in order of priority.
- `quote: [QuoteOrderByNestedInput!]` Quote the tag is attached to, or empty when not attached to a quote. Sorts by fields of the related record, listed in order of priority.
- `solution: [SolutionOrderByNestedInput!]` Solution the tag is attached to, or empty when not attached to a solution. Sorts by fields of the related record, listed in order of priority.
- `tag: [TagOrderByNestedInput!]` Tag being attached to the record. Sorts by fields of the related record, listed in order of priority.
- `task: [TaskOrderByNestedInput!]` Task the tag is attached to, or empty when not attached to a task. Sorts by fields of the related record, listed in order of priority.
- `accountId: OrderByEnum` Id of the linked account.
- `appointmentId: OrderByEnum` Id of the linked appointment.
- `contactId: OrderByEnum` Id of the linked contact.
- `customEntityId: OrderByEnum` Id of the linked custom entity record.
- `emailId: OrderByEnum` Id of the linked email.
- `leadId: OrderByEnum` Id of the linked lead.
- `opptyId: OrderByEnum` Id of the linked opportunity.
- `processId: OrderByEnum` Id of the linked sales process.
- `projectId: OrderByEnum` Id of the linked project.
- `quoteId: OrderByEnum` Id of the linked quote.
- `solutionId: OrderByEnum` Id of the linked solution.
- `tagId: OrderByEnum` Id of the tag attached to the record.
- `taskId: OrderByEnum` Id of the linked task.
- `revision: OrderByEnum` Revision when entity was lastly changed.

### CreateOrUpdateTagRelationInput (input)

Field values of a TagRelation 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.
- `accountId: ID` Id of the linked account.
- `appointmentId: ID` Id of the linked appointment.
- `contactId: ID` Id of the linked contact.
- `customEntityId: ID` Id of the linked custom entity record.
- `emailId: ID` Id of the linked email.
- `leadId: ID` Id of the linked lead.
- `opptyId: ID` Id of the linked opportunity.
- `processId: ID` Id of the linked sales process.
- `projectId: ID` Id of the linked project.
- `quoteId: ID` Id of the linked quote.
- `solutionId: ID` Id of the linked solution.
- `tagId: ID` Id of the tag attached to the record.
- `taskId: ID` Id of the linked task.
- `revision: Int` Revision when entity was lastly changed.

### CreateTagRelationInput (input)

Field values of a new TagRelation 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.
- `accountId: ID` Id of the linked account.
- `appointmentId: ID` Id of the linked appointment.
- `contactId: ID` Id of the linked contact.
- `customEntityId: ID` Id of the linked custom entity record.
- `emailId: ID` Id of the linked email.
- `leadId: ID` Id of the linked lead.
- `opptyId: ID` Id of the linked opportunity.
- `processId: ID` Id of the linked sales process.
- `projectId: ID` Id of the linked project.
- `quoteId: ID` Id of the linked quote.
- `solutionId: ID` Id of the linked solution.
- `tagId: ID!` Id of the tag attached to the record.
- `taskId: ID` Id of the linked task.
- `revision: Int` Revision when entity was lastly changed.

### DeleteTagRelationInput (input)

Id of the TagRelation 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.

### SolutionOrderByNestedInput (input)

Sorting by a field of the related Solution 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.
- `description: OrderByEnum` Free-text description of the solution.
- `name: OrderByEnum` Name of the entity and its default text representation.
- `ownerId: OrderByEnum` Id of the owning user.
- `solutionTemplateId: OrderByEnum` Template this solution was created from, if any.
- `nodeCount: OrderByEnum` Number of nodes on the canvas.
- `status: OrderByEnum` Live status derived from the activatable nodes (Automatizer, Email Sequence, Online Form): Active when all are enabled, Inactive when none are, Partial otherwise.

### TagOrderByNestedInput (input)

Sorting by a field of the related Tag 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.
- `color: OrderByEnum` Display color of the tag, encoded as a 24-bit RGB integer: (red << 16) | (green << 8) | blue.
- `creatorId: OrderByEnum` Id of the creating user.
- `entityApiName: OrderByEnum` For tags scoped to custom entities, the api name of the custom entity the tag belongs to. Required for custom-entity tags and must be empty for all other tags.
- `isEnabled: OrderByEnum` When false, the tag is hidden in pickers and cannot be assigned to new records.
- `name: OrderByEnum` Name of the entity and its default text representation.
- `supportedEntities: OrderByEnum` Bit flags of the entities the tag can be attached to, added together: Contact 1, Account 2, Opportunity 4, Lead 8, Project 16, Email 32, Process 64, Appointment 128, Task 256, Quote 512, CustomEntity 1024, Solution 2048.
- `useLang: OrderByEnum` When true, the tag name is treated as a translation key and localized in the UI; otherwise the literal name is shown.
- `revision: OrderByEnum` Revision when entity was lastly changed.

### UpdateTagRelationInput (input)

Id of a TagRelation 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.
- `accountId: ID` Id of the linked account.
- `appointmentId: ID` Id of the linked appointment.
- `contactId: ID` Id of the linked contact.
- `customEntityId: ID` Id of the linked custom entity record.
- `emailId: ID` Id of the linked email.
- `leadId: ID` Id of the linked lead.
- `opptyId: ID` Id of the linked opportunity.
- `processId: ID` Id of the linked sales process.
- `projectId: ID` Id of the linked project.
- `quoteId: ID` Id of the linked quote.
- `solutionId: ID` Id of the linked solution.
- `tagId: ID` Id of the tag attached to the record.
- `taskId: ID` Id of the linked task.
- `revision: Int` Revision when entity was lastly changed.

### BulkUpdateTagRelationPayload (object)

Result of the bulkUpdateTagRelation mutation.

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

### CreateTagRelationPayload (object)

Result of the createTagRelation mutation.

- `tagRelation: TagRelationEntity` 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).

### DeleteTagRelationPayload (object)

Result of the deleteTagRelation mutation.

- `tagRelation: TagRelationEntity` 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).

### UpdateTagRelationPayload (object)

Result of the updateTagRelation mutation.

- `tagRelation: TagRelationEntity` 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 FirstTagRelations {
  entities {
    tagRelation {
      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 FirstTagRelations { entities { tagRelation { getByCriteria(first: 3, orderBy: [{ modified: Desc }]) { totalCount edges { node { id modified } } } } } }"}'
```
