Skip to content

Function: restoreContentVersion()

ts
function restoreContentVersion(client, parameters): Promise<Version>;

Defined in: src/v1/api/contentVersions.ts:12

Restores a historical version to be the latest version. That is, a new version is created with the content of the historical version.

Permissions required: Permission to update the content.

Parameters

ParameterTypeDescription
clientClient-
parameters{ expand?: string[]; id: string; operationKey: "restore"; params: { [key: string]: unknown; message: string; restoreTitle?: boolean; versionNumber: number; }; }-
parameters.expand?string[]A multi-value parameter indicating which properties of the content to expand. By default, the content object is expanded. - collaborators returns the users that collaborated on the version. - content returns the content for the version.
parameters.idstringThe ID of the content for which the history will be restored.
parameters.operationKey"restore"Set to 'restore'.
parameters.params{ [key: string]: unknown; message: string; restoreTitle?: boolean; versionNumber: number; }-
parameters.params.messagestringDescription for the version.
parameters.params.restoreTitle?booleanIf true, the content title will be the same as the title from the version restored. Defaults to false.
parameters.params.versionNumbernumberThe version number to be restored.

Returns

Promise&lt;Version>