Skip to main content
A chat request identifies its conversation in one of two ways. userId is meant to keep a stable conversation for a user across platforms such as WhatsApp, Discord, and Telegram.
Where an endpoint takes conversationRef (list messages, delete conversation, delete message, cancel tool call), you can pass either a conversationId or a persistent userId.

Per-user conversations in your app

If you need your own user and conversation management, build a thin wrapper around the API. As described in the API specification, the wrapper should:
  • Manage and identify users.
  • Store the mapping between your userId and the ReyGrid conversationId in your database.
  • Reuse the stored conversationId when the same user continues.
  • Verify a conversation ID belongs to the expected user before using it.
ReyGrid’s userId can also serve as the stable identifier. If you need your own mapping, keep it in your own database.
As the API specification recommends, verify in your wrapper that a stored conversation ID belongs to the expected user before using it.

Managing history

List conversations

Paginated, per agent.

List messages

By conversationId or userId.

Delete a conversation

Removes all of its messages.

Delete a message

Optionally with cascade=true.