# MiConvert File Converter API, as sold on RapidAPI. Source: docs/marketplace/openapi.yaml
openapi: 3.0.3
info:
  title: MiConvert File Converter
  version: 1.0.0
  description: >
    Convert files between 140+ formats: 3D and CAD (STEP, IGES, STL, OBJ, FBX, GLB, 3MF, DWG→DXF),

    OFD e-invoices to PDF, documents, images (HEIC, RAW, AVIF, WebP), audio (including Wwise WEM),

    video, fonts, archives and GIS (KML/KMZ).


    **Get a key:** subscribe on RapidAPI (free BASIC plan available):
    https://rapidapi.com/huuhuybn/api/miconvert-file-converter


    **Flow:** `POST /convert` with a file (or a public `file_url`) and the target format `to`.

    You get a `jobId`. Read `GET /jobs/{jobId}` until `status` is `complete` or `failed`,

    then download each file from its `downloadUrl`.


    Uploads through RapidAPI are limited to 50 MB per request. For bigger files (up to your

    plan's limit), pass a public `file_url` instead.


    Pass `wait=30` on either call to hold the request until the job finishes (up to 30 s):

    most image, document and audio conversions then finish in a single call.


    A finished job and its download links stay available for 4 hours (`expiresAt`).

    Uploaded and converted files are deleted automatically after that.


    Status words: a job is `queued`, `processing`, `complete` or `failed`. In a multi-file job,

    check each file's own `status`: a `complete` job can contain a `failed` file.
  contact:
    name: MiConvert support
    url: https://miconvert.com/en/contact
  x-logo:
    url: https://miconvert.com/dl/store/01-app-icon-512.png
  termsOfService: https://miconvert.com/en/terms
servers:
  - url: https://miconvert-file-converter.p.rapidapi.com
    description: RapidAPI gateway
paths:
  /convert:
    post:
      operationId: convertFile
      summary: Convert a file
      description: |
        Send the file as multipart field `file` (repeat it for several files of the same type,
        up to your plan's limit), or send `file_url` instead. The source format is read from the
        file name's extension unless you pass `from`.
      parameters:
        - $ref: '#/components/parameters/Wait'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
                - to
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to convert. Its name must carry the extension (photo.heic, part.step).
                to:
                  type: string
                  example: pdf
                  description: Target format. See GET /formats.
                from:
                  type: string
                  example: ofd
                  description: Source format, when it should not be taken from the file name.
          application/json:
            schema:
              type: object
              required:
                - file_url
                - to
              properties:
                file_url:
                  type: string
                  format: uri
                  example: https://example.com/files/invoice.ofd
                  description: A public http(s) URL MiConvert downloads the file from.
                to:
                  type: string
                  example: pdf
                from:
                  type: string
                  description: Source format, needed when the URL has no file extension.
                filename:
                  type: string
                  description: Name to use for the downloaded file (with extension).
      responses:
        '200':
          description: Finished within `wait` seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '202':
          description: Queued (or still running when `wait` ran out). Poll `statusUrl`.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Queued'
                  - $ref: '#/components/schemas/Job'
        '400':
          $ref: '#/components/responses/Error'
        '413':
          $ref: '#/components/responses/Error'
        '429':
          $ref: '#/components/responses/Error'
        '503':
          $ref: '#/components/responses/Error'
  /jobs/{jobId}:
    get:
      operationId: getJob
      summary: Get job status and download links
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - $ref: '#/components/parameters/Wait'
      responses:
        '200':
          description: The job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '404':
          $ref: '#/components/responses/Error'
  /formats:
    get:
      operationId: listFormats
      summary: List supported conversions
      parameters:
        - name: from
          in: query
          required: false
          schema:
            type: string
            example: step
          description: Only list the targets for this source format.
      responses:
        '200':
          description: Source format → target formats.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  count:
                    type: integer
                    description: Number of conversion pairs.
                  formats:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
                    example:
                      png:
                        - jpg
                        - webp
                        - pdf
                      step:
                        - stl
                        - obj
                        - glb
                        - iges
                  from:
                    type: string
                  to:
                    type: array
                    items:
                      type: string
        '404':
          $ref: '#/components/responses/Error'
  /health:
    get:
      operationId: health
      summary: Health check
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: string
                    example: ok
      security: []
components:
  parameters:
    Wait:
      name: wait
      in: query
      required: false
      schema:
        type: integer
        minimum: 0
        maximum: 30
        example: 30
      description: Seconds to hold the request until the job finishes (max 30).
  schemas:
    Queued:
      type: object
      properties:
        success:
          type: boolean
        jobId:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - queued
        from:
          type: string
        to:
          type: string
        files:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              size:
                type: integer
        statusUrl:
          type: string
          format: uri
    Job:
      type: object
      properties:
        success:
          type: boolean
        jobId:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - queued
            - processing
            - complete
            - failed
        to:
          type: string
        createdAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
          description: When this job record expires.
        files:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              status:
                type: string
                enum:
                  - pending
                  - processing
                  - complete
                  - failed
              outputName:
                type: string
                nullable: true
              downloadUrl:
                type: string
                format: uri
                nullable: true
                description: Valid for 4 hours.
              error:
                type: string
                nullable: true
              warnings:
                type: array
                items:
                  type: string
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: UNSUPPORTED_CONVERSION
          description: |
            NO_FILE, MISSING_PARAMS, INVALID_FORMAT, UNSUPPORTED_FORMAT, UNSUPPORTED_CONVERSION,
            MIXED_FORMATS, TOO_MANY_FILES, FILE_TOO_LARGE, DOWNLOAD_FAILED, BAD_REQUEST,
            TOO_MANY_ACTIVE_JOBS, BUSY, NOT_FOUND, SERVER_ERROR, or a file-validation code.
        message:
          type: string
  responses:
    Error:
      description: Error. 429 and 503 carry a Retry-After header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    RapidAPIKey:
      type: apiKey
      in: header
      name: X-RapidAPI-Key
    RapidAPIHost:
      type: apiKey
      in: header
      name: X-RapidAPI-Host
      description: Always miconvert-file-converter.p.rapidapi.com
externalDocs:
  description: Pricing, playground and API keys on RapidAPI
  url: https://rapidapi.com/huuhuybn/api/miconvert-file-converter
security:
  - RapidAPIKey: []
    RapidAPIHost: []
