POST
https://api.craftkit.dev/v1/embed/sessionsiframe_url to mount, and a single-use renew_token. Sessions live
for 4 hours — rotate the token with Refresh a session before
expires_at. The key’s project must have embed enabled, or auth returns invalid_credentials.
Authorization
Bearer ck_live_… — a project API key for a project with embed enabled.Body
The organization this session belongs to. Upserted on every mint.
The end-user inside the iframe. Upserted under the tenant.
What the session can open.
An inline catalog used for this session only (same shape as
Create a catalog). Mutually exclusive with
catalogRef.Reference a published catalog by name. Resolves to the current version when
version is omitted.Partial override of permission flags (
publish, saveDraft, delete, rename, rollback,
createCustomVariables, changePageSettings, viewVersionHistory, submitForm, saveFormDraft,
shareDocument, emailDocument, viewEngagement). Omitted flags use schema defaults.Name of a saved permission preset (≤60 chars). Accepted by the schema; reserved.
Partial branding (
primaryColor, logoUrl, fontUrl, locale, ui, support).Framework-agnostic styling contract (
baseTheme, variables, rules, layout, stylesheetUrl,
fontUrl, logoUrl). Supersedes branding when both are present. Falls back to the partner’s
default theme.onPublishedUrl / onCloseUrl — partner URLs the embed posts to.Partial override of
maxPublishes (10), maxSaveDrafts (200), maxUploadsBytes (5 MiB).Form-fill claims — only meaningful when
scope.mode === 'fill': prefill, showPreview (false),
showDocumentAfterSubmit (true), redirectUrl.Send either
variableCatalog (inline, one-off) or catalogRef (a pointer to a published
catalog), not both. Neither is required — omit both for a session with no catalog. An unknown
catalogRef.name returns 404 catalog_not_found.Response
200 with the minted session.
Session UUID. Use it to revoke the session server-side.
Signed EdDSA JWT, also carried in
iframe_url.URL to mount in your
<iframe> (builder, or form route in fill mode).ISO-8601 expiry, 4 hours from mint.
Single-use token for the refresh endpoint.
Errors
| Status | code | Meaning |
|---|---|---|
| 401 | missing_authorization | No Authorization: Bearer header. |
| 401 | invalid_credentials | Key not found, revoked, or embed not enabled. |
| 400 | invalid_json | Body is not valid JSON. |
| 422 | invalid_request | Body failed schema validation (issues included). |
| 404 | catalog_not_found | catalogRef.name has no current catalog in this project. |
| 500 | catalog_resolution_failed | Inline/ref catalog lookup threw — retry. |
| 500 | mint_failed | Minting threw (e.g. no active signing key) — retry. |
cURL
200