.error field:
HTTP status codes
400 Bad Request
400 Bad Request
What it means: the server understood the route but your request body or path params were invalid.Common causes:
- Missing
taskorendUserIdonPOST /v1/tasks - Blank
taskstring (empty or whitespace-only) endUserIdlonger than 256 characters- Malformed JSON body
- Invalid
fieldslist onDELETE credentials
error message, fix your request, retry.401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
What it means: the token was recognized but denied.Common causes:
- API key has been revoked
- Attempting to read/write resources belonging to another business
- Attempting to submit a follow-up into a
sessionIdthat isn’t yours - Attempting to use an API key on a dashboard-only route (
/v1/api-keys)
404 Not Found
404 Not Found
What it means: the resource doesn’t exist, or it does but you don’t own it (we deliberately don’t distinguish the two).Common causes:
- Unknown
taskIdonGET /v1/tasks/{taskId} - Unknown
sessionIdonGET /v1/sessions/{sessionId} - API-key
prefixthat was never issued, or belongs to another business
405 Method Not Allowed
405 Method Not Allowed
What it means: wrong HTTP verb for the endpoint.What to do: check the endpoint doc for the allowed verbs.
429 Too Many Requests
429 Too Many Requests
What it means: rate-limit or quota threshold crossed.What to do: back off and retry with exponential delay. The response body indicates which limit was hit.
500 Internal Server Error
500 Internal Server Error
What it means: our bug.What to do: retry with exponential backoff (we often recover within seconds). If it persists, report to team@stablebrowse.ai with the timestamp and (ideally) the request ID from response headers.
Task-level errors
A task that reachesstatus: "failed" carries an error string explaining what went wrong. This is distinct from the HTTP error codes above — the API call itself succeeded (GET /v1/tasks/{id} returns 200), but the underlying agent run didn’t produce a useful answer. Common patterns:
Symptom on task.error | Likely cause |
|---|---|
"Task timed out (3 minute limit)" | The agent used up its full step/time budget without reaching a done state |
"<platform> authentication is required. All <platform> tools need valid login credentials" | You ran a task targeting a credentialed platform before uploading the end-user’s cookies. Resolution: upload via PUT credentials and try again |
"Failed to enqueue task: ..." | We couldn’t send to our internal queue. Rare. Retry; if persistent, email us |
SDK exceptions
The Python and TypeScript SDKs map HTTP errors into a typed exception hierarchy. See Python SDK → Exceptions and TypeScript SDK → Exceptions.StablebrowseError. TaskFailed and TaskTimeout both carry the underlying task on .task for inspection.
Retry guidance
| Status | Retry? |
|---|---|
400, 401, 403, 404, 405 | No — fix the request |
429 | Yes, with exponential backoff |
500, 502, 503, 504 | Yes, with exponential backoff (max 3-5 retries) |
tasks.run specifically, the SDKs’ built-in polling handles transient 5xx on GET /v1/tasks/{id}. You don’t need to implement retries for the polling loop itself.