back to manuals

Conversation Cleanup

Learn how conversations are automatically cleaned up through expiry and empty conversation retention policies.

Conversation Expiry and Cleanup

Conversations can be automatically removed from the platform through two distinct lifecycle mechanisms: expiry and empty conversation cleanup.

Expiry

Conversations can be created with an optional expiresAt timestamp. Once that timestamp passes, the conversation is considered expired and will be deleted during the next cleanup cycle. This is useful for time-bounded sessions, such as temporary support chats or short-lived agent interactions, where you want to guarantee data is not retained beyond a fixed window.

You can set expiry when creating or updating a conversation:

Empty Conversation Cleanup

Conversations that were created but never used - meaning they have no messages at all - are automatically deleted after some time. This prevents abandoned or programmatically created conversations from accumulating indefinitely.

No action is required to opt in to this behavior. It applies to all conversations regardless of how they were created.