> ## 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.

# Starting Tasks

To start a task, send a `POST` request to:

```
https://api.turbofiles.io/v1/tasks
```

Your request must include the following fields:

* `format.input`: The input file format
* `format.output`: The desired format of output file
* `settings`: Format-specific configuration options
* `id`: The input file ID (specified in the `relationships` field)

### File Conversion

<RequestExample>
  ```http theme={null}
  POST /tasks HTTP/1.1
  Accept: application/vnd.api+json
  Content-Type: application/vnd.api+json

  {
    "data": {
      "type": "tasks",
      "attributes": {
        "format": {
          "input": "image/png",
          "output": "image/avif"
        },
        "settings": {
          "resize": {
            "width": 640,
            "height": 640,
            "max_width": 1280,
            "max_height": 1280
          }
        }
      },
      "relationships": {
        "input": {
          "data": {
            "type": "files",
            "id": "<string>"
          }
        }
      }
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "jsonapi": {
      "version": "1.1"
    },
    "data": {
      "type": "tasks",
      "id": "<string>",
      "attributes": {
        "public": false,
        "created_at": "2023-01-01T00:00:00.000000Z",
        "updated_at": "2023-01-02T00:00:00.000000Z",
        "settings": {},
        "format": {
          "input": "image/png",
          "output": "image/avif"
        },
        "started_at": "2023-01-03T00:00:00.000000Z",
        "processed_at": "2023-01-04T00:00:00.000000Z",
        "processing_metadata": {},
        "status": "COMPLETED"
      },
      "relationships": {
        "input": {
          "data": {
            "type": "files",
            "id": "<string>"
          },
          "links": {
            "self": "<string>",
            "related": "<string>"
          }
        },
        "output": {
          "data": {
            "type": "files",
            "id": "<string>"
          },
          "links": {
            "self": "<string>",
            "related": "<string>"
          }
        }
      },
      "links": {
        "self": "<string>"
      }
    },
    "links": {
      "self": "<string>"
    },
    "included": [
      {
        "type": "files",
        "id": "8fhd83jpk",
        "attributes": {
          "format": "image/png",
          "size": 504233,
          "created_at": "2023-11-07T05:31:56Z",
          "updated_at": "2023-11-07T05:31:56Z"
        },
        "links": {
          "self": "<string>",
          "upload": "<string>",
          "download": "<string>"
        }
      }
    ]
  }
  ```
</ResponseExample>
