embed_url to your frontend. The URL contains a short-lived boot token; the iframe exchanges it for a narrower browser credential before calling canvas, asset, export, or chat endpoints.
Create an embed session
Moda-Version: 2026-05-01 is the REST API version. It is not the same as the browser protocol version: 2026-05-27 you send in postMessage envelopes — see the Browser SDK version note. They version independently.Request
Response
403.
Request fields
Modes
UI options
chat controls where the Moda agent chat appears:
"hidden"disables agent chat for the embed session."inside"renders a Moda-hosted chat panel inside the iframe."external"enables the agent runtime but leaves the chat UI to your application through postMessage commands and events.
Recommended presets
Origin validation
allowed_origins must contain origins only: scheme, host, and optional port. Do not include paths.
Refresh a session
Refresh rotates the session boot token for an existing session and returns a fresh browser token for the iframe. Call this from your backend before expiry, then pass the new values to the iframe withsession.refresh.
Response
session:refreshed with { expiresAt }. The iframe also proactively warns you before expiry by posting session:refresh_requested (by default 60 seconds before expiry), and posts session:expired if the token lapses — refresh in response to the warning (see Refresh long-running sessions).
Revoke a session
Call revoke when the user closes the embedded editor, signs out, or loses access in your product.Error codes
Every public API error — including session create/refresh/revoke and the internal iframe endpoints — returns the same envelope:code categories:
Expired, revoked, and invalid-token failures all surface as
401 / authentication; today they are distinguished only by the human-readable message ("Embed session expired", "Embed session revoked", "Invalid embed browser token"). Branch on status for recovery (re-mint on 401, surface a permission error on 403), and treat message as non-stable display text. Finer-grained machine codes are a known beta limitation.load:error event carrying the same code and status.
Internal iframe endpoints
The iframe exchanges the boot URL token for a short-lived embed browser credential, then uses that credential for internal browser-hit endpoints:GET /v1/embed/sessions/{session_id}/canvasPATCH /v1/embed/sessions/{session_id}/canvasPOST /v1/embed/sessions/{session_id}/imagesGET /v1/embed/sessions/{session_id}/images/{file_id}
Authorization: Bearer <embed_browser_token>.
You normally do not call these directly. Use the iframe and browser SDK commands instead.