Create a workspace and submit the initial task atomically
const url = 'https://your-org.evershell.ai/v1/tasks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role_id":"example","role_name":"example","description":"example","environment":"example","thinking_effort":"high","max_continuations":1,"max_context_tokens":1}'};
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/tasks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role_id": "example", "role_name": "example", "description": "example", "environment": "example", "thinking_effort": "high", "max_continuations": 1, "max_context_tokens": 1 }'Permissions: (workspace:write or workspace:write:own)
and (tasks:write or tasks:write:own). The unscoped
tasks:write is never granted to a default role; every
default role holds the :own variants, which are
trivially satisfied because the caller becomes the new
workspace’s owner.
The task-first UX path. Provisions a workspace from the
named role and queues the first task. Returns 202 with the
new workspace + task ids; the workspace transitions through
provisioning → idle → busy asynchronously.
Accepts JSON or multipart/form-data — multipart adds a
repeatable file field for task uploads that ride into the
workspace’s /data/uploads/<task_id>/ directory before the
agent picks the task up.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
object
Repeatable file part. Each part lands in /data/uploads/<task_id>/<filename> in the workspace sandbox.
Responses
Section titled “ Responses ”Accepted
object
Example
{ "task_id": "task_01HZ", "workspace_id": "ws_01HZ", "status": "submitted"}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 — unarchive
before submitting, or task_already_running — workspace
already has an active task.
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.
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" }}Per-org rate limit exceeded
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" }}Headers
Section titled “Headers ”Seconds until the bucket refills