POST
https://api.craftkit.dev/v1/embed/builder/templateslayout parses as a render-ready
document, a first version is published automatically.
Authorization
Accepts either a partner API key or an embed session JWT.Bearer ck_live_… (partner API key — grants saveDraft and publish) or
Bearer <session_token> (embed session JWT — rights come from the session’s permissions
claims, and the request must originate from an allow-listed iframe origin).Body
The builder draft to persist. Stored as-is; the whole object is returned (adapted) in the
response. Only
name, layout, and presetKey are interpreted server-side — all other keys
round-trip through the draft.Response
200 with the created template, adapted to the builder’s documentTemplate shape.
Errors
| Status | code | Meaning |
|---|---|---|
| 400 | invalid_json | Body is not valid JSON. |
| 401 | missing_or_invalid_authorization | No bearer token, or neither a valid API key nor a valid session token. |
| 403 | permission_denied | Authenticated, but the session lacks saveDraft rights. |
| 500 | insert_failed | The template row could not be written. |
cURL
200