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

Overview

Applies chmod and/or chown to a workspace path. Changing uid/gid requires CAP_CHOWN in the sandbox — most production sandboxes drop this capability, so only mode will succeed. At least one of mode, uid, or gid should be set.

Path Parameters

id
string
required
Browser session ID (UUID).

Body

path
string
required
Workspace-relative path to modify.
mode
integer
New Unix mode (octal).
uid
integer
New owner UID. Requires CAP_CHOWN in the sandbox.
gid
integer
New owner GID. Requires CAP_CHOWN in the sandbox.

Example Request

curl -X PUT "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/fs/permissions" \
  -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "scripts/run.sh",
    "mode": 493
  }'

Response

Success Response (200)

path
string
The modified workspace-relative path.
Example Response:
{
  "path": "scripts/run.sh"
}

Error Responses

StatusDescription
400Invalid path, mode, uid, or gid.
401Unauthorized — invalid or missing API key.
404Session or path not found.