---
title: "Create an upload"
method: POST
path: "/v1/uploads"
tags: ["Uploads"]
---

# Create an upload

`POST /v1/uploads`

Request a pre-signed URL to upload an image asset. Upload the file with an HTTP `PUT` to the returned `presignedUrl` (sending the same `Content-Type` and `Content-Length`), then call `/uploads/{emailAssetId}/complete` to finalize the asset.

## Request body

- CreateUploadRequest
  - `contentType` string, required — The MIME type of the file to upload. Supported types are `image/jpeg`, `image/png`, `image/gif` and `image/webp`.
  - `contentLength` integer, required — The size of the file in bytes. Must be a positive integer no greater than 4,000,000 bytes.

## Response `200`

Pre-signed upload URL created.

- CreateUploadResponse
  - `emailAssetId` string, required — The ID of the created asset. Pass this as `emailAssetId` to `POST /v1/uploads/{emailAssetId}/complete` once the file has been uploaded.
  - `presignedUrl` string, required — The pre-signed URL to upload the file to with an HTTP `PUT` request. Send the same `Content-Type` and `Content-Length` used in the create request.

## Other responses

- `400` — Invalid request body or unsupported `contentType`.
- `401` — Invalid API key or content API not enabled for this team.
- `405` — Wrong HTTP request method.
- `413` — Upload exceeds the maximum allowed size.

---

[API](https://skmtc.net/loops/apis/loops-openapi-spec.md) · [All operations](https://skmtc.net/loops/apis/loops-openapi-spec/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/loops/loops-openapi-spec/revisions/9cc087257f0d/schema)
