Delete multiple files and folders

v2/async/files/delete

This call lets you perform perform an asynchronous bulk deletion of files or folders. Deleting folders which aren't empty is allowed.

Request

https://cgc-api.sbgenomics.com/v2/async/files/delete

Example request

POST /v2/async/files/delete
Host: cgc-api.sbgenomics.com
X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74
curl -X POST \
  https://cgc-api.sbgenomics.com/v2/async/files/delete \
  -H 'Content-Type: application/json' \
  -H 'X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74' \
  -d '{
  "items": [
    {
      "file": "568e69abe9b0307bc0412345"
    },
    {
      "file": "568e69abe9b0307bc0498765"
     },
    {
      "file": "568e69abe9b0307bc0414164"
    }
  ]
}'

Header Fields

NameDescription
X-SBG-Auth-Token
required
Your CGC authentication token.
Content-Type
required
application/json

Request body

KeyData typeDescription
file
required
objectThe ID of the file or folder you are deleting. Use the API call for listing all files to obtain the file or folder ID. Deleting folders which are not empty is allowed.
{
  "items": [
    {
      "file": "568e69abe9b0307bc0412345"
    },
    {
      "file": "568e69abe9b0307bc0498765"
     },
    {
      "file": "568e69abe9b0307bc0414164"
    }
  ]
}

Response

See a list of CGC-specific response codes that may be contained in the body of the response..

Response body

KeyData type of valueDescription of value
filestringID of this delete job.
resultstringThe result of the job if available at the time the call is made. Use the details of a deletion job to see more information.
typestringThe type of job, which is DELETE in the case of deleting files.
statestringThe state is SUBMITTED at the time of making this call.
failed_filesstringThe number of failed files if that information is available at the time of the call. You can get details of a copy job with a dedicated call.
completed_filesstringThe number of completed files if that information is available at the time of the call. You can get details of a copy job with a dedicated call.
total_filesstringThe number of failed files if that information is available at the time of the call. You can get the details of a deletion job with a dedicated call.

Example response body

{
    "href": "https://cgc-api.sbgenomics.com/v2/async/files/delete/71714077692819236",
    "id": "71714077692819236",
    "result": [],
    "type": "DELETE",
    "state": "SUBMITTED",
    "failed_files": 0,
    "completed_files": 0,
    "total_files": 0
}