> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postinger.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Start an upload

> Reserves a file in the library and answers where to PUT its bytes: upload.url for the whole file, or upload.parts, each upload.partSize bytes. Then complete it. JPEG or PNG up to 8 MB, MP4 or MOV up to 1 GB. Width, height and duration are yours to measure; the platforms' rules are checked against them. Needs media:write.



## OpenAPI

````yaml POST /v1/media
openapi: 3.1.1
info:
  title: Postinger API
  description: >-
    Schedule and publish posts, upload media and read analytics for one
    workspace. Authenticate with an API key from API Keys in the app:
    Authorization: Bearer pst_live_…
  version: v1
servers:
  - url: https://api.postinger.dev
    description: Production
security:
  - apiKey: []
tags:
  - name: Accounts
  - name: Analytics
  - name: Workspace
  - name: Media
  - name: Posts
paths:
  /v1/media:
    post:
      tags:
        - Media
      summary: Start an upload
      description: >-
        Reserves a file in the library and answers where to PUT its bytes:
        upload.url for the whole file, or upload.parts, each upload.partSize
        bytes. Then complete it. JPEG or PNG up to 8 MB, MP4 or MOV up to 1 GB.
        Width, height and duration are yours to measure; the platforms' rules
        are checked against them. Needs media:write.
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Send the same key again to retry without doing it twice: the first
            answer comes back. Up to 255 characters, kept for 24 hours.
          schema:
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartUploadBody'
            example:
              fileName: autumn.jpg
              contentType: image/jpeg
              size: 482133
              width: 1080
              height: 1350
              durationSeconds: null
          text/json:
            schema:
              $ref: '#/components/schemas/StartUploadBody'
          application/*+json:
            schema:
              $ref: '#/components/schemas/StartUploadBody'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartUploadResponse'
              example:
                media:
                  id: 0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18
                  kind: image
                  status: uploading
                  contentType: image/jpeg
                  fileName: autumn.jpg
                  size: 482133
                  width: 1080
                  height: 1350
                  durationSeconds: null
                  url: null
                  posterUrl: null
                  createdAt: '2026-10-28T10:00:00+00:00'
                upload:
                  url: https://storage.postinger.dev/…?X-Amz-Signature=…
                  headers:
                    Content-Type: image/jpeg
                  partSize: null
                  parts: null
                poster: null
                expiresAt: '2026-10-28T11:00:00+00:00'
components:
  schemas:
    StartUploadBody:
      required:
        - fileName
        - contentType
        - size
        - width
        - height
        - durationSeconds
      type: object
      properties:
        fileName:
          type:
            - 'null'
            - string
          description: The name shown in the library.
        contentType:
          type:
            - 'null'
            - string
          description: image/jpeg, image/png, video/mp4 or video/quicktime.
        size:
          type:
            - 'null'
            - integer
          description: 'In bytes: images up to 8 MB, videos up to 1 GB.'
          format: int64
        width:
          type:
            - 'null'
            - integer
          description: In pixels, when known. The platforms' rules check it.
          format: int32
        height:
          type:
            - 'null'
            - integer
          description: In pixels, when known. The platforms' rules check it.
          format: int32
        durationSeconds:
          type:
            - 'null'
            - number
          description: 'Videos: the length in seconds. TikTok and YouTube check it.'
          format: double
    StartUploadResponse:
      required:
        - media
        - upload
        - poster
        - expiresAt
      type: object
      properties:
        media:
          $ref: '#/components/schemas/MediaResponse'
        upload:
          $ref: '#/components/schemas/UploadInstructions'
        poster:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/UploadInstructions'
              description: 'Videos: where a JPEG frame for the thumbnail may go. Optional.'
        expiresAt:
          type: string
          format: date-time
    MediaResponse:
      required:
        - id
        - kind
        - status
        - contentType
        - fileName
        - size
        - width
        - height
        - durationSeconds
        - url
        - posterUrl
        - createdAt
      type: object
      properties:
        id:
          type: string
          format: uuid
        kind:
          enum:
            - image
            - video
          type: string
        status:
          enum:
            - uploading
            - ready
          type: string
        contentType:
          type: string
        fileName:
          type: string
        size:
          type: integer
          format: int64
        width:
          type:
            - 'null'
            - integer
          format: int32
        height:
          type:
            - 'null'
            - integer
          format: int32
        durationSeconds:
          type:
            - 'null'
            - number
          format: double
        url:
          type:
            - 'null'
            - string
        posterUrl:
          type:
            - 'null'
            - string
        createdAt:
          type: string
          format: date-time
    UploadInstructions:
      required:
        - url
        - headers
        - partSize
        - parts
      type: object
      properties:
        url:
          type:
            - 'null'
            - string
          description: 'Where to PUT the whole file, with headers. Null: upload in parts.'
        headers:
          type: object
          additionalProperties:
            type: string
          description: Headers to send with the PUT. Never add your API key.
        partSize:
          type:
            - 'null'
            - integer
          description: The bytes in each part; the last may be smaller.
          format: int32
        parts:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/UploadPart'
          description: 'Where to PUT each part, in partNumber order. Null: one PUT to url.'
    UploadPart:
      required:
        - partNumber
        - url
      type: object
      properties:
        partNumber:
          type: integer
          format: int32
        url:
          type: string
  securitySchemes:
    apiKey:
      type: http
      description: A workspace API key (pst_live_…).
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.