Jobs
Create job Async
Create a job with one ore more tasks.
This endpoint is asynchronous and immediately responds after job creation with a job in status processing. There is also a synchronous version of this endpoint available.
Authentication
task.write scope.Body
convert, import/s3 or export/s3).Example Body
{
"tasks": {
"import-my-file": {
"operation": "import/s3"
},
"convert-my-file": {
"operation": "convert",
"input": "import-my-file",
"input_format": "docx",
"output_format": "pdf",
"pages": "1-2",
"optimize_print": true
},
"export-my-file": {
"operation": "export/s3",
"input": "convert-my-file"
}
},
"tag": "myjob-123"
}
Response
The endpoint returns the created job in processing status. You can find details about the job model response in the documentation about the show jobs endpoint.
Create job and wait Sync
Create a job and block until the job is completed. This is the synchronous version of the create job endpoint.
Authentication
task.write scope.Body
convert, import/s3 or export/s3).true the response will a be a redirect to the export URL of the job. Using this parameter requires that the job has an export/url task.Example Body
{
"tasks": {
"import-my-file": {
"operation": "import/url",
"url": "https://..."
},
"convert-my-file": {
"operation": "convert",
"input": "import-my-file",
"input_format": "docx",
"output_format": "pdf",
"pages": "1-2",
"optimize_print": true
},
"export-my-file": {
"operation": "export/url",
"input": "convert-my-file"
}
},
"tag": "myjob-123",
"redirect": true
}
Response
The endpoint returns the completed job in finsihed or error status. You can find details about the job model response in the documentation about the show jobs endpoint.
If redirect was set to true, it redirects to the output file of the job (a 302 redirect with the Location header pointing to the output file).
Show job Async
Show a job status.
This endpoint is asynchronous and immediately responds the job status, even if the job has not completed yet. There is also a synchronous version of this endpoint available.
Authentication
task.read scope.Query Parameters
true the response will a be a redirect to the export URL of the job. Using this parameter requires that the job has an export/url task.Response
The job status, including tasks:
waiting, processing, finished or error.convert, import/s3 or export/s3.waiting, processing, finished or error.files key with the names of the result files of the task (See the example below).If redirect was set to true, it redirects to the output file of the job (a 302 redirect with the Location header pointing to the output file).
Example Response
{
"data": {
"id": "9a160154-58e2-437f-9b6b-19d63b1f59e3",
"tag": "myjob-123",
"status": "processing",
"created_at": "2018-09-19T14:42:58+00:00",
"started_at": "2018-09-19T14:42:58+00:00",
"tasks": [
{
"id": "1f34c1b5-9ee8-4c8c-890f-bf44cda1deb7",
"operation": "convert",
"status": "finished",
"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,
"result": {
"files": [
{
"filename": "output.pdf"
}
]
},
"links": {
"self": "https://api.cloudconvert.com/v2/tasks/h451E6HMhG"
}
},
{
"id": "48c6e72b-cb8e-4ecc-bf3d-ead5477b4741",
"operation": "export/url",
"status": "finished",
"credits": null,
"message": null,
"code": null,
"created_at": "2018-09-19T14:42:58+00:00",
"started_at": null,
"ended_at": null,
"result": {
"files": [
{
"filename": "output.pdf",
"url": "https://storage.cloudconvert.com/48c6e72b-cb8e-4ecc-bf3d-ead5477b4741/output.pdf"
}
]
},
"links": {
"self": "https://api.cloudconvert.com/v2/tasks/Xhrek8bGGq"
}
}
],
"links": {
"self": "https://api.cloudconvert.com/v2/jobs/Xh56hvvMhG"
}
}
}
Wait for job Sync
Wait until the job status is completed and return the job status. This is the synchronous version of the show job endpoint.
Authentication
task.read scope.Query Parameters
true the response will a be a redirect to the export URL of the job. Using this parameter requires that the job has an export/url task.Response
The finished or failed job, including tasks. You can find details about the job model response in the documentation about the show job endpoint.
If redirect was set to true, it redirects to the output file of the job (a 302 redirect with the Location header pointing to the output file).
HTTP/1.1 302 FOUND
Location: https://storage.cloudconvert.com/48c6e72b-cb8e-4ecc-bf3d-ead5477b4741/output.pdf
List jobs
List all your jobs.
Authentication
task.read scope.Query Parameters
processing, finished or error).tasks in the result.100.Response
The list of jobs. You can find details about the job model response in the documentation about the show jobs endpoint.
Example Response
{
"data": [
{
"id": "9a160154-58e2-437f-9b6b-19d63b1f59e3",
"tag": "myjob-123",
"status": "processing",
"created_at": "2018-09-19T14:42:58+00:00",
"started_at": "2018-09-19T14:42:58+00:00",
"links": {
"self": "https://api.cloudconvert.com/v2/tasks/Xh56hvvMhG"
}
},
{
"id": "e8d19289-f8f0-4e83-928a-4705606b086b",
"status": "processing",
"created_at": "2018-09-19T14:42:58+00:00",
"started_at": "2018-09-19T14:42:58+00:00",
"links": {
"self": "https://api.cloudconvert.com/v2/tasks/2h56hvvMhG"
}
}
],
"links": {
"first": "https://api.cloudconvert.com/v2/jobs?page=1",
"last": null,
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"path": "https://api.cloudconvert.com/v2/jobs",
"per_page": 100,
"to": 2
}
}
Delete job
Delete a job, including all tasks and data. Requires the task.write scope.
Jobs are deleted automatically 24 hours after they have ended.
Authentication
task.write scope.Response
An empty response with HTTP Code 204.