Embed support in your app

Tickets, in-app threads and webhooks — the full recipe for embedding AnswerRidge support in your product.

Embed support in your app

AnswerRidge is built to be the support layer inside your product, not just a chat bubble on your marketing site. This guide shows the full recipe: your users submit feedback or report problems in-app, each submission becomes a ticket in your workspace, and your team's replies surface back inside your UI — optionally in real time via webhooks.

The three building blocks

  1. Create tickets from your backend — POST /v1/tickets with the user's email, subject and description. Returns a ticket id and a human-friendly ticket number you can store on your own record (e.g. a feedback row).
  2. Show the conversation in-app — two options: proxy the ticket-portal API from your backend (full control of the UI), or embed the hosted ticket portal as an iframe / script (see Embed the ticket portal). Both authenticate the end user with a customer identity token — see Customer identity tokens.
  3. Push agent replies back — register a webhook endpoint (Admin → Developer Portal → Webhooks, or the webhook-manager API) for ticket.replied.agent, ticket.resolved and ticket.reopened. Verify the signature, then write the reply into your app's thread and raise your own notification. See Webhooks.

Reference flow

App submit ──> your backend ──> POST /v1/tickets        (ticket # created)
                                        │
Your DB row <── store ticket_id/ticket_number
                                        │
User opens thread ──> your backend mints support_token
                    ──> GET portal /tickets/:id (replies)
                    or embed <iframe /embed/tickets?support_token=…>
                                        │
Agent replies in AnswerRidge ──> webhook POST to your endpoint
                              ──> write reply + notify user

Example: create a ticket from a feedback form

curl -X POST "https://fbyeoijchofxayzhozwy.supabase.co/functions/v1/public-api-v1/v1/tickets" \
  -H "x-api-key: ar_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "[FB-A1B2C3D4] Report a problem: Payment failed",
    "description": "User message…\n\nApp: ios 2.0.0 · Device: iPhone 16",
    "customer_email": "jane@example.com",
    "customer_name": "Jane Doe",
    "priority": "high"
  }'

Store the returned id and ticket_number on your feedback record so you can correlate the conversation later.

Tips

  • Prefix subjects (e.g. [FB-xxxx]) so agents can recognise in-app tickets at a glance.
  • Map your context (category, app version, device) into description — it lands on the ticket as the first message.
  • Replies posted through the portal or API appear in the same thread agents see; internal notes are never exposed.
  • Make your webhook handler idempotent — dedupe on data.reply.id.