---
title: "Upload or prepare several media items"
method: POST
path: "/v1/media/batch"
tags: ["Media"]
---

# Upload or prepare several media items

`POST /v1/media/batch`

## Request

- Base URL: `https://api.postlake.dev`
- URL: `https://api.postlake.dev/v1/media/batch`
- Auth: `bearerAuth` (a scheme the document does not define)

Carousel helper. JSON `{ items: [{ contentType, sizeBytes }] }` returns signed five-minute PUT targets (same as MCP local upload). Multipart with multiple file parts uploads the bytes and returns MediaAsset records. Max 12 items.

## Request body

- object
  - `items` object[], required
    - `contentType` string, required
    - `sizeBytes` integer

## Response `201`

Created

- object
  - `items` union[]
    - union
      - MediaAsset
        - `deletionState` 'deleting': Cleanup is incomplete and can be retried. This upload cannot be used in new posts.
        - `retention` object: Minimum 90 days from upload on every plan while the account is open. Scheduled references remain protected until terminal state plus 30 days if later. No automatic expiry currently. Account deletion, verified erasure requests and legal/security removal are exceptions. Source URLs are public, not private storage.
          - `version` string
          - `minimumDays` integer
          - `minimumUntil` string, date-time
          - `scheduledProtection` string
          - `automaticExpiry` boolean
          - `exceptions` string[]
          - `scope` string
          - `accountRequirement` string
          - `publicUrls` boolean
          - `postRemovalDeletesMedia` boolean
          - `backupService` boolean
        - `id` string, required
        - `url` string, uri, required
        - `contentType` string, required
        - `size` integer, required
        - `createdAt` string, date-time, required
        - `width` integer: Pixel width. Images only, and absent when the header could not be read.
        - `height` integer: Pixel height. Images only, and absent when the header could not be read.
      - object

## Other responses

- `400`: Empty items, too many files, or an unsupported media type
- `401`: Unauthorized

---

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