Create an embedded signup session
POST /api/embed/sessionsReturns a single-use URL to embed in an iframe. The token in clear text is shown only once. When the channel is connected, Neike notifies by webhook (channel.connected) and the result is available through GET of the session.
Request body
Section titled “Request body”| Field | Type | Description | |
|---|---|---|---|
allowed_origins | string[] | required | Origins allowed to embed the iframe. They feed the frame-ancestors of the CSP and the targetOrigin of the result postMessage. Example: ["https://app.tu-dominio.com"]. |
platforms | whatsapp · instagram · facebook[] | optional | Channels offered inside the iframe. Default: ["whatsapp"]. |
external_ref | string | optional | Business id in the client’s system. It comes back unchanged in the webhook and in the result, to correlate the channel with its tenant. Example: "tenant_8842". |
ttl_minutes | number | optional | Validity of the session in minutes. Default: 30. |
prefill | object | optional | Business data the client already knows; they prefill Meta’s form (business.name, business.email, business.website, phone.displayName, phone.category). Example: {"business":{"name":"Café Central","email":"[email protected]"}}. |
Responses
Section titled “Responses”| Status | Description | Schema |
|---|---|---|
201 | — | — |
Example
Section titled “Example”curl -X POST https://api.neike.dev/api/embed/sessions \ -H "x-neike-api-key: whk_live_…" \ -H "Content-Type: application/json" \ -d '{ "allowed_origins": [ "https://app.tu-dominio.com" ] }'