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

# Upload media

<Warning>
  This endpoint uses a different base URL:

  `https://media.postflow.app/api/v1`
</Warning>


## OpenAPI

````yaml media.json POST /upload
openapi: 3.1.0
info:
  title: PostFlow Media Server
  version: '1'
  description: >-
    Media Server API for uploading and processing media files.


    The Media Server handles file uploads, processing, and storage. It supports
    synchronous and asynchronous uploads via file or URL.
servers:
  - url: https://media.postflow.app/api/v1
security:
  - http: []
paths:
  /upload:
    post:
      summary: Upload file
      description: >-
        Synchronous file upload. The file is processed and a MediaData object is
        returned.
      operationId: upload.file
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    The file to upload. Max 2048 MB.


                    Allowed extensions: heic, avif, webp, jpeg, png, jpg, gif,
                    pdf, srt, mp4, mov, mpeg, webm, avi, mp3.
              required:
                - file
      responses:
        '200':
          description: '`MediaData`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaData'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unsupported file type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Upload failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    MediaData:
      type: object
      properties:
        id:
          type: string
        organization_id:
          type: string
        user_id:
          type:
            - string
            - 'null'
          description: The ID of the user who uploaded the media
        media_folder_id:
          type:
            - string
            - 'null'
        is_media_library:
          type: boolean
          description: Determines whether the media is part of the media library
        type:
          $ref: '#/components/schemas/MediaType'
        url:
          type: string
        client_name:
          type:
            - string
            - 'null'
        file_name:
          type: string
        mime_type:
          type: string
        extension:
          type: string
        size:
          type: integer
        thumbnail:
          type:
            - string
            - 'null'
        preview:
          type:
            - string
            - 'null'
        width:
          type:
            - integer
            - 'null'
        height:
          type:
            - integer
            - 'null'
        aspect_ratio:
          type:
            - number
            - 'null'
        duration:
          type:
            - number
            - 'null'
        fps:
          type:
            - number
            - 'null'
        video_thumbnail_frame:
          type:
            - string
            - 'null'
        video_thumbnail_custom:
          type:
            - string
            - 'null'
        video_thumbnail_time:
          type:
            - number
            - 'null'
        page_count:
          type:
            - integer
            - 'null'
          description: Number of pages in the PDF document
        page_previews:
          type: array
          items:
            type: string
        conversions:
          type:
            - array
            - 'null'
          items:
            type: string
        alt_text:
          type:
            - string
            - 'null'
        pivot_alt_text:
          type:
            - array
            - 'null'
          items:
            type: string
        note:
          type:
            - string
            - 'null'
        origin:
          anyOf:
            - $ref: '#/components/schemas/MediaOrigin'
            - type: 'null'
        is_processing:
          type: boolean
        is_converted:
          type: boolean
          description: >-
            The media has been converted to ensure compatibility with social
            platforms
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      title: MediaData
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message.
      required:
        - error
    MediaType:
      type: integer
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
      x-enum-varnames:
        - Image
        - Video
        - Audio
        - Document
        - Subtitles
      description: >-
        `1` Image <br/> `2` Video <br/> `3` Audio <br/> `4` Document <br/> `5`
        Subtitles
      title: MediaType
    MediaOrigin:
      type: integer
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
      x-enum-varnames:
        - Import
        - ClickUp
        - GoogleDrive
        - Dropbox
        - Tenor
        - PostComment
        - Api
      description: >-
        `1` Import <br/> `2` ClickUp <br/> `3` GoogleDrive <br/> `4` Dropbox
        <br/> `5` Tenor <br/> `6` PostComment <br/> `7` Api
      title: MediaOrigin
  securitySchemes:
    http:
      type: http
      scheme: bearer

````