`GET /api/code-lib/files` — list the workspace's shared code-lib tree.
const url = 'https://example.com/api/code-lib/files';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/code-lib/filesResponses
Section titled “Responses”Wire-shape view of one shared-lib row. Binary rows expose content_b64; text
rows expose content. The mutex matches the DB CHECK so a consumer can switch
on is_binary without a second lookup.
container_path and import_hint are DERIVED, never stored: they are the two
questions a reader of this file actually has (“where does it land?”, “how do I
import it?”), and deriving them server-side keeps the answer identical across
the web editor, the API and the docs.
object
Absolute path inside the code-node container — /sc/lib/<path>.
The specifier a code node uses to reach this file, or None for a file with
no import form (binary, data, or an extension neither runtime imports).
Path relative to the lib root — e.g. mail_triage.ts.
Examplegenerated
[ { "container_path": "example", "content": "example", "content_b64": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "import_hint": "example", "is_binary": true, "path": "example", "size_bytes": 1, "updated_at": "2026-04-15T12:00:00Z", "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }]Authentication required
The canonical JSON body of every error response — the single source of truth
the frontend binds to. Every AppError serializes as this exact shape, and
the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is
what the frontend error schema is generated from, so there is no hand-written
error schema on either end.
object
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Example
{ "code": "not_found"}Permission denied
The canonical JSON body of every error response — the single source of truth
the frontend binds to. Every AppError serializes as this exact shape, and
the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is
what the frontend error schema is generated from, so there is no hand-written
error schema on either end.
object
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Example
{ "code": "not_found"}Structured server error
The canonical JSON body of every error response — the single source of truth
the frontend binds to. Every AppError serializes as this exact shape, and
the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is
what the frontend error schema is generated from, so there is no hand-written
error schema on either end.
object
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Example
{ "code": "not_found"}