Folder

Deletes a folder asynchronously. You can use ListFolder to preview the operation using the `dryRun` parameter. *External storage:* external files are only deleted when you directly delete a file or subfolder of a folder that has external storage configured. If you delete the folder itself, only the mapping is removed. Requires a `secret_*` API key. Alternatively, you can use a `public_*` API key and JWT-based auth.

Changed on

Deletes a folder asynchronously.

You can use ListFolder to preview the operation using the dryRun parameter.

External storage: external files are only deleted when you directly delete a file or subfolder of a folder that has external storage configured. If you delete the folder itself, only the mapping is removed.

Requires a secret_* API key. Alternatively, you can use a public_* API key and JWT-based auth.

delete/v2/accounts/{accountId}/folders

Request

Path parameters

accountIdstring required

Your account ID.

This is visible on the settings page:

https://www.bytescale.com/dashboard/settings

Example:A623uY2

Request body

deleteFilesboolean

If true then deletes files.

Default: true

deleteVirtualFoldersboolean

If true then deletes virtual folders (virtual folders are folders created using the PutFolder operation).

Default: true

folderPathstring required

Absolute path to a folder. Begins with a /. Should not end with a /.

recursiveboolean

If true then deletes files and folder settings that descend folderPath.

If false then only deletes files that are direct children of folderPath and only deletes the folder settings of the current folder (if any). Does not delete the folder settings of any child or descendant folders.

Default: true

Example request

{
  "deleteFiles": true,
  "deleteVirtualFolders": true,
  "folderPath": "/uploads",
  "recursive": true
}

Response

Success.

jobDocs'https://www.bytescale.com/docs/job-api/GetJob' required

Link to the documentation that describes how to get a job's status from its job ID.

jobIdstring required

Job ID.

jobType'ProcessImageJob' | 'ProcessVideoJob' | 'ProcessAudioJob' | 'AntivirusJob' | 'ResetCacheJob' | 'DeleteFolderBatchJob' | 'DeleteFileBatchJob' | 'CopyFolderBatchJob' | 'CopyFileBatchJob' required

Job type.

jobUrlstring required

URL for the job's status.

You can GET this URL to retrieve the job's status.

You must authorize your GET request with a secret_* API key when accessing the URL.

Example response

{
  "jobId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
  "jobUrl": "https://api.bytescale.com/v2/accounts/FW25aki/jobs/ExampleJob/01ARZ3NDEKTSV4RRFFQ69G5FAV"
}

Changes

    • warning

      added the new AntivirusJob enum value to the response property for the response status

    • warning

      added the new ProcessAudioJob enum value to the response property for the response status

    • warning

      added the new ProcessImageJob enum value to the response property for the response status

    • warning

      added the new ProcessVideoJob enum value to the response property for the response status

    • warning

      added the new ResetCacheJob enum value to the response property for the response status

    • info

      removed the ProcessFileJob enum value from the response property for the response status