---
title: "Start an upload"
method: POST
path: "/media"
---

# Start an upload

`POST /media`

## Request

- Base URL: `https://govir.app/api/v1`
- URL: `https://govir.app/api/v1/media`
- Auth: HTTP bearer

Scope: `write`.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `mime` 'image/jpeg' | 'image/png' | 'image/webp' | 'video/mp4' | 'video/quicktime', required
  - `size` integer, required

## Response `201`

Created

- object
  - `id` string, uuid
  - `status` 'pending'
  - `upload` object
    - `method` 'PUT'
    - `url` string
    - `headers` object

## Other responses

- `400`: The request isn't valid
- `401`: No key, a wrong key, or a revoked one
- `403`: The key lacks the scope, or publishing right away isn't allowed
- `422`: The Idempotency-Key was used with another request
- `429`: Too many requests; see Retry-After

---

[API](https://skmtc.dev/govir/apis/govir-api.md) · [All operations](https://skmtc.dev/govir/apis/govir-api/llms.txt) · [OpenAPI document](https://skmtc.dev/govir/apis/govir-api/revisions/2806c124851e?raw)
