Skip to main content
Second Opinion PrePrompts are the suggestion cards shown to users in the Second Opinion feature. They are stored in a separate collection (second_opinion_preprompts) from the main chat preprompts. Each pre-prompt stores:
  • a unique key (used by clients),
  • the publicValue shown in UI suggestion cards,
  • the maskedValue sent to the LLM when user clicks the card,
  • optional description (subtitle text) and tags.

Authentication

Administrative endpoints live under /api/v1/second-opinion/preprompts and are protected by the backendSecretMiddleware. Send either:
Authorization: Bearer <BACKEND_SECRET>
or
X-Backend-Secret: <BACKEND_SECRET>
where BACKEND_SECRET is configured in your environment variables.

Surface area

ActionEndpointDescription
CreatePOST /api/v1/second-opinion/prepromptsCreate new suggestion card (admin)
ListGET /api/v1/second-opinion/prepromptsList all preprompts (admin)
GetGET /api/v1/second-opinion/preprompts/{key}Get specific preprompt (admin)
UpdatePUT /api/v1/second-opinion/preprompts/{key}Update preprompt (admin)
DeleteDELETE /api/v1/second-opinion/preprompts/{key}Soft delete preprompt (admin)
PublicGET /api/v1/public/second-opinion/prepromptsGet public catalog (no auth)
See the endpoint pages for request bodies, parameter constraints, and example responses pulled directly from the OpenAPI schema.

Quick start

  1. Create suggestion cards via the admin API (requires BACKEND_SECRET).
  2. Surface the public catalog (GET /api/v1/public/second-opinion/preprompts) to end-users.
  3. Render the cards in the Second Opinion UI for users to tap and get instant opinions.
All records persist inside the MongoDB second_opinion_preprompts collection.

Current PrePrompts

The following suggestion cards are currently configured:
KeyDisplay TextDescription
groww_ipoGroww IPO looks good… but should I actually apply? 🤔Understand hidden risks before subscribing.
crypto_investmentFriend says crypto will 10x… should I invest my savings? 💰Get clarity on volatility and real risks.
esop_worthBoss offered ESOP… is it worth it? 🎯Know what you’re getting into.
term_vs_investmentShould I buy term insurance or investment plan? 🛡️Understand what actually protects you.

Frontend Integration

Front-ends should:
  1. Fetch the public catalog on component mount
  2. Render the publicValue as card titles and description as subtitles
  3. When user taps a card, send maskedValue (or publicValue with emojis stripped) to the Second Opinion API
The maskedValue is intentionally kept separate to allow different text to be sent to the LLM than what’s displayed to users (e.g., removing emojis, adding context).