Files
Upload Asset URLs
Create a list of urls used to upload the assets needed to generate a video. Each video type has their own requirements on what assets are required. Please refer to the specific mode API for more details. The response array will be in the same order as the request body.
Below is the list of valid extensions for each asset type:
- video: mp4, m4v, mov, webm
- audio: mp3, mpeg, wav, aac, aiff, flac
- image: png, jpg, jpeg, webp, avif, jp2, tiff, bmp
Note: .gif
is supported for face swap API video_file_path
field.
After receiving the upload url, you can upload the file by sending a PUT request with the header 'Content-Type: application/octet-stream'
.
For example using curl
curl -X PUT -H 'Content-Type: application/octet-stream' \
--data '@/path/to/file/video.mp4' \
https://videos.magichour.ai/api-assets/id/video.mp4?auth-value=1234567890
POST
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Body
Example:
[
{ "type": "video", "extension": "mp4" },
{ "type": "audio", "extension": "mp3" }
]
Response
200
application/json
Success
Example:
[
{
"upload_url": "https://videos.magichour.ai/api-assets/id/video.mp4?auth-value=1234567890",
"expires_at": "2024-07-25T16:56:21.932Z",
"file_path": "api-assets/id/video.mp4"
},
{
"upload_url": "https://videos.magichour.ai/api-assets/id/audio.mp3?auth-value=1234567890",
"expires_at": "2024-07-25T16:56:21.932Z",
"file_path": "api-assets/id/audio.mp3"
}
]
Was this page helpful?