Validate a script
/scripts/validateLints the code, reads its settings and outputs, and resolves its dependencies, without saving or running anything. It uses no compute units, so call it on every edit before you save or run.
Scope | Heavy call | Long poll | CLI |
|---|---|---|---|
| Yes | No |
|
Guidance
It answers
200even when the code has errors. Checkok, then readdiagnostics: anerrorstops a save or a run, awarningdoes not.Create a script and Save a script version run the same checks and refuse code with errors as
422 script_invalid, so fix everyerrorhere first.Use
interfaceto see what Chartnaut read from the code: the settings a run accepts and the output ids, event ids and result keys you can filter results by.dependencieslists the versions a save would pin now. A built-in that only runs in the browser comes back as adependency.browser_onlywarning: it reads empty in API runs, so pick another.It is a heavy call. While your plan's heavy calls are busy it answers
429 busy; wait forRetry-After(2 seconds) and send it again.Lint and error codes explains each diagnostic code.
Request body
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes |
|
| array of File | Yes | 1 to 50 files, 2 MB in all. An indicator has exactly one |
Response
200 with:
Field | Type | Description |
|---|---|---|
| boolean |
|
| array of Diagnostic | Every finding. |
| What Chartnaut read from the code. | |
| array of Dependency | The versions a save would pin now. Studies always return |
Status codes
Status | Code | Meaning |
|---|---|---|
| - | The checks ran. |
|
| The body is not JSON, |
|
| Past your heavy calls at once. |
|
| The checks could not run. Retry |
