Skip to content
On this page

Directus Cloud

Everything you need to start building. Provisioned in 90 seconds. Starting at $15/month.

Get Started

This is an auto-generated document to support extension builders understand the internal packages they can utilize. To find our written guides, tutorials, and API/SDK reference, check out our main docs .

Directus / @directus/sdk / rest / promoteContentVersion

Function: promoteContentVersion() ​

promoteContentVersion<Schema, Collection, Item>(id, mainHash, fields?): RestCommand<string | number, Schema>

Promote an existing Content Version to become the new main version of the item.

Type Parameters ​

• Schema

• Collection extends string | number | symbol

• Item = UnpackList<Schema[Collection]>

Parameters ​

• id: DirectusVersion<Schema>["id"]

Primary key of the version.

• mainHash: string

The current hash of the main version of the item (obtained from the compare endpoint).

• fields?: keyof UnpackList<Item>[]

Optional array of field names of which the values are to be promoted. By default, all fields are selected.

Returns ​

RestCommand<string | number, Schema>

The primary key of the promoted item.

Defined in ​

rest/commands/utils/versions.ts:69