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.
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"
Sandbox id (sbx_...).
Pattern: ^sbx_[A-Za-z0-9]{1,64}$
Example: "sbx_j572abc123def456"
Body
user: a workspace member. opencode: an OpenCode Server (oc_...).
Available options: user, opencode
Required string length: 1 - 100
Required array length: 1 - 5 elements
Response
Access granted
Sandbox access grant id (sbxg_...).
Pattern: ^sbxg_[A-Za-z0-9]{1,64}$
Example: "sbxg_j572abc123def456"
Sandbox id (sbx_...).
Pattern: ^sbx_[A-Za-z0-9]{1,64}$
Example: "sbx_j572abc123def456"
A Workspace member, an OpenCode Server, or every current member of this sandbox's Workspace.
Available options: user, opencode, workspace