ChartnautDocs

List versions

GET/scripts/{slug}/versions

Returns a script's versions, newest first, with who saved each and what changed. Call it to find a version to compare with or go back to.

Scope

Heavy call

Long poll

CLI

scripts:read

No

No

chartnaut versions

Guidance

  • The first item is the latest version. Its version matches latest_version on the Script.

  • To read an older version's code, call Get a script with slug@N and include=source.

  • To go back to an older version, read its files and save them with Save a script version. The old version stays; the save adds a new one on top.

  • author tells you where a version came from: api for the CLI or API, you for a save in the app, app-agent or a model id for the Agent. A version you did not expect is usually an edit made in the app.

  • A @N suffix on the slug is accepted and ignored: every version comes back.

Path parameters

Name

Type

Description

slug

string

Your script's slug. A @N suffix is accepted and ignored

Query parameters

Name

Type

Required

Default

Description

kind

string

No

None

indicator, definition or study, when a study shares the slug

limit

integer

No

50

Most 500

cursor

string

No

None

From the previous page's next_cursor

Response

200 with a page whose data is an array of Version.

Status codes

Status

Code

Meaning

200

-

A page of versions, newest first

400

invalid_request

The slug in the path is not valid

404

not_found

You have no script with that slug

409

conflict

A study shares the slug. Add kind