Editor sessions

Rendering

Editor sessions

Short-lived tokens to init the editor without exposing a long-lived key.

Create a session server-side and hand the token to the browser, it's org-scoped, HMAC-signed and self-expiring:

bash
POST /v3/editor-sessions   → 201 { session_token: "es_…", expires_at }

Verify it server-side before trusting it. See authentication.

Calling it

The endpoint needs a secret server key (sk_live_…), sent as a Bearer token or as ?token=. A publishable pk_live_… token, or an inactive key, gets 401 with { "error": "invalid_token" }. The request takes no body.

bash
curl -X POST https://api.mailkaro.com/v3/editor-sessions \
  -H "Authorization: Bearer sk_live_…"
# 201 { "session_token": "es_…", "expires_at": "2026-10-29T11:00:00.000Z" }

Lifetime

A session lasts one hour from when it is created, and the request cannot change that. Create a new session when the old one is close to expires_at.

What is inside the token

The token is es_, then a base64url payload, a dot and a signature. The payload holds the organization id and the expiry as plain text, so anyone with the token can read them; the HMAC-SHA256 signature only stops them from being changed. Keep the token out of URLs and logs. To create the server key, see embed tokens.