# v1.files.upload_urls
## Module Functions
### Generate asset upload urls <a name="create"></a>
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](/integration/input-files) 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, opus, ogg, aiff, amr
- image: png, jpg, jpeg, jfif, heic, heif, webp, avif, jp2, tiff, bmp
- gif: gif, webp, webm
> Note: `gif` is only supported for face swap API `video_file_path` field.
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>
```
**API Endpoint**: `POST /v1/files/upload-urls`
#### Parameters
| Parameter | Required | Description | Example |
| --------- | :------: | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `items` | ✓ | The list of assets to upload. The response array will match the order of items in the request body. | `vec![V1FilesUploadUrlsCreateBodyItemsItem {extension: "mp4".to_string(), type_: V1FilesUploadUrlsCreateBodyItemsItemTypeEnum::Video}, V1FilesUploadUrlsCreateBodyItemsItem {extension: "mp3".to_string(), type_: V1FilesUploadUrlsCreateBodyItemsItemTypeEnum::Audio}]` |
#### Example Snippet
```rust
let client = magic_hour::Client::default()
.with_bearer_auth(&std::env::var("API_TOKEN").unwrap());
let res = client
.v1()
.files()
.upload_urls()
.create(magic_hour::resources::v1::files::upload_urls::CreateRequest {
items: vec![
magic_hour::models::V1FilesUploadUrlsCreateBodyItemsItem { extension :
"mp4".to_string(), type_ :
magic_hour::models::V1FilesUploadUrlsCreateBodyItemsItemTypeEnum::Video
}, magic_hour::models::V1FilesUploadUrlsCreateBodyItemsItem { extension :
"mp3".to_string(), type_ :
magic_hour::models::V1FilesUploadUrlsCreateBodyItemsItemTypeEnum::Audio }
],
})
.await;
```
#### Response
##### Type
[V1FilesUploadUrlsCreateResponse](/src/models/v1_files_upload_urls_create_response.rs)
##### Example
```rust
V1FilesUploadUrlsCreateResponse {items: vec![V1FilesUploadUrlsCreateResponseItemsItem {expires_at: "2024-07-25T16:56:21.932Z".to_string(), file_path: "api-assets/id/video.mp4".to_string(), upload_url: "https://videos.magichour.ai/api-assets/id/video.mp4?auth-value=1234567890".to_string()}, V1FilesUploadUrlsCreateResponseItemsItem {expires_at: "2024-07-25T16:56:21.932Z".to_string(), file_path: "api-assets/id/audio.mp3".to_string(), upload_url: "https://videos.magichour.ai/api-assets/id/audio.mp3?auth-value=1234567890".to_string()}]}
```