---
title: "Get pre-signed URL for media upload"
method: POST
path: "/get-upload-url"
tags: ["Media"]
---

# Get pre-signed URL for media upload

`POST /get-upload-url`

Get a pre-signed S3 URL to upload images, videos, or PDF documents.
Upload the file directly to S3 via HTTP PUT, then create a post.
Upload URLs expire in 1 hour. The image count per post is
platform-specific (up to 4 for Twitter/X, Bluesky, Mastodon; up to 10
for Instagram, LinkedIn, Facebook, Telegram; up to 20 for Threads), or 1 video per
post. Attach multiple images to the same postGroupId to form a carousel;
these post-media count rules do not apply to PDF document assets.

## Headers

- `x-publora-user-id` string

## Request body

- object
  - `fileName` string, required
  - `contentType` string, required — MIME type. It must match an image/*, video/*, or application/pdf upload.
  - `type` 'image' | 'video' | 'document' — Optional media-type hint; inferred from contentType when omitted
  - `postGroupId` string, required — Post group to attach media to

## Response `200`

Upload URL generated

- object
  - `success` boolean
  - `uploadUrl` string, uri — Pre-signed S3 URL. PUT your file here.
  - `fileUrl` string, uri — Public URL after upload
  - `mediaId` string — Media record ID

## Other responses

- `400` — Missing required fields
- `401` — Invalid API key
- `500` — Server error

---

[API](https://skmtc.dev/publora/apis/publora-api.md) · [All operations](https://skmtc.dev/publora/apis/publora-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/publora/publora-api/revisions/a1534a88d80a/schema)
