GraphQLRepositorieschatConversation
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.
Queries
Fields of entities { chatConversation { … } }.
| Kind | Field | Returns |
|---|---|---|
| QUERY | getById(entityId: ID!)Returns the record with the given id, or null when there is none. Deleted records are returned as well. | ChatConversationEntity |
| QUERY | getByIds(entityIds: [ID!]!)Returns the records with the given ids; ids without a record are left out. Deleted records are returned as well. | [ChatConversationEntity!]! |
| QUERY | getAll(limit: Int, offset: Int, filter: ChatConversationFilterInput, orderBy: [ChatConversationOrderByInput!], includeDeleted: Boolean)Returns the records that match the filter, paged with limit and offset. | [ChatConversationEntity!]! |
| QUERY | getByCriteria(filter: ChatConversationFilterInput, orderBy: [ChatConversationOrderByInput!], includeDeleted: Boolean, before: String, after: String, first: Int, last: Int)Returns the records that match the filter as a cursor-paginated connection. | ChatConversationEntityConnection |
| QUERY | getChangedFieldsSinceRevision(id: UUID!, revision: Int!)Returns the ids of the fields of a record that changed after the given revision. Returns an empty list for entities without change tracking. | [UUID!]! |
| QUERY | pollMessages(input: PollMessagesInput!)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. | [TextMessageEntity!]! |
Mutations
| Kind | Mutation | Does | Returns |
|---|---|---|---|
| MUTATION | createChatConversation(input: CreateChatConversationInput!, validationLevel: [ValidationLevel!]) | Create one record | CreateChatConversationPayload |
| MUTATION | updateChatConversation(input: UpdateChatConversationInput!, validationLevel: [ValidationLevel!], sessionIdToUpdate: String) | Update fields | UpdateChatConversationPayload |
| MUTATION | bulkUpdateChatConversation(input: [CreateOrUpdateChatConversationInput!]!, deleteInput: [DeleteChatConversationInput!], validationLevel: [ValidationLevel!], rollbackMethod: RollbackMethod, match: MatchingInput) | Create or update many; per-item results | BulkUpdateChatConversationPayload |
| MUTATION | deleteChatConversation(input: DeleteChatConversationInput!) | Soft-delete | DeleteChatConversationPayload |
Types
The types this repository uses, each with its fields and their descriptions. Types several repositories share, such as PageInfo and the filter fields, are in the types index.
ChatConversationEntity object 11 fields: isDeleteProtected, id, isDeleted, …
Conversation of a user with the AI assistant, either general or about a specific record.
| Field | Type | Description |
|---|---|---|
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 pageInfo: PageInfo!, edges: [ChatConversationEntityEdge]!, totalCount: Int
Paginated list of ChatConversation records.
| Field | Type | Description |
|---|---|---|
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 node: ChatConversationEntity, cursor: String!
A Relay edge containing a ChatConversationEntity and its cursor.
| Field | Type | Description |
|---|---|---|
node | ChatConversationEntity | The item at the end of the edge |
cursor | String! | A cursor for use in pagination |
ChatConversationFilterInput input AND, OR, NOT, globalSearchQuery, one condition per field
Filter conditions for ChatConversation records. Conditions on different fields are combined with AND; use OR, AND and NOT for other combinations.
| Input field | Type | Description |
|---|---|---|
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 Asc or Desc per field
Sorting of ChatConversation records. Set exactly one field in each item; list several items to sort by more fields, in order of priority.
| Input field | Type | Description |
|---|---|---|
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 eq: [ChatConversationTypeEnum!], NOT: ChatConversationTypeEnumFilterInput
Conditions on an enumeration field. Several conditions given together must all match.
| Input field | Type | Description |
|---|---|---|
eq | [ChatConversationTypeEnum!] | Matches any of the listed values. |
NOT | ChatConversationTypeEnumFilterInput | Matches values that do not meet this condition. |
CreateChatConversationInput input 6 fields: clientMutationId, modified, created, …
Field values of a new ChatConversation record.
| Input field | Type | Description |
|---|---|---|
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 7 fields: clientMutationId, id, modified, …
Field values of a ChatConversation record to create, or to update when its id is set.
| Input field | Type | Description |
|---|---|---|
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 12 fields: id, modified, created, …
Field values of a TextMessage record to create, or to update when its id is set, together with the record it belongs to.
| Input field | Type | Description |
|---|---|---|
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 11 fields: modified, created, content, …
Field values of a new TextMessage record, created together with the record it belongs to.
| Input field | Type | Description |
|---|---|---|
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 clientMutationId: String, id: ID!
Id of the ChatConversation record to delete.
| Input field | Type | Description |
|---|---|---|
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 7 fields: clientMutationId, id, modified, …
Id of a ChatConversation record and the field values to change.
| Input field | Type | Description |
|---|---|---|
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: BulkUpdateResults!
Result of the bulkUpdateChatConversation mutation.
| Field | Type | Description |
|---|---|---|
result | BulkUpdateResults! | Ids of the created, updated and deleted records, and the items that failed. |
CreateChatConversationPayload object chatConversation: ChatConversationEntity, clientMutationId: String
Result of the createChatConversation mutation.
| Field | Type | Description |
|---|---|---|
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 chatConversation: ChatConversationEntity, clientMutationId: String
Result of the deleteChatConversation mutation.
| Field | Type | Description |
|---|---|---|
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 chatConversation: ChatConversationEntity, clientMutationId: String
Result of the updateChatConversation mutation.
| Field | Type | Description |
|---|---|---|
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 entityType: EntityNameEnum, entityApiName: String, entityId: ID, data: JSONString
Record an AI chat conversation is about, with the screen it was started from.
| Field | Type | Description |
|---|---|---|
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 AiChat, AiRecordDetail
Kind of AI chat conversation.
| Value | Description |
|---|---|
AiChat | General conversation with the AI assistant. |
AiRecordDetail | Conversation with the AI assistant about a specific record. |