Measure v2 migration guide - Intervention
Technical guide for migrating from Intervention v0 to unified Measure v2
This migration guide is intended for clients to prepare to move over to Measure API v2. This guide covers changes in the Intervention module v0.
Please see https://help.regrow.ag/measure-v2-migration-guide for Inventory migration.
Intervention V0 Migration
Project Configuration
Endpoint:
v0/intervention/projects ->
/v2/measure/projects
Intervention V0 project creation takes its input as query parameters (plus an x-consumer-id header). Measure V2 moves this to a single JSON request body: project_name and is_test map over unchanged, and everything intervention-specific now lives nested under a new intervention_configuration object, which is required whenever outcomes include "Intervention".
|
Intervention V0 (query parameter) |
Measure V2 (JSON body field) |
Notes |
|
project_name |
project_name |
Unchanged |
|
is_test |
is_test |
Unchanged, defaults to false |
|
(none) |
outcomes |
New, required. Must include "Intervention" |
|
protocol |
intervention_configuration.protocol |
Unchanged, now nested |
|
baseline_method |
intervention_configuration.baseline_method |
Nested; now required for every protocol (V0 only required it for sep); see removed values below |
|
reporting_percentile |
intervention_configuration.reporting_percentile |
Nested; still only settable when protocol is general_scope_3 |
|
optional_scope_1_ghg_boundaries |
(none) |
Removed — see below |
|
optional_scope_3_ghg_boundaries |
(none) |
Removed — see below |
Removed
- optional_scope_1_ghg_boundaries query parameter — no equivalent field in Measure V2. (V0 already rejects this if supplied, so this is not a functional change.)
- optional_scope_3_ghg_boundaries query parameter — no equivalent field in Measure V2. (V0 already rejects this if supplied, so this is not a functional change.)
Baseline method allowed values per protocol
|
Protocol |
Intervention V0 allowed baseline_method values |
Measure V2 allowed baseline_method values |
|
general_scope_3 |
blended, rotational, matched, climate_matched_rice, climate_matched |
blended, rotational, matched |
|
vm0042 |
rotational, climate_matched_rice, blended |
rotational, blended, climate_matched_rice |
|
sep |
blended, matched |
blended, matched |
Examples
Intervention V0:
curl -X POST "https://api.regrow.ag/dndc-scenarios-service/v0/api/projects?project_name=my_project&protocol=general_scope_3&baseline_method=matched&reporting_percentile=40&is_test=true" \
-H "x-consumer-id: <your_consumer_id>"
Measure V2:
curl -X POST "https://api.regrow.ag/dndc-scenarios-service/v2/measure/projects" \
-H "Content-Type: application/json" \
-H "x-consumer-id: <your_consumer_id>" \
-d '{
"project_name": "my_project",
"outcomes": ["Intervention"],
"is_test": true,
"intervention_configuration": {
"protocol": "general_scope_3",
"baseline_method": "matched",
"reporting_percentile": 40
}
}'
Field Input
Endpoint:
/v0/api/projects/{project_name}/fields →
/v2/measure/projects/{project_name}/fields
There is a large structural change between the Intervention V0 and Measure V2 field input JSON schema. Intervention V0 requires submitting a session of exactly two scenarios in one request — either baseline + practice_change, or historical_baseline + intervention — each with its own rotations and phases (a phases entry is equivalent to one cultivation cycle in Measure V2). Measure V2 instead has a cultivation_cycle list; there is no scenarios list and no scenario_type tag. Essentially, the two scenarios in Intervention V0 are merged into one list in Measure V2. The role of each scenario in Intervention V0 is now implicit in each cultivation cycle's date relative to enrollment_date rather than an explicit scenario_type tag.
Cultivation cycles that fall before enrollment_date are the Measure V2 analog of Intervention V0's historical_baseline/baseline scenario — they are the historical data fed into the intervention baseline thread-generation logic driven by the project's intervention_configuration.baseline_method) that Intervention V0's separate historical_baseline scenario fed.
Cultivation cycles on or after enrollment_date play the role Intervention V0's intervention/practice_change scenario played.
|
Intervention V0 |
Measure V2 |
Notes |
|
session_name |
name |
Renamed; V2's name identifies a single field, not a paired session |
|
scenarios (exactly 2, each with name/location/soil/rotations[0].phases[]) |
(none) |
Removed — both scenarios' history is merged into a single cultivation_cycles list |
|
Scenario rotations[0].phases[] |
cultivation_cycles |
Restructured. Same "phases = cultivation cycle" concept, now one combined list instead of split across two scenarios |
|
scenario_type (baseline/practice_change/historical_baseline/intervention) |
(none — implicit via enrollment_date) |
Restructured. The baseline role is played by cultivation cycles before enrollment_date; the intervention role by cycles at or after it |
|
intervention_start_date (optional; only valid for the baseline+practice_change pairing) |
enrollment_date (required) |
Restructured. Analogous — marks where the reporting/intervention period begins — but always required in Measure V2, since the pairing distinction no longer exists |
|
Scenario location / soil |
location / soil |
Restructured. Narrowed the same way as documented in the Inventory V0 Field Input section above |
|
reporting_information.crop_name / .crop_yield |
reporting_information.crop_name / .crop_yield_in_kg_per_ha |
Renamed with explicit units in kilogram per hectare, other unit types are not supported. Not required for Scope 1 projects, but required for Scope 3 projects. |
Minimum historical length
The minimum historical length required by Measure V2 works differently than V0 Intervention. Intervention V0 has no fixed "3 year" rule like Inventory V0 — it uses a phase-length-parity check between the two scenarios and a protocol-configured minimum phase count instead.
For Measure V2 projects configured with Intervention outcomes, the protocol-configured minimum historical cultivation cycle requirement still exists. The 3 years of cultivation-cycle history before the enrollment_date is also required.
When migrating an Intervention V0 project to Measure V2, re-check your historical cultivation cycles against that fixed rule rather than your old protocol-specific phase-count requirement.
Event types supported
irrigation, till, flood, cropping, fertilizer, organic_amendment, and fire events are supported and unchanged.
Deprecated event types no longer supported
-
application — Please use fertilizer and/or organic_amendment instead.
-
graze
-
tile_drainage
Example JSON payloads
Intervention V0 (two scenarios: historical_baseline covering 2016–2019, intervention covering 2020):
{
"session_name": "my_field",
"scenarios": [
{
"name": "my_field_historical",
"scenario_type": "historical_baseline",
"location": {
"boundary": {
"type": "Polygon",
"coordinates": [[[-90.1, 41.5], [-90.1, 41.6], [-90.0, 41.6], [-90.0, 41.5], [-90.1, 41.5]]]
}
},
"rotations": [
{
"phases": [
{
"start_date": "2016-01-01",
"end_date": "2016-12-31",
"management_events": {
"cropping": [{"start_date": "2016-05-01", "end_date": "2016-10-15", "name": "corn"}]
}
},
{
"start_date": "2017-01-01",
"end_date": "2017-12-31",
"management_events": {
"cropping": [{"start_date": "2017-05-01", "end_date": "2017-10-15", "name": "corn"}]
}
},
{
"start_date": "2018-01-01",
"end_date": "2018-12-31",
"management_events": {
"cropping": [{"start_date": "2018-05-01", "end_date": "2018-10-15", "name": "corn"}]
}
},
{
"start_date": "2019-01-01",
"end_date": "2019-12-31",
"management_events": {
"cropping": [{"start_date": "2019-05-01", "end_date": "2019-10-15", "name": "corn"}]
}
}
]
}
]
},
{
"name": "my_field_intervention",
"scenario_type": "intervention",
"location": {
"boundary": {
"type": "Polygon",
"coordinates": [[[-90.1, 41.5], [-90.1, 41.6], [-90.0, 41.6], [-90.0, 41.5], [-90.1, 41.5]]]
}
},
"rotations": [
{
"phases": [
{
"start_date": "2020-01-01",
"end_date": "2020-12-31",
"management_events": {
"cropping": [{"start_date": "2020-05-01", "end_date": "2020-10-15", "name": "corn"}],
"fertilizer": [{"date": "2020-05-01", "name": "urea", "amount": 150, "depth": 5}]
}
}
]
}
]
}
],
"reporting_information": {
"start_date": "2020-01-01",
"end_date": "2020-12-31",
"crop_name": "corn",
"crop_yield": 180
}
}
Measure V2 (one field; the 2016–2019 cycles are the historical/baseline analog, 2020 is the intervention/reporting year):
{
"name": "my_field",
"location": {
"boundary": {
"type": "Polygon",
"coordinates": [[[-90.1, 41.5], [-90.1, 41.6], [-90.0, 41.6], [-90.0, 41.5], [-90.1, 41.5]]]
}
},
"enrollment_date": "2020-01-01",
"cultivation_cycles": [
{
"start_date": "2016-01-01",
"end_date": "2016-12-31",
"management_events": {
"cropping": [{"start_date": "2016-05-01", "end_date": "2016-10-15", "name": "corn"}]
}
},
{
"start_date": "2017-01-01",
"end_date": "2017-12-31",
"management_events": {
"cropping": [{"start_date": "2017-05-01", "end_date": "2017-10-15", "name": "corn"}]
}
},
{
"start_date": "2018-01-01",
"end_date": "2018-12-31",
"management_events": {
"cropping": [{"start_date": "2018-05-01", "end_date": "2018-10-15", "name": "corn"}]
}
},
{
"start_date": "2019-01-01",
"end_date": "2019-12-31",
"management_events": {
"cropping": [{"start_date": "2019-05-01", "end_date": "2019-10-15", "name": "corn"}]
}
},
{
"start_date": "2020-01-01",
"end_date": "2020-12-31",
"management_events": {
"cropping": [{"start_date": "2020-05-01", "end_date": "2020-10-15", "name": "corn"}],
"fertilizer": [{"date": "2020-05-01", "name": "urea", "amount": 150, "depth": 5}]
}
}
],
"reporting_information": {
"start_date": "2020-01-01",
"end_date": "2020-12-31",
"crop_name": "corn",
"crop_yield_in_kg_per_ha": 11296
}
}
Project Response
This section details the differences between the V0 Intervention project response and the Measure V2 project response.
Endpoint: V0's separate GET .../scope_1 and GET .../scope_3 endpoints unify into one single endpoint GET /v2/measure/projects/{project_name}. The credit_share_type query parameter carries over to the unified endpoint, narrowed to just deduction (default) and weighted_full. weighted and enrollment are no longer supported.
The top-level response shape has changed, Measure V2 returns project metadata directly at the top level (project_type, dndc_version, api_version, total_number_of_fields, total_area_ha) alongside intervention_outcomes — all Intervention outcome data lives under this key (which can be null if the project is not configured for Intervention outcomes).
Key concepts
- Removals and Emissions are now separated.
biogenic_removalsandbiogenic_emissionsDSOC values are relative to the atmosphere (emissions are positive values, removals are negative values).
- Intervention V0 used AR5 conversion factors for CO2e results. For Measure V2 this has been updated to using AR6 conversion factors.
- Null values represent quantification that could not be made, not 0 emission/removal values.
New output fields: Project-level per-gas breakdown and per-hectare metrics
Per-gas breakdowns are not returned at the project/crop level in Intervention V0 — it only existed at the field level. Measure V2 adds a full land_management_emissions breakdown (CH4, direct N2O, indirect N2O, each in kg CO2e, per-kg-yield, and per-hectare) at the project level too.
*_per_ha variants of output fields are new at both the project and field level as well.
Project-level JSON field mapping (project_level)
Intervention V0's project_level (a single object, Scope 1 only) and crop_level (a dict, Scope 3 only) are now unified into one project_level: list in the Measure V2 response. Scope 1 yields a single item with crop_name: null; Scope 3 yields one item per crop.
|
Measure V2 field |
Intervention V0 source |
Notes |
|---|---|---|
|
|
Scope 3: Scope 1: (none) |
Scope 1 → |
|
|
|
Flattened directly onto the item, no longer nested under a |
|
|
Scope 3: Scope 1: (none) |
Renamed + unit change bushels → kg; |
|
|
|
Renamed + unit change acres → ha |
|
|
|
Renamed to match Inventory |
|
|
Scope 3: new (no combined absolute grand total existed). Scope 1: |
Renamed with explicit kg CO2e units for Scope 1 |
|
|
Scope 3: Scope 1: (none) |
Renamed + rebased per-bushel → per-kg-yield; |
|
|
(none) |
New for both scopes |
|
|
Scope 3: Scope 1: |
Renamed/restructured |
|
|
(none) |
New. |
|
|
Scope 3: |
Renamed + rebased per-bushel → per-kg-yield; |
|
|
(none) |
New |
|
|
Scope 3: Scope 1: (none) |
Renamed + rebased; |
|
|
(none) |
New |
|
|
Scope 3: Scope 1: |
Renamed/restructured |
|
|
(None) |
New project-level per-gas breakdown — Intervention V0 only exposed this at the field level, never at project/crop level |
Field-level JSON field mapping (field_level)
Intervention V0's field_level was an object keyed by field id. Measure V2's field_level is a plain list with name as a field instead of a dict key.
Terminology renames
Intervention V0's baseline / practice_change / preliminary_credit (or, inconsistently, plain credit for indirect N2O and Scope 1 soil CH4) become Measure V2's counterfactual_baseline / intervention / delta, applied uniformly across dSOC, CH4, direct N2O, and indirect N2O.
|
Measure V2 field |
Intervention V0 source |
Notes |
|---|---|---|
|
|
|
Renamed |
|
|
(not echoed in Intervention V0) |
New in the response |
|
|
|
Flattened, no longer nested |
|
|
|
Unchanged, flattened |
|
|
|
Renamed + unit change; may be |
|
|
Scope 1: |
Renamed for Scope 1; net-new for Scope 3 |
|
|
|
Renamed, units clarified as kg CO2e |
|
|
(none — split from the single |
New split |
|
|
|
Renamed ( |
|
|
|
Renamed ( |
|
|
|
Renamed ( |
|
|
|
Renamed; note Intervention V0 used plain |
|
|
|
Renamed |
|
|
|
Renamed; Intervention V0 used plain |
Removed
- Raw uncertainty output: Intervention V0 echoed back
uncertainty_distribution,mean, andstandard_deviationper-gas and per-scope throughout both project- and field-level responses. None of this is returned in Measure V2 — only final derived values remain.- Uncertainty data can be retrieved from a separate endpoint:
/v2/measure/projects/{project_name}/uncertainty_distribution - The
include_uncertainty_distributionquery parameter has therefore also been removed
- Uncertainty data can be retrieved from a separate endpoint:
- Deprecated Intervention V0 fields:
fossil_fuel_co2(both scopes), and Scope-1-onlyenteric_ch4/liming_emissions.
Example JSON payloads
Intervention V0 (GET .../scope_3, one crop/one field):
{
"crop_level": {
"corn": {
"reporting_information": {
"start_date": "2020-01-01",
"end_date": "2020-12-31",
"crop_name": "corn",
"total_yield": 200.0
},
"credit": {
"number_of_fields": 1,
"number_of_acres": 100.0,
"reversible_credits": { "total_reversible_emissions_reductions": 55.0 },
"non_reversible_credits": { "total_non_reversible_emissions_reductions": 30.0 },
"total_reversible_credit": 0.275,
"total_non_reversible_credit": 0.15,
"total_credit": 0.425
}
}
},
"field_level": {
"1001": {
"field_name": "my_field",
"reporting_information": {
"start_date": "2020-01-01",
"end_date": "2020-12-31",
"crop_name": "corn",
"crop_yield": 200.0
},
"outcomes": {
"credit_share": 55.0,
"reversible_outcomes": {
"credit_share": 55.0,
"dsoc": { "baseline": 40.0, "practice_change": 55.0, "preliminary_credit": 15.0 }
},
"non_reversible_outcomes": {
"credit_share": 30.0,
"direct_n2o": { "baseline": 20.0, "practice_change": 12.0, "preliminary_credit": 8.0 },
"indirect_n2o": { "baseline": 10.0, "practice_change": 8.0, "credit": 2.0 },
"soil_ch4": { "baseline": 5.0, "practice_change": 5.0, "credit": 0.0 }
}
}
}
}
}
Measure v2:
{
"scope": "scope_3",
"protocol": "general_scope_3",
"reporting_percentile": 50,
"baseline_method": "matched",
"credit_share_type": "deduction",
"project_level": [
{
"crop_name": "corn",
"earliest_reporting_start_date": "2020-01-01",
"latest_reporting_end_date": "2020-12-31",
"total_crop_yield_kg": 90718,
"total_area_ha": 40.47,
"number_of_fields": 1,
"total_credit_kg_co2e": -25000,
"total_credit_kg_co2e_per_kg_yield": -0.27558,
"total_credit_kg_co2e_per_ha": -617.74153,
"dsoc": {
"dsoc_kg_co2": -55000,
"dsoc_kg_co2e": -55000,
"dsoc_ef_kg_co2_per_kg_yield": -0.606,
"dsoc_ef_kg_co2e_per_kg_yield": -0.606,
"dsoc_kg_co2e_per_ha": -1359.5
},
"land_management_emissions": {
"total_co2e_kg_co2e": 30000,
"total_co2e_ef_kg_co2e_per_kg_yield": 0.3307,
"total_kg_co2e_per_ha": 741.3,
"ch4_emissions_kg_co2e": 0,
"ch4_emissions_kg_co2e_per_kg_yield": 0,
"ch4_emissions_kg_co2e_per_ha": 0,
"direct_n2o_emissions_kg_co2e": 20000,
"direct_n2o_emissions_kg_co2e_per_kg_yield": 0.2205,
"direct_n2o_emissions_kg_co2e_per_ha": 494.2,
"indirect_n2o_emissions_kg_co2e": 10000,
"indirect_n2o_emissions_kg_co2e_per_kg_yield": 0.1102,
"indirect_n2o_emissions_kg_co2e_per_ha": 247.1
}
}
],
"field_level": [
{
"name": "my_field",
"enrollment_date": "2020-01-01",
"reporting_start_date": "2020-01-01",
"reporting_end_date": "2020-12-31",
"crop_name": "corn",
"total_crop_yield_kg": 90718,
"total_area_ha": 40.47,
"total_credit_share_kg_co2e": -25000,
"dsoc_credit_share_kg_co2e": -55000,
"land_management_emissions_credit_share_kg_co2e": 30000,
"dsoc_pre_uncertainty": {
"dsoc_intervention_kg_co2e": 60000,
"dsoc_counterfactual_baseline_kg_co2e": 40000,
"dsoc_delta_kg_co2e": 20000
},
"land_management_emissions_pre_uncertainty": {
"ch4_intervention_kg_co2e": 5000,
"ch4_counterfactual_baseline_kg_co2e": 5000,
"ch4_delta_kg_co2e": 0,
"direct_n2o_intervention_kg_co2e": 12000,
"direct_n2o_counterfactual_baseline_kg_co2e": 20000,
"direct_n2o_delta_kg_co2e": -8000,
"indirect_n2o_intervention_kg_co2e": 8000,
"indirect_n2o_counterfactual_baseline_kg_co2e": 10000,
"indirect_n2o_delta_kg_co2e": -2000
}
}
}
]
}
Field Input Requirements
This section details the field input requirements for Measure V2. The /v2/measure/projects/{project_name}/fields endpoint will return a HTTP 4XX error code and error description for any input that does not meet all of these requirements.
Common Requirements
Requirements that apply to all projects regardless of the outcome type.
- Field name uniqueness — a field's
namemust be unique within the project; submitting a duplicate returns409 Conflict. - Multi-polygon centroid proximity — for multi-polygon locations, every pair of the constituent polygons' centroids must be within 5000 km of each other.
- Exactly one cultivation cycle in the reporting period —
reporting_information's date range must overlap exactly one of the submittedcultivation_cycles— not zero, not more than one. - Reporting period within cultivation-cycle bounds —
reporting_information.start_dateand.end_datemust both fall within the full span of the submitted cultivation cycles, from the earliest cycle's start date to the latest cycle's end date. - A matching cropping event within the reporting period — at least one
croppingevent namedreporting_information.crop_namemust exist and be fully contained within the reporting period. - No management event may partially overlap the reporting period boundary — every management event, of any type, must fall either fully inside or fully outside the reporting period; straddling the boundary is rejected.
- Minimum 3 years of historical cultivation-cycle data before
enrollment_date— At least 3 years of cultivation-cycle history must exist before theenrollment_date. - Fertilizer additive rules — additive requirements and pairings for each fertilizer event are validated against our internal data (for example, an EENF fertilizer must have additives, an EENF-type additive is only valid on a custom fertilizer, and urease/nitrification inhibitor additives must be paired correctly).
- Fertilizer/organic-amendment rate unit must resolve to a known density — a volume-based
rate_unitrequires a known liquid density for that fertilizer or organic-amendment name, unless the event iscustomand supplies its own density. - Fertilizer nutrient-amount and inhibitor bounds — nitrate, urea, ammonia, ammonium, ammonium_bicarbonate, sulfate, and phosphate amounts must fall within
[0, 600]; inhibitor durations must fall within[0, 180]days; inhibitor efficiencies must fall within[0, 1]. Organic amendments are not subject to this check, only the density check above. - Cropping event
plant_densityrequires DNDC 12.3.0 or later — if any submittedcroppingevent setsplant_density, the request is rejected if the DNDC version being used is not12.3.0or greater.
Intervention Requirements
Requirements that apply to projects configured with Intervention outcomes.
- Minimum pre-enrollment cultivation cycles — the number of submitted cultivation cycles ending before
enrollment_datemust meet a protocol-specific minimum: 3 forsep,vm0042, andgeneral_scope_3. - Scope 3 yield is required –
reporting_information.crop_yield_in_kg_per_hais required for any project with Intervention outcomes and a scope 3 protocol (general_scope_3), it is optional for a scope 1 protocol.