TurboFiles

Create a Task

Creates a task with given attributes.

POST
/ v1 / tasks
Attributes
format.input
The format of the input file.
format.output
The format of the output file.
settings
The settings used for the processing. Depends on input_formatand output_format.

Returns

Returns a File object
curl -X "POST" "https://api.turbofiles.io/v1/tasks" \
  -H 'Accept: application/vnd.api+json' \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Authorization: Bearer {api_key}' \
  -d $'{
  "data": {
    "type": "tasks",
    "attributes": {
      "format": {
        "input": "png",
        "output": "webp"
      },
      "settings": {}
    },
    "relationships": {
      "input": {
        "data": {
          "type": "files",
          "id": "a8fhd83jpk.png"
        }
      }
    }
  }
}'
{
  "jsonapi": {
    "version": "1.1"
  },
  "links": {
    "self": "https://api.turbofiles.io/v1/tasks/vjhd09hfl2"
  },
  "data": {
    "type": "tasks",
    "id": "vjhd09hfl2",
    "attributes": {
      "format": {
        "input": "png",
        "output": "webp"
      },
      "settings": {},
      "processing_metadata": {},
      "status": "pending",
      "started_at": null,
      "processed_at": null,
      "created_at": "2023-01-01T00:00:00.000000Z",
      "updated_at": "2023-01-02T00:00:00.000000Z"
    },
    "relationships": {
      "input": {
        "data": {
          "type": "files",
          "id": "a8fhd83jpk.png"
        },
        "links": {
          "self": "https://api.turbofiles.io/v1/tasks/vjhd09hfl2/relationships/input",
          "related": "https://api.turbofiles.io/v1/tasks/vjhd09hfl2/input"
        }
      }
    },
    "included": [
      {
        "type": "files",
        "id": "a8fhd83jpk.png",
        "attributes": {
          "format": "png",
          "size": 1901020,
          "created_at": "2023-11-07T05:31:56Z",
          "updated_at": "2023-11-07T05:31:56Z"
        },
        "links": {
          "self": "https://api.turbofiles.io/v1/files/a8fhd83jpk.png",
          "download": "https://cdn.turbofiles.io/public/a8fhd83jpk.png"
        }
      }
    ],
    "links": {
      "self": "https://api.turbofiles.io/v1/tasks/vjhd09hfl2",
    }
  }
}