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

# entities.contactRelation

Read contact relation records with the contactRelation repository, and change them with the contact relation mutations. Same records as the REST ContactRelations entity.

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

## Queries

- `getById(entityId: ID!): ContactRelationEntity` Returns the record with the given id, or null when there is none. Deleted records are returned as well.
- `getByIds(entityIds: [ID!]!): [ContactRelationEntity!]!` 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: ContactRelationFilterInput, orderBy: [ContactRelationOrderByInput!], includeDeleted: Boolean): [ContactRelationEntity!]!` Returns the records that match the filter, paged with limit and offset.
- `getByCriteria(filter: ContactRelationFilterInput, orderBy: [ContactRelationOrderByInput!], includeDeleted: Boolean): [ContactRelationEntity!]!` 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

- `createContactRelation(input: CreateContactRelationInput!, validationLevel: [ValidationLevel!]): CreateContactRelationPayload` Create one record.
- `updateContactRelation(input: UpdateContactRelationInput!, validationLevel: [ValidationLevel!], sessionIdToUpdate: String): UpdateContactRelationPayload` Update fields.
- `bulkUpdateContactRelation(input: [CreateOrUpdateContactRelationInput!]!, deleteInput: [DeleteContactRelationInput!], validationLevel: [ValidationLevel!], rollbackMethod: RollbackMethod, match: MatchingInput): BulkUpdateContactRelationPayload` Create or update many; per-item results.
- `deleteContactRelation(input: DeleteContactRelationInput!): DeleteContactRelationPayload` Soft-delete.

## Types

### ContactRelationEntity (object)

Link between two related contacts, such as colleagues or family members; its labels give the kind of relationship.

- `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.
- `contact1: ContactEntity` One side of the contact-to-contact relationship.
- `contact2: ContactEntity` Other side of the contact-to-contact relationship.
- `contact1Id: ID!` Id of the first related contact.
- `contact2Id: ID!` Id of the second related contact.
- `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.

### ContactRelationFilterInput (input)

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

- `OR: [ContactRelationFilterInput!]` Matches records that meet at least one of the listed filters.
- `AND: [ContactRelationFilterInput!]` Matches records that meet all of the listed filters.
- `NOT: ContactRelationFilterInput` 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.
- `contact1Id: EntityFilterStringField` Id of the first related contact.
- `contact2Id: EntityFilterStringField` Id of the second related contact.
- `revision: EntityFilterNumberField` Revision when entity was lastly changed.
- `contact1: ContactFilterInput` One side of the contact-to-contact relationship. Matches records where a related record meets these conditions.
- `contact2: ContactFilterInput` Other side of the contact-to-contact relationship. Matches records where a related record meets these conditions.

### ContactRelationOrderByInput (input)

Sorting of ContactRelation 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.
- `contact1: [ContactOrderByNestedInput!]` One side of the contact-to-contact relationship. Sorts by fields of the related record, listed in order of priority.
- `contact2: [ContactOrderByNestedInput!]` Other side of the contact-to-contact relationship. Sorts by fields of the related record, listed in order of priority.
- `contact1Id: OrderByEnum` Id of the first related contact.
- `contact2Id: OrderByEnum` Id of the second related contact.
- `revision: OrderByEnum` Revision when entity was lastly changed.

### CreateContactRelationInput (input)

Field values of a new ContactRelation 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.
- `contact1Id: ID!` Id of the first related contact.
- `contact2Id: ID!` Id of the second related contact.
- `revision: Int` Revision when entity was lastly changed.

### CreateOrUpdateContactRelationInput (input)

Field values of a ContactRelation 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.
- `contact1Id: ID` Id of the first related contact.
- `contact2Id: ID` Id of the second related contact.
- `revision: Int` Revision when entity was lastly changed.

### DeleteContactRelationInput (input)

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

### UpdateContactRelationInput (input)

Id of a ContactRelation 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.
- `contact1Id: ID` Id of the first related contact.
- `contact2Id: ID` Id of the second related contact.
- `revision: Int` Revision when entity was lastly changed.

### BulkUpdateContactRelationPayload (object)

Result of the bulkUpdateContactRelation mutation.

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

### CreateContactRelationPayload (object)

Result of the createContactRelation mutation.

- `contactRelation: ContactRelationEntity` 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).

### DeleteContactRelationPayload (object)

Result of the deleteContactRelation mutation.

- `contactRelation: ContactRelationEntity` 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).

### UpdateContactRelationPayload (object)

Result of the updateContactRelation mutation.

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