> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magnific.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Uploads

> Bring your own files into Magnific as creations, to use them as references, sources and audio in any call.

An upload turns a file of yours (a product photo, a recorded voice, a video clip, a 3D model) into a **creation**, with its own `creation_id`. From then on it works like anything Magnific made: a reference for an image, the start frame of a video, the audio of a lip sync, the source of an edit.

There are two ways in:

| | When | Calls |
| - | - | - |
| **Upload a file** | Any file of yours: images, audio, video, GLB models | `POST /v2/uploads` → `PUT` the bytes → `POST /v2/uploads/finalize` |
| **Import from a URL** | An image that is already on a public URL | `POST /v2/uploads/import` |

> [!TIP]
>
> For a one-off image you do not need either: the generation and edit calls also take an image as a public `url` or as `base64` in `references` and `keyframes`, and save it as an upload of yours before anything is charged. Uploads are for audio and video, large files, and files you reuse across many calls.

## Upload a file, step by step

Say you have a voice recording, `voiceover.mp3`, and want a portrait to speak it with lip sync. The audio is yours, so it goes in first.

### 1. Ask where to upload it

```bash theme={null}
curl -X POST https://api.magnific.com/v2/uploads \
  -H "x-magnific-api-key: $MAGNIFIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mime_type": "audio/mpeg", "count": 1, "folder_reference": "prj_8f2a" }'
```

Nothing is uploaded yet. You get one target per file: a signed `upload_url` to send the bytes to, and the `path` you will finalize.

`folder_reference` is required: it is the project or folder the file will land in (a `reference` from `GET /v2/projects`, `POST /v2/projects` or `POST /v2/folders`). It is checked here, before anything is uploaded: a destination you cannot add to (outside your organization, a project where you are a Viewer, an archived project) is refused with `403`, and no target is handed out or counted against your quota.

```json theme={null}
{
  "data": {
    "uploads": [
      {
        "upload_url": "https://…/uploads/proxy?path=temp-files%2F3f1c…mp3&expires=…&signature=…",
        "path": "temp-files/3f1c9a52-7e41-4b8e-9c0d-2a6b1f5e8d70.mp3",
        "mime_type": "audio/mpeg",
        "expires_at": "2026-11-26T14:30:00Z"
      }
    ]
  }
}
```

### 2. Send the bytes

`PUT` the raw file to `upload_url`, with the same `Content-Type` as `mime_type`. No JSON, no multipart, and no API key: the signature in the URL is the authorization.

```bash theme={null}
curl -X PUT "https://…/uploads/proxy?path=temp-files%2F3f1c…mp3&expires=…&signature=…" \
  -H "Content-Type: audio/mpeg" \
  --data-binary @voiceover.mp3
```

A `2xx` means the file is stored, but it is not a creation yet.

### 3. Finalize it

Tell Magnific the file is there, with the same `folder_reference`. It checks it (that it exists, its size, and that its content is the type you said) and turns it into a creation in that folder. It only takes the `path`s that step 1 gave you.

```bash theme={null}
curl -X POST https://api.magnific.com/v2/uploads/finalize \
  -H "x-magnific-api-key: $MAGNIFIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "uploads": [ { "path": "temp-files/3f1c9a52-7e41-4b8e-9c0d-2a6b1f5e8d70.mp3" } ], "folder_reference": "prj_8f2a" }'
```

```json theme={null}
{
  "data": {
    "results": [
      { "path": "temp-files/3f1c9a52-7e41-4b8e-9c0d-2a6b1f5e8d70.mp3", "creation_id": "Aud9xK2pLq", "status": "completed", "folder_reference": "prj_8f2a" }
    ]
  }
}
```

The `creation_id` is usable right away. Filing it into the folder completes a few seconds after the answer, so `GET /v2/projects/{project_reference}/creations` may take a moment to list it.

### 4. Use it

```bash theme={null}
curl -X POST https://api.magnific.com/v2/videos/speak/omnihuman \
  -H "x-magnific-api-key: $MAGNIFIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "audio_creation_id": "Aud9xK2pLq", "image_creation_id": "ab12CdEf34" }'
```

### Why three steps

The bytes go to a signed upload URL, not to the API call itself, so a 200 MB video never rides a JSON request. Magnific cannot tell from the API when that `PUT` ends, so `finalize` is your signal: it checks the file and answers with the `creation_id` in the same call, ready for the next request. One `finalize` takes every file you uploaded together.

## Import from a URL

When the image is already online, one call does it all:

```bash theme={null}
curl -X POST https://api.magnific.com/v2/uploads/import \
  -H "x-magnific-api-key: $MAGNIFIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/portrait.jpg", "file_name": "portrait.jpg", "folder_reference": "prj_8f2a" }'
```

The answer is the creation, already completed, with its `creation_id`. JPEG, PNG, WebP or SVG. The URL must be public: one that resolves to a private or internal address is refused.

## Rules and limits

* **Sizes:** images 25 MB, SVG 10 MB, audio 50 MB, video 200 MB, GLB models as the catalog states.
* **Targets expire** at `expires_at`. A target whose `PUT` failed is not retried: request a fresh one.
* **All or nothing on the checks:** if one file is missing, too large or not the type you said, `finalize` refuses the whole call and creates nothing. Past the checks, a file that fails to become a creation is listed under `errors` and the rest are made.
* **Daily quota:** every file counts against a daily upload quota, from the moment you request its target. Past it, `429 upload_quota_exceeded` says what is left or when it resets.
* **Where it lands:** in the project or folder of `folder_reference`, which every upload call requires (without it, `422`). `visible: false` keeps the creations out of your library, as working assets.
* **Who can upload there:** the same rule as generating into that project. Outside your organization, as a Viewer or into an archived project, `403` on the first call, before any byte is sent.
* **Security:** each `upload_url` is signed for one file, one type, your account and a short time; it cannot be reused for another file or after it expires, and `finalize` only accepts the paths Magnific issued to you.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.