---
title: "Upload a file for an item"
method: POST
path: "/portal/{slug}/items/{key}/files"
tags: ["Portal"]
---

# Upload a file for an item

`POST /portal/{slug}/items/{key}/files`

## Request

- Base URL: `https://api.briefgate.dev`
- URL: `https://api.briefgate.dev/portal/{slug}/items/{key}/files`
- Auth: none required

Upload a file for a `file`, `file_list`, or `image` item via multipart/form-data. Returns a `file_id` that must be referenced in the subsequent submitItem call.

## Path parameters

- `slug` string, required
- `key` string, required

## Response `201`

File uploaded

- object
  - `file_id` string
  - `filename` string
  - `size` integer
  - `mime_type` string

## Other responses

- `400`: Invalid request — malformed body or query parameters
- `401`: No valid portal session
- `404`: Resource not found
- `413`: File exceeds size limit
- `415`: Unsupported file type
- `422`: Validation error — the body shape is correct but values are invalid

---

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