curl --request POST \
--url https://your-webhook.com/video.errored \
--header 'Content-Type: application/json' \
--header 'magic-hour-event-signature: <magic-hour-event-signature>' \
--header 'magic-hour-event-timestamp: <magic-hour-event-timestamp>' \
--data '
{
"type": "video.errored",
"payload": {
"id": "cuid-example",
"name": "Example Name",
"status": "complete",
"type": "FACE_SWAP",
"created_at": "2023-11-07T05:31:56Z",
"width": 512,
"height": 960,
"enabled": true,
"start_seconds": 0,
"end_seconds": 15,
"total_frame_cost": 450,
"credits_charged": 450,
"fps": 30,
"error": null,
"downloads": [
{
"url": "https://videos.magichour.ai/id/output.mp4",
"expires_at": "2024-10-19T05:16:19.027Z"
}
],
"download": {
"url": "https://videos.magichour.ai/id/output.mp4",
"expires_at": "2024-10-19T05:16:19.027Z"
}
}
}
'{
"message": "Success message from your endpoint"
}The request example illustrates what your webhook endpoint should expect.
curl --request POST \
--url https://your-webhook.com/video.errored \
--header 'Content-Type: application/json' \
--header 'magic-hour-event-signature: <magic-hour-event-signature>' \
--header 'magic-hour-event-timestamp: <magic-hour-event-timestamp>' \
--data '
{
"type": "video.errored",
"payload": {
"id": "cuid-example",
"name": "Example Name",
"status": "complete",
"type": "FACE_SWAP",
"created_at": "2023-11-07T05:31:56Z",
"width": 512,
"height": 960,
"enabled": true,
"start_seconds": 0,
"end_seconds": 15,
"total_frame_cost": 450,
"credits_charged": 450,
"fps": 30,
"error": null,
"downloads": [
{
"url": "https://videos.magichour.ai/id/output.mp4",
"expires_at": "2024-10-19T05:16:19.027Z"
}
],
"download": {
"url": "https://videos.magichour.ai/id/output.mp4",
"expires_at": "2024-10-19T05:16:19.027Z"
}
}
}
'{
"message": "Success message from your endpoint"
}A signatured created with the webhook secret key and a signed_payload, using HMAC with SHA-256
"3e771b50c..."
Time in seconds since the epoch. Use this value to check whether the request is within a reasonable window of the current time. Usually less than 5 minutes.
"1730742038"
Body
video.errored Success
Show child attributes
Unique ID of the video. This value can be used in the get video project API to fetch additional details such as status
"cuid-example"
The name of the video.
"Example Name"
The status of the video.
draft, queued, rendering, complete, error, canceled "complete"
The type of the video project. Possible values are ANIMATION, IMAGE_TO_VIDEO, VIDEO_TO_VIDEO, TEXT_TO_VIDEO, FACE_SWAP, LIP_SYNC, AUTO_SUBTITLE, TALKING_PHOTO
"FACE_SWAP"
The width of the final output video. A value of -1 indicates the width can be ignored.
512
The height of the final output video. A value of -1 indicates the height can be ignored.
960
Indicates whether the resource is deleted
The start time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.
x >= 00
The end time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.1, and more than the start_seconds.
x >= 0.115
Deprecated: Previously represented the number of frames (original name of our credit system) used for video generation. Use 'credits_charged' instead.
The amount of frames used to generate the video. If the status is not 'complete', the cost is an estimate and will be adjusted when the video completes.
450
The amount of credits deducted from your account to generate the video. If the status is not 'complete', this value is an estimate and may be adjusted upon completion based on the actual FPS of the output video.
If video generation fails, credits will be refunded, and this field will be updated to include the refund.
450
Frame rate of the video. If the status is not 'complete', the frame rate is an estimate and will be adjusted when the video completes.
30
In the case of an error, this object will contain the error encountered during video render
null
Success
Success
"Success message from your endpoint"
Was this page helpful?