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

# entities.chatConversation

Read chat conversation records with the chatConversation repository, and change them with the chat conversation mutations. Same records as the REST ChatConversations entity.

REST: [ChatConversations](https://developers.coevera.com/reference/rest/chat-conversations.md).

## Queries

- `getById(entityId: ID!): ChatConversationEntity` Returns the record with the given id, or null when there is none. Deleted records are returned as well.
- `getByIds(entityIds: [ID!]!): [ChatConversationEntity!]!` 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: ChatConversationFilterInput, orderBy: [ChatConversationOrderByInput!], includeDeleted: Boolean): [ChatConversationEntity!]!` Returns the records that match the filter, paged with limit and offset.
- `getByCriteria(filter: ChatConversationFilterInput, orderBy: [ChatConversationOrderByInput!], includeDeleted: Boolean, before: String, after: String, first: Int, last: Int): ChatConversationEntityConnection` 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.
- `pollMessages(input: PollMessagesInput!): [TextMessageEntity!]!` Returns the messages of the AI chat conversation that were added or changed after the given time, so a client can poll for new replies.

## Mutations

- `createChatConversation(input: CreateChatConversationInput!, validationLevel: [ValidationLevel!]): CreateChatConversationPayload` Create one record.
- `updateChatConversation(input: UpdateChatConversationInput!, validationLevel: [ValidationLevel!], sessionIdToUpdate: String): UpdateChatConversationPayload` Update fields.
- `bulkUpdateChatConversation(input: [CreateOrUpdateChatConversationInput!]!, deleteInput: [DeleteChatConversationInput!], validationLevel: [ValidationLevel!], rollbackMethod: RollbackMethod, match: MatchingInput): BulkUpdateChatConversationPayload` Create or update many; per-item results.
- `deleteChatConversation(input: DeleteChatConversationInput!): DeleteChatConversationPayload` Soft-delete.

## Types

### ChatConversationEntity (object)

Conversation of a user with the AI assistant, either general or about a specific 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.
- `owner: ClientEntity` User the conversation belongs to.
- `context: AiContext` Record context the conversation was started in (entity type, entity id and the AI screen view). Empty for conversations not bound to a record.
- `ownerId: ID!` Id of the owning user.
- `type: ChatConversationTypeEnum` Kind of AI chat: a general conversation with the AI assistant, or one about a specific record identified by context.
- `messages: TextMessageEntityConnection (7 args)` Messages exchanged in the conversation, in chronological order.
- `instancePermissions: [EntityPermsEnum!]! (1 args)` Permissions the current user has on this record, out of the requested ones.

### ChatConversationEntityConnection (object)

Paginated list of ChatConversation records.

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

### ChatConversationEntityEdge (object)

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

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

### ChatConversationFilterInput (input)

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

- `OR: [ChatConversationFilterInput!]` Matches records that meet at least one of the listed filters.
- `AND: [ChatConversationFilterInput!]` Matches records that meet all of the listed filters.
- `NOT: ChatConversationFilterInput` 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.
- `ownerId: EntityFilterStringField` Id of the owning user.
- `type: ChatConversationTypeEnumFilterInput` Kind of AI chat: a general conversation with the AI assistant, or one about a specific record identified by context.
- `owner: ClientFilterInput` User the conversation belongs to. Matches records where a related record meets these conditions.
- `messages: TextMessageFilterInput` Messages exchanged in the conversation, in chronological order. Matches records where a related record meets these conditions.

### ChatConversationOrderByInput (input)

Sorting of ChatConversation 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.
- `owner: [ClientOrderByNestedInput!]` User the conversation belongs to. Sorts by fields of the related record, listed in order of priority.
- `ownerId: OrderByEnum` Id of the owning user.
- `type: OrderByEnum` Kind of AI chat: a general conversation with the AI assistant, or one about a specific record identified by context.

### ChatConversationTypeEnumFilterInput (input)

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

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

### CreateChatConversationInput (input)

Field values of a new ChatConversation 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.
- `ownerId: ID!` Id of the owning user.
- `type: ChatConversationTypeEnum` Kind of AI chat: a general conversation with the AI assistant, or one about a specific record identified by context.
- `messages: [CreateTextMessageNoChatConversationBackrefInput!]` Messages exchanged in the conversation, in chronological order.

### CreateOrUpdateChatConversationInput (input)

Field values of a ChatConversation 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.
- `ownerId: ID` Id of the owning user.
- `type: ChatConversationTypeEnum` Kind of AI chat: a general conversation with the AI assistant, or one about a specific record identified by context.
- `messages: [CreateOrUpdateTextMessageNoChatConversationBackrefInput!]` Messages exchanged in the conversation, in chronological order.

### CreateOrUpdateTextMessageNoChatConversationBackrefInput (input)

Field values of a TextMessage record to create, or to update when its id is set, together with the record it belongs to.

- `id: ID` Unique identifier of entity.
- `modified: DateTime` Last modification time.
- `created: DateTime` Creation time.
- `content: String` Body of the message. May be plain text or a JSON payload (e.g. AI assistant examples / suggestions).
- `datetimeSent: DateTime` Timestamp the message was sent.
- `direction: EmailDirectionEnum` Direction of the message (Incoming, Outgoing).
- `messageSid: String` External message identifier from the SMS provider (e.g. Twilio Message SID).
- `score: Int` Quality score given to the message by the user (e.g. for AI-suggested replies). Used to feed back into the suggestion engine.
- `status: TextMessageStatusEnum` Delivery status of the message: Sending, Sent, Seen or Failed for outgoing messages, Received for incoming ones.
- `textMessageConversationId: ID` Id of the text message conversation this message belongs to, or empty for AI assistant chat messages.
- `revision: Int` Revision when entity was lastly changed.
- `attachments: [CreateCloudObjectRelationNoBackrefInput!]` Files attached to the message (e.g. MMS attachments).

### CreateTextMessageNoChatConversationBackrefInput (input)

Field values of a new TextMessage record, created together with the record it belongs to.

- `modified: DateTime` Last modification time.
- `created: DateTime` Creation time.
- `content: String!` Body of the message. May be plain text or a JSON payload (e.g. AI assistant examples / suggestions).
- `datetimeSent: DateTime` Timestamp the message was sent.
- `direction: EmailDirectionEnum!` Direction of the message (Incoming, Outgoing).
- `messageSid: String` External message identifier from the SMS provider (e.g. Twilio Message SID).
- `score: Int` Quality score given to the message by the user (e.g. for AI-suggested replies). Used to feed back into the suggestion engine.
- `status: TextMessageStatusEnum` Delivery status of the message: Sending, Sent, Seen or Failed for outgoing messages, Received for incoming ones.
- `textMessageConversationId: ID` Id of the text message conversation this message belongs to, or empty for AI assistant chat messages.
- `revision: Int` Revision when entity was lastly changed.
- `attachments: [CreateCloudObjectRelationNoBackrefInput!]` Files attached to the message (e.g. MMS attachments).

### DeleteChatConversationInput (input)

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

### UpdateChatConversationInput (input)

Id of a ChatConversation 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.
- `ownerId: ID` Id of the owning user.
- `type: ChatConversationTypeEnum` Kind of AI chat: a general conversation with the AI assistant, or one about a specific record identified by context.
- `messages: [CreateOrUpdateTextMessageNoChatConversationBackrefInput!]` Messages exchanged in the conversation, in chronological order.

### BulkUpdateChatConversationPayload (object)

Result of the bulkUpdateChatConversation mutation.

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

### CreateChatConversationPayload (object)

Result of the createChatConversation mutation.

- `chatConversation: ChatConversationEntity` 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).

### DeleteChatConversationPayload (object)

Result of the deleteChatConversation mutation.

- `chatConversation: ChatConversationEntity` 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).

### UpdateChatConversationPayload (object)

Result of the updateChatConversation mutation.

- `chatConversation: ChatConversationEntity` 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).

### AiContext (object)

Record an AI chat conversation is about, with the screen it was started from.

- `entityType: EntityNameEnum` Entity of the record the conversation is about.
- `entityApiName: String` API name of the custom entity when entityType is CustomEntity; null otherwise.
- `entityId: ID` Id of the record the conversation is about.
- `data: JSONString` Data of the screen the conversation was started from, as a JSON object.

### ChatConversationTypeEnum (enum)

Kind of AI chat conversation.

- `AiChat` General conversation with the AI assistant.
- `AiRecordDetail` Conversation with the AI assistant about a specific record.

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