---
title: entities.customEntityRelationData
description: Read custom entity relation data records with the customEntityRelationData repository.
canonical: https://developers.coevera.com/reference/graphql/custom-entity-relation-data/
section: graphql
verification: schema
generatedFrom: schema f155746 (2026-10-20)
publisher: Coevera
---

# entities.customEntityRelationData

Read custom entity relation data records with the customEntityRelationData repository.

## Queries

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

## Types

### CustomEntityRelationDataEntity (object)

Link between two records made through a custom relation, such as an account linked to a custom entity 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.
- `account1: AccountEntity` Account on the field1 side of this custom relation link; empty when that record is of another type.
- `account2: AccountEntity` Account on the field2 side of this custom relation link; empty when that record is of another type.
- `appointment1: AppointmentEntity` Appointment on the field1 side of this custom relation link; empty when that record is of another type.
- `task1: TaskEntity` Task on the field1 side of this custom relation link; empty when that record is of another type.
- `appointment2: AppointmentEntity` Appointment on the field2 side of this custom relation link; empty when that record is of another type.
- `task2: TaskEntity` Task on the field2 side of this custom relation link; empty when that record is of another type.
- `client1: ClientEntity` User on the field1 side of this custom relation link; empty when that record is of another type.
- `client2: ClientEntity` User on the field2 side of this custom relation link; empty when that record is of another type.
- `contact1: ContactEntity` Contact on the field1 side of this custom relation link; empty when that record is of another type.
- `contact2: ContactEntity` Contact on the field2 side of this custom relation link; empty when that record is of another type.
- `customEntity1: CustomEntityEntity` Custom entity record on the field1 side of this custom relation link; empty when that record is of another type.
- `customEntity2: CustomEntityEntity` Custom entity record on the field2 side of this custom relation link; empty when that record is of another type.
- `customEntityRelation: CustomEntityRelationEntity` Custom relation (pair of lookup fields) this link belongs to.
- `lead1: LeadEntity` Lead on the field1 side of this custom relation link; empty when that record is of another type.
- `oppty1: OpportunityEntity` Opportunity on the field1 side of this custom relation link; empty when that record is of another type.
- `lead2: LeadEntity` Lead on the field2 side of this custom relation link; empty when that record is of another type.
- `oppty2: OpportunityEntity` Opportunity on the field2 side of this custom relation link; empty when that record is of another type.
- `opptyProductRelation1: OpptyProductRelationEntity` Opportunity product line on the field1 side of this custom relation link; empty when that record is of another type.
- `opptyProductRelation2: OpptyProductRelationEntity` Opportunity product line on the field2 side of this custom relation link; empty when that record is of another type.
- `product1: ProductEntity` Product on the field1 side of this custom relation link; empty when that record is of another type.
- `product2: ProductEntity` Product on the field2 side of this custom relation link; empty when that record is of another type.
- `project1: ProjectEntity` Project on the field1 side of this custom relation link; empty when that record is of another type.
- `project2: ProjectEntity` Project on the field2 side of this custom relation link; empty when that record is of another type.
- `quote1: QuoteEntity` Quote on the field1 side of this custom relation link; empty when that record is of another type.
- `quote2: QuoteEntity` Quote on the field2 side of this custom relation link; empty when that record is of another type.
- `account1Id: ID` Id of the account on the field1 side of this custom relation link; empty when that record is of another type.
- `account2Id: ID` Id of the account on the field2 side of this custom relation link; empty when that record is of another type.
- `activity1Id: ID` Id of the appointment or task on the field1 side of this custom relation link; empty when that record is of another type.
- `activity2Id: ID` Id of the appointment or task on the field2 side of this custom relation link; empty when that record is of another type.
- `client1Id: ID` Id of the user on the field1 side of this custom relation link; empty when that record is of another type.
- `client2Id: ID` Id of the user on the field2 side of this custom relation link; empty when that record is of another type.
- `contact1Id: ID` Id of the contact on the field1 side of this custom relation link; empty when that record is of another type.
- `contact2Id: ID` Id of the contact on the field2 side of this custom relation link; empty when that record is of another type.
- `customEntity1Id: ID` Id of the custom entity record on the field1 side of this custom relation link; empty when that record is of another type.
- `customEntity2Id: ID` Id of the custom entity record on the field2 side of this custom relation link; empty when that record is of another type.
- `customEntityRelationId: ID!` Id of the custom relation this link belongs to.
- `isPrimary: Boolean` True when the linked record is the primary one among the records linked through the same lookup field; used when the custom relation has hasIsPrimary enabled.
- `leadOppty1Id: ID` Id of the lead or opportunity on the field1 side of this custom relation link; empty when that record is of another type.
- `leadOppty2Id: ID` Id of the lead or opportunity on the field2 side of this custom relation link; empty when that record is of another type.
- `opptyProductRelation1Id: ID` Id of the opportunity product line on the field1 side of this custom relation link; empty when that record is of another type.
- `opptyProductRelation2Id: ID` Id of the opportunity product line on the field2 side of this custom relation link; empty when that record is of another type.
- `product1Id: ID` Id of the product on the field1 side of this custom relation link; empty when that record is of another type.
- `product2Id: ID` Id of the product on the field2 side of this custom relation link; empty when that record is of another type.
- `project1Id: ID` Id of the project on the field1 side of this custom relation link; empty when that record is of another type.
- `project2Id: ID` Id of the project on the field2 side of this custom relation link; empty when that record is of another type.
- `quote1Id: ID` Id of the quote on the field1 side of this custom relation link; empty when that record is of another type.
- `quote2Id: ID` Id of the quote on the field2 side of this custom relation link; empty when that record is of another type.
- `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.

### CustomEntityRelationDataEntityConnection (object)

Paginated list of CustomEntityRelationData records.

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

### CustomEntityRelationDataEntityEdge (object)

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

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

### CustomEntityRelationDataFilterInput (input)

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

- `OR: [CustomEntityRelationDataFilterInput!]` Matches records that meet at least one of the listed filters.
- `AND: [CustomEntityRelationDataFilterInput!]` Matches records that meet all of the listed filters.
- `NOT: CustomEntityRelationDataFilterInput` 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.
- `account1Id: EntityFilterStringField` Id of the account on the field1 side of this custom relation link; empty when that record is of another type.
- `account2Id: EntityFilterStringField` Id of the account on the field2 side of this custom relation link; empty when that record is of another type.
- `activity1Id: EntityFilterStringField` Id of the appointment or task on the field1 side of this custom relation link; empty when that record is of another type.
- `activity2Id: EntityFilterStringField` Id of the appointment or task on the field2 side of this custom relation link; empty when that record is of another type.
- `client1Id: EntityFilterStringField` Id of the user on the field1 side of this custom relation link; empty when that record is of another type.
- `client2Id: EntityFilterStringField` Id of the user on the field2 side of this custom relation link; empty when that record is of another type.
- `contact1Id: EntityFilterStringField` Id of the contact on the field1 side of this custom relation link; empty when that record is of another type.
- `contact2Id: EntityFilterStringField` Id of the contact on the field2 side of this custom relation link; empty when that record is of another type.
- `customEntity1Id: EntityFilterStringField` Id of the custom entity record on the field1 side of this custom relation link; empty when that record is of another type.
- `customEntity2Id: EntityFilterStringField` Id of the custom entity record on the field2 side of this custom relation link; empty when that record is of another type.
- `customEntityRelationId: EntityFilterStringField` Id of the custom relation this link belongs to.
- `isPrimary: Boolean` True when the linked record is the primary one among the records linked through the same lookup field; used when the custom relation has hasIsPrimary enabled.
- `leadOppty1Id: EntityFilterStringField` Id of the lead or opportunity on the field1 side of this custom relation link; empty when that record is of another type.
- `leadOppty2Id: EntityFilterStringField` Id of the lead or opportunity on the field2 side of this custom relation link; empty when that record is of another type.
- `opptyProductRelation1Id: EntityFilterStringField` Id of the opportunity product line on the field1 side of this custom relation link; empty when that record is of another type.
- `opptyProductRelation2Id: EntityFilterStringField` Id of the opportunity product line on the field2 side of this custom relation link; empty when that record is of another type.
- `product1Id: EntityFilterStringField` Id of the product on the field1 side of this custom relation link; empty when that record is of another type.
- `product2Id: EntityFilterStringField` Id of the product on the field2 side of this custom relation link; empty when that record is of another type.
- `project1Id: EntityFilterStringField` Id of the project on the field1 side of this custom relation link; empty when that record is of another type.
- `project2Id: EntityFilterStringField` Id of the project on the field2 side of this custom relation link; empty when that record is of another type.
- `quote1Id: EntityFilterStringField` Id of the quote on the field1 side of this custom relation link; empty when that record is of another type.
- `quote2Id: EntityFilterStringField` Id of the quote on the field2 side of this custom relation link; empty when that record is of another type.
- `revision: EntityFilterNumberField` Revision when entity was lastly changed.
- `account1: AccountFilterInput` Account on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `account2: AccountFilterInput` Account on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `appointment1: AppointmentFilterInput` Appointment on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `task1: TaskFilterInput` Task on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `appointment2: AppointmentFilterInput` Appointment on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `task2: TaskFilterInput` Task on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `client1: ClientFilterInput` User on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `client2: ClientFilterInput` User on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `contact1: ContactFilterInput` Contact on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `contact2: ContactFilterInput` Contact on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `customEntity1: CustomEntityFilterInput` Custom entity record on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `customEntity2: CustomEntityFilterInput` Custom entity record on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `customEntityRelation: CustomEntityRelationFilterInput` Custom relation (pair of lookup fields) this link belongs to. Matches records where a related record meets these conditions.
- `lead1: LeadFilterInput` Lead on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `oppty1: OpportunityFilterInput` Opportunity on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `lead2: LeadFilterInput` Lead on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `oppty2: OpportunityFilterInput` Opportunity on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `opptyProductRelation1: OpptyProductRelationFilterInput` Opportunity product line on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `opptyProductRelation2: OpptyProductRelationFilterInput` Opportunity product line on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `product1: ProductFilterInput` Product on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `product2: ProductFilterInput` Product on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `project1: ProjectFilterInput` Project on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `project2: ProjectFilterInput` Project on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `quote1: QuoteFilterInput` Quote on the field1 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.
- `quote2: QuoteFilterInput` Quote on the field2 side of this custom relation link; empty when that record is of another type. Matches records where a related record meets these conditions.

### CustomEntityRelationDataOrderByInput (input)

Sorting of CustomEntityRelationData 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.
- `account1: [AccountOrderByNestedInput!]` Account on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `account2: [AccountOrderByNestedInput!]` Account on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `appointment1: [AppointmentOrderByNestedInput!]` Appointment on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `task1: [TaskOrderByNestedInput!]` Task on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `appointment2: [AppointmentOrderByNestedInput!]` Appointment on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `task2: [TaskOrderByNestedInput!]` Task on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `client1: [ClientOrderByNestedInput!]` User on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `client2: [ClientOrderByNestedInput!]` User on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `contact1: [ContactOrderByNestedInput!]` Contact on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `contact2: [ContactOrderByNestedInput!]` Contact on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `customEntity1: [CustomEntityOrderByNestedInput!]` Custom entity record on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `customEntity2: [CustomEntityOrderByNestedInput!]` Custom entity record on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `customEntityRelation: [CustomEntityRelationOrderByNestedInput!]` Custom relation (pair of lookup fields) this link belongs to. Sorts by fields of the related record, listed in order of priority.
- `lead1: [LeadOrderByNestedInput!]` Lead on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `oppty1: [OpportunityOrderByNestedInput!]` Opportunity on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `lead2: [LeadOrderByNestedInput!]` Lead on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `oppty2: [OpportunityOrderByNestedInput!]` Opportunity on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `opptyProductRelation1: [OpptyProductRelationOrderByNestedInput!]` Opportunity product line on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `opptyProductRelation2: [OpptyProductRelationOrderByNestedInput!]` Opportunity product line on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `product1: [ProductOrderByNestedInput!]` Product on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `product2: [ProductOrderByNestedInput!]` Product on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `project1: [ProjectOrderByNestedInput!]` Project on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `project2: [ProjectOrderByNestedInput!]` Project on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `quote1: [QuoteOrderByNestedInput!]` Quote on the field1 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `quote2: [QuoteOrderByNestedInput!]` Quote on the field2 side of this custom relation link; empty when that record is of another type. Sorts by fields of the related record, listed in order of priority.
- `account1Id: OrderByEnum` Id of the account on the field1 side of this custom relation link; empty when that record is of another type.
- `account2Id: OrderByEnum` Id of the account on the field2 side of this custom relation link; empty when that record is of another type.
- `activity1Id: OrderByEnum` Id of the appointment or task on the field1 side of this custom relation link; empty when that record is of another type.
- `activity2Id: OrderByEnum` Id of the appointment or task on the field2 side of this custom relation link; empty when that record is of another type.
- `client1Id: OrderByEnum` Id of the user on the field1 side of this custom relation link; empty when that record is of another type.
- `client2Id: OrderByEnum` Id of the user on the field2 side of this custom relation link; empty when that record is of another type.
- `contact1Id: OrderByEnum` Id of the contact on the field1 side of this custom relation link; empty when that record is of another type.
- `contact2Id: OrderByEnum` Id of the contact on the field2 side of this custom relation link; empty when that record is of another type.
- `customEntity1Id: OrderByEnum` Id of the custom entity record on the field1 side of this custom relation link; empty when that record is of another type.
- `customEntity2Id: OrderByEnum` Id of the custom entity record on the field2 side of this custom relation link; empty when that record is of another type.
- `customEntityRelationId: OrderByEnum` Id of the custom relation this link belongs to.
- `isPrimary: OrderByEnum` True when the linked record is the primary one among the records linked through the same lookup field; used when the custom relation has hasIsPrimary enabled.
- `leadOppty1Id: OrderByEnum` Id of the lead or opportunity on the field1 side of this custom relation link; empty when that record is of another type.
- `leadOppty2Id: OrderByEnum` Id of the lead or opportunity on the field2 side of this custom relation link; empty when that record is of another type.
- `opptyProductRelation1Id: OrderByEnum` Id of the opportunity product line on the field1 side of this custom relation link; empty when that record is of another type.
- `opptyProductRelation2Id: OrderByEnum` Id of the opportunity product line on the field2 side of this custom relation link; empty when that record is of another type.
- `product1Id: OrderByEnum` Id of the product on the field1 side of this custom relation link; empty when that record is of another type.
- `product2Id: OrderByEnum` Id of the product on the field2 side of this custom relation link; empty when that record is of another type.
- `project1Id: OrderByEnum` Id of the project on the field1 side of this custom relation link; empty when that record is of another type.
- `project2Id: OrderByEnum` Id of the project on the field2 side of this custom relation link; empty when that record is of another type.
- `quote1Id: OrderByEnum` Id of the quote on the field1 side of this custom relation link; empty when that record is of another type.
- `quote2Id: OrderByEnum` Id of the quote on the field2 side of this custom relation link; empty when that record is of another type.
- `revision: OrderByEnum` Revision when entity was lastly changed.

### CustomEntityRelationOrderByNestedInput (input)

Sorting by a field of the related CustomEntityRelation 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.
- `field1Id: OrderByEnum` Id of the lookup field on the first side of the custom relation.
- `field2Id: OrderByEnum` Id of the lookup field on the second side of the custom relation.
- `hasIsPrimary: OrderByEnum` When true, one of the records linked through the relation can be marked as primary. Cannot be switched back to false once enabled.
- `showRelated1: OrderByEnum` When true, field2 offers only records related to the record being edited. Not supported yet; must be false.
- `showRelated2: OrderByEnum` When true, field1 offers only records related to the record being edited (e.g. the contacts of its account).
- `showTab1: OrderByEnum` When true, the records linked through field1 are shown in a tab named tabName1.
- `showTab2: OrderByEnum` When true, the records linked through field2 are shown in a tab named tabName2.
- `tabName1: OrderByEnum` Name of the tab that shows the records linked through field1.
- `tabName2: OrderByEnum` Name of the tab that shows the records linked through field2.
- `isPublished: OrderByEnum` True when the entity configuration is published; false while it exists only as an unpublished draft.
- `revision: OrderByEnum` Revision when entity was lastly changed.

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