
Can I get an invoice with our VAT number?
I can’t edit invoices. Want me to get someone?
JAJared joined the chat
Jared · SupportOn it. Sending the new invoice now.
AI assistant with a human handoff
Your assistant answers first. When it gets stuck, or the customer just wants a person, a teammate joins the same chat with the whole story.
Add a human handoff to the AI assistant in my product, with Fernand (https://getfernand.com) as the support backend.
Find the assistant in my codebase. When it can't resolve a request, or the user asks for a person, show a "Talk to a human" action in the chat.
1. Open the conversation. When the user clicks it, POST https://api.getfernand.com/messenger/contact from the browser. This endpoint is public and doesn't take the API key.
- Header: X-AppId set to my Fernand organization slug (or send slug in the body instead).
- JSON body: name, email, subject, message (the assistant transcript so far), and tags: ["in-app-ai-assistant"]. Remind me to create that tag in Fernand first.
- Attachments, if I need them, go base64 in that same JSON body.
- If the user is signed in, my backend signs their lowercased email with HMAC-SHA256 using the chat secret (Settings → Channels → Chat → Authentication), and the request sends that signature as hash.
- extra is an object, not an array. Example:
"extra": {
"account_id": { "label": "Account ID", "value": "12345" }
}
- A 204 means an incoming conversation is open on the default channel. Tell the user in the chat that a teammate has the full conversation.
2. Get my team's replies back. Add a webhook endpoint on my server, and have me create two Fernand webhook rules pointing to it, both filtered to the tag in-app-ai-assistant:
- "New conversation": the payload includes conversation_id, the message text, the contact email, and the status. Store conversation_id on the chat thread.
- "When a reply is sent": push the reply into the matching chat thread, so it shows up where the user already is.
- Call GET /conversations/{id}/messages (server side, with the API key) only when you need attachment URLs.
3. History. When the user comes back, load their past handoffs from my server with GET /conversations?search=from:<email> tag:in-app-ai-assistant.
Read these before you write code:
- API reference: https://developers.getfernand.com/ (https://developers.getfernand.com/llms.txt is the same index, written for agents)
- OpenAPI spec: https://api.getfernand.com/openapi.json (exact endpoints, parameters, and response shapes)
- Headless contact form: https://help.getfernand.com/features/headless-contact-form
- Authenticating users: https://help.getfernand.com/features/support-widget/authenticating-users
API key: I create it in Fernand under Settings → Integrations → API Key, with only the permissions this needs. Send it in the X-Api-Key header, from my server only. If you need one and don't have it, ask me.
Rules:
- Build it with my existing components and design tokens. It should look like the rest of my product, not like a widget.
- The API key and the chat secret stay on my server, in environment variables. Never ship them to the browser, never commit them, never print them back.
- Stay under the API rate limits: 20 reads and 5 writes per minute. Cache reads where you can.
- Ask me for anything you can't infer from the codebase, like my Fernand organization slug.
When you're done, tell me what you built, what I need to set up in Fernand (tags, webhooks, API key), and how to test it end to end.CopiedOpen prompt in…
CursorCodexClaude Code

