---
title: "Upload a media file"
method: POST
path: "/api/assets/upload/single"
tags: ["Media"]
---

# Upload a media file

`POST /api/assets/upload/single`

## Request

- Base URL: `https://api-app.postnext.io`
- URL: `https://api-app.postnext.io/api/assets/upload/single`
- Auth: API key in header `x-api-key`

Uploads a single image or video via multipart form data. Only `image/*`
and `video/*` MIME types are accepted, up to 500 MB. The `userId` form
field is currently required by the server.

## Response `201`

Uploaded

- object
  - `message` string
  - `asset` Asset
    - `_id` string
    - `teamId` string
    - `userId` string
    - `folderId` string, nullable
    - `name` string: Stored (S3) filename.
    - `originalName` string
    - `type` string: MIME type (stored under `type`, not `mimeType`).
    - `url` string, uri
    - `size` integer: Bytes.
    - `width` integer
    - `height` integer
    - `displayName` string
    - `source` 'user_upload' | 'unsplash' | 'pixabay' | 'pexels' | 'brand_scraper' | 'ai_generated' | 'other'
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400`: No file, or missing userId/teamId
- `401`: Missing or invalid API key
- `403`: Storage limit reached or file exceeds remaining storage

---

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