# Get a one-time upload URL

Returns a one-time URL to PUT a local file to. Send its id as image_upload_id, video_upload_id or audio_upload_id to POST /audit. Voice clips cannot be optimized.

`POST https://realpng.com/api/v1/uploads`

## Request body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `size` | integer | Yes | The file's exact size in bytes, up to 25 MB for an image |
| `content_type` | `image/png`, `image/jpeg`, `image/webp`, `video/mp4`, `video/quicktime`, `video/webm`, `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/mp4`, `audio/x-m4a` | Yes |  |

## Responses

### 201

The upload

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string, uuid | Yes |  |
| `upload_url` | string, uri | Yes |  |
| `method` | `PUT` | Yes |  |
| `headers` | object | Yes | Send these with the PUT |
| `max_bytes` | integer | Yes |  |
| `expires_at` | string, date-time | Yes |  |

### 400

invalid_body: size is missing or not a positive integer, or content_type is missing

### 401

invalid_key: the key is missing, malformed, unknown or revoked

### 402

plan_required: the plan has no API access. payment_failed: the last payment failed, update the card to resume.

### 413

image_too_large: an image over 25 MB. video_too_large: a video over 1 GB.

### 415

unsupported_media: content_type other than image/png, image/jpeg, image/webp, video/mp4, video/quicktime, video/webm

### 429

rate_limited: over the plan's requests a minute, or over the 60 upload URLs an account gets a minute, with Retry-After in seconds.

### 503

uploads_unavailable: image storage is unavailable.

### default

A problem, with a stable code

Every error has a `code` and a `message`, listed on [Errors](/docs/errors).
