Chat

List chat messages

Lists a conversation's messages with read receipts for both sides. Deleted messages are included as tombstones (deletedAt set, empty content).

  • History (default): the newest limit messages, then older pages through nextPageToken; each page is in ascending order. The object cursor and nextCursor are the legacy form of the same paging.
  • Incremental sync (after): the messages created at or after 2 minutes before after, oldest first. Pass nextPageToken back with the same after until it is null. Messages commit slightly out of order (a broadcast inserts many at once), so the window deliberately overlaps what you already hold: dedupe on message id. createdAt never changes on edits, so after does not return an edited or deleted message again: follow those through the chat.message.updated and chat.message.deleted webhooks.

A page token only continues the direction that issued it, and cursor cannot be combined with pageToken or after (400).

get/chat/threads/{chatId}/messages

Request

  • Base URL: https://viral.app/api/v1
  • URL: https://viral.app/api/v1/chat/threads/{chatId}/messages
  • Auth: API key in header x-api-key

Path parameters

chatIdstring required

Query parameters

createdAtstring date-time required
idstring required
pageTokenstring

The previous page's nextPageToken. Pass it with the same after.

afterstring date-time

Incremental sync: the messages created at or after 2 minutes before this instant, oldest first.

limitinteger

Response

OK

nextPageTokenstring nullable
viewerSide'org' | 'creator' required

Changes

No recorded changes to this operation across all 1 revision of this API.