Skip to content

Backtest a version over a cohort

POST/api/v1/credit/scorecard-versions/{version_id}/backtest

Console operators only. Queues a run of the version over up to 500 businesses and returns the job; poll GET /credit/scorecard-backtests/{id} until status is completed or failed. Each business is measured once and scored; pass compare_version_id to score it under a second version too and learn which businesses come out differently. Measures only: no assessment is created and no event is emitted.

Operation ID: backtest_scorecard_version·View as markdown·OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Parameters

Path

version_idstringrequired

Request body

business_idsarray · string

The cohort, explicitly. Each must be accessible to the caller.

firm_idstring

Or: every business the caller can access in this firm (workspace). Ignored when business_ids is given.

limit_modestring

Where each business's requested limit comes from. fixed: requested_limit_cents for all. line_limit: the business's existing credit line on this operator. per_business: requested_limits_cents. none: no limit is supplied.

One of: fixed, line_limit, per_business, none

requested_limit_centsinteger
requested_limits_centsobject

Business id to requested limit, in cents.

requested_term_daysinteger
as_ofstring · date
compare_version_idstring

Also run this version and report which businesses come out differently.

Responses

202Successful Response

successboolean
messagestring
codestring
dataScorecardBacktestResponse

400Bad Request - Invalid input

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

401Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

403Forbidden - Insufficient permissions

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

404Not Found - Resource does not exist

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

422Validation Error

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.