Run a definition over history
POST
/scripts/{slug}/collect- Base URL
https://api.chartnaut.com/v1- Auth
- Bearer key
- Operation ID
collectDefinition
Only the part of the window not already collected runs. Uses the plan's research gate
and Events budget, like collecting in the app. Needs runs:write. Studies run through
the API collect what they declare automatically.
Path parameters#
slugstringRequiredYour script's slug, optionally pinned as slug@N.
Request bodyapplication/json#
object
instrumentstringRequiredExactly one of {from,to}, last or bars. Warmup is fetched before
the window automatically and never counted in results. Clamped to the
plan's historical depth.
Show fields
fromstring (date-time)tostring (date-time)Defaults to now.
laststringbarsintegerversionintegerDefault latest.
Responses#
200OKapplication/json
The window was already collected (covered: true).
object
202Acceptedapplication/json
Collection queued; poll the events summary.
object
ErrorAny other statusapplication/json
Error.
object · Error
errorobjectRequiredShow fields
codestringRequiredStable. Branch on this, never on message.
messagestringRequireddetailsobjectdocs_urlstring (uri)request_idstring