/api/v1/user/* router powers the in-app conversation list, individual
threads, and lifecycle actions such as pinning, archiving, restoring, or
deleting chats. All endpoints support both Auth0 JWT and device-based authentication,
enabling seamless access for both registered users and guest users during trial flows.
Authentication Methods
All conversation endpoints support two authentication options:-
Auth0 JWT (Registered users)
- Header:
Authorization: Bearer <token> - Standard authenticated flow for logged-in users
- Header:
-
Device-based (Guest users)
- Headers:
x-device-id,x-user-id(optional),x-platform - Same authentication as chat API
- Enables conversation management during free trial/guest sessions
- Headers:
Conversation Metadata
Each conversation now includes rich metadata to support analytics and better UX:type:'chat'or'second_opinion'- Differentiates main chat from second opinion featureinputType:'text','file', or'voice'- How the conversation was initiated (tracks user engagement patterns)prepromptKey: The pre-prompt used when creating the conversation (enables pre-prompt analytics)
Quick facts
- Base path:
/api/v1/user - All responses use the shared
{ success, data, meta }envelope - Pagination follows
limit/offsetsemantics with ahasMorecursor hint where applicable - Conversation IDs are MongoDB ObjectIds (24 hex characters)
- Both authentication methods work identically - choose based on your use case
| Capability | Endpoint(s) | Description |
|---|---|---|
| List & search | GET /conversations | Retrieve the sidebar-style list with optional q param for title/preview search |
| Inspect | GET /conversations/{conversationId}, GET /conversations/{conversationId}/messages | Fetch metadata plus paginated message history |
| Update metadata | PATCH /conversations/{conversationId} | Rename, pin, or retag a chat |
| Lifecycle | POST /conversations/{conversationId}/archive, POST /conversations/{conversationId}/restore, DELETE /conversations/{conversationId} | Archive, unarchive, or soft-delete a thread |
| Feedback | POST /messages/{messageId}/feedback | Submit like/dislike rating and optional text feedback |
Using the API Playground
In the “Try it” section on each endpoint page:- Select your authentication method from the security dropdown
- For Auth0 JWT: Enter your bearer token in the Authorization field
- For Device-based: The playground will show fields for
x-device-id,x-user-id, andx-platform