Skip to content
Navigation

Render a composition

Renders one HTML document you wrote (a Hyperframes composition) and spends credits equal to its data-duration. Mosio checks it first: only local assets, a sized root element with a duration, and no Hyperframes lint errors. Google Fonts links and GSAP from a CDN are allowed; Mosio stores local copies. Registry components can be loaded with data-composition-src="compositions/components/<name>.html". See the composition guide for the rules. Needs the videos:create permission.

POST
https://app.mosio.me/v1/compositions

Authorization

  • apiKeyAPI key in headerrequired

Request bodyJSONrequired

  • htmlstringrequired

    One complete HTML document. Its root element sets the size and length, for example <div id="root" data-composition-id="main" data-start="0" data-duration="15" data-width="1080" data-height="1920" data-fps="30">.

    maxLength: 200000
  • titleoptionalstring

    A short title for the dashboard.

    maxLength: 80
  • idempotency_keyoptionalstring

    Send the same key again to get the same video instead of a second one.

    maxLength: 200 · minLength: 1

Returns

200

A video with this idempotency_key and the same body already exists; it is returned unchanged.

JSON
  • idstringrequired
  • statusqueuedorrenderingordoneorfailedorcanceledrequired
  • templatestringrequired

    The template id, composition for a rendered composition, or studio for a Studio project.

  • created_atstringrequired
    format: date-time
  • finished_atstring | nullrequired
    format: date-time
  • duration_secondsnumber | nullrequired

    Length of the finished video.

  • output_urlstring | nullrequired

    Short-lived link to the MP4 once status is done.

  • errorobject | nullrequired

    Why the render failed, when status is failed. Failed videos spend no credits.

    • codeoptionalstring
    • messageoptionalstring

201

The video was created and queued.

JSON
  • idstringrequired
  • statusqueuedorrenderingordoneorfailedorcanceledrequired
  • templatestringrequired

    The template id, composition for a rendered composition, or studio for a Studio project.

  • created_atstringrequired
    format: date-time
  • finished_atstring | nullrequired
    format: date-time
  • duration_secondsnumber | nullrequired

    Length of the finished video.

  • output_urlstring | nullrequired

    Short-lived link to the MP4 once status is done.

  • errorobject | nullrequired

    Why the render failed, when status is failed. Failed videos spend no credits.

    • codeoptionalstring
    • messageoptionalstring

400

The request body is not valid JSON or does not match the schema.
JSON
  • errorunauthorizedorinvalid_api_keyorinsufficient_scopeorforbiddenorinvalid_inputorunknown_template+9 morerequired

    A stable error code.

  • messagestringrequired

    A message for people, in Indonesian.

  • detailsoptionalunknown

    More about the error, such as the fields to fix.

401

The API key is missing or not valid.
JSON
  • errorunauthorizedorinvalid_api_keyorinsufficient_scopeorforbiddenorinvalid_inputorunknown_template+9 morerequired

    A stable error code.

  • messagestringrequired

    A message for people, in Indonesian.

  • detailsoptionalunknown

    More about the error, such as the fields to fix.

402

The workspace does not have enough credits for this video.
JSON
  • errorunauthorizedorinvalid_api_keyorinsufficient_scopeorforbiddenorinvalid_inputorunknown_template+9 morerequired

    A stable error code.

  • messagestringrequired

    A message for people, in Indonesian.

  • detailsoptionalunknown

    More about the error, such as the fields to fix.

409

This idempotency_key was used before with a different body.
JSON
  • errorunauthorizedorinvalid_api_keyorinsufficient_scopeorforbiddenorinvalid_inputorunknown_template+9 morerequired

    A stable error code.

  • messagestringrequired

    A message for people, in Indonesian.

  • detailsoptionalunknown

    More about the error, such as the fields to fix.

422

The composition cannot be rendered yet. details.problems lists what to fix.
JSON
  • errorunauthorizedorinvalid_api_keyorinsufficient_scopeorforbiddenorinvalid_inputorunknown_template+9 morerequired

    A stable error code.

  • messagestringrequired

    A message for people, in Indonesian.

  • detailsoptionalunknown

    More about the error, such as the fields to fix.

429

The workspace already has the maximum number of videos queued or rendering (2). Wait for one to finish.
JSON
  • errorunauthorizedorinvalid_api_keyorinsufficient_scopeorforbiddenorinvalid_inputorunknown_template+9 morerequired

    A stable error code.

  • messagestringrequired

    A message for people, in Indonesian.

  • detailsoptionalunknown

    More about the error, such as the fields to fix.

Type to search…

↑↓ navigate↵ selectEsc close