Replacing a video
Replacing a video file is done by sending a PUT request to the /videos/upload/[VIDEO_ID] endpoint to replace the video file.
You will get a response containing a signed S3 URL to upload the video file to. Set useMultipart to true in the JSON body when you want a multipart upload instead. The response then contains multipartUpload instead of signedUrl. See Multipart upload.
When replacing a video, all old video files of this video will be deleted or overwritten. The replacement is irreversible.
Get signed URL
CURL
curl -X PUT https://app.ignitevideo.cloud/api/videos/upload/[VIDEO_ID] \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"useMultipart": false}'Response
A single-file upload returns signedUrl. That URL expires after 1 hour.
{
"videoId": "[VIDEO_ID]",
"signedUrl": "[SIGNED_URL]"
}With useMultipart: true the response is videoId plus multipartUpload:
{
"videoId": "[VIDEO_ID]",
"multipartUpload": {
"uploadId": "[UPLOAD_ID]",
"key": "[S3_KEY]"
}
}Errors
A missing video returns 400:
{
"error": "not_found"
}An id that is not 24 hex characters returns 400:
{
"error": "invalid_video_id"
}Upload video file
Upload your video file as a PUT request to the signed URL returned in the previous step.
You have to pass the mime type of the file as Content-Type header. You can get the mime type from your local video file via the file input element.
CURL
curl -X PUT [SIGNED_URL] \
-H "Content-Type: [MIME_TYPE]" \
--data-binary "@[PATH_TO_VIDEO_FILE]"Encoding process
After the replacement file has been uploaded, encoding starts. During the replace flow, status may briefly be REPLACING before it becomes PROGRESSING. Encoding can take a while, depending on the video size and encoding complexity.
Poll the encoding status with GET /api/videos/[VIDEO_ID] as described in get video. A poll interval of a few seconds is usually enough. While encoding runs, status is PROGRESSING and statusProgress is a percentage from 0 to 100.
Example fields while encoding:
{
"id": "[VIDEO_ID]",
"status": "PROGRESSING",
"statusProgress": 36,
"errorCode": null,
"errorMessage": null
}When encoding succeeds, status becomes COMPLETE, statusProgress is 100, and playback sources are available under src.
When encoding fails, status becomes ERROR. Use errorCode for programmatic handling and errorMessage as a human-readable fallback. See Encoding status for the full lifecycle, status values, and error codes.
You can also subscribe to video.updated webhooks instead of polling. Progress updates can fire often during encoding. See Webhooks.