Create Package Config
Create a matching package config: a group of matching configs keyed by document type, with per-type presence rules and a package-level pass/fail criteria.
Package matching scores a bundle of documents of different types (for example an invoice, a delivery note, and a contract) against reference data in one governed run. A package config groups one matching config per document type, sets how strictly each type must be present, and defines the criteria that turn the per-type results into a single package verdict.
This is distinct from the simpler single-document matching under /v1/matching. There, one config matches one document type against one reference dataset. A package config orchestrates several of those configs at once and produces a package-level passed, failed, or review outcome across the whole bundle.
Each entry in document_type_configs names a document_type, the matching_config_id that scores documents of that type, and a presence of required, expected, or optional. The pass_criteria block then aggregates: all_required_matched enforces that every required type matched, min_confidence sets the floor, and allow_review_on_expected decides whether a soft miss on an expected type drops to review instead of failing.
/v1/matching/packages/configsResponse
Response fields
Request body
{
"name": "Shipment bundle",
"document_type_configs": [
{
"document_type": "invoice",
"matching_config_id": "mc_uuid_1",
"presence": "required"
},
{
"document_type": "delivery_note",
"matching_config_id": "mc_uuid_2",
"presence": "expected"
},
{
"document_type": "contract",
"matching_config_id": "mc_uuid_3",
"presence": "optional"
}
],
"pass_criteria": {
"all_required_matched": true,
"min_confidence": 0.8,
"allow_review_on_expected": true
}
}Response
{
"id": "pkg_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Shipment bundle",
"document_type_configs": [
{ "document_type": "invoice", "matching_config_id": "mc_uuid_1", "presence": "required" },
{ "document_type": "delivery_note", "matching_config_id": "mc_uuid_2", "presence": "expected" },
{ "document_type": "contract", "matching_config_id": "mc_uuid_3", "presence": "optional" }
],
"pass_criteria": {
"all_required_matched": true,
"min_confidence": 0.8,
"allow_review_on_expected": true
},
"created_at": "2024-09-14T10:32:00.000Z",
"updated_at": "2024-09-14T10:32:00.000Z",
"links": {
"self": "/v1/matching/packages/configs/pkg_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"runs": "/v1/matching/packages/runs?package_config_id=pkg_a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}Errors
Error responses