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

# Finalize uploaded media

> Verify uploaded media exists in storage, probe it for metadata, and mark it ready to attach to posts.



## OpenAPI

````yaml openapi.json POST /api/v1/media/finalize
openapi: 3.1.0
info:
  title: Posttu API
  version: 1.0.0
  description: >-
    Posttu V1 REST API — Workflow automation, social-media post management,
    inbox, tags, and calendar.
servers:
  - url: https://posttu.com
    description: Production
security: []
paths:
  /api/v1/media/finalize:
    post:
      tags:
        - Media
      summary: Finalize uploaded media
      description: >-
        Verify that media uploaded via presigned PUT exists in storage, probe it
        for dimensions, duration, and format, and mark it LIVE (ready to attach
        to posts). Call this after completing uploads and before referencing the
        media IDs in post creation.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FinalizeMedia'
      responses:
        '200':
          description: Per-media finalize outcome with probed metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaFinalizeResponse'
        '400':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '401':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '403':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '404':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    FinalizeMedia:
      type: object
      properties:
        mediaIds:
          type: array
          items:
            type: string
          minItems: 1
          maxItems: 50
          description: IDs of uploaded media assets to verify, probe, and mark ready
          example:
            - md_abc123
      required:
        - mediaIds
    MediaFinalizeResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Success status
        data:
          type: array
          items:
            $ref: '#/components/schemas/MediaFinalizeItem'
          description: Per-media finalize outcome, in request order
        error:
          type: string
          description: Error message
      required:
        - success
        - data
    MediaFinalizeItem:
      type: object
      properties:
        id:
          type: string
          description: Media ID
          example: md_abc123
        exists:
          type: boolean
          description: Whether the uploaded object was found in storage
          example: true
        status:
          type: string
          enum:
            - LIVE
            - NOT_FOUND
            - FAILED
          description: >-
            LIVE when verified and ready to attach; NOT_FOUND when missing from
            this workspace or storage; FAILED when verification or probing
            errored
          example: LIVE
        stats:
          $ref: '#/components/schemas/MediaProbeStats'
      required:
        - id
        - exists
        - status
        - stats
    MediaProbeStats:
      type:
        - object
        - 'null'
      properties:
        size:
          type: number
          description: File size in bytes
          example: 248320
        format:
          type: string
          description: File format / extension
          example: jpg
        mime_type:
          type: string
          description: MIME type
          example: image/jpeg
        media_type:
          type: string
          enum:
            - image
            - video
            - audio
            - pdf
            - unknown
          description: High-level media category
          example: image
        width:
          type: number
          description: Width in pixels
          example: 1920
        height:
          type: number
          description: Height in pixels
          example: 1080
        aspect_ratio:
          type: string
          description: Aspect ratio
          example: '16:9'
        duration:
          type: number
          description: Duration in seconds for video/audio
          example: 12.5
      required:
        - size
        - format
        - mime_type
        - media_type
      description: Probed technical metadata, null when probing failed
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: 'Pass your API key via the Authorization header: `Bearer <api-key>`'

````

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