---
title: "Set lock options"
method: POST
path: "/locks"
tags: ["Service"]
---

# Set lock options

`POST /locks`

Set lock options. If write is locked, all write operations and collection creation are forbidden. Returns previous lock options

## Request body

- LocksOption
  - `error_message` string, nullable
  - `write` boolean, required

## Response `200`

successful operation

- object
  - `usage` union
    - HardwareUsage — Usage of the hardware resources, spent to process the request
      - `cpu` integer, required
      - `payload_io_read` integer, required
      - `payload_io_write` integer, required
      - `payload_index_io_read` integer, required
      - `payload_index_io_write` integer, required
      - `vector_io_read` integer, required
      - `vector_io_write` integer, required
    - unknown
  - `time` number, float — Time spent to process this request
  - `status` string
  - `result` LocksOption
    - `error_message` string, nullable
    - `write` boolean, required

## Other responses

- `default` — error
- `4XX` — error

## Changes

- **2025-04-15** `5d330acca4cd` — 2 breaking, 6 info
  - removed the required property `usage/anyOf[#/components/schemas/HardwareUsage]/io_read` from the response with the `200` status
  - removed the required property `usage/anyOf[#/components/schemas/HardwareUsage]/io_write` from the response with the `200` status
  - added the required property `usage/anyOf[#/components/schemas/HardwareUsage]/payload_index_io_read` to the response with the `200` status
  - added the required property `usage/anyOf[#/components/schemas/HardwareUsage]/payload_index_io_write` to the response with the `200` status
  - …4 more
- **2025-01-17** `a7900f38a79d` — 3 info
  - api tag `Service` added
  - api tag `service` removed
  - added the optional property `usage` to the response with the `200` status

[Change history](https://skmtc.dev/qdrant/apis/qdrant-api/changes/locks/post.md)

---

[API](https://skmtc.dev/qdrant/apis/qdrant-api.md) · [All operations](https://skmtc.dev/qdrant/apis/qdrant-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qdrant/qdrant-api/revisions/5d330acca4cd/schema)
