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
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
Name | Description |
---|---|
X-SBG-Auth-Token required | Your CGC authentication token. |
Content-Type required | application/json |
Request body
Key | Data type | Description |
---|---|---|
file required | object | The 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
Key | Data type of value | Description of value |
---|---|---|
file | string | ID of this delete job. |
result | string | The result of the job if available at the time the call is made. Use the details of a deletion job to see more information. |
type | string | The type of job, which is DELETE in the case of deleting files. |
state | string | The state is SUBMITTED at the time of making this call. |
failed_files | string | The 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_files | string | The 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_files | string | The 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. |
{
"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
}
Updated less than a minute ago