---
title: "Issue a signed upload URL after quota + content-type checks"
method: POST
path: "/uploads"
tags: ["Media"]
---

# Issue a signed upload URL after quota + content-type checks

`POST /uploads`

## Request

- Base URL: `https://whatareyoudo.ing/api/v1`
- URL: `https://whatareyoudo.ing/api/v1/uploads`
- Auth: HTTP bearer

## Request body

- CreateUploadRequest: At most one of diaryId and entryId; sending both is a 422. The caller must be an active member of the group the file is stored in.
  - `fileName` string, required
  - `contentType` string, required
  - `size` integer, required
  - `groupId` string, uuid, nullable: Group to store the file in. Omitted with no diaryId/entryId: the caller's personal group. Alongside diaryId/entryId it is optional and must match the target's group.
  - `diaryId` string, uuid, nullable: Upload for this diary (its cover, or an entry not created yet). The group is the diary's; requires diary.update or entry.create, plus media.create, on it. Mutually exclusive with entryId.
  - `entryId` string, uuid, nullable: Upload for this entry (its cover or photos). The group is the entry's diary's; requires entry.update and media.create on that diary. Mutually exclusive with diaryId.

## Response `201`

Created

- object
  - `data` object, required
    - `mediaAssetId` string, uuid, required
    - `uploadUrl` string, required
    - `method` 'PUT', required
    - `headers` object, required
  - `meta` object, required
    - `requestId` string, required

## Other responses

- `403`: PLAN_LIMIT_REACHED -- storage quota exceeded
- `413`: UPLOAD_TOO_LARGE -- exceeds the 40MB per-file limit

---

[API](https://skmtc.dev/whatareyoudo/apis/whatcha-api.md) · [All operations](https://skmtc.dev/whatareyoudo/apis/whatcha-api/llms.txt) · [OpenAPI document](https://skmtc.dev/whatareyoudo/apis/whatcha-api/revisions/48dd8a54abea?raw)
