Skip to main content
PUT
/
browser
/
sessions
/
{id}
/
fs
/
dir
Create Directory
curl --request PUT \
  --url https://api.example.com/browser/sessions/{id}/fs/dir \
  --header 'Content-Type: application/json' \
  --data '
{
  "path": "<string>",
  "mode": 123
}
'
{
  "path": "<string>"
}

Overview

Creates a directory at the given workspace-relative path. Missing parent directories are created automatically (mkdir -p semantics). Creating an existing directory is a no-op and returns 201.

Path Parameters

id
string
required
Browser session ID (UUID).

Body

path
string
required
Workspace-relative directory path to create.
mode
integer
default:"0755"
Unix mode (octal). Applied to the final directory.

Example Request

curl -X PUT "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/fs/dir" \
  -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "exports/csv"
  }'

Response

Success Response (201)

path
string
The created workspace-relative directory path.
Example Response:
{
  "path": "exports/csv"
}

Error Responses

StatusDescription
400Invalid path.
401Unauthorized — invalid or missing API key.
404Session not found.
409Path exists and is not a directory.