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

# Complete a chunked upload



## OpenAPI

````yaml /api-reference/openapi.json post /v1/media/uploads/{token}/parts/complete
openapi: 3.0.0
info:
  title: PlugKit API
  description: >-
    One API to publish, schedule and message across Instagram, Facebook,
    Threads, WhatsApp, TikTok, Telegram, YouTube, X, LinkedIn and Bluesky — and
    to run Meta and Google ads.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.plugkit.co
security: []
tags: []
paths:
  /v1/media/uploads/{token}/parts/complete:
    post:
      tags:
        - media
      summary: Complete a chunked upload
      operationId: MediaController_completeMultipart
      parameters:
        - name: token
          required: true
          in: path
          schema:
            type: string
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      Human-readable confirmation. Informative only: do not
                      parse.
                    example: Media stored
                  media:
                    type: object
                    properties:
                      url:
                        type: string
                        format: uri
                      filename:
                        type: string
                    required:
                      - url
                      - filename
                required:
                  - message
                  - media
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security: []
components:
  responses:
    BadRequest:
      description: >-
        Invalid request. `code` is `validation_failed` for body/query validation
        (one message per field in `details.fields`), or a specific code
        (`invalid_reference`, `unsupported_for_platform`…).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 2 validation errors on the request.
            type: invalid_request_error
            code: validation_failed
            details:
              fields:
                - content should not be empty
                - accountIds must be an array
    NotFound:
      description: The resource does not exist, or does not belong to the caller.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: No post found with id 'cm3post000001'.
            type: not_found
            code: post_not_found
            details:
              id: cm3post000001
  schemas:
    Error:
      type: object
      description: >-
        Every error response has this shape. The request id is returned in the
        `x-request-id` header, not in the body.
      properties:
        error:
          type: string
          description: >-
            Human-readable message (English). Informative only: branch on `type`
            and `code`.
          example: scheduledFor must be a future date.
        type:
          type: string
          description: Error class, for programmatic branching.
          example: invalid_request_error
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - not_found
            - rate_limit_error
            - platform_error
            - billing_error
            - api_error
        code:
          type: string
          description: >-
            Stable machine code for the precise case (e.g. `validation_failed`,
            `post_not_found`, `rate_limited`, `subscription_required`).
          example: scheduled_in_past
        param:
          type: string
          description: Request field at fault, when there is one.
          example: scheduledFor
        platform:
          type: string
          description: >-
            Upstream platform (meta, tiktok, x…) when `type` is
            `platform_error`.
          example: meta
        platformError:
          type: object
          additionalProperties: true
          description: Raw error payload from the platform, passed through verbatim.
        details:
          type: object
          additionalProperties: true
          description: >-
            Extra structured context. Validation errors carry `details.fields`
            (one message per invalid field); billing errors carry
            `details.action_url`; rate limits carry `details.retryAfter`.
      required:
        - error
        - type
        - code

````

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