ChartnautDocs

Rename or describe a script

PATCH/scripts/{slug}
Base URL
https://api.chartnaut.com/v1
Auth
Bearer key
Operation ID
updateScriptMetadata

Making a public script private while other people use it is refused with 409 in_use and changes nothing: details.usage counts who would lose it (people, installs, apps, insights, studies, scripts, and for definitions alerts, collectors, events). Send the same request with confirm_users: true to go ahead; they lose access at once. With nobody else using it, no confirmation is needed.

Path parameters#

slugstringRequired

Your script's slug, optionally pinned as slug@N.

Pattern ^[a-z0-9][a-z0-9-]{1,62}(@[0-9]+)?$Example vwap-reclaim@3

Request bodyapplication/json#

object
namestring
descriptionstring
visibilitystring · Visibility

Studies are always private; setting visibility on a study is refused with 400.

One of private public
confirm_usersboolean

Go ahead with making it private although other people use it. Only read with visibility.

Responses#

200OKapplication/json

Updated.

object · Script

Includes ScriptSummary

idstring

The script's id for the Terminal SDK and partner API: ind_<n> for an indicator, flw_<n> for a definition. Pass it to cn.scripts.publish({ script }) or chart.scripts.add. Absent for a study.

Example ind_1298
slugstring
kindstring · ScriptKind
One of indicator definition study
namestring
descriptionstring
visibilitystring · Visibility

Studies are always private; setting visibility on a study is refused with 400.

One of private public
latest_versioninteger
updated_atstring (date-time)
app_urlstring (uri)

Opens this script in the Chartnaut app.

versioninteger

The version this response describes.

interfaceobject · ScriptInterface

What a caller needs to run the script and read its results. Derived from the code.

Show fields
settingsmap of object · SettingDef
Show value fields
typestring

An indicator's settings take their type, bounds and options from its settings dialog.

One of number string boolean color select multi_select timeframe range array
defaultany
minnumber
maxnumber
stepnumber
optionsarray of any

Choices for a select. From an indicator's settings dialog each is {label, value}.

outputsarray of object · OutputDef

Indicator only.

Show item fields
idstring
namestring
kindstring

The output's declared kind (line, area, baseline, histogram, fill, markers, labels, hline, range, …).

panestring
One of price own
eventsarray of object · EventDef

Definition only. The events it can emit.

Show item fields
idstring
Example reclaim_long
intentstring
payload_keysarray of string
resultsarray of object

Study only. The result blocks it produces.

Show item fields
keystring
kindstring · StudyResultKind
One of metric series distribution boxplot heatmap scatter bar table vega annotation prose popover_layout
titlestring
timeframesarray of string · Timeframe

Extra timeframes the script reads besides the run's own.

warmup_barsinteger
dependenciesarray of object · PinnedDependency
Show item fields
refstring · ScriptRef

slug or slug@N for your own scripts; author/slug or author/slug@N for library scripts; chartnaut/slug for built-ins (which always run their latest version).

Examples vwap-reclaim vwap-reclaim@3 jane/orb-breakout@7 chartnaut/rsi
asstring

The alias the script uses.

versioninteger
filesarray of object · ScriptFile

Present with include=source on your own scripts.

Show item fields
pathstringRequired
Example main.ts
codestringRequired
entryboolean

Exactly one file is the entry. Indicators have one file, always the entry.

409Conflictapplication/json

in_use: other people use this script, so making it private needs confirm_users: true. details.usage has the counts.

object · Error
errorobjectRequired
Show fields
codestringRequired

Stable. Branch on this, never on message.

One of unauthorized forbidden_scope plan_limit not_found version_conflict script_invalid in_use out_of_coverage unknown_instrument ambiguous_instrument unsupported_timeframe run_not_finished rate_limited busy invalid_request forbidden conflict not_in_library confirmation_required not_shared not_installable not_implemented authorization_pending slow_down access_denied expired_token internal
messagestringRequired
detailsobject
docs_urlstring (uri)
request_idstring
ErrorAny other statusapplication/json

Error.

object · Error
errorobjectRequired
Show fields
codestringRequired

Stable. Branch on this, never on message.

One of unauthorized forbidden_scope plan_limit not_found version_conflict script_invalid in_use out_of_coverage unknown_instrument ambiguous_instrument unsupported_timeframe run_not_finished rate_limited busy invalid_request forbidden conflict not_in_library confirmation_required not_shared not_installable not_implemented authorization_pending slow_down access_denied expired_token internal
messagestringRequired
detailsobject
docs_urlstring (uri)
request_idstring