Generate Asset Upload Urls API Reference - Magic Hour Docs
Generates a list of pre-signed upload URLs for the assets required. This API is only necessary if you want to upload to Magic Hour’s storage. Refer to the Input Files Guide for more details.
The response array will match the order of items in the request body.
Valid file extensions per asset type:
- video: mp4, m4v, mov, webm
- audio: mp3, wav, aac, flac, webm, m4a
- image: png, jpg, jpeg, heic, heif, webp, avif, jp2, tiff, bmp
- gif: gif, webp, webm
Note:
gifis only supported for face swap APIvideo_file_pathfield.
Once you receive an upload URL, send a PUT request to upload the file directly.
Example:
curl -X PUT --data '@/path/to/file/video.mp4' \
https://videos.magichour.ai/api-assets/id/video.mp4?<auth params from the API response>
Documentation Index
Fetch the complete documentation index at: https://magichour-update-openapi-spec.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Bearer authentication header of the form Bearer <api_key>, where <api_key> is your API key. To get your API key, go to Developer Hub and click "Create new API Key".
Body
Body
The list of assets to upload. The response array will match the order of items in the request body.
1[
{ "type": "video", "extension": "mp4" },
{ "type": "audio", "extension": "mp3" }
]Response
Success
Success
The list of upload URLs and file paths for the assets. The response array will match the order of items in the request body. Refer to the Input Files Guide for more details.
[
{
"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"
}
]