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

# Create a task



## OpenAPI

````yaml POST /v1/tasks
openapi: 3.1.0
info:
  title: TurboFiles API
  version: 0.1.0
  description: |
    TurboFiles is a high-performance file compression service that provides
    efficient compression for various file types through a simple REST API.
  contact:
    name: TurboFiles Support
    url: https://www.turbofiles.io/support
    email: support@turbofiles.io
servers:
  - url: https://api.turbofiles.io/
    description: Production API
security:
  - bearerAuth: []
paths:
  /v1/tasks:
    post:
      summary: Initiate a task
      operationId: v1_tasks_create
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: object
                  required:
                    - type
                    - attributes
                    - relationship
                  properties:
                    type:
                      type: string
                      enum:
                        - tasks
                    attributes:
                      type: object
                      required:
                        - action
                        - format
                      properties:
                        format:
                          type: object
                          properties:
                            input:
                              type: string
                              description: The format of the input file.
                              enum:
                                - image/png
                                - image/jpeg
                                - image/webp
                                - image/gif
                                - image/bmp
                                - image/tiff
                                - image/x-icon
                                - image/avif
                                - image/x-portable-anymap
                                - image/x-tga
                                - image/vnd.ms-dds
                                - image/vnd.radiance
                                - image/x-exr
                                - image/x-farbfeld
                                - image/qoi
                                - image/svg+xml
                                - video/mp4
                                - video/webm
                                - video/x-msvideo
                                - video/quicktime
                                - video/x-ms-wmv
                                - video/x-flv
                                - video/x-matroska
                                - video/3gpp
                                - video/mpeg
                                - video/ogg
                                - video/mp2t
                                - video/x-m4v
                                - video/dvd
                                - video/x-f4v
                                - audio/mpeg
                                - audio/wav
                                - audio/aac
                                - audio/ogg
                                - audio/opus
                                - audio/flac
                                - audio/mp4
                                - audio/x-ms-wma
                                - application/pdf
                              example: image/png
                            output:
                              type: string
                              description: The format of the output file.
                              enum:
                                - image/png
                                - image/jpeg
                                - image/webp
                                - image/gif
                                - image/bmp
                                - image/tiff
                                - image/x-icon
                                - image/avif
                                - image/x-portable-anymap
                                - image/x-tga
                                - image/vnd.ms-dds
                                - image/vnd.radiance
                                - image/x-exr
                                - image/x-farbfeld
                                - image/qoi
                                - image/svg+xml
                                - video/mp4
                                - video/webm
                                - video/x-msvideo
                                - video/quicktime
                                - video/x-ms-wmv
                                - video/x-flv
                                - video/x-matroska
                                - video/3gpp
                                - video/mpeg
                                - video/ogg
                                - video/mp2t
                                - video/x-m4v
                                - video/dvd
                                - video/x-f4v
                                - audio/mpeg
                                - audio/wav
                                - audio/aac
                                - audio/ogg
                                - audio/opus
                                - audio/flac
                                - audio/mp4
                                - audio/x-ms-wma
                                - application/pdf
                              example: image/webp
                        settings:
                          type: object
                          description: The compression settings for the task.
                          oneOf:
                            - title: Image
                              type: object
                              properties:
                                resize:
                                  type: object
                                  properties:
                                    width:
                                      type: integer
                                      minimum: 0
                                      example: 640
                                      description: Target width in pixels
                                    height:
                                      type: integer
                                      minimum: 0
                                      example: 640
                                      description: Target height in pixels
                                    max_width:
                                      type: integer
                                      minimum: 0
                                      example: 1280
                                      description: Maximum width constraint in pixels
                                    max_height:
                                      type: integer
                                      minimum: 0
                                      example: 1280
                                      description: Maximum height constraint in pixels
                            - title: Audio
                              type: object
                              properties:
                                gain:
                                  type: number
                                  minimum: 0
                                  default: 1
                                  description: >-
                                    Scale factor for audio amplitude (1.0 =
                                    original level)
                                normalize:
                                  type: boolean
                                  description: >-
                                    Whether to normalize audio levels across the
                                    entire track
                                denoise:
                                  type: boolean
                                  description: >-
                                    Whether to apply noise reduction processing
                                    to remove background noise
                            - title: Video
                              type: object
                              properties:
                                resize:
                                  type: object
                                  properties:
                                    width:
                                      type: integer
                                      minimum: 0
                                      example: 640
                                      description: Target width in pixels
                                    height:
                                      type: integer
                                      minimum: 0
                                      example: 640
                                      description: Target height in pixels
                                    max_width:
                                      type: integer
                                      minimum: 0
                                      example: 1280
                                      description: Maximum width constraint in pixels
                                    max_height:
                                      type: integer
                                      minimum: 0
                                      example: 1280
                                      description: Maximum height constraint in pixels
                            - title: SVG
                              type: object
                              properties:
                                gain:
                                  type: number
                                  minimum: 0
                                  default: 1
                                  description: >-
                                    Scale factor for audio amplitude (1.0 =
                                    original level)
                                normalize:
                                  type: boolean
                                  description: >-
                                    Whether to normalize audio levels across the
                                    entire track
                                denoise:
                                  type: boolean
                                  description: >-
                                    Whether to apply noise reduction processing
                                    to remove background noise
                            - title: PDF
                              type: object
                              properties:
                                gain:
                                  type: number
                                  minimum: 0
                                  default: 1
                                  description: >-
                                    Scale factor for audio amplitude (1.0 =
                                    original level)
                                normalize:
                                  type: boolean
                                  description: >-
                                    Whether to normalize audio levels across the
                                    entire track
                                denoise:
                                  type: boolean
                                  description: >-
                                    Whether to apply noise reduction processing
                                    to remove background noise
                    relationship:
                      type: object
                      properties:
                        input:
                          type: object
                          properties:
                            data:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - files
                                id:
                                  type: string
      responses:
        '201':
          description: Created successfully
          content:
            application/vnd.api+json:
              schema:
                type: object
                required:
                  - jsonapi
                  - data
                  - links
                properties:
                  jsonapi:
                    type: object
                    required:
                      - version
                    properties:
                      version:
                        type: string
                        example: '1.1'
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        description: Link to the current page of results
                  data:
                    allOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - tasks
                          id:
                            type: string
                          attributes:
                            type: object
                            required:
                              - public
                              - created_at
                              - updated_at
                              - settings
                              - status
                            properties:
                              public:
                                type: boolean
                                description: Whether the task is publicly accessible.
                                example: false
                              created_at:
                                type: string
                                format: date-time
                                description: The date and time when the task was created.
                                example: '2023-01-01T00:00:00.000000Z'
                              updated_at:
                                type: string
                                format: date-time
                                description: >-
                                  The date and time when the task was last
                                  updated.
                                example: '2023-01-02T00:00:00.000000Z'
                              format:
                                type: object
                                properties:
                                  input:
                                    type: string
                                    description: The format of the input file.
                                    enum:
                                      - image/png
                                      - image/jpeg
                                      - image/webp
                                      - image/gif
                                      - image/bmp
                                      - image/tiff
                                      - image/x-icon
                                      - image/avif
                                      - image/x-portable-anymap
                                      - image/x-tga
                                      - image/vnd.ms-dds
                                      - image/vnd.radiance
                                      - image/x-exr
                                      - image/x-farbfeld
                                      - image/qoi
                                      - image/svg+xml
                                      - video/mp4
                                      - video/webm
                                      - video/x-msvideo
                                      - video/quicktime
                                      - video/x-ms-wmv
                                      - video/x-flv
                                      - video/x-matroska
                                      - video/3gpp
                                      - video/mpeg
                                      - video/ogg
                                      - video/mp2t
                                      - video/x-m4v
                                      - video/dvd
                                      - video/x-f4v
                                      - audio/mpeg
                                      - audio/wav
                                      - audio/aac
                                      - audio/ogg
                                      - audio/opus
                                      - audio/flac
                                      - audio/mp4
                                      - audio/x-ms-wma
                                      - application/pdf
                                    example: image/png
                                  output:
                                    type: string
                                    description: The format of the output file.
                                    enum:
                                      - image/png
                                      - image/jpeg
                                      - image/webp
                                      - image/gif
                                      - image/bmp
                                      - image/tiff
                                      - image/x-icon
                                      - image/avif
                                      - image/x-portable-anymap
                                      - image/x-tga
                                      - image/vnd.ms-dds
                                      - image/vnd.radiance
                                      - image/x-exr
                                      - image/x-farbfeld
                                      - image/qoi
                                      - image/svg+xml
                                      - video/mp4
                                      - video/webm
                                      - video/x-msvideo
                                      - video/quicktime
                                      - video/x-ms-wmv
                                      - video/x-flv
                                      - video/x-matroska
                                      - video/3gpp
                                      - video/mpeg
                                      - video/ogg
                                      - video/mp2t
                                      - video/x-m4v
                                      - video/dvd
                                      - video/x-f4v
                                      - audio/mpeg
                                      - audio/wav
                                      - audio/aac
                                      - audio/ogg
                                      - audio/opus
                                      - audio/flac
                                      - audio/mp4
                                      - audio/x-ms-wma
                                      - application/pdf
                                    example: image/webp
                              settings:
                                type: object
                                description: The parameters for the task.
                                example: {}
                              started_at:
                                type: string
                                format: date-time
                                nullable: true
                                description: The date and time when the task was started.
                                example: '2023-01-03T00:00:00.000000Z'
                              processed_at:
                                type: string
                                format: date-time
                                nullable: true
                                description: The date and time when the task was processed.
                                example: '2023-01-04T00:00:00.000000Z'
                              processing_metadata:
                                type: object
                                nullable: true
                                description: The metadata for the processing of the task.
                                example: {}
                              status:
                                type: string
                                enum:
                                  - PENDING
                                  - IN_PROGRESS
                                  - COMPLETED
                                  - FAILED
                                description: The status of the task.
                                example: COMPLETED
                      - type: object
                        properties:
                          relationships:
                            type: object
                            properties:
                              input:
                                type: object
                                properties:
                                  data:
                                    type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - files
                                      id:
                                        type: string
                                  links:
                                    type: object
                                    properties:
                                      self:
                                        type: string
                                        format: uri
                                      related:
                                        type: string
                                        format: uri
                              output:
                                type: object
                                properties:
                                  data:
                                    type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - files
                                      id:
                                        type: string
                                  links:
                                    type: object
                                    properties:
                                      self:
                                        type: string
                                        format: uri
                                      related:
                                        type: string
                                        format: uri
                          links:
                            type: object
                            properties:
                              self:
                                type: string
                                format: uri
                  included:
                    type: array
                    items:
                      allOf:
                        - type: object
                          required:
                            - type
                            - id
                            - attributes
                          properties:
                            type:
                              type: string
                              enum:
                                - files
                            id:
                              type: string
                              example: 8fhd83jpk
                            attributes:
                              type: object
                              properties:
                                format:
                                  type: string
                                  enum:
                                    - image/png
                                    - image/jpeg
                                    - image/webp
                                    - image/gif
                                    - image/bmp
                                    - image/tiff
                                    - image/x-icon
                                    - image/avif
                                    - image/x-portable-anymap
                                    - image/x-tga
                                    - image/vnd.ms-dds
                                    - image/vnd.radiance
                                    - image/x-exr
                                    - image/x-farbfeld
                                    - image/qoi
                                    - image/svg+xml
                                    - video/mp4
                                    - video/webm
                                    - video/x-msvideo
                                    - video/quicktime
                                    - video/x-ms-wmv
                                    - video/x-flv
                                    - video/x-matroska
                                    - video/3gpp
                                    - video/mpeg
                                    - video/ogg
                                    - video/mp2t
                                    - video/x-m4v
                                    - video/dvd
                                    - video/x-f4v
                                    - audio/mpeg
                                    - audio/wav
                                    - audio/aac
                                    - audio/ogg
                                    - audio/opus
                                    - audio/flac
                                    - audio/mp4
                                    - audio/x-ms-wma
                                    - application/pdf
                                size:
                                  type: integer
                                  example: 504233
                                created_at:
                                  type: string
                                  format: date-time
                                updated_at:
                                  type: string
                                  format: date-time
                        - type: object
                          required:
                            - links
                          properties:
                            links:
                              type: object
                              required:
                                - self
                              properties:
                                self:
                                  type: string
                                  format: uri
                                upload:
                                  type: string
                                  format: uri
                                download:
                                  type: string
                                  format: uri
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Authentication token must be provided in the Authorization header using
        the Bearer scheme.

        Example: Authorization: Bearer your-api-key-or-token

````