# Create a new document version

URL: /en/docs/api/v1/documents/id/versions/post
Last Updated: 2026-07-30T21:15:30.553Z

## Description
No description available.

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

## Content
### POST /api/v1/documents/{id}/versions

**Create a new document version**

Creates a draft version from either the current promoted version or a specific source version.
The new version is created with status `draft` and is not active until published and activated.

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

**Path parameters:**

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

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

- `source_version_id` (string): Optional source version ID to clone. Use `current` to clone the promoted version.
- `name` (string): Optional friendly name for the new version.

**Responses:**

- `201` - Version created successfully
  - `success` (boolean)
  - `data` (object)
    - `version` (DocumentVersionResource (object))
      - `id` (string (uuid))
      - `key` (string)
      - `name` (string)
      - `status` (enum: draft | published | archived)
      - `is_active` (boolean)
      - `date_created` (string (date-time))
      - `date_updated` (string (date-time))
      - `modified_fields` (array of string)
- `400` - Bad request
  - `type` (string)
  - `code` (string)
  - `message` (string)
  - `doc_url` (string)
- `401` - Unauthorized
  - `type` (string)
  - `code` (string)
  - `message` (string)
  - `doc_url` (string)
- `403` - Forbidden
  - `type` (string)
  - `code` (string)
  - `message` (string)
  - `doc_url` (string)
- `404` - Document or source version not found
  - `type` (string)
  - `code` (string)
  - `message` (string)
  - `doc_url` (string)
- `500` - Internal server error
  - `type` (string)
  - `code` (string)
  - `message` (string)
  - `doc_url` (string)

**Code samples:**

cURL:

```curl
curl -X POST "https://app.orbiqhq.com/api/v1/documents/{id}/versions" \\
  -H "Authorization: Bearer $ACCESS_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{"name": "Q2 Refresh"}'

```

JavaScript (fetch):

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

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

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

```

cURL:

```bash
curl -X POST "https://app.orbiqhq.com/api/v1/documents/{id}/versions" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Q2 Refresh"}'

```

