Create Reprocess
Kick off an async reprocess (create a new version) for a DDS
record. Returns 202 Accepted immediately with the reprocess
envelope; the worker takes over from there. Poll GET /dds/:recordId/tasks/:taskId to watch progress. The wire URL
retains /tasks and the JSON type is still dds_record_task —
only the user-facing concept changed.
▶Path params
| Param | Description |
|---|---|
recordId | DDS record id |
▶Body
| Field | Type | Notes |
|---|---|---|
data.type | string | Literal "dds_record_task" |
data.attributes.operation | enum | "create_version" (only value today) |
data.attributes.end_date | string | null | Optional. ISO YYYY-MM-DD. Must be either Dec 31 of any past year or any date in the current calendar year (server-evaluated at request time). When provided, drives a deforestation re-pin to the requested monitoring_end. |
data.attributes.include_unaccounted_plots | boolean | Default false. When true, plots that satisfy the record's filter today but aren't in v_n get added to v_{n+1}. |
data.attributes.rerun_deforestation | boolean | Default false. When true, forces a deforestation re-run for every plot in v_{n+1} — not just those whose pinned monitoring_end is stale or unpinned. Useful after a methodology update, or when refreshing the deforestation signal across the full plot set is desired. |
data.attributes.reuse_assessments_within_days | int | false | Default 30. Positive integer N reuses cached assessments whose sco2_run_at is within the last N days; false forces every plot's assessments to be re-run regardless of cache state. Max 3650 (10 years). |
▶Worker behaviour
Once the reprocess is accepted, the worker runs the steps below.
The user-visible status field walks pending → processing → completed | failed.
- Resolve the v_{n+1} plot set. Starts with v_n's plots; if
include_unaccounted_plots: true, unions in plots resolved by re-applying v_n's filter against the source asset task today. - Re-run location assessments for every plot's location. Cache-aware: assessments that already exist for a location and type aren't re-computed.
- Decide deforestation re-run set.
rerun_deforestation: true→ every plot in v_{n+1} is re-run; freshness check is bypassed.end_dateprovided → plots whose pinnedmonitoring_enddoesn't equalend_dateplus any newly-added unaccounted plots.end_dateomitted → only plots with no pinned metric and any newly-added unaccounted plots; everyone else carries their v_n pin verbatim.
- Atomic insert v_{n+1} — a single transaction inserts the new version and its per-plot snapshot (with the freshly pinned assessments and deforestation metric), and copies v_n's exclusions and justifications forward to v_{n+1}.
Until step 4 commits, the record's "current version" stays at v_n.
A failure at any step flips the reprocess to failed with
error_message set; v_{n+1} is never half-created.
▶Concurrency
Only one reprocess per record can be in flight. While it is
pending or processing, a second POST returns 409 CONFLICT.
▶Errors
| Status | Code | When |
|---|---|---|
| 400 | BAD_REQUEST | Body failed Zod validation (bad end_date, etc.) |
| 401 | UNAUTHORIZED | Missing/invalid API key |
| 404 | NOT_FOUND | Record isn't visible to the caller |
| 409 | CONFLICT | A reprocess is already running for this record, or the current version has been submitted (or is mid-submission) to TRACES — submitted records are immutable; create a new record to start over |
Required scope:
ingestions:write