---
title: "Prepare a local file upload"
method: POST
path: "/uploads/prepare"
tags: ["File Uploads"]
---

# Prepare a local file upload

`POST /uploads/prepare`

Creates an upload job and returns signed credentials so you can POST a local file directly to the returned `uploadUrl`. After preparing, POST the file to `uploadUrl` as multipart form data with the returned `params`, `signature`, and `file` fields, then poll `GET /uploads/{id}` until status is `ready`.

See [File uploads](/api/file-uploads#local-file-upload) for a full walkthrough and curl examples.

**Supported file types:**
- Images: JPEG, PNG, GIF, WebP
- Videos: MP4, QuickTime (MOV)

**File size limits:**
- Images: 10 MB max
- GIFs: 15 MB max
- Videos: 350 MB max

The returned credentials are short-lived. Upload the file before `expiresAt`.

## Request body

- object
  - `filename` string, required — Original filename, including extension.
  - `mimetype` string, required — MIME type of the file (e.g., image/jpeg, video/mp4).
  - `size` integer, required — File size in bytes.

## Response `200`

Signed credentials for uploading the file

- UploadPrepared — Response when a local file upload is prepared. Use `uploadUrl`, `params`, and `signature` to POST the file. See [File uploads](/api/file-uploads#local-file-upload) for the full multipart upload example.
  - `id` string, uuid, required — Upload job ID. Use this to poll GET /uploads/{id}.
  - `status` 'awaiting_upload', required — Initial status while Ordinal waits for the file POST.
  - `uploadUrl` string, uri, required — URL to POST the file to as multipart form data.
  - `params` string, required — Signed upload params. Include verbatim as the `params` form field.
  - `signature` string, required — Signature for the params. Include verbatim as the `signature` form field.
  - `expiresAt` string, date-time, required — Time after which the signed credentials are no longer valid.
  - `createdAt` string, date-time, required

## Other responses

- `400` — Bad Request - Invalid input parameters
- `401` — Unauthorized - Missing or invalid API key
- `429` — Too Many Requests - Rate limit exceeded

---

[API](https://skmtc.net/tryordinal/apis/ordinal-api.md) · [All operations](https://skmtc.net/tryordinal/apis/ordinal-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tryordinal/ordinal-api/revisions/1d0792ff454f/schema)
