Status and recent activity
GET /api/connections?userRef= answers the two questions you have about a user: are they connected, and how active have they been.
connectedis true when at least one connection isactive.needsReauthis true when at least one connection isneeds_reauth. This is the only status that should trigger a “please reconnect” message. Arevokedconnection was either replaced after a reconnect or deleted by the user on purpose.recentConversationCountcounts conversations whose first message is dated within the last 30 days, evaluated at request time. It measures what the user did, not what Verso imported: an old history imported yesterday counts for nothing, and continuing an old conversation does not move it into the window.
userRef. Connection ids change when a user reconnects, and one user may hold several connections.
An expired session is detected at the next sync, so connected can stay true for a few hours after the provider invalidated the session. lastSyncAt tells you when it was last verified.
Reading conversations
GET /api/conversations?connectionId= returns pages of conversations, newest update_time first.
update_time, a conversation the user continues moves back to the top. To detect changes cheaply, compare update_time with what you stored.
Shape of a conversation
messages is the conversation’s current branch in chronological order. System messages and empty nodes are dropped; messages the user regenerated or branched away from are not included.
Attachments are metadata only for now. The files are stored by Verso but cannot be retrieved through the API yet.
Sync cadence
Every connection is synced by a background worker that lists the account’s conversations, fetches the ones that changed, and stores them. The pace adapts to the account and to the provider’s limits.
The initial backfill fetches the most recent conversations first, then works backwards; a large history takes hours because the provider limits how fast one account can be read. Each sync that inserts or updates at least one conversation sends
data.imported.
Re-authentication
When the provider rejects the stored session, the connection becomesneeds_reauth and reauth.needed is sent. Sign a new connect link: