Create a Forward Insight
/insightsPuts a finished study run on your charts as a Forward Insight: click one of the definition's events and a card shows what happened after events like it. Call it once the study publishes pin_cell and a run of it has succeeded.
Scope | Heavy call | Long poll | CLI |
|---|---|---|---|
| Yes | No |
|
Guidance
The in-app Attach to chart wizard has an agent write
pin_cellfor you. This endpoint never does, and never spends AI credits: you, or your own AI, writepin_cellinto the study first. Forward Insights is the contract.The usual flow: save the study with
pin_cellusing Save a script version, start it with Create a run, wait on Get a run, then readkeys=pin_cellfrom Get run results and check there is one row per combination of itsindexedBydimensions. Then call this withdry_run: true, look at the card, and call it again without.dry_runruns every check and compiles the preview card for a sample event, then saves nothing. It skips only the name check thatreplace: falsemakes.The insight goes on the definition the study reads. When it reads only one of yours, that one is used. When it reads several, name one in
definition, or you get400with the choices. Forward Insights go on your own definitions only: to use someone else's, save a copy, have the study declare the copy, and run it again.It shows on your charts of that definition, on the run's instrument and timeframe, with the definition profile the run used. Run the study on the instrument and timeframe you trade.
To change the numbers, change the study, run it again and call this with the same
name.replacedefaults totrue, so the new insight archives the old one on that definition. Sendreplace: falseto be refused with409 conflictinstead.A
422 script_invalidanswer is a change the study needs.details.fix, when present, is the code to add, anddetails.docs_urllinks the contract. Fix the study, save it, run it again, and retry with the new run: a run is never re-checked against a newer version.
Request body
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | A succeeded study run: |
| string | Yes | What you see on the chart and in the definition's Forward Insights tab. At most 120 characters |
| string | No | Your own definition's slug. Needed only when the study reads more than one of your definitions |
| string | No | What the card answers. At most 2,000 characters |
| boolean | No | Default |
| boolean | No | Default |
Response
201 with the new Forward Insight and a preview. A dry run answers 200 with the fields below and saves nothing.
Field | Type | Description |
|---|---|---|
| boolean | Dry run only. Always |
| string | Dry run only. The definition the insight would go on |
| array of string | Dry run only. |
| object or null | The card as the chart would show it for |
| object or null | The scope values of the event the card was compiled for, such as |
Status codes
Status | Code | Meaning |
|---|---|---|
| - | The Forward Insight was saved and is on your charts |
| - | Dry run: every check passed. Nothing was saved |
|
| The body is not JSON; |
|
|
|
|
| A limit of your plan. Do not retry |
|
| No run with that id on your account |
|
| The run has not succeeded. |
|
|
|
|
| The study does not meet the |
|
| Past your heavy calls at once. Retry after |
