# Toggle document versioning

URL: /en/docs/api/v1/documents/id/versioning/patch
Last Updated: 2026-07-30T21:15:30.524Z

## Description
No description available.

## Available Actions
- Execute PATCH request
- View request parameters
- View response schema
- Get code examples
- Navigate to related topics
- View step-by-step instructions
- Get best practices

## Content
### PATCH /api/v1/documents/{id}/versioning

**Toggle document versioning**

Disable versioning to resume editing the promoted document directly. When disabled, existing versions are archived
but remain available for review or reactivation.

**Authentication:** Bearer token (`Authorization: Bearer <token>`)

**Path parameters:**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | Yes | Document ID |

**Request body** (`application/json`) - required:

- `versioning` (boolean, required): Set to `false` to disable versioning. Set to `true` to enable versioning without creating a draft.

**Responses:**

- `200` - Versioning state updated successfully
  - `success` (boolean)
  - `data` (object)
    - `versioning` (boolean)
- `400` - Bad request
  - `type` (string)
  - `code` (string)
  - `message` (string)
  - `doc_url` (string)
- `401` - Unauthorized
- `403` - Not authorized to manage this document
  - `type` (string)
  - `code` (string)
  - `message` (string)
  - `doc_url` (string)
- `404` - Document not found
  - `type` (string)
  - `code` (string)
  - `message` (string)
  - `doc_url` (string)
- `500` - Internal server error

**Code samples:**

cURL:

```curl
curl -X PATCH "https://app.orbiqhq.com/api/v1/documents/{id}/versioning" \\
  -H "Authorization: Bearer $ACCESS_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{"versioning": false}'

```

JavaScript (fetch):

```js
const response = await fetch(
  "https://app.orbiqhq.com/api/v1/documents/{id}/versioning",
  {
    method: "PATCH",
    headers: {
      Authorization: `Bearer ${process.env.ACCESS_TOKEN}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ versioning: false }),
  }
);

if (!response.ok) {
  throw new Error(await response.text());
}

const payload = await response.json();
console.log(payload);

```

cURL:

```bash
curl -X PATCH "https://app.orbiqhq.com/api/v1/documents/{id}/versioning" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"versioning":false}'

```

