Delete a Collection

delete

/documents/api/1.1/collections/{collectionId}

Delete the specified collection.

Request

Supported Media Types
  • application/json
  • application/xml
Path Parameters
collectionId
Type: string
Required: true

Globally unique identifier (GUID) for the collection.

Response

Supported Media Types
  • application/json
  • application/xml
200 Response

The request was fulfilled.

Body
Root Schema : CollectionDeleteResponse
Example application/json

{
    "errorCode":"0",
    "idList":"F79BD107FC398ED6FB482274T0000DEFAULT00000000",
    "type":"collection"
}
400 Response

Request parameters are not formatted correctly.

403 Response

User does not have rights to the specified collection.

404 Response

Collection is in the trash or is not found.

Examples

The following example deletes a collection.

DELETE .../collections/FEFFA68839EB0B144EDCD29545B3E9DD649055F5640B

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "errorCode": "0",
    "idList": "FEFFA68839EB0B144EDCD29545B3E9DD649055F5640B",
    "type": "collection"
}

Example 2

The following example doesn’t delete a collection because the collection specified is in the user's trash.

DELETE ...collections/F8BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 404

JSON Response

{
    "errorCode": "-1",
    "errorKey": "!csFldUnableToDeleteItems!csFldSourceInDestination,ATTRestCollection,Trash",
    "errorMessage": "Unable to delete items. Source Item 'ATTRestCollection' is already in destination 'Trash'. Please specify different destination.",
    "errorType": "collection",
    "idList": "F8BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801",
    "title": "Unable to delete items. Source Item 'ATTRestCollection' is already in destination 'Trash'. Please specify different destination.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 3

The following example doesn’t delete a collection because the collection specified doesn't exist.

DELETE ...collections/F9BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 404

JSON Response

{
    "errorCode": "-16",
    "errorKey": "!csFldUnableToDeleteItems!csSecurityValidationFailed!csFldDoesNotExist,F9BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801!csUnprivilegedSystemError",
    "errorMessage": "Unable to delete items. Security validation failed. 'F9BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801' does not exist. The error was caused by an internally generated issue. The error has been logged.",
    "errorType": "collection",
    "idList": "F9BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801",
    "title": "Unable to delete items. Security validation failed. 'F9BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801' does not exist. The error was caused by an internally generated issue. The error has been logged.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 4

The following example doesn’t delete a collection because the collection is not owned by or shared with the user.

DELETE ...collections/F1FB95D79D849A0439DAA43045B3E9DD649028853801

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 403

JSON Response

{
    "errorCode": "-20",
    "errorKey": "!csFldUnableToDeleteItems!csCloudItemInsufficientPrivileges,UserAA,fFolderGUID:F1FB95D79D849A0439DAA43045B3E9DD649028853801,FLD_MOVE_TO_TRASH",
    "errorMessage": "Unable to delete items. User 'UserAA' has insufficient privilege to access fFolderGUID:F1FB95D79D849A0439DAA43045B3E9DD649028853801 with service FLD_MOVE_TO_TRASH.",
    "errorType": "collection",
    "idList": "F1FB95D79D849A0439DAA43045B3E9DD649028853801",
    "title": "Unable to delete items. User 'UserAA' has insufficient privilege to access fFolderGUID:F1FB95D79D849A0439DAA43045B3E9DD649028853801 with service FLD_MOVE_TO_TRASH.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}