> For the complete documentation index, see [llms.txt](https://bountyv.gitbook.io/vdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bountyv.gitbook.io/vdocs/account/uploads-sign.md).

# Signed uploads

Get a presigned URL you can `PUT` a large file to directly, bypassing the platform's request body size limit — then hand the resulting public URL to whichever endpoint needs it (e.g. `video_url` on [Wan Reel](/vdocs/video-api/videos-wan-reel.md), `reference_video_url` on [Reel Recreate](/vdocs/video-api/videos-generate.md), or `image_urls` on [Seedance](/vdocs/frontier-passthrough/frontier-seedance.md)).

```
POST /api/v1/uploads/sign
```

Synchronous — the call immediately returns a signed URL. Uploading the file to that URL is a separate step you perform right after (see below).

## Authentication

Requires a Bearer API key. See [Authentication](/vdocs/authentication.md).

## Request

**Content-Type:** `application/json`

| Field          | Type   | Required | Default    | Description                                                              |
| -------------- | ------ | -------- | ---------- | ------------------------------------------------------------------------ |
| `filename`     | string | —        | `"upload"` | Original filename. Only the extension is used, to name the stored object |
| `content_type` | string | —        | —          | Accepted in the body but not currently used by the server                |

## Response

```json
{
  "upload_url": "https://<project>.supabase.co/storage/v1/object/upload/sign/uploads/api-uploads/usr_123/direct/V1StGXR8_Z5jdHi6B-myT.mp4?token=...",
  "public_url": "https://<project>.supabase.co/storage/v1/object/public/uploads/api-uploads/usr_123/direct/V1StGXR8_Z5jdHi6B-myT.mp4",
  "storage_path": "api-uploads/usr_123/direct/V1StGXR8_Z5jdHi6B-myT.mp4"
}
```

| Field          | Type   | Description                                                                   |
| -------------- | ------ | ----------------------------------------------------------------------------- |
| `upload_url`   | string | One-time signed URL — `PUT` your file's bytes here                            |
| `public_url`   | string | Permanent public URL — pass this to other endpoints once the upload completes |
| `storage_path` | string | Internal storage path (informational; you generally don't need it)            |

HTTP status: `200 OK`.

## The full flow

1. **Sign** — call `POST /api/v1/uploads/sign` with a `filename` to get `upload_url` and `public_url`.
2. **Upload** — `PUT` the raw file bytes to `upload_url`. This request goes straight to storage, not through the Substance API, so it isn't subject to the API's body size limit.
3. **Use** — pass `public_url` as the URL field on whichever endpoint accepts it — for example `video_url` on [Wan Reel](/vdocs/video-api/videos-wan-reel.md), `reference_video_url` on [Reel Recreate](/vdocs/video-api/videos-generate.md), `image_urls` on [Seedance](/vdocs/frontier-passthrough/frontier-seedance.md), or `audio_url`/`image_url` on [Lyric Video](/vdocs/youtube-tools-api/lyric-video.md) / [Music Short](/vdocs/youtube-tools-api/music-short.md).

The uploaded object is stored in a public bucket, so `public_url` is fetchable by our workers (and by anyone else who has the link) as soon as the `PUT` completes — treat it like any other public file URL. See [Uploading Files](/vdocs/uploading-files.md) for the size/format requirements that apply to each downstream endpoint's own inputs.

## Example

```bash
# 1. Sign
curl -X POST https://substance-api.com/api/v1/uploads/sign \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"filename": "my-reel.mp4"}'

# => { "upload_url": "...", "public_url": "...", "storage_path": "..." }

# 2. Upload the file to the signed URL
curl -X PUT "<upload_url from step 1>" \
  --upload-file ./my-reel.mp4

# 3. Use the public_url with another endpoint, e.g. Wan Reel
curl -X POST https://substance-api.com/api/v1/videos/wan-reel \
  -H "Authorization: Bearer sk_live_..." \
  -F "face=@face.jpg" \
  -F "video_url=<public_url from step 1>"
```

```javascript
import { readFileSync } from "node:fs";

const sign = await fetch("https://substance-api.com/api/v1/uploads/sign", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ filename: "my-reel.mp4" }),
});
const { upload_url, public_url } = await sign.json();

await fetch(upload_url, {
  method: "PUT",
  body: readFileSync("./my-reel.mp4"),
});

// public_url is now ready to pass to another endpoint
```

## Errors

| Status | When                                                   |
| ------ | ------------------------------------------------------ |
| `400`  | Request body isn't valid JSON                          |
| `401`  | Missing, malformed, or revoked API key                 |
| `403`  | Account disabled — contact support                     |
| `429`  | Rate limit exceeded for your key                       |
| `500`  | Could not create the signed upload URL — safe to retry |

`PUT`-ing to an expired or already-used `upload_url` fails at the storage layer — request a fresh one via this endpoint rather than retrying the same `upload_url`.

See [Errors](/vdocs/errors.md) for the full error format.

## Pricing

Free — this endpoint is not billed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bountyv.gitbook.io/vdocs/account/uploads-sign.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
