---
title: "Acquire a lock for an asynchronous job"
method: POST
path: "/async-jobs/{job_id}/lock"
tags: ["AsynchronousJob"]
---

# Acquire a lock for an asynchronous job

`POST /async-jobs/{job_id}/lock`

Acquires a lock for a pending asynchronous job to start processing. Returns the lock details including the lock_key which is required to release the lock.

## Path parameters

- `job_id` string, required

## Response `200`

Lock acquired successfully.

- AsyncJobLock — Lock information for an asynchronous job
  - `job_id` string, required — The ID of the job this lock is for
  - `lock_key` string, required — The unique key required to release or update this lock
  - `acquired_time` integer, required — Timestamp when the lock was acquired

## Other responses

- `401` — User not authenticated
- `403` — User not authorized
- `404` — Entity not found
- `409` — Job is not in a lockable state (e.g., already running, completed, or failed).
- `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)
