Manage Strategy
Retrieve or update a matching strategy. Strategies define AI-recommended field mappings, blocking keys, thresholds, and edge case handling rules used by smart-run.
Retrieve or update an existing matching strategy. Strategies are created by the generate strategy endpoint and define the field mappings, blocking keys, thresholds, and edge case rules used by smart-run. Use GET to inspect a strategy before applying it, or PATCH to fine-tune individual fields after generation.
The strategy object contains the full configuration used by the matching engine during a smart-run: field mappings with per-field rationale, blocking keys for candidate pre-filtering, hard filters for mandatory constraints, field-level comparison rules, confidence thresholds, and edge case documentation. Each update increments the version counter and updates the version_hash.
Use PATCH to adjust specific strategy fields without regenerating the entire strategy. Common adjustments include tuning thresholds after reviewing initial results, adding blocking keys to improve performance on large datasets, updating field rules to handle edge cases discovered during review, or refining the cardinality and data quality notes for documentation purposes.
The blocking_strategy field controls how blocking keys are applied during candidate pre-filtering: parallel evaluates all blocking keys independently and unions the candidate sets, while ordered_fallback tries keys in order and falls back to the next key only when the current key produces no candidates. Choose parallel for recall-oriented matching and ordered_fallback for precision-oriented matching on large datasets.
/v1/matching/strategies/:idResponse (GET)
Response fields
Response (GET)
{
"id": "f6a7b8c9-d0e1-2345-fab2-456789012345",
"name": "Vendor Invoice Strategy v2",
"matching_config_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"strategy": {
"field_mappings": [
{ "source": "vendor_name", "target": "name", "strategy": "fuzzy", "weight": 0.4, "rationale": "High cardinality text — fuzzy handles name variations." },
{ "source": "invoice_date", "target": "date", "strategy": "date_range", "weight": 0.3, "rationale": "Date field — range comparison tolerates minor discrepancies." },
{ "source": "total_amount", "target": "total", "strategy": "numeric_range", "weight": 0.3, "rationale": "Numeric field — range accounts for rounding differences." }
],
"threshold": 0.85
},
"version": 2,
"version_hash": "b2c3d4e5f6a7",
"created_at": "2024-10-03T10:00:00.000Z",
"updated_at": "2024-10-04T09:15:00.000Z",
"links": {
"self": "/v1/matching/strategies/f6a7b8c9-d0e1-2345-fab2-456789012345"
}
}/v1/matching/strategies/:idResponse (PATCH)
Response fields
Response (PATCH)
{
"id": "f6a7b8c9-d0e1-2345-fab2-456789012345",
"name": "Vendor Invoice Strategy v2",
"matching_config_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"strategy": {
"field_mappings": [
{ "source": "vendor_name", "target": "name", "strategy": "fuzzy", "weight": 0.4, "rationale": "High cardinality text — fuzzy handles name variations." },
{ "source": "invoice_date", "target": "date", "strategy": "date_range", "weight": 0.3, "rationale": "Date field — range comparison tolerates minor discrepancies." },
{ "source": "total_amount", "target": "total", "strategy": "numeric_range", "weight": 0.3, "rationale": "Numeric field — range accounts for rounding differences." }
],
"threshold": 0.85
},
"version": 3,
"version_hash": "c3d4e5f6a7b8",
"created_at": "2024-10-03T10:00:00.000Z",
"updated_at": "2024-10-05T11:30:00.000Z",
"links": {
"self": "/v1/matching/strategies/f6a7b8c9-d0e1-2345-fab2-456789012345"
}
}Errors
Error responses