---
title: "Create media upload"
method: POST
path: "/create_upload"
tags: ["Write"]
---

# Create media upload

`POST /create_upload`

## Request

- Base URL: `https://pdb.postpen.ai/functions/v1/agent-api`
- URL: `https://pdb.postpen.ai/functions/v1/agent-api/create_upload`
- Auth: HTTP bearer

Returns a private, short-lived upload URL for a file that has no public HTTPS link (a carousel PDF, an image, or an mp4). The file is sent with an HTTP PUT of its raw bytes to upload_url using the returned headers; the returned upload_id is then accepted by save_draft as media: [{ upload_id }], with id to attach it to an existing draft or scheduled post. The URL expires in 2 hours. Limits: images 5MB, video 75KB–200MB mp4, PDF 100MB.

## Request body

- object
  - `type` 'image' | 'video' | 'document', required: What you will upload: image (jpeg, png, webp, gif), video (mp4), or document (pdf).
  - `content_type` string: Optional MIME type, for example image/png, video/mp4, or application/pdf. Defaults from type.
  - `size_bytes` integer: Optional file size in bytes, checked against the limit before you upload.

## Response `200`

Success. JSON object; never contains LinkedIn tokens.

- object

## Other responses

- `400`: Invalid input, or a confirm: true guard was not met.
- `401`: Missing or invalid API key.
- `402`: Plan limit reached (for example the Free plan's monthly post cap).
- `403`: Destination not allowed for this account or plan.

---

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