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

# Create an async job



## OpenAPI

````yaml /openapi.json post /api/jobs
openapi: 3.1.0
info:
  title: Convertly API
  version: 1.0.0
  description: >-
    Convertly provides production API endpoints for media conversion,
    compression, Image CDN delivery, Forma AI, HLS/DASH video streaming, media
    tools, async jobs, workflows, webhooks, and Convertly Storage.
  license:
    name: Proprietary
    url: https://convertly.sh/terms
servers:
  - url: https://convertly.sh
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /api/jobs:
    post:
      tags:
        - Jobs
      summary: Create an async job
      operationId: createJob
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateJobRequest'
      responses:
        '200':
          description: Queued job
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobId:
                    type: string
                    format: uuid
                  status:
                    const: pending
                required:
                  - jobId
                  - status
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '413':
          $ref: '#/components/responses/Error'
        '503':
          $ref: '#/components/responses/Error'
components:
  schemas:
    CreateJobRequest:
      allOf:
        - $ref: '#/components/schemas/ConvertRequest'
        - type: object
          properties:
            jobType:
              type: string
              enum:
                - convert
                - compress
              default: convert
            createArchive:
              type: string
              enum:
                - 'true'
                - 'false'
              default: 'false'
            saveToStorage:
              type: string
              enum:
                - 'true'
              description: >-
                Required for API-key async jobs because jobs store source files
                while background workers process them.
            mode:
              type: string
              enum:
                - quality
                - target-size
            modes:
              type: string
            targetByteValues:
              type: string
            losslessValues:
              type: string
            stripMetadataValues:
              type: string
    ConvertRequest:
      type: object
      properties:
        files:
          type: array
          items:
            type: string
            format: binary
          description: One or more files.
        format:
          $ref: '#/components/schemas/OutputFormat'
        formats:
          type: string
          description: JSON array of output formats, one per file.
        compression:
          type: integer
          minimum: 1
          maximum: 100
          default: 82
        compressions:
          type: string
          description: JSON array of compression values.
        resize:
          $ref: '#/components/schemas/ResizeMode'
        resizes:
          type: string
          description: JSON array of resize modes.
        resizeWidths:
          type: string
          description: JSON array of widths or null.
        resizeHeights:
          type: string
          description: JSON array of heights or null.
        autoOrient:
          type: string
          enum:
            - 'true'
            - 'false'
          default: 'true'
        autoOrients:
          type: string
          description: JSON array of booleans.
        mono:
          type: string
          enum:
            - 'true'
            - 'false'
          default: 'false'
          description: >-
            Set true for monochrome raster-to-SVG tracing. SVG output preserves
            color by default.
        monos:
          type: string
          description: JSON array of booleans for per-file monochrome SVG tracing.
        saveToStorage:
          type: string
          enum:
            - 'true'
            - 'false'
          default: 'false'
          description: >-
            API-key requests do not save files by default. Set true to store
            uploads and outputs in Convertly storage.
      required:
        - files
        - format
        - resize
    Error:
      type: object
      properties:
        error:
          type: string
        upgradeUrl:
          type: string
      required:
        - error
    OutputFormat:
      type: string
      enum:
        - jpg
        - png
        - webp
        - avif
        - tiff
        - gif
        - heif
        - svg
        - pdf
        - mp4
        - webm
        - mov
        - mp3
        - wav
        - ogg
        - m4a
        - flac
        - zip
        - tar
        - tgz
        - 7z
        - rar
        - gz
        - bz2
        - xz
    ResizeMode:
      type: string
      enum:
        - original
        - website
        - email
        - instagram
        - linkedin
        - ecommerce
        - square
        - width
        - height
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Dashboard-generated Convertly API key. Keys currently begin with
        `cvly_`.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Alternative API key header for server-side clients.

````