Errors

Every error has the same shape and a stable code.

View as Markdown
JSON
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_document",
    "message": "pages[0].canvas needs a width and height",
    "param": "document",
    "docs_url": "https://muzekit.com/docs/errors#invalid_document"
  }
}

type groups errors by status; code never changes meaning, so match on it.

Statustype
400 and other 4xx (402, 410, 413, 415, 422, 428)invalid_request_error
401authentication_error
403permission_error
404not_found_error
409conflict_error
429rate_limit_error
5xxapi_error

Codes

CodeMeaning
missing_api_keyNo Authorization: Bearer header
invalid_api_keyUnknown or revoked key
workspace_suspended403: the editor is suspended
invalid_requestA field is missing or invalid; see param
invalid_documentThe document breaks a rule; problems lists them all
template_not_foundNo such template in this workspace and environment
revision_conflictThe document changed since you read it
if_match_requiredSaving a document needs If-Match
external_id_takenAnother template has this external_id
idempotency_key_reusedThe same Idempotency-Key was used on another request
idempotency_in_progressA request with this Idempotency-Key is still running; retry in a moment
invalid_client_secretThe session's client secret is unknown, expired or used
origin_not_allowedThe page embedding the editor is not an allowed domain, or a Live key was used on localhost (use your Test key there)
rate_limitedToo many requests; wait for the time in the RateLimit header
render_unavailable503: renders can't be queued for a moment; try again shortly. Nothing was charged
plan_required402: the editor has no plan, or its plan is paused or unpaid; reason says which (no_plan, payment_failed, subscription_paused)
sessions_exhausted402: this period's sessions and the 3% margin are used. Editors already open keep working; add sessions in Billing, move up a plan or wait for the next period. top_up_url is set when you can add a pack
localhost_sessions_exhausted402: this period's free localhost sessions (fair use) are used. Test on your staging domain, or wait for the next period
api_credits_exhausted402: this period's API credits are used. Test-key renders stay free
test_renders_exhausted429: this Test environment made 500 renders (or 50 videos) in the last 24 hours. Test renders are for trying things out; render with your Live key for production
ai_credits_exhausted402: this period's AI credits are used, or the plan has none
member_limit402: the plan's team seats are used
unsupported_fileAn upload isn't an image, video, audio file or font the editor can use (checked from the file's bytes)
file_too_largeOver the size limit: images 25 MB, video 200 MB, audio 50 MB, fonts 10 MB
unsafe_svgThe SVG contains scripts, event handlers or javascript: links
upload_expiredThe upload link was used, or is older than 15 minutes
storage_full402: the editor's storage (plan plus storage add-ons) is full; files already uploaded keep working. Remove files or add storage
addon_required402: AI assistants for your users need their add-on in Live; they are free in Test. Add it in Billing
trial_no_addons409: add-ons start with the first payment; start your plan now in Billing to add them
no_trial409: the editor isn't in a free trial, so there is no trial to end
payment_needs_action402: an upgrade needs the card holder to approve the payment; invoice_url opens it
yearly_to_monthly409: a yearly plan moves to monthly at renewal, not mid-period
copy_direction400: Copy to Live only goes from Test to Live
request_expired404: an AI app's sign-in request (/v1/assistant/requests/…) was used or is older than 10 minutes; the user starts again from their AI app
asset_in_use409: templates still use the file you are deleting; templates is how many, names the first few. Send force=true to delete it anyway, which breaks them

Connected apps

An AI app connected through MCP gets the codes above, plus these when its sign-in doesn't allow a call:

CodeMeaning
invalid_token401: the sign-in expired or was revoked; the app signs in again
forbidden403: the member's role can't do this on that editor (see Team)
insufficient_scope403: the member didn't allow this for that editor when they connected the app; scope names what's missing
live_write_not_granted403: a change in Live without Live changes; reconnect and allow it
dashboard_only403: billing, API keys, webhook secrets and deleting or transferring an editor are done in the dashboard only

In the browser

The SDK reports these through on.error, and logs them to the console when your page has no error handler.

CodeMeaning and fix
client_secret_unavailablefetchClientSecret failed or did not return the client_secret string. Check what your session route returns.
editor_unreachableThe editor never loaded. Check editorUrl, and allow the editor's origin in your Content-Security-Policy frame-src.
no_parentThe editor got no client secret from your page in time. Mount it with Muzekit.mount.
invalid_sessionThe session ended. Mount again so your server opens a new one.
session_expiredThe session reached its maximum age. Mount again.
read_onlyA view session tried to change a template.