File Tree
File Tree
/v2/tasks/{task_id}/files/tree**Admission responses.** This endpoint answers four ways when the task has no usable machine. The three 409s are told apart by `detail.code`; a billing refusal is told apart by its HTTP status: - `machine_not_ready` (409, with `Retry-After`) — provisioning is in progress. Retry. - `task_run_busy` (409, with `Retry-After`) — the task holds an active run lease. Retry. - `task_terminal_no_machine` (409, **no** `Retry-After`) — nothing will ever provision this task. Do not retry. - 402 or 429 — the payer was refused by the credit gate. Do not retry; surface the billing error. What `detail` holds on a refusal is described below. `Retry-After` is present on the two retryable 409s and absent on the terminal one, so it is the quick check; `detail.code` is the precise one. Retrying a terminal answer will never succeed. This endpoint is read-only: it never changes the task, and on a credit refusal it returns `{"code": "credits_exhausted", "message": ...}` under `detail` only, with no billing figures.
Path Parameters
task_idstring · uuidrequiredQuery Parameters
pathstringoptionalRoot of the tree (default: workspace root)
max_depthintegeroptionalmax_entriesintegeroptionalcurl --request GET \
--url https://api.brainbaselabs.com/v2/tasks/{task_id}/files/tree \
--header 'Authorization: Bearer YOUR_API_KEY'{
"name": "string",
"path": "string",
"is_dir": true,
"size": 0,
"children": [
{}
]
}