---
title: "Generate a URL to which a new media can be uploaded"
method: POST
path: "/media/uploads"
tags: ["Media upload"]
---

# Generate a URL to which a new media can be uploaded

`POST /media/uploads`

This URL can be used in a PUT request to upload a local file. The request must include the Content-Type and Content-Length headers matching the uploaded file.

Example: curl -T media.mp4 -H 'Content-Type: video/mp4' "${URL}"

## Request body

- object — An object containing the necessary information media creation
  - `user_id` integer — ID of the user to upload the media on behalf of

## Response `201`

The media upload URL has been generated.

- object
  - `upload` MediaUpload
    - `id` integer
    - `url` string

## Other responses

- `401` — Authorization information is missing or invalid.
- `403` — If a user without proper permissions tries to call this endpoint, the call is rejected with 403 Forbidden.
- `404` — The user was not found by id.
- `422` — Invalid user_id is provided.

---

[API](https://skmtc.net/instructure/apis/studio-public-api.md) · [All operations](https://skmtc.net/instructure/apis/studio-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/instructure/studio-public-api/revisions/4838a5113869/schema)
