ChartnautDocs

Check what a script needs

GET/library/{author}/{slug}/requirements

Lists what adding a script to your library would add with it: every script it reads, each with its status, and anything that is not shared with you. It changes nothing. Call it before Add to your library and show the person the list, as the app's Add to library dialog does.

Scope

Heavy call

Long poll

CLI

scripts:read

No

No

chartnaut library needs

Guidance

  • Another author's script runs only once it is in your library, and adding it adds the scripts it reads that you have not added yet. Adding never copies anything: each script stays its author's, picks up their edits, and you can remove it at any time.

  • confirm is exactly what to send as confirm to Add to your library: every script in needs with status installable. Show the person message or the needs list first, and add only if they agree.

  • Anything in cannot_add is not shared with you, and one entry is enough to stop the add. Only its kind and name come back, never who wrote it.

  • root.status says whether the add can happen at all. Only installable can be added. owned, builtin and installed are usable already, and adding them changes nothing.

  • A study's root.status is not_installable: studies cannot be added to a library, and only your own run.

  • A library entry is the live script, never a version, so slug@N is refused with 400.

  • The walk stops at 200 scripts. truncated is then true and needs is a prefix.

Path parameters

Name

Type

Description

author

string

A username, chartnaut or me, in any letter case

slug

string

The script's slug, without @N

Query parameters

Name

Type

Required

Default

Description

kind

string

No

None

indicator, definition or study, when the author has more than one script with that slug

Response

200 with the fields below.

Field

Type

Description

root

object

The script you asked about: ref, kind, name, and status, one of installable, installed, owned, builtin, unavailable or, for a study, not_installable

needs

array of object

Every script it reads that you can have, each with ref, kind, name, author and status: installable (adding the root adds it), installed (already in your library), owned (yours) or builtin (Chartnaut's). [] when none

cannot_add

array of object

Every script it reads that is not shared with you, each with kind and name. [] when none

truncated

boolean

true when the walk stopped at 200 scripts

confirm

array of string

The refs to send as confirm when you add it

message

string

What the app would tell the person, ready to show

Status codes

Status

Code

Meaning

200

-

What adding it would add

400

invalid_request

The path is not /library/{author}/{slug}, it has @N, or kind is not one of its values

404

not_found

No script by that author and slug that you can see

409

conflict

The author has more than one script with that slug. Add kind