Tasks
Create task
Tasks are created when creating a job. A job typically contains multiple tasks (for example: importing the file from S3, converting it and exporting it to S3 again).
For example, see the convert files documentation on how to create a job with a convert task for converting files.
Show task Async
Show a task status.
This endpoint is asynchronous and immediately responds the task status, even if the task has not completed yet. There is also a synchronous version of this endpoint available.
Authentication
task.read scope.Query Parameters
retries, depends_on_tasks, payload and/or job in the result. Multiple include values are separated by ,.Response
The task status:
convert or import/s3.waiting, processing, finished or error.error.error.finished.include parameter was set to depends_on_tasks.include parameter was set to retries.include parameter was set to payload.files key with the names of the result files of the task (See the example below).Example Response
{
"data": {
"id": "c85f3ca9-164c-4e89-8ae2-c08192a7cb08",
"job_id": "73df1e16-fd8b-47a1-a156-f197babde91a",
"operation": "convert",
"status": "processing",
"credits": null,
"message": null,
"code": null,
"created_at": "2018-09-19T14:42:58+00:00",
"started_at": "2018-09-19T14:42:58+00:00",
"ended_at": null,
"depends_on_tasks": {
"my-import-task": "x441E6HMhG"
},
"engine": "office",
"engine_version": "2.1",
"payload": {
"input_format": "docx",
"output_format": "pdf",
"pages": "1-2",
"optimize_print": true
},
"result": {
"files": [
{
"filename": "document.pdf"
}
]
}
}
}
Wait for task Sync
Wait until the task status is completed and return the task status. This is the synchronous version of the show task endpoint.
Authentication
task.read scope.Response
The finished or failed task. You can find details about the task model response in the documentation about the show task endpoint.
List tasks
List all your tasks with their status, payload and result.
Authentication
task.read scope.Query Parameters
waiting, processing, finished or error).convert or import/s3).retries and/or depends_on_tasks in the result.100.Response
The list of tasks. You can find details about the task model response in the documentation about the show task endpoint.
Example Response
{
"data": [
{
"id": "73df1e16-fd8b-47a1-a156-f197babde91a",
"operation": "convert",
"status": "processing",
"credits": null,
"message": null,
"code": null,
"created_at": "2018-09-19T14:42:58+00:00",
"started_at": "2018-09-19T14:42:58+00:00",
"ended_at": null,
"payload": {},
"result": null,
"links": {
"self": "https://api.cloudconvert.com/v2/tasks/h451E6HMhG"
}
},
{
"id": "4d610226-5347-4522-b08a-d165b1dde6a0",
"operation": "export/s3",
"status": "waiting",
"credits": null,
"message": null,
"code": null,
"created_at": "2018-09-19T14:42:58+00:00",
"started_at": null,
"ended_at": null,
"payload": {},
"result": null,
"links": {
"self": "https://api.cloudconvert.com/v2/tasks/Xhrek8bGGq"
}
}
],
"links": {
"first": "https://api.cloudconvert.com/v2/tasks?page=1",
"last": null,
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"path": "https://api.cloudconvert.com/v2/tasks",
"per_page": 100,
"to": 2
}
}
Cancel task
Cancel a task that is in status waiting or processing.
Authentication
task.write scope.Response
The updated task. You can find details about the task model response in the documentation about the show task endpoint.
Retry task
Create a new task, based on the payload of another task.
Authentication
task.write scope.Response
The new task (with a new task ID). You can find details about the task model response in the documentation about the show task endpoint.
Delete task
Delete a task, including all data.
Tasks are deleted automatically 24 hours after they have ended.
Authentication
task.write scope.Response
An empty response with HTTP Code 204.