Skip to main content

copilotSessionMessages

Requires permission catalog:copilot:chat.

Messages of one of the caller's OWN chats that are older than before, oldest first. copilotSession returns only the newest window; this reads the rest.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query CopilotSessionMessages($before: ID!, $sessionId: ID!) {
copilotSessionMessages(before: $before, sessionId: $sessionId) {
hasMore
messages {
id
createdAt
cardIds
feedback
role
text
}
}
}

Variables:

{
"before": "id",
"sessionId": "id"
}

Response:

{
"data": {
"copilotSessionMessages": {
"hasMore": true,
"messages": [
{
"id": "id",
"createdAt": 0,
"cardIds": [
"string"
],
"feedback": {},
"role": "string",
"text": "string"
}
]
}
}
}
copilotSessionMessages(
before: ID!
first: Int = 20
sessionId: ID!
): CopilotMessagePage!

Arguments​

copilotSessionMessages.before ● ID! non-null scalar​

Return only messages older than this message ID.

copilotSessionMessages.first ● Int scalar​

The number of items to return.

copilotSessionMessages.sessionId ● ID! non-null scalar​

The ID of the Copilot session.

Type​

CopilotMessagePage object​

Messages older than a given message, oldest first — reads a long chat back past its newest window.