Upload file chunks

Upload a single chunk of a file

  • First, split your file into chunks. Chunk size is up to you but must be 5 MB or less. If you attempt to upload a chunk larger than 5 MB you'll receive an error. The last number is the chunk number. This is used, to determine the order to reassemble the chunks on the server. So the second chunk would be POST /api/v2//upload_jobs/{upload_id}/files/{asset_id}/chunks/2. The request body should be the binary data of the chunk. Make sure to set the Content-Length header.

POST requests to the chunk endpoint will return the following response codes:

  • 201 - File upload chunk processed successfully and the file upload is complete.
  • 204 - File upload chunk processed successfully, waiting for more file chunks for the complete file upload.
  • 422 - File upload chunk failed, please ensure your file chunk is 5MB or less and retry.

Once all files for an upload job have been uploaded, an asset will be created automatically on Image Relay.

Click Try It! to start a request and see the response here!