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

# Upload media

`POST /v1/media/upload-link`

## Request

- Base URL: `https://api.post-bridge.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.post-bridge.com/v1/media/upload-link`
- Auth: HTTP bearer

To upload media to attach to your post, make a `POST` request to the `/media/create-upload-url` endpoint. 

You'll receive the ID of your media item (which can be used anywhere that `media_id` is referenced) and will include an `upload_url` which is a signed URL of the storage location for uploading your file to. 

This URL is unique and publicly signed for a short time, so make sure to upload your files in a timely manner.

**Example flow using JavaScript and the Fetch API:**

**Request an upload URL**

   ```js
   // Step 1: Request an upload URL from your API
   const response = await fetch('https://api.post-bridge.com/v1/media/create-upload-url', {
     method: 'POST',
     headers: {
       'Content-Type': 'application/json'
     },
     body: JSON.stringify({
       name: 'photo.jpg',
       mime_type: 'image/jpeg',
       size_bytes: 123456
     })
   });

   const { media_id, upload_url } = await response.json();
   ```

**Upload your file to the signed URL**

   ```js
   // Step 2: Upload your file to the signed URL
   const file = /* your File or Blob object, e.g., from an <input type="file"> */;
   await fetch(upload_url, {
     method: 'PUT',
     headers: {
       'Content-Type': 'image/jpeg'
     },
     body: file
   });
   ```

**Use the `media_id` in your post or wherever a media reference is required.**

**Rate limit note**

- API keys currently have a general limit of **10 requests per second per key**.
- There is no bulk endpoint for requesting multiple upload URLs at once.
- If you are uploading many files, keep your aggregate request rate under the limit and retry `429` responses with backoff.

## Response `200`

Upload page URL and expiry.

Signed upload URL and media record created successfully.

- CreateUploadUrlResponseDto
  - `media_id` string, required: The unique media record ID
  - `upload_url` string, required: The signed upload URL for the client to upload the file
  - `name` string, required: The provided name of the media file

## Changes

- **2026-09-07** `1fd31775f6fb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/post-bridge/apis/post-bridge-api/changes/v1/media/upload-link/post.md)

---

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