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

# entities.textMessageConversation

Read text message conversation records with the textMessageConversation repository, and change them with the text message conversation mutations. Same records as the REST TextMessageConversations entity.

REST: [TextMessageConversations](https://developers.coevera.com/reference/rest/text-message-conversations.md).

## Queries

- `getById(entityId: ID!): TextMessageConversationEntity` Returns the record with the given id, or null when there is none. Deleted records are returned as well.
- `getByIds(entityIds: [ID!]!): [TextMessageConversationEntity!]!` 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: TextMessageConversationFilterInput, orderBy: [TextMessageConversationOrderByInput!], includeDeleted: Boolean): [TextMessageConversationEntity!]!` Returns the records that match the filter, paged with limit and offset.
- `getByCriteria(filter: TextMessageConversationFilterInput, orderBy: [TextMessageConversationOrderByInput!], includeDeleted: Boolean, before: String, after: String, first: Int, last: Int): TextMessageConversationEntityConnection` 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.
- `getByPhone(phoneNumber: String!, country: String!): TextMessageConversationEntity` Returns the current user's text message conversation with the given phone number, or null when there is none. The user must have a personal SMS number; otherwise an error is returned.
- `pollMessages(input: PollMessagesInput!): [TextMessageEntity!]!` Returns the messages of the text message conversation that were added or changed after the given time, so a client can poll for new messages. Returns an empty list when no time is given.

## Mutations

- `createTextMessageConversation(input: CreateTextMessageConversationInput!, validationLevel: [ValidationLevel!]): CreateTextMessageConversationPayload` Create one record.
- `updateTextMessageConversation(input: UpdateTextMessageConversationInput!, validationLevel: [ValidationLevel!], sessionIdToUpdate: String): UpdateTextMessageConversationPayload` Update fields.

## Types

### TextMessageConversationEntity (object)

Text message conversation between a Coevera phone number and an external phone number.

- `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.
- `phone: PhoneEntity` Coevera phone number used as the sender side of the conversation.
- `recipientAccount: AccountEntity` Account record matched to the recipient phone, when one exists.
- `recipientContact: ContactEntity` Contact record matched to the recipient phone, when one exists.
- `phoneId: ID!` Id of the sender phone.
- `recipientAccountId: ID` Id of the matched account.
- `recipientContactId: ID` Id of the matched contact.
- `recipientPhoneNumber: String` External phone number of the conversation recipient. Cannot be changed once the conversation has started.
- `revision: Int` Revision when entity was lastly changed.
- `messages: TextMessageEntityConnection (7 args)` Messages exchanged in the conversation, ordered by send time.
- `accountRelations: TextMessageConversationRelationsEntityConnection (8 args)` Accounts linked to this conversation.
- `contactRelations: TextMessageConversationRelationsEntityConnection (8 args)` Contacts linked to this conversation.
- `projectRelations: TextMessageConversationRelationsEntityConnection (8 args)` Projects linked to this conversation.
- `leadRelations: TextMessageConversationRelationsEntityConnection (8 args)` Leads linked to this conversation.
- `opportunityRelations: TextMessageConversationRelationsEntityConnection (8 args)` Opportunities linked to this conversation.
- `quoteRelations: TextMessageConversationRelationsEntityConnection (8 args)` Quotes linked to this conversation.
- `instancePermissions: [EntityPermsEnum!]! (1 args)` Permissions the current user has on this record, out of the requested ones.

### TextMessageConversationEntityConnection (object)

Paginated list of TextMessageConversation records.

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

### TextMessageConversationEntityEdge (object)

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

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

### TextMessageConversationFilterInput (input)

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

- `OR: [TextMessageConversationFilterInput!]` Matches records that meet at least one of the listed filters.
- `AND: [TextMessageConversationFilterInput!]` Matches records that meet all of the listed filters.
- `NOT: TextMessageConversationFilterInput` 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.
- `phoneId: EntityFilterStringField` Id of the sender phone.
- `recipientAccountId: EntityFilterStringField` Id of the matched account.
- `recipientContactId: EntityFilterStringField` Id of the matched contact.
- `recipientPhoneNumber: EntityFilterStringField` External phone number of the conversation recipient. Cannot be changed once the conversation has started.
- `revision: EntityFilterNumberField` Revision when entity was lastly changed.
- `phone: PhoneFilterInput` Coevera phone number used as the sender side of the conversation. Matches records where a related record meets these conditions.
- `recipientAccount: AccountFilterInput` Account record matched to the recipient phone, when one exists. Matches records where a related record meets these conditions.
- `recipientContact: ContactFilterInput` Contact record matched to the recipient phone, when one exists. Matches records where a related record meets these conditions.
- `messages: TextMessageFilterInput` Messages exchanged in the conversation, ordered by send time. Matches records where a related record meets these conditions.
- `accountRelations: TextMessageConversationRelationsFilterInput` Accounts linked to this conversation. Matches records where a related record meets these conditions.
- `contactRelations: TextMessageConversationRelationsFilterInput` Contacts linked to this conversation. Matches records where a related record meets these conditions.
- `projectRelations: TextMessageConversationRelationsFilterInput` Projects linked to this conversation. Matches records where a related record meets these conditions.
- `leadRelations: TextMessageConversationRelationsFilterInput` Leads linked to this conversation. Matches records where a related record meets these conditions.
- `opportunityRelations: TextMessageConversationRelationsFilterInput` Opportunities linked to this conversation. Matches records where a related record meets these conditions.
- `quoteRelations: TextMessageConversationRelationsFilterInput` Quotes linked to this conversation. Matches records where a related record meets these conditions.

### TextMessageConversationOrderByInput (input)

Sorting of TextMessageConversation 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.
- `phone: [PhoneOrderByNestedInput!]` Coevera phone number used as the sender side of the conversation. Sorts by fields of the related record, listed in order of priority.
- `recipientAccount: [AccountOrderByNestedInput!]` Account record matched to the recipient phone, when one exists. Sorts by fields of the related record, listed in order of priority.
- `recipientContact: [ContactOrderByNestedInput!]` Contact record matched to the recipient phone, when one exists. Sorts by fields of the related record, listed in order of priority.
- `phoneId: OrderByEnum` Id of the sender phone.
- `recipientAccountId: OrderByEnum` Id of the matched account.
- `recipientContactId: OrderByEnum` Id of the matched contact.
- `recipientPhoneNumber: OrderByEnum` External phone number of the conversation recipient. Cannot be changed once the conversation has started.
- `revision: OrderByEnum` Revision when entity was lastly changed.

### CreateOrUpdateTextMessageNoTextMessageConversationBackrefInput (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.
- `chatConversationId: ID` Id of the AI assistant chat conversation this message belongs to, when applicable.
- `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.
- `revision: Int` Revision when entity was lastly changed.
- `attachments: [CreateCloudObjectRelationNoBackrefInput!]` Files attached to the message (e.g. MMS attachments).

### CreateTextMessageConversationInput (input)

Field values of a new TextMessageConversation 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.
- `phoneId: ID!` Id of the sender phone.
- `recipientAccountId: ID` Id of the matched account.
- `recipientContactId: ID` Id of the matched contact.
- `recipientPhoneNumber: String` External phone number of the conversation recipient. Cannot be changed once the conversation has started.
- `revision: Int` Revision when entity was lastly changed.
- `messages: [CreateTextMessageNoTextMessageConversationBackrefInput!]` Messages exchanged in the conversation, ordered by send time.
- `accountRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Accounts linked to this conversation.
- `contactRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Contacts linked to this conversation.
- `projectRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Projects linked to this conversation.
- `leadRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Leads linked to this conversation.
- `opportunityRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Opportunities linked to this conversation.
- `quoteRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Quotes linked to this conversation.

### CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput (input)

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

- `modified: DateTime` Last modification time.
- `created: DateTime` Creation time.
- `accountId: ID` Id of the linked account.
- `contactId: ID` Id of the linked contact.
- `leadOpptyId: ID` Id of the lead or opportunity the conversation is linked to, or empty when not linked.
- `projectId: ID` Id of the linked project, or empty when not linked.
- `quoteId: ID` Id of the linked quote, or empty when not linked.
- `revision: Int` Revision when entity was lastly changed.

### CreateTextMessageNoTextMessageConversationBackrefInput (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.
- `chatConversationId: ID` Id of the AI assistant chat conversation this message belongs to, when applicable.
- `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.
- `revision: Int` Revision when entity was lastly changed.
- `attachments: [CreateCloudObjectRelationNoBackrefInput!]` Files attached to the message (e.g. MMS attachments).

### UpdateTextMessageConversationInput (input)

Id of a TextMessageConversation 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.
- `phoneId: ID` Id of the sender phone.
- `recipientAccountId: ID` Id of the matched account.
- `recipientContactId: ID` Id of the matched contact.
- `recipientPhoneNumber: String` External phone number of the conversation recipient. Cannot be changed once the conversation has started.
- `revision: Int` Revision when entity was lastly changed.
- `messages: [CreateOrUpdateTextMessageNoTextMessageConversationBackrefInput!]` Messages exchanged in the conversation, ordered by send time.
- `accountRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Accounts linked to this conversation.
- `contactRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Contacts linked to this conversation.
- `projectRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Projects linked to this conversation.
- `leadRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Leads linked to this conversation.
- `opportunityRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Opportunities linked to this conversation.
- `quoteRelations: [CreateTextMessageConversationRelationsNoTextMessageConversationBackrefInput!]` Quotes linked to this conversation.

### CreateTextMessageConversationPayload (object)

Result of the createTextMessageConversation mutation.

- `textMessageConversation: TextMessageConversationEntity` 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).

### UpdateTextMessageConversationPayload (object)

Result of the updateTextMessageConversation mutation.

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