---
title: "Upload media directly"
method: POST
path: "/api/v1/media/upload"
tags: ["Media"]
---

# Upload media directly

`POST /api/v1/media/upload`

## Request

- Base URL: `https://www.poster.ly`
- URL: `https://www.poster.ly/api/v1/media/upload`
- Auth: HTTP bearer

Compatibility upload endpoint for small image/video files up to 5MB decoded. Large uploads should use `/api/v1/media/signed-upload` so the file can go directly to storage. PDFs are not accepted on this relay route: use `/api/v1/media/signed-upload` (up to 50MB, for LinkedIn document posts).

## Request body

- object
  - `filename` string, required
  - `data` string, required: Base64-encoded file bytes
  - `content_type` string
  - `workspace_id` string: Optional. The workspace this call acts in and whose plan and credits it uses (from whoami). Needed only when the key can act in several workspaces.

## Response `200`

Media uploaded successfully

- MediaUploadResponse
  - `url` string, required
  - `path` string, required
  - `asset_id` string, nullable: Registered media asset id. Uploads are analyzed automatically in the background; null when analysis registration was skipped.

## Other responses

- `400`: Validation error
- `401`: Invalid or missing API key
- `413`: Request payload is too large for this endpoint
- `429`: Too many requests

---

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