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

# Complete a media upload

> Validate uploaded media and queue video preparation. Read its status until ready before scheduling it.

Write access: a member/administrator with a write-enabled credential, or an authorized signed-in user.

Validate uploaded media and queue video preparation. Read its status until ready before scheduling it.

Images can become ready immediately. Videos normally return state processing with HTTP 202 and must finish preparation before a post can use them. Invalid bytes or size are rejected.

MCP clients can use [`complete_media_upload`](/mcp-reference/complete_media_upload) for this operation.

[Request conventions](/api-reference/overview) · [API keys](/api-keys) · [MCP connections](/mcp-connections)


## OpenAPI

````yaml api-reference/openapi.json POST /api/media/{mediaId}/complete
openapi: 3.1.0
info:
  title: Posted HTTP API
  version: 0.2.0
  description: >-
    All registered application, account, OAuth, MCP transport and health
    endpoints. Publishing and draft request schemas come from the shared runtime
    validators. Replace the example server with your installation. Documentation
    uses simple request examples and does not execute live publishing requests.
servers:
  - url: https://posted-api.example.com
security: []
paths:
  /api/media/{mediaId}/complete:
    post:
      tags:
        - Media
      summary: Complete a media upload
      description: >-
        Validate uploaded media and queue video preparation. Read its status
        until ready before scheduling it.


        Images can become ready immediately. Videos normally return state
        processing with HTTP 202 and must finish preparation before a post can
        use them. Invalid bytes or size are rejected.


        Write access: a member/administrator with a write-enabled credential, or
        an authorized signed-in user.
      operationId: post_api_media_by_mediaId_complete
      parameters:
        - name: mediaId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: >-
            The mediaId from the corresponding list, record or authorization
            response.
      responses:
        '200':
          description: >-
            Successful response. Examples are illustrative; field values vary by
            record.
          content:
            application/json:
              schema:
                type: object
                properties:
                  state:
                    type: string
                  media:
                    type: object
                    properties:
                      id:
                        type: string
                      fileName:
                        type: string
                      contentType:
                        type: string
                      sizeBytes:
                        type: integer
                      width:
                        type: integer
                      height:
                        type: integer
                      alt:
                        type: string
                      durationSeconds:
                        type:
                          - string
                          - 'null'
                    additionalProperties: true
                additionalProperties: true
              example:
                state: ready
                media:
                  id: 44444444-4444-4444-8444-444444444444
                  fileName: studio.jpg
                  contentType: image/jpeg
                  sizeBytes: 245760
                  width: 1600
                  height: 900
                  alt: A bright studio desk beside a window
                  durationSeconds: null
        '202':
          description: Video preparation is still processing; poll media status.
          content:
            application/json:
              schema:
                type: object
                properties:
                  state:
                    const: processing
              example:
                state: processing
        default:
          description: >-
            Request failure. Inspect code, message and requestId; respect
            Retry-After on HTTP 429.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - sessionCookie: []
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - requestId
          properties:
            code:
              type: string
            message:
              type: string
            requestId:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Personal or team Posted REST API key
    sessionCookie:
      type: apiKey
      in: cookie
      name: posted_session
      description: >-
        Signed-in human browser session; mutation requests also need the exact
        UI Origin

````

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