> ## 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.

# Complete an upload

> Checks what arrived in storage and makes the file ready to attach. Safe to call again. Needs media:write.



## OpenAPI

````yaml POST /v1/media/{mediaId}/complete
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/{mediaId}/complete:
    post:
      tags:
        - Media
      summary: Complete an upload
      description: >-
        Checks what arrived in storage and makes the file ready to attach. Safe
        to call again. Needs media:write.
      parameters:
        - name: mediaId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - 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
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaResponse'
              example:
                id: 0193a59e-7c2d-7a1b-9e4f-3d8c2b6a5f18
                kind: image
                status: ready
                contentType: image/jpeg
                fileName: autumn.jpg
                size: 482133
                width: 1080
                height: 1350
                durationSeconds: null
                url: https://media.postinger.dev/…/autumn.jpg
                posterUrl: null
                createdAt: '2026-10-28T10:00:00+00:00'
components:
  schemas:
    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
  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.