---
title: "Create Lock"
method: POST
path: "/locks/{path}"
tags: ["locks", "Locks"]
---

# Create Lock

`POST /locks/{path}`

Create Lock

## Path parameters

- `path` string, required

## Response `201`

The Locks object.

- LockEntity — LockEntity model
  - `path` string — Path
  - `timeout` integer — Lock timeout in seconds
  - `depth` string
  - `recursive` boolean — Does lock apply to subfolders?
  - `owner` string — Owner of the lock. This can be any arbitrary string.
  - `scope` string
  - `exclusive` boolean — Is lock exclusive?
  - `token` string — Lock token. Use to release lock.
  - `type` string
  - `allow_access_by_any_user` boolean — Can lock be modified by users other than its creator?
  - `user_id` integer — Lock creator user ID
  - `username` string — Lock creator username

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `405` — Method Not Allowed
- `409` — Conflict
- `412` — Precondition Failed
- `422` — Unprocessable Entity
- `423` — Locked
- `429` — Too Many Requests

---

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