Embedded partners
Sandbox & go-live
Test the widget, prefill and the quote-to-bind webhook lifecycle with a test token, then switch to live.
Test everything end to end before you go live: the parts you use, including the widget, upsert_lead, event streams and signed webhooks. Sandbox leads never reach live insurance carriers or real customers.
How sandbox isolation works
Your Kinro partnership contact issues two separate partner API tokens:
- Sandbox token (
environment: "test"): Every lead created with atesttoken is flagged as a sandbox test lead. Live carrier submissions and outbound customer emails/SMS are blocked, and only yourtest-environment webhooks receive its events. - Production token (
environment: "live"): Used strictly in production after your go-live check.
Use the sandbox token at https://api.kinro.com/mcp once Kinro has configured your embed, even before activation. The production token and public embed require activation: until then, open the widget with a customer_token minted by upsert_lead with your sandbox token. Kinro can also provision access on https://api-preview.kinro.com/mcp. To point the widget at the preview endpoint, add data-mcp-url="https://api-preview.kinro.com/mcp" to the script tag.
For a complete run from a blank page to documents and webhooks, follow the example integration.
With a sandbox token, both start_session and upsert_lead attach the session to a test lead. Authenticate with a sandbox token whenever you want to create a test lead.
Test leads and live leads
| Test lead | Live lead | |
|---|---|---|
| Created by | Your test token (upsert_lead, start_session), a customer_token minted with it, or any visitor on a local development page | Your live token, a customer_token minted with it, or an anonymous visitor on your registered sites after activation |
| Leo | Answers in the widget as usual | Answers in the widget as usual |
| Emails, texts and calls | Held, never sent | Sent to the contact details the customer gave |
| Carriers | Never submitted to live carriers | Real carrier quotes and policies |
| Visible to | test tokens: list_leads, test webhooks and the test event stream | live tokens: list_leads, live webhooks and the live event stream |
Documents in list_leads | Included | Not yet |
| Simulated events | Yes, on the preview endpoint | Never |
A lead never changes between test and live. To test the same customer again, create a new test lead.
Shared test lead
On the preview endpoint, every test token can read one shared test lead. It belongs to a made-up business, Sample Harbor Bakery LLC, and has a bound policy with sample documents. Use it to build your lead list, document handling and webhook handlers before your own test leads have quotes or policies.
- Its
external_idiskinro_shared_test_lead.list_leadsreturns it to everytesttoken withshared_test_lead: true, and counts it in yourcounts. - Its documents (declarations page, policy and certificate of insurance) are sample PDFs marked as samples. Download them as described in Policy documents.
simulate_sandbox_eventwithexternal_id: "kinro_shared_test_lead"sends itsquote.ready,policy.boundandpolicy.status_changedevents to yourtestwebhooks and your event stream only. Other partners never see your events.- Nobody can change it: its policy stays active whatever events you simulate, and you cannot prefill it or open the widget on it. Create your own test lead with
upsert_leadto test the conversation.
Simulating quote and policy events
On the preview endpoint, a test partner token grants access to the simulate_sandbox_event MCP tool so you can deterministically drive a sandbox lead through the entire insurance lifecycle:
- Create a sandbox lead with
upsert_leadusing yourtesttoken. - Trigger
quote_readyto emit a sample quote event on MCP SSE and your sandbox webhook. It has the same fields as a livequote.ready, with one quote whosecheckout_urlisnull, so the handler you build here works unchanged in production. - Trigger
policy_boundto create a sandbox policy and emitpolicy.bound. - Trigger
policy_status_changedto transition the sandbox policy toactive,pending_docs,cancelled, orexpiredand emitpolicy.status_changed.
Example: full sandbox lifecycle
# 1. Trigger a simulated quote
curl -X POST https://api-preview.kinro.com/mcp \
-H "Authorization: Bearer $KINRO_TEST_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": "sim_1",
"method": "tools/call",
"params": {
"name": "simulate_sandbox_event",
"arguments": {
"action": "quote_ready",
"external_id": "sandbox_acct_001",
"line_of_business": "general_liability",
"monthly_premium_usd": 115
}
}
}'
# 2. Trigger a simulated policy bind
curl -X POST https://api-preview.kinro.com/mcp \
-H "Authorization: Bearer $KINRO_TEST_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": "sim_2",
"method": "tools/call",
"params": {
"name": "simulate_sandbox_event",
"arguments": {
"action": "policy_bound",
"external_id": "sandbox_acct_001"
}
}
}'
# 3. Trigger a simulated cancellation
curl -X POST https://api-preview.kinro.com/mcp \
-H "Authorization: Bearer $KINRO_TEST_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": "sim_3",
"method": "tools/call",
"params": {
"name": "simulate_sandbox_event",
"arguments": {
"action": "policy_status_changed",
"external_id": "sandbox_acct_001",
"policy_status": "cancelled",
"reason": "Sandbox cancellation test"
}
}
}'Staging QA checklist
Before switching to your live token, check the items that apply to your integration. Skip widget checks if your integration works entirely through your server.
- Widget mounting: Popup opens and closes cleanly (button, backdrop, Escape, focus restoration) and inline containers mount/unmount cleanly on SPA navigation.
- CSP compliance: No console CSP errors on
script-src,connect-src, orstyle-src(withdata-nonce). - Prefill skipping: Passing a
customer_tokenminted byupsert_leadskips questions your backend already answered; an expired token triggerserrorand recovers cleanly. - Mobile & private browsing: Test at 390px viewport and in Safari Private / Chrome Incognito (no third-party cookies required).
- Webhooks: Signature verification succeeds for
quote.ready,policy.bound, andpolicy.status_changed, and duplicateevt_*IDs are handled idempotently.
Going live
- Share your production HTTPS origins and production webhook URL with Kinro.
- Complete a short integration review with Kinro covering placements, prefill mapping, and webhook verification.
- Receive your
livekinro_pk_*token and productionwhsec_*webhook secret, swap credentials in your server secrets manager, and roll out to your first cohort.