Create an embed session
POST/v1/embed-sessions
Requires an API key with the embed:write scope. About keys and scopes
Partner keys only.
A repeat without a key does it again; send Idempotency-Key and a retry within 24 hours replays the first response. About idempotency
Creates an embed session for one tenant. Partner keys only, from your server, with Kirora-Workspace naming the tenant. Returns a token the embedded segment and email builders send as Authorization: Bearer es_… for 15 minutes; the SDK asks your server for a new one before it expires. The key must have allowedOrigins, and a session is refused with 403 EMBED_ORIGIN_NOT_ALLOWED from any other origin. A session lets the chosen builders read what they need, render previews, count audiences, upload images and, when testSendTo lists addresses, send test emails to those addresses only. It never saves, publishes or sends anything else; your server saves what the builders return. It sees masked attributes as a member does, and attribute values and event property samples only with includeAttributeValues. Revoking the key ends every session it minted. Use a new Idempotency-Key for each session: a repeat with the same key within 24 hours returns the first session again, whose token may have expired.
Header parameters
Kirora-WorkspacestringoptionalPartner keys only: the child workspace to act in, by the external id the partner gave it. Without it, a partner key acts in its own workspace. Any other key that sends it is refused with 403, and an unknown workspace is 404.
pattern
^[A-Za-z0-9._:-]{1,128}$Idempotency-KeystringoptionalMakes a retry safe: a repeat with the same key and body within 24 hours gets the first response again, with
Idempotency-Replay: true. The same key with another request is 409IDEMPOTENCY_KEY_REUSED; while the first is still running, 409IDEMPOTENCY_KEY_IN_USE; after anunsafefirst request failed or never returned, 409IDEMPOTENCY_KEY_OUTCOME_UNKNOWN. Use a new key, such as a UUID, for each new request.8–255 characters
Request body
componentsstring[]requiredThe builders the browser may load; each opens only the routes it needs.
at least 1 item
includeAttributeValuesbooleanoptionalLets the session read attribute values and event property samples, for value suggestions. Off by default: they are the workspace's customer data.
default
falsetestSendTostring[]optionalUp to 5 addresses the email builder may send a test to, such as your signed-in user's. Defaults to none, which hides test sending. The builder can send to no other address.
at most 5 items · default
[]
Returns
Returns 201 Created with an EmbedSession in data. It can also return 409 Conflict, 413 Payload Too Large or 415 Unsupported Media Type; see the statuses below. Otherwise returns an error; Errors lists every code and which to retry.
201 CreatedThe session token and when it expires.409 ConflictThe request conflicts with current state — a duplicate unique value, or a resource whose status does not allow this operation.413 Payload Too LargeThe body is larger than this operation accepts (PAYLOAD_TOO_LARGE).415 Unsupported Media TypeThe body is not JSON, or not the upload the operation takes (UNSUPPORTED_MEDIA_TYPE).
tokenstringrequiredFor Kirora's hosted builder, which sends it as
Authorization: Bearer <token>; it works only inside a page whose origin the partner key allows.starts_with · pattern
^es_.*expiresAtstringrequiredWhen the token stops working (15 minutes).
date-time
apiUrlstringrequiredThe API's base URL, for
KiroraProvider'sapiUrl.uri
builderUrlstringrequiredThe hosted builders' base address;
@kirora/reactopens each builder under it.uri
testSendTostring[]requiredThe addresses the builder may send a test to, as the request named them; empty hides test sending.
Headers on 201 Created
Idempotency-Replaystringoptionaltruewhen this is the stored response to an earlier request with the same key.one of
true