List helper libraries
const url = 'https://api.sloose.com/orgs/org_9f3c/libraries?source=true&usage=true';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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://api.sloose.com/orgs/org_9f3c/libraries?source=true&usage=true' \ --header 'Authorization: Bearer <token>'Every library the organisation can use: its own, plus the global ones shipped with the product. Manifests only unless you ask for source.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation id the session was issued for. A token for one organisation can never read another.
Example
org_9f3cThe organisation id the session was issued for. A token for one organisation can never read another.
Query Parameters
Section titled “Query Parameters”true to include each library’s source.
Example
truetrue to include each library’s source.
true to include who uses each library: the organisation’s templates and imports not finished that call it, and its runs in progress.
Example
truetrue to include who uses each library: the organisation’s templates and imports not finished that call it, and its runs in progress.
Responses
Section titled “Responses”Organisation and global libraries.
object
The configuration version this list is of. Send it back as If-Match to delete conditionally.
object
The library’s own id. A name removed and published again is another library under a new id (#1040), so a page that changes who publishes it names this (PUT …/management), and an import’s kept version names it too (LibraryPin.library).
The manifest’s own semver: the author’s label, not which publish this is.
Which publish is current: 3 for v3 (…/versions). 0 for a library stored before versions were kept.
object
The module as written, when the route answers it (?source=true on the list).
sdk when the organisation’s configuration repository publishes it: its page is read only, and a person publishing, restoring or removing it is refused (409 LIBRARY_MANAGED) until it is taken over (PUT …/management), while an API token, which publishes as the repository, may. Null when people publish it on its page, where a push leaves it alone and says so and an API token is refused. A library a push or a token makes is the repository’s.
Whether this organisation’s plan lets it publish libraries (the helper_libraries feature) — what PUT, a restore and a push carrying libraries are refused for (403 FEATURE_HELPER_LIBRARIES) when false. Reading and running libraries do not depend on it.
With usage=true: who uses each library in libraries, in the same order.
object
The organisation’s templates, which each run whichever version is current.
object
How many call one of its functions by name.
How many may reach it without naming the function (helpers[name], or the library read whole), or could not be read: never counted as not using it.
Its imports not finished.
object
How many call one of its functions by name.
How many may reach it without naming the function (helpers[name], or the library read whole), or could not be read: never counted as not using it.
Its connections, by their own defaults: a module’s default match rule and a field’s default mapping, which a run takes from the connection rather than its recipe. A connection that is somebody else’s own is counted, never named.
object
How many call one of its functions by name.
How many may reach it without naming the function (helpers[name], or the library read whole), or could not be read: never counted as not using it.
The organisation’s runs in progress.
object
The version of this library the run started with, which it keeps until it ends — 0 for what came before v1 (the one Sloose ships, or one stored before versions were kept); null when the run did not say which libraries it holds. A run that said, and named no version of this one, holds none of it and is not listed.
True when what the run holds is of a library since removed — its record names another library’s id — so version is no version of this one.
Imports not finished that keep an older version of this library instead of the current one (“Keep v3 for this import”): counted in no use of the current version, and broken by no publish.
object
The version it keeps.
Only on the answer to a removal where Sloose ships a library under the same name: the functions this import calls that the Sloose library also has, which it will use instead of the version it keeps.
How much the organisation’s libraries hold against the bounds on them (#1442): how many, their size together, the versions published in the last 24 hours and the history kept. A publish past one is refused (LIBRARY_LIMIT, LIBRARIES_TOO_LARGE, LIBRARY_PUBLISH_RATE, LIBRARY_HISTORY_FULL); reading and running a library never are.
object
Libraries the organisation holds.
UTF-8 bytes of source across its libraries as they currently are.
UTF-8 bytes of source across every version it keeps. Removing a library removes its versions.
Versions published in the last 24 hours, across its libraries.
When the oldest of those leaves the 24 hours, so another may be published where the day’s cap is met. Null with none.
The most of each, the same on every plan.
object
Example
{ "libraries": [ { "scope": "global", "managedBy": "sdk" } ]}The request — its body or its query — did not match the schema. issues carries the Zod issue list.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No bearer, or one that no longer resolves: a session that is unknown or expired (code: AUTH_REQUIRED), or an API token that was revoked or expired (TOKEN_REVOKED, TOKEN_EXPIRED), whose organisation is gone (ORG_NOT_FOUND) or whose member or user row is (MEMBERSHIP_GONE).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The bearer’s role is too low (code: ROLE_REQUIRED), or it was issued for a different organisation; the organisation has been closed (code: ORG_CLOSED, either kind of bearer); the person is banned (code: BANNED, a session); or it is a session that is signed in but in no organisation (code: NO_ORG): one that never joined one, or whose person was taken out of the one it was in, or left it. Signing in again changes nothing for NO_ORG; choosing or making an organisation does.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, except the operator’s own POST /staff/people/{id}/delete with the ADMIN_TOKEN. Sloose is down for maintenance. Please try again in a few minutes.
object
Example
{ "code": "MAINTENANCE"}Headers
Section titled “Headers”Seconds until asking again is worth it (300 while the switch is on).