Video Started
The request example illustrates what your webhook endpoint should expect.
curl --request POST \
--url https://your-webhook.com/video.started \
--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.started",
"payload": {
"id": "clx7uu86w0a5qp55yxz315r6r",
"name": "Example Name",
"status": "complete",
"type": "ANIMATION",
"created_at": "2023-11-07T05:31:56Z",
"width": 512,
"height": 960,
"enabled": true,
"start_seconds": 0,
"end_seconds": 15,
"total_frame_cost": 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"
}
Headers
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.started
Success
Unique ID of the video. This value can be used in the get video project API to fetch additional details such as status
"clx7uu86w0a5qp55yxz315r6r"
The name of the video.
"Example Name"
The status of the video.
draft
, queued
, rendering
, complete
, error
, canceled
"complete"
ANIMATION
, IMAGE_TO_VIDEO
, VIDEO_TO_VIDEO
, TEXT_TO_VIDEO
, FACE_SWAP
, LIP_SYNC
, AUTO_SUBTITLE
The width of the final output video. The maximum width depends on your subscription. Please refer to our pricing page for more details
x >= 64
512
The height of the final output video. The maximum height depends on your subscription. Please refer to our pricing page for more details
x >= 64
960
Indicates whether the resource is deleted
The start time of the input video in seconds
x >= 0
0
The end time of the input video in seconds
x >= 0.1
15
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
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
Response
Success
"Success message from your endpoint"
Was this page helpful?
curl --request POST \
--url https://your-webhook.com/video.started \
--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.started",
"payload": {
"id": "clx7uu86w0a5qp55yxz315r6r",
"name": "Example Name",
"status": "complete",
"type": "ANIMATION",
"created_at": "2023-11-07T05:31:56Z",
"width": 512,
"height": 960,
"enabled": true,
"start_seconds": 0,
"end_seconds": 15,
"total_frame_cost": 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"
}