Skip to content

Create recurring bill templates from detected patterns

POST/api/v1/subscriptions/create-templates

Turn detected recurring spend into recurring bill templates in one call: name the rows (counterparty_keys, as listed by GET /) or take every row at or above min_confidence. Vendor, amount, cadence and first date come from the detection (re-run server-side). A row with no vendor of that name, a semi-annual row, or a vendor that already has an open template on that cadence is skipped with a reason; each row is isolated. dry_run plans without creating.

Operation ID: create_templates_from_detection·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.

Request body

counterparty_keysarray · string

counterparty_key of the detected rows to turn into templates. Omit to use min_confidence.

min_confidencenumber

Every detected row at or above this confidence (keys omitted).

lookback_daysinteger

Detection window; match the list you showed.

vendor_overridesobject

counterparty_key -> vendor_id for rows whose vendor is not found by name.

dry_runboolean

Plan the templates; create nothing.

plan_hashstring

plan_hash of the dry run; refused if the patterns moved

Responses

200Successful Response

successboolean
messagestring
codestring
dataCreateTemplatesFromDetectionResponse

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.

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.