DeleteDocumentVersionCommand

Deletes a specific version of a document.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { WorkDocsClient, DeleteDocumentVersionCommand } from "@aws-sdk/client-workdocs"; // ES Modules import
// const { WorkDocsClient, DeleteDocumentVersionCommand } = require("@aws-sdk/client-workdocs"); // CommonJS import
const client = new WorkDocsClient(config);
const input = { // DeleteDocumentVersionRequest
  AuthenticationToken: "STRING_VALUE",
  DocumentId: "STRING_VALUE", // required
  VersionId: "STRING_VALUE", // required
  DeletePriorVersions: true || false, // required
};
const command = new DeleteDocumentVersionCommand(input);
const response = await client.send(command);
// {};

DeleteDocumentVersionCommand Input

Parameter
Type
Description
DeletePriorVersions
Required
boolean | undefined

Deletes all versions of a document prior to the current version.

DocumentId
Required
string | undefined

The ID of the document associated with the version being deleted.

VersionId
Required
string | undefined

The ID of the version being deleted.

AuthenticationToken
string | undefined

Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.

DeleteDocumentVersionCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
ConcurrentModificationException
client

The resource hierarchy is changing.

ConflictingOperationException
client

Another operation is in progress on the resource that conflicts with the current operation.

EntityNotExistsException
client

The resource does not exist.

FailedDependencyException
client

The Directory Service cannot reach an on-premises instance. Or a dependency under the control of the organization is failing, such as a connected Active Directory.

InvalidOperationException
client

The operation is invalid.

ProhibitedStateException
client

The specified document version is not in the INITIALIZED state.

UnauthorizedOperationException
client

The operation is not permitted.

UnauthorizedResourceAccessException
client

The caller does not have access to perform the action on the resource.

WorkDocsServiceException
Base exception class for all service exceptions from WorkDocs service.