Skip to content
Navigation

Create a video from a template

Queues a render of a template and spends credits equal to the video's length. Variables you leave out (nama_usaha, warna_utama, warna_latar, kontak) come from the workspace brand kit. Send an idempotency_key so a retried request does not create a second video. Needs the videos:create permission.

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

Authorization

  • apiKeyAPI key in headerrequired

Request bodyJSONrequired

  • templatestringrequired

    Template id with its version, such as promo-produk@1. See the template reference.

  • variablesoptionalmap ofstring

    Template variables. Every value is a string; colours are #RRGGBB.

    default: {}
  • outputoptionalobject

    Output size and frame rate. The size must be one the template supports.

    • widthoptionalinteger
      default: 1080
    • heightoptionalinteger
      default: 1920
    • fpsoptional24or25or30
      default: 30
  • 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.

404

No such template or video in this workspace.
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

Some variables are missing or too long, or the output size is not supported. details names the variables.
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