Create a Forward Insight
/insightsSaves a finished study run to your library as a Forward Insight: a card that shows what happened after events like the one you click. It shows on a chart once it is active there, with Activate a Forward Insight or in the app. Call this once the study publishes pin_cell and a run of it has succeeded.
Scope | Heavy call | Long poll | CLI |
|---|---|---|---|
| Yes | No |
|
Guidance
In the app, Put on chart has an agent write
pin_cellfor you and makes the insight active as it saves. This endpoint never writespin_cell, 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 belongs to 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. Saving it does not make it active: activate it to show it on your charts.
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 to your library. It is not active on a chart yet |
| - | Dry run: every check passed. Nothing was saved |
|
| The body is not JSON; |
|
|
|
|
| Your library is at your plan's Forward Insight limit: 5 on Free and 25 on Pro. The message is Your plan keeps 5 Forward Insights in your library. Delete one, or upgrade for more. Replacing one with the same |
|
| 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 |
