Policy Backtests

Start a backtest of a policy version

Changed on

Compare a policy version over historical deals and return immediately with the run's id to poll. The baseline defaults to the account's active version. as_evaluated compares each deal with its newest stored section evaluations. A run whose workflow could not be started comes back with status failed and the reason in error.

post/api/policy_version/{version}/backtest

Request

  • Base URL
    https://app.herondata.io
  • URL
    https://app.herondata.io/api/policy_version/{version}/backtest
  • Auth
    API key in header x-api-key

Path parameters

versioninteger required

Request body

baseline'active' | 'as_evaluated'

Compare with the active policy or each deal's stored evaluations

descriptionstring nullable

Free text describing what this run is testing

end_user_heron_idsstring[] nullable

Specific deals to run, in request order; cannot be combined with selection filters

limitinteger nullable

Deals to include, at most 4000 (default 200)

window_daysinteger nullable

How far back to look for deals; the account's configured window when omitted

window_endstring date-time nullable

Exclusive deal creation bound; requires window_start and is clamped to now when in the future

window_startstring date-time nullable

Inclusive deal creation bound; requires window_end and cannot be combined with window_days

with_policy_resultstring[] nullable

Only deals whose last policy result was one of ['failed', 'missing_data', 'passed', 'review_required']; omit for all

Response

The run was recorded; its status says whether the workflow started

Changes