EndpointsGrant access to a sandbox

Sandboxes

Grant access to a sandbox

Gives a Workspace member, an OpenCode Server, or every current Workspace member permissions on the sandbox. For subject_type workspace, subject_id may be omitted and must match this Workspace if supplied. One grant per subject; change permissions by deleting and granting again. Requires manage.

POST/sandboxes/{id}/access
Authorizationstringheaderrequired

Bearer token for the authenticated caller.

Optional workspace/scope context for the request. Carries a single workspace wire id (ws_…) today. Only needed for broad tokens - a workspace-owned token implies its workspace.

Required string length: 1 - 53

Example: "ws_j572abc123def4"

idstringrequired

Sandbox id (sbx_...).

Pattern: ^sbx_[A-Za-z0-9]{1,64}$

Example: "sbx_j572abc123def456"

Body

application/json
subject_typeenum<string>required

user: a workspace member. opencode: an OpenCode Server (oc_...).

Available options: user, opencode

subject_idstringrequired

Required string length: 1 - 100

permissionsenum<string>[]required

Required array length: 1 - 5 elements

Response

application/json

Access granted

idstringrequired

Sandbox access grant id (sbxg_...).

Pattern: ^sbxg_[A-Za-z0-9]{1,64}$

Example: "sbxg_j572abc123def456"

sandbox_idstringrequired

Sandbox id (sbx_...).

Pattern: ^sbx_[A-Za-z0-9]{1,64}$

Example: "sbx_j572abc123def456"

subject_typeenum<string>required

A Workspace member, an OpenCode Server, or every current member of this sandbox's Workspace.

Available options: user, opencode, workspace

subject_idstringrequired
permissionsenum<string>[]required
created_byobjectrequired
child attributes
created_by.typeenum<string>required

user: a workspace member. opencode: an OpenCode Server (oc_...).

Available options: user, opencode

created_by.idstringrequired

Required string length: 1 - 100

created_atintegerrequired

Grant time (Unix seconds).

Required range: x >= 0