Create a workspace (empty, no initial task)
const url = 'https://your-org.evershell.ai/v1/workspaces';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role_id":"example","role_name":"example","environment":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-org.evershell.ai/v1/workspaces \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role_id": "example", "role_name": "example", "environment": "example" }'Permissions: workspace:write or workspace:write:own.
The workspace lands in idle after provisioning. Use
POST /tasks to atomically create-workspace-and-submit-task
in one call.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
One of role_id or role_name
Example generated
{ "role_id": "example", "role_name": "example", "environment": "example"}Responses
Section titled “ Responses ”Created
object
Archived workspaces keep their status (typically stopped)
and carry a non-null archived_at; archive is not a status
value.
Populated when Stop ran against a pod that no longer existed and the snapshot save failed — paired with an empty snapshot_ref. Cleared on the next successful snapshot.
Set on forked workspaces; references the parent.
Set on forked workspaces; references the snapshot the fork was created from.
Set on forked workspaces; how many parent tasks were included before the fork boundary.
Whether the workspace’s running pod reflects the role’s current pack set. Computed at fetch time, not persisted.
Set when the workspace has been archived; null otherwise.
Example
{ "id": "ws_01HZ", "status": "provisioning", "pack_status": "current"}Validation failure
object
object
Closed-enum slug (e.g. permission_denied, validation_error, workspace_not_found)
Human-readable summary
Server-generated request id for correlating logs
Optional structured context. Validation errors land at
details.fields as a per-field map.
object
Example
{ "error": { "code": "permission_denied", "message": "caller lacks required scope", "request_id": "7f3a9c2e" }}role_archived or provider_archived — the role (or its
provider) is archived; unarchive before creating
workspaces against it.
object
object
Closed-enum slug (e.g. permission_denied, validation_error, workspace_not_found)
Human-readable summary
Server-generated request id for correlating logs
Optional structured context. Validation errors land at
details.fields as a per-field map.
object
Example
{ "error": { "code": "permission_denied", "message": "caller lacks required scope", "request_id": "7f3a9c2e" }}invalid_capabilities — the role’s caps.yaml failed to
compile. Edit the role to fix it, then retry.
object
object
Closed-enum slug (e.g. permission_denied, validation_error, workspace_not_found)
Human-readable summary
Server-generated request id for correlating logs
Optional structured context. Validation errors land at
details.fields as a per-field map.
object
Example
{ "error": { "code": "permission_denied", "message": "caller lacks required scope", "request_id": "7f3a9c2e" }}Tenant is past_due, decommissioning, or trial-expired
object
object
Closed-enum slug (e.g. permission_denied, validation_error, workspace_not_found)
Human-readable summary
Server-generated request id for correlating logs
Optional structured context. Validation errors land at
details.fields as a per-field map.
object
Example
{ "error": { "code": "permission_denied", "message": "caller lacks required scope", "request_id": "7f3a9c2e" }}