Skip to content

List helper libraries

GET
/orgs/{org}/libraries
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.

org
required

The organisation id the session was issued for. A token for one organisation can never read another.

string
Example
org_9f3c

The organisation id the session was issued for. A token for one organisation can never read another.

source

true to include each library’s source.

string
Allowed values: true false
Example
true

true to include each library’s source.

usage

true to include who uses each library: the organisation’s templates and imports not finished that call it, and its runs in progress.

string
Allowed values: true false
Example
true

true to include who uses each library: the organisation’s templates and imports not finished that call it, and its runs in progress.

Organisation and global libraries.

Media typeapplication/json
object
registryVersion
required

The configuration version this list is of. Send it back as If-Match to delete conditionally.

number
libraries
required
Array<object>
object
namespace
required
string
libraryId
required

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).

string
version
required

The manifest’s own semver: the author’s label, not which publish this is.

string
versionNumber
required

Which publish is current: 3 for v3 (…/versions). 0 for a library stored before versions were kept.

number
scope
required
string
Allowed values: global org
manifest
required
object
key
additional properties
source

The module as written, when the route answers it (?source=true on the list).

string
managedBy
required

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.

string | null
Allowed values: sdk
updatedAt
required
string
publishing
required

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.

boolean
usage

With usage=true: who uses each library in libraries, in the same order.

Array<object>
object
namespace
required
string
templates
required

The organisation’s templates, which each run whichever version is current.

object
uses
required

How many call one of its functions by name.

number
mayUse
required

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.

number
imports
required

Its imports not finished.

object
uses
required

How many call one of its functions by name.

number
mayUse
required

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.

number
connections
required

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
uses
required

How many call one of its functions by name.

number
mayUse
required

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.

number
running
required

The organisation’s runs in progress.

Array<object>
object
importId
required
string | null
importName
required
string | null
version
required

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.

number | null
removed
required

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.

boolean
kept
required

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.

Array<object>
object
importId
required
string
importName
required
string
version
required

The version it keeps.

number
usesShipped

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.

Array<string>
holding
required

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
required

Libraries the organisation holds.

number
currentBytes
required

UTF-8 bytes of source across its libraries as they currently are.

number
historyBytes
required

UTF-8 bytes of source across every version it keeps. Removing a library removes its versions.

number
publishedToday
required

Versions published in the last 24 hours, across its libraries.

number
nextPublishAt
required

When the oldest of those leaves the 24 hours, so another may be published where the day’s cap is met. Null with none.

string | null
caps
required

The most of each, the same on every plan.

object
libraries
required
number
currentBytes
required
number
publishesADay
required
number
historyBytes
required
number
Example
{
"libraries": [
{
"scope": "global",
"managedBy": "sdk"
}
]
}

The request — its body or its query — did not match the schema. issues carries the Zod issue list.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed value: MAINTENANCE
Example
{
"code": "MAINTENANCE"
}
Retry-After
integer

Seconds until asking again is worth it (300 while the switch is on).

Report a problem with this page

sloose.com