Skip to main content
DELETE
/
browser
/
sessions
/
{id}
/
fs
/
dir
Delete Directory
curl --request DELETE \
  --url https://api.example.com/browser/sessions/{id}/fs/dir

Overview

Removes a directory from the session workspace. By default the directory must be empty — pass recursive=true to remove a non-empty tree. To remove a single file, use DELETE /fs/file instead.

Path Parameters

id
string
required
Browser session ID (UUID).

Query Parameters

path
string
required
Workspace-relative directory path to delete.
recursive
boolean
default:"false"
When true, delete the directory and all its contents. When false, the call fails with 409 if the directory is non-empty.

Example Request

curl -X DELETE -G "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/fs/dir" \
  -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
  --data-urlencode "path=exports/csv"

Response

Success Response (204)

No content.

Error Responses

StatusDescription
400Invalid path.
401Unauthorized — invalid or missing API key.
404Session or directory not found.
409Directory is not empty and recursive was not set, or target is not a directory (ENOTDIR).