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.