---
updatedAt: 2026-04-20T20:26:21.000Z
agentTools:
  projectIndex: https://docs.wistia.com/llms.txt
---

# Bulk Delete Subfolders

Deletes multiple subfolders asynchronously. Their media is also soft-deleted and can be restored from the trash by an account owner or manager until it is purged. To keep the media, use the Delete Subfolder endpoint, which moves it to the folder's root level.

## Requires api token with one of the following permissions
```
Read, update & delete anything
```

Tokens with the "Act with a team member's permissions" permission
(`all:delegate_to_contact_permissions` scope) can also be used. Requests
made with such a token are authorized using the permissions of the
contact assigned to the token.

An [expiring access token](https://docs.wistia.com/reference/post_expiring-token)
created with the `all:delegate_to_contact_permissions` scope and an
authorization granting the `update` permission on this folder can also
be used.

An [expiring access token](https://docs.wistia.com/reference/post_expiring-token)
created with the `all:delegate_to_contact_permissions` scope and an
authorization granting the `update` permission on the folder can also be
used.


# OpenAPI definition

````json
{
  "openapi": "3.1.1",
  "info": {
    "title": "Data API",
    "description": "Wistia Data API",
    "version": "2026.09.0"
  },
  "servers": [
    {
      "url": "https://api.wistia.com/modern"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Subfolders"
    }
  ],
  "paths": {
    "/folders/{folderId}/subfolders/bulk_delete": {
      "delete": {
        "summary": "Bulk Delete Subfolders",
        "x-speakeasy-group": "subfolders",
        "x-speakeasy-name-override": "bulkDelete",
        "description": "Deletes multiple subfolders asynchronously. Their media is also soft-deleted and can be restored from the trash by an account owner or manager until it is purged. To keep the media, use the Delete Subfolder endpoint, which moves it to the folder's root level.\n\n## Requires api token with one of the following permissions\n```\nRead, update & delete anything\n```\n\nTokens with the \"Act with a team member's permissions\" permission\n(`all:delegate_to_contact_permissions` scope) can also be used. Requests\nmade with such a token are authorized using the permissions of the\ncontact assigned to the token.\n\nAn [expiring access token](https://docs.wistia.com/reference/post_expiring-token)\ncreated with the `all:delegate_to_contact_permissions` scope and an\nauthorization granting the `update` permission on this folder can also\nbe used.\n\nAn [expiring access token](https://docs.wistia.com/reference/post_expiring-token)\ncreated with the `all:delegate_to_contact_permissions` scope and an\nauthorization granting the `update` permission on the folder can also be\nused.\n",
        "parameters": [
          {
            "name": "folderId",
            "in": "path",
            "description": "The hashed ID of the folder containing the subfolders",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "abc123def4"
              ]
            }
          },
          {
            "name": "X-Wistia-API-Version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2026-09"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "unevaluatedProperties": false,
                "type": "object",
                "properties": {
                  "hashed_ids": {
                    "description": "An array of the subfolder hashed IDs to be deleted.",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "hashed_ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful queuing of subfolder deletion.",
            "content": {
              "application/json": {
                "schema": {
                  "unevaluatedProperties": false,
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "description": "A confirmation message that the background job has been queued.",
                          "type": "string"
                        },
                        "background_job_status": {
                          "unevaluatedProperties": false,
                          "allOf": [
                            {
                              "type": "object",
                              "description": "A background job keeps track of the progress of an asynchronous task, e.g\nbulk archiving media, translating media, etc.\n",
                              "properties": {
                                "id": {
                                  "description": "The ID of the background job that's been queued for the request.",
                                  "type": "integer"
                                },
                                "hashed_id": {
                                  "description": "The unguessable hashed ID of the background job. Prefer this over the numeric ID when polling for status.",
                                  "type": "string"
                                },
                                "status": {
                                  "description": "The status of the background job that's been queued for the request.",
                                  "type": "string",
                                  "enum": [
                                    "queued",
                                    "started",
                                    "finished",
                                    "failed"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "hashed_id",
                                "status"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "background_job_status"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, invalid or missing token",
            "content": {
              "application/json": {
                "schema": {
                  "unevaluatedProperties": false,
                  "type": "object",
                  "properties": {
                    "code": {
                      "description": "A machine-readable identifier for the specific authorization failure.",
                      "type": "string",
                      "enum": [
                        "unauthorized_credentials",
                        "account_inactive",
                        "unauthorized_scope",
                        "unauthorized_params"
                      ]
                    },
                    "error": {
                      "type": "string",
                      "examples": [
                        "Invalid credentials."
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden, token is valid but account does not have access to feature",
            "content": {
              "application/json": {
                "schema": {
                  "unevaluatedProperties": false,
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "examples": [
                        "Webinars are not available on your current plan"
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Folder not found",
            "content": {
              "application/json": {
                "schema": {
                  "unevaluatedProperties": false,
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "examples": [
                        "Project with ID abc123def4 not found."
                      ]
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity, e.g. missing required parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "unevaluatedProperties": false,
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "unevaluatedProperties": false,
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "examples": [
                        "Internal server error"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Subfolders"
        ],
        "x-readme": {
          "code-samples": [
            {
              "name": "Typescript (SDK)",
              "language": "javascript",
              "code": "import { Wistia } from \"@wistia/wistia-api-client\";\n\nconst wistia = new Wistia({\n  bearerAuth: process.env[\"WISTIA_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await wistia.subfolders.bulkDelete({\n    folderId: \"abc123def4\",\n    requestBody: {\n      hashedIds: [\n        \"<value 1>\",\n        \"<value 2>\",\n      ],\n    },\n  });\n\n  console.log(result);\n}\n\nrun();"
            }
          ]
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "x-readme": {
    "samples-languages": [
      "javascript",
      "shell",
      "node",
      "python",
      "ruby"
    ]
  }
}
````