Flag of Ukraine

Replay an Assembly

POST https://api2.transloadit.com/assemblies/{ASSEMBLY_ID}/replay

If an Assembly crashed, and if we can recover the input files, Transloadit can retry its execution.

You can specify a new notify_url parameter in params to avoid replaying the URL already specified for the Assembly.

Specify the steps parameter to override the Steps of the original Assembly being replayed.

The newly created Assembly will have a parent_assembly_status in its Status, pointing to the URL of the original crashed Assembly that it is a Replay of.

POST fields

  • Passing signature is required. For more information please check Signature Authentication.
  • Passing params is required. It should contain a JSON encoded object with the keys as shown in the table below.

Supported keys inside the params field

  • auth

    Objectrequired

    Contains at least your Transloadit Auth Key in the key property.

    If you enable Signature Authentication, you'll also set an expiry date for the request in the expires property like so:

    {
      "key": "23c96d084c744219a2ce156772ec3211",
      "expires": "2022/01/01 16:53:14+00:00"
    }
    

    The referer property is a regular expression to match against the HTTP referer of this upload, such as "example\.org". Specify this key to make sure that uploads only come from your domain.

    Uploads without a referer will always pass (as they are turned off for some browsers) making this useful in just a handful of use cases. For details about regular expressions, see Mozilla's RegExp documentation.

    The max_size property can be used to set a maximum size that an upload can have in bytes, such as 1048576 (1 MB). Specify this to prevent users from uploading excessively large files.

    When using this key, make sure that it is specified as a hidden max_size form field, since setting max_size in a Template will have no effect.

    The file size is checked as soon as the upload is started and if it exceeds the maximum size, the entire upload process is canceled and the Assembly will error out, even if it contains files that do not exceed the max_size limitation.

    If you want to just ignore the files that exceed a certain size, but process all others, then please use our /file/filter Robot.

  • steps

    Object ⋅ default: {}

    Contains Assembly Instructions. Example:

    "encoded": {
      "use": ":original",
      "robot": "/video/encode",
      "preset": "iphone-high"
    },
    "thumbed": {
      "use": "encoded",
      "robot": "/video/thumbs",
      "count": 8
    }
    

    Note: By default you may use the steps parameter to overrule Template Steps at runtime. If you set allow_steps_override to false then steps and template_id will be mutually exclusive and you may only supply one of these parameters. See Overruling Templates at Runtime.

  • template_id

    String ⋅ default: ""

    The ID of the Template that contains your Assembly Instructions. If you set allow_steps_override to false then steps and template_id will be mutually exclusive and you may only supply one of these parameters.

  • notify_url

    String ⋅ default: ""

    Transloadit can send a Pingback to your server when the Assembly is completed. We'll send the Assembly status in a form url-encoded JSON string inside of a transloadit field in a multipart POST request to the URL supplied here.

  • fields

    Object ⋅ default: {}

    An object of string to string pairs (name -> value) that can be used as Assembly Variables, just like additional form fields can. For example, to dynamically have us resize images based on an end-user provided width, you could use ${fields.user_width} in your Assembly Instructions, and either post an <input name="user_width" value="800" /> or supply this fields param with the following object:

    {
      "user_width": 800
    }
    
  • reparse_template

    Integer ⋅ default: 0

    Specify 1 to reparse the Template used in your Assembly (useful if the Template changed in the meantime). Alternatively, 0 replays the identical Steps used in the Assembly.

Response

Here’s an example response body:

We either return the success code ASSEMBLY_REPLAYING or an error response code detailing what went wrong.
Uppy
20% off any plan for the Uppy community
Use the UPPY20 code when upgrading.
Sign up
tus
20% off any plan for the tus community
Use the TUS20 code when upgrading.
Sign up
Product Hunt
20% off any plan for Product Hunters
Use the PRH20 code when upgrading.
Sign up