200 from POST /v1/workspaces/{workspace_id}/shell means the server ran
the line, not that the line succeeded: check exit_code. Most API errors return
JSON with a detail message, but an auth or Host refusal can be plain text,
so check Content-Type before parsing. The full status table is in
Errors; requests past a limit answer 429 with
Retry-After (rate limits).
HTTP status codes
Each endpoint’s Errors section lists its documented failures. The complete
OpenAPI contract
retains every response schema. JSON errors can
include
errno and refusal alongside detail. Those fields describe filesystem
errors and policy refusals when available.
The readiness endpoint uses a different body: HTTP 503 returns
{"status": "full"} or {"status": "shutting_down"} when the server cannot
accept new workspaces.
Examples
Missing or invalid credentials
The TypeScript daemon returns HTTP401 with JSON:
Content-Type: text/plain:
Content-Type before decoding the body. Supply a valid token before retrying.
See Authentication.
Workspace identifier conflict
Creatingdemo again with a different configuration returns HTTP 409:
200 and the existing
workspace, with the same response shape as a successful 201 creation.
Invalid request field
Sending a numeric workspaceid returns HTTP 422:
loc identifies the invalid field. Change id to a string before retrying.
Validation messages can differ between server implementations.
Shell exit codes
A completed shell request can return HTTP200 with a nonzero exit_code.
Inspect exit_code, stdout, stderr and refusal before treating the command
as successful. The response’s HTTP status describes the request, while
exit_code describes the shell command.