---
title: "Update an asynchronous job"
method: PATCH
path: "/async-jobs/{job_id}"
tags: ["AsynchronousJob"]
---

# Update an asynchronous job

`PATCH /async-jobs/{job_id}`

Updates Job

## Path parameters

- `job_id` string, required

## Headers

- `If-Match` string, required

## Request body

- AsynchronousJob — An AsynchronousJob to track and provide insight into long-running background job
  - `id` string — Unique identifier of the TestCase
  - `workspace_id` string — Unique identifier for the associated Workspace
  - `job_type` 'xray_sync' | 'workspace_copy' — Type of AsynchronousJob
  - `status` 'pending' | 'running' | 'completed' | 'failed' — Current status of the AsynchronousJob
  - `associated_entities` AsynchronousJobAssociatedEntity[] — Type of Entity this AsynchronousJob is associated with
    - `type` 'workspace' | 'plan_run' — Type of Entity this AsynchronousJob is associated with
    - `id` string — Unique identifier for the associated Entity
  - `created_time` integer — Time the AsynchronousJob was created
  - `created_by_id` string — Identifier of the user who created the AsynchronousJob
  - `last_updated_time` integer — Time the AsynchronousJob was last updated
  - `last_updated_by_id` string — Identifier of the user who last updated the AsynchronousJob
  - `error_message` string — If failed, an optional error message associated with the failure
  - `job_source` 'test_run' | 'plan_run' — What triggered this job

## Response `200`

Job updated Successfully

- AsynchronousJob — An AsynchronousJob to track and provide insight into long-running background job
  - `id` string — Unique identifier of the TestCase
  - `workspace_id` string — Unique identifier for the associated Workspace
  - `job_type` 'xray_sync' | 'workspace_copy' — Type of AsynchronousJob
  - `status` 'pending' | 'running' | 'completed' | 'failed' — Current status of the AsynchronousJob
  - `associated_entities` AsynchronousJobAssociatedEntity[] — Type of Entity this AsynchronousJob is associated with
    - `type` 'workspace' | 'plan_run' — Type of Entity this AsynchronousJob is associated with
    - `id` string — Unique identifier for the associated Entity
  - `created_time` integer — Time the AsynchronousJob was created
  - `created_by_id` string — Identifier of the user who created the AsynchronousJob
  - `last_updated_time` integer — Time the AsynchronousJob was last updated
  - `last_updated_by_id` string — Identifier of the user who last updated the AsynchronousJob
  - `error_message` string — If failed, an optional error message associated with the failure
  - `job_source` 'test_run' | 'plan_run' — What triggered this job

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `404` — Entity not found
- `412` — If-Match header did not match current entity version
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
