userId is meant to keep a stable conversation for a user across platforms such as WhatsApp, Discord, and Telegram.
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
userIdand the ReyGridconversationIdin your database. - Reuse the stored
conversationIdwhen the same user continues. - Verify a conversation ID belongs to the expected user before using it.
userId can also serve as the stable identifier. If you need your own mapping, keep it in your own database.
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.Memory and retention
Every persistent conversation is kept for a duration defined by your ReyGrid plan. The same retention rules apply whether you key a conversation on auserId or on an explicit conversationId.
How retention works
ReyGrid follows one simple rule: a conversation is deleted in only one case — when there is no activity for the duration defined by your plan.
There is no other deletion path based on time or volume:
- Conversations do not expire while they are in use, regardless of how long they have been alive.
- Conversations do not expire because they reach a message count.
- Conversations do not expire on a calendar schedule — only on inactivity.
The expiration timer
- The timer starts at the last message of a conversation.
- Every call to
POST /agents/{AgentId}/chat(or any other write to the conversation) resets the timer to the full retention window of your plan. - As long as activity continues, the conversation lives indefinitely.
Inspecting the expiration time
Each entry returned byGET /agents/{agentId}/conversations includes an expiresAt timestamp. It is the moment at which the conversation will be deleted if no further messages arrive before then.
user_42 will move expiresAt forward again, extending the lifetime of the conversation by the plan’s full retention window.
The exact retention window depends on your subscription plan. You can review your plan’s limits and current usage with
GET /usage or in the ReyGrid dashboard.
