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

# entities.emailMailboxRelation

Read email mailbox relation records with the emailMailboxRelation repository, and change them with the email mailbox relation mutations. Same records as the REST EmailMailboxRelations entity.

REST: [EmailMailboxRelations](https://developers.coevera.com/reference/rest/email-mailbox-relations.md).

## Queries

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

### EmailMailboxRelationEntity (object)

Link between an email and a mailbox the email belongs to.

- `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.
- `email: EmailEntity` Email that belongs to the mailbox.
- `direction: EmailDirectionEnum` Direction of the email relative to this mailbox: outgoing for the mailbox that sent it, incoming for a mailbox that received it. The same email can therefore be outgoing in one mailbox and incoming in another. Defaults to the email direction when not set.
- `emailCreated: DateTime` Creation time.
- `emailId: ID!` Id of the email that belongs to the mailbox.
- `emailIsDeleted: Boolean` True when the related email has been deleted from this mailbox; such links are hidden from the inbox view.
- `errorCode: Int` Error code for the email in this mailbox; 0 means the email was processed without error.
- `eventTypes: EmailEventTypeFlagEnum` Tracking events recorded so far for the related email (opens, clicks, replies, bounces, unsubscribes); several can be combined. Read-only; kept in sync with the email's EmailEvent records.
- `isDraft: Boolean` Copy of the related email's draft flag; true when the email is an unsent draft, which shows it in the mailbox Drafts.
- `isScheduled: Boolean` Whether the email is scheduled to be sent at a future time and has not been sent yet.
- `labelIds: JSONString` Ids of the labels applied to this conversation in this mailbox. Read-only copy of the EmailLabelRelation records; manage labels via that entity rather than writing here.
- `mailboxId: ID!` Id of the mailbox (connected email account) the email belongs to.
- `sentOrScheduledAt: DateTime` Time when the email was sent, or its scheduled send time if it has not been sent yet.
- `threadOrId: ID` Id of the email thread, or the id of the email itself when it does not belong to a thread.
- `type: EmailTypeEnum` Copy of the related email's type: an individual email or part of a mass email. Read-only; kept in sync with the email.
- `instancePermissions: [EntityPermsEnum!]! (1 args)` Permissions the current user has on this record, out of the requested ones.

### EmailEventTypeFlagEnumFilterInput (input)

Conditions on an enumeration field. Several conditions given together must all match.

- `eq: [EmailEventTypeFlagEnum!]` Matches any of the listed values.
- `NOT: EmailEventTypeFlagEnumFilterInput` Matches values that do not meet this condition.

### EmailMailboxRelationFilterInput (input)

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

- `OR: [EmailMailboxRelationFilterInput!]` Matches records that meet at least one of the listed filters.
- `AND: [EmailMailboxRelationFilterInput!]` Matches records that meet all of the listed filters.
- `NOT: EmailMailboxRelationFilterInput` 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.
- `direction: EmailDirectionEnumFilterInput` Direction of the email relative to this mailbox: outgoing for the mailbox that sent it, incoming for a mailbox that received it. The same email can therefore be outgoing in one mailbox and incoming in another. Defaults to the email direction when not set.
- `emailCreated: EntityFilterDateTimeField` Creation time.
- `emailId: EntityFilterStringField` Id of the email that belongs to the mailbox.
- `emailIsDeleted: Boolean` True when the related email has been deleted from this mailbox; such links are hidden from the inbox view.
- `errorCode: EntityFilterNumberField` Error code for the email in this mailbox; 0 means the email was processed without error.
- `eventTypes: EmailEventTypeFlagEnumFilterInput` Tracking events recorded so far for the related email (opens, clicks, replies, bounces, unsubscribes); several can be combined. Read-only; kept in sync with the email's EmailEvent records.
- `isDraft: Boolean` Copy of the related email's draft flag; true when the email is an unsent draft, which shows it in the mailbox Drafts.
- `isScheduled: Boolean` Whether the email is scheduled to be sent at a future time and has not been sent yet.
- `mailboxId: EntityFilterStringField` Id of the mailbox (connected email account) the email belongs to.
- `sentOrScheduledAt: EntityFilterDateTimeField` Time when the email was sent, or its scheduled send time if it has not been sent yet.
- `threadOrId: EntityFilterStringField` Id of the email thread, or the id of the email itself when it does not belong to a thread.
- `type: EmailTypeEnumFilterInput` Copy of the related email's type: an individual email or part of a mass email. Read-only; kept in sync with the email.
- `email: EmailFilterInput` Email that belongs to the mailbox. Matches records where a related record meets these conditions.

### EmailMailboxRelationOrderByInput (input)

Sorting of EmailMailboxRelation 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.
- `email: [EmailOrderByNestedInput!]` Email that belongs to the mailbox. Sorts by fields of the related record, listed in order of priority.
- `direction: OrderByEnum` Direction of the email relative to this mailbox: outgoing for the mailbox that sent it, incoming for a mailbox that received it. The same email can therefore be outgoing in one mailbox and incoming in another. Defaults to the email direction when not set.
- `emailCreated: OrderByEnum` Creation time.
- `emailId: OrderByEnum` Id of the email that belongs to the mailbox.
- `errorCode: OrderByEnum` Error code for the email in this mailbox; 0 means the email was processed without error.
- `isDraft: OrderByEnum` Copy of the related email's draft flag; true when the email is an unsent draft, which shows it in the mailbox Drafts.
- `isScheduled: OrderByEnum` Whether the email is scheduled to be sent at a future time and has not been sent yet.
- `sentOrScheduledAt: OrderByEnum` Time when the email was sent, or its scheduled send time if it has not been sent yet.
- `type: OrderByEnum` Copy of the related email's type: an individual email or part of a mass email. Read-only; kept in sync with the email.

### EmailEventTypeFlagEnum (enum)

Set of tracked events recorded for an email in a mailbox; several flags can be combined.

- `Open` The recipient opened the email.
- `Click` The recipient clicked a link in the email.
- `Unsubscribe` The recipient unsubscribed through the email.
- `Bounce` The email bounced permanently (hard bounce).
- `Reply` The recipient replied to the email.
- `BounceSoft` Delivery failed temporarily or was delayed (soft bounce).

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