{"openapi":"3.1.0","info":{"title":"Nexus API","version":"0.1.0"},"components":{"schemas":{"ErrorDetail":{"type":"object","properties":{"location":{"description":"Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'","type":"string"},"message":{"description":"Error message text","type":"string"},"value":{"description":"The value at the given location"}},"additionalProperties":false},"ErrorModel":{"type":"object","properties":{"title":{"type":"string"},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"detail":{"type":"string"},"errors":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetail"}},{"type":"null"}]}},"additionalProperties":false},"TenantStats":{"type":"object","properties":{"datasets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"jobs_14d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Jobs created in the last 14 days"},"active_keys":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_activity_at":{"description":"Latest job or ingestion","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["datasets","records","jobs_14d","active_keys"],"additionalProperties":false},"Tenant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","suspended"]},"billing_exempt":{"type":"boolean","description":"Internal tenant: no plan, no limits and no usage reported"},"max_rulesets":{"description":"Overrides the ruleset limit of the tenant's plan","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stats":{"$ref":"#/components/schemas/TenantStats"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","name","status","billing_exempt","created_at","updated_at"],"additionalProperties":false},"CreateTenantInputBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"billing_exempt":{"type":"boolean"},"max_rulesets":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]}},"required":["name"],"additionalProperties":false},"UpdateTenantInputBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"status":{"type":"string","enum":["active","suspended"]},"billing_exempt":{"type":"boolean"},"max_rulesets":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]}},"additionalProperties":false},"ListTenantsOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Tenant"}},{"type":"null"}]},"next_cursor":{"type":"string"}},"required":["data"],"additionalProperties":false},"APIKey":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revoked_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","tenant_id","name","prefix","scopes","created_at"],"additionalProperties":false},"CreateAPIKeyInputBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["admin","write","read"]}}},"required":["name","scopes"],"additionalProperties":false},"CreateAPIKeyOutputBody":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revoked_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"key":{"type":"string","description":"Shown only once. Store it securely."}},"required":["id","tenant_id","name","prefix","scopes","created_at","key"],"additionalProperties":false},"ListAPIKeysOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/APIKey"}},{"type":"null"}]}},"required":["data"],"additionalProperties":false},"DatasetPairUsage":{"type":"object","properties":{"left_dataset_id":{"type":"string"},"left_dataset_name":{"type":"string"},"right_dataset_id":{"type":"string"},"right_dataset_name":{"type":"string"},"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Matches the engine reconciled on its own"},"possible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Possible matches the engine suggested, whether pending, confirmed or rejected"}},"required":["matched","possible"],"additionalProperties":false},"TenantMatchUsage":{"type":"object","properties":{"tenant_id":{"type":"string"},"tenant_name":{"type":"string"},"tenant_status":{"type":"string","enum":["active","suspended","deleted"]},"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"possible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"datasets":{"type":"array","items":{"$ref":"#/components/schemas/DatasetPairUsage"}}},"required":["tenant_id","tenant_name","tenant_status","matched","possible","datasets"],"additionalProperties":false},"MatchUsageOutputBody":{"type":"object","properties":{"from":{"type":"string","description":"First day, YYYY-MM-DD (UTC)"},"to":{"type":"string","description":"Last day, YYYY-MM-DD (UTC)"},"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"possible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tenants":{"type":"array","items":{"$ref":"#/components/schemas/TenantMatchUsage"}}},"required":["from","to","matched","possible","tenants"],"additionalProperties":false},"BillingPlan":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"monthly_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"BRL cents charged in advance every month"},"included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Processed events covered by the monthly fee"},"overage_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"BRL cents per processed event beyond the included ones"},"rulesets":{"description":"Rulesets the plan allows; absent means no limit","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","name","monthly_amount","included","overage_amount"],"additionalProperties":false},"BillingSubscription":{"type":"object","properties":{"plan":{"type":"string"},"status":{"type":"string","description":"Stripe status, for display; gate on is_live"},"is_live":{"type":"boolean"},"current_period_end":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"cancel_at_period_end":{"type":"boolean","description":"Cancelled, with access until current_period_end"}},"required":["status","is_live","cancel_at_period_end"],"additionalProperties":false},"BillingBlock":{"type":"object","properties":{"kind":{"type":"string","enum":["events","rulesets"],"description":"events: the free plan's monthly events are used up; rulesets: more rulesets than the plan allows"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Monthly events of the free plan, or rulesets the plan allows"},"count":{"description":"Rulesets the tenant has","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","limit"],"additionalProperties":false},"BillingOutputBody":{"type":"object","properties":{"configured":{"type":"boolean","description":"Billing is set up in this environment"},"exempt":{"type":"boolean","description":"Internal tenant: no plan, no limits"},"plan":{"description":"Plan of the live subscription; absent means the free plan","type":"string"},"subscription":{"$ref":"#/components/schemas/BillingSubscription"},"plans":{"type":"array","items":{"$ref":"#/components/schemas/BillingPlan"}},"free":{"type":"object","properties":{"events":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rulesets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["events","rulesets"],"additionalProperties":false,"description":"Allowance of the free plan"},"usage":{"type":"object","properties":{"month":{"type":"string","description":"Billing month, YYYY-MM in America/Sao_Paulo"},"events":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Matches and possible matches generated this month"},"event_limit":{"description":"Monthly cap; only the free plan has one","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rulesets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ruleset_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["month","events","rulesets"],"additionalProperties":false},"block":{"description":"Why jobs and ingestions are refused right now","$ref":"#/components/schemas/BillingBlock"}},"required":["configured","exempt","plans","free","usage"],"additionalProperties":false},"BillingPlanInputBody":{"type":"object","properties":{"plan":{"type":"string","minLength":1,"maxLength":64}},"required":["plan"],"additionalProperties":false},"BillingCheckoutInputBody":{"type":"object","properties":{"plan":{"type":"string","minLength":1,"maxLength":64},"tax_id":{"type":"string","minLength":11,"maxLength":18,"description":"CPF or CNPJ the company is billed under, with or without punctuation"}},"required":["plan","tax_id"],"additionalProperties":false},"BillingRedirectOutputBody":{"type":"object","properties":{"url":{"type":"string","description":"Send the browser here"}},"required":["url"],"additionalProperties":false},"FieldSpec":{"type":"object","properties":{"name":{"type":"string","maxLength":63},"type":{"type":"string","enum":["string","integer","decimal","boolean","date","timestamp"]},"scale":{"description":"Decimal places; required for decimal fields. Values are stored as integers in minor units.","type":"integer","minimum":0,"maximum":9},"required":{"type":"boolean"},"normalize":{"description":"Applied once at ingestion, in order. String fields only.","anyOf":[{"type":"array","items":{"type":"string","enum":["trim","upper","lower","unaccent","digits","alnum","cnpj_root"]}},{"type":"null"}]},"index":{"description":"Create an index; recommended for blocking keys.","type":"boolean"}},"required":["name","type"],"additionalProperties":false},"ComputedSpec":{"type":"object","properties":{"name":{"type":"string","maxLength":63},"from":{"type":"string","description":"Source string field."},"normalize":{"anyOf":[{"minItems":1,"type":"array","items":{"type":"string","enum":["trim","upper","lower","unaccent","digits","alnum","cnpj_root"]}},{"type":"null"}]},"index":{"type":"boolean"}},"required":["name","from","normalize"],"additionalProperties":false},"Dataset":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["source","derived"],"description":"derived datasets are produced by workflow steps"},"source_job_id":{"type":"string"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"external_id":{"type":"string"},"record_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Records stored in the database, excluding archived months"},"fields":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/FieldSpec"}},{"type":"null"}]},"computed":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ComputedSpec"}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","name","kind","external_id","record_count","fields","computed","created_at","updated_at"],"additionalProperties":false},"CreateDatasetInputBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9_-]*$"},"external_id":{"type":"string","description":"Field that uniquely identifies a record; must be a required string or integer field."},"fields":{"anyOf":[{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/FieldSpec"}},{"type":"null"}]},"computed":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ComputedSpec"}},{"type":"null"}]}},"required":["name","external_id","fields"],"additionalProperties":false},"UpdateDatasetInputBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9_-]*$"},"add_fields":{"description":"New optional fields. Existing fields cannot be changed or removed.","anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/FieldSpec"}},{"type":"null"}]}},"additionalProperties":false},"ListDatasetsOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Dataset"}},{"type":"null"}]},"next_cursor":{"type":"string"}},"required":["data"],"additionalProperties":false},"Record":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":"string"},"ingestion_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ingested_on":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Field values after normalization, including computed fields. Decimals are strings to preserve exactness."}},"required":["id","external_id","ingestion_id","ingested_on","values"],"additionalProperties":false},"ListRecordsOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Record"}},{"type":"null"}]},"next_cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"description":"Records matching the filters, counted up to total_capped; omitted when counting takes longer than a second","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_capped":{"type":"boolean"}},"required":["data"],"additionalProperties":false},"MatchRecord":{"type":"object","properties":{"dataset_id":{"type":"string"},"record_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_id":{"type":"string"},"values":{"description":"Field values of the record; only in the single-match responses","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["dataset_id","record_id","external_id"],"additionalProperties":false},"MatchReview":{"type":"object","properties":{"reason":{"type":"string","enum":["below_threshold","ambiguous","amount_variance"],"description":"below_threshold: score under the match threshold; ambiguous: another candidate scored within ambiguity_margin; amount_variance: the group totals differ by more than the tolerance but within the variance"},"match_threshold":{"type":"number","description":"Match threshold of the ruleset version the job ran with"},"ambiguity_margin":{"type":"number"},"rival":{"description":"Competing candidate within ambiguity_margin when the engine decided; it may share records with this match","type":"object","properties":{"score":{"type":"number"},"left":{"type":"array","items":{"$ref":"#/components/schemas/MatchRecord"}},"right":{"type":"array","items":{"$ref":"#/components/schemas/MatchRecord"}}},"required":["score","left","right"],"additionalProperties":false}},"required":["reason","match_threshold","ambiguity_margin"],"additionalProperties":false},"MatchOut":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ruleset_id":{"type":"string","description":"Relationship the match belongs to; a record has at most one effective match per ruleset"},"status":{"type":"string","enum":["matched","possible","partial","confirmed","rejected","reverted"]},"kind":{"type":"string","enum":["1:1","1:N","N:1","N:M"]},"strategy":{"type":"string","enum":["pair","complete_group","subset","amount_variance","partial","meet_in_the_middle","manual"]},"amount_diff":{"description":"Right-side total minus left-side total, in minor units, for composite matches","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expected_count":{"description":"For partial matches: number of installments expected in total","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"score":{"type":"number"},"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Workflow step that produced the match (0 for single-ruleset jobs)"},"pass":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Index of the 1:1 blocking pass; -1 for composite and manual matches"},"job_id":{"description":"Empty for manual matches","type":"string"},"note":{"type":"string"},"decided_at":{"description":"When the match was confirmed, rejected or undone","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"breakdown":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Factor (0..1) returned by each matcher"},"review":{"description":"Why the engine left the match as possible instead of matched","$ref":"#/components/schemas/MatchReview"},"left":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MatchRecord"}},{"type":"null"}]},"right":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MatchRecord"}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","ruleset_id","status","kind","strategy","score","step","pass","breakdown","left","right","created_at"],"additionalProperties":false},"RecordDetailOutputBody":{"type":"object","properties":{"record":{"$ref":"#/components/schemas/Record"},"matches":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MatchOut"}},{"type":"null"}],"description":"Every match the record takes part in, in any ruleset and status"}},"required":["record","matches"],"additionalProperties":false},"ListMatchesOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MatchOut"}},{"type":"null"}]},"next_cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"description":"Matches meeting the filters, counted up to total_capped; omitted when counting takes longer than a second","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_capped":{"type":"boolean"}},"required":["data"],"additionalProperties":false},"MatchCount":{"type":"object","properties":{"ruleset_id":{"type":"string"},"status":{"type":"string"},"matches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["ruleset_id","status","matches"],"additionalProperties":false},"ReconciledCount":{"type":"object","properties":{"ruleset_id":{"type":"string"},"dataset_id":{"type":"string"},"records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Records of the dataset with an effective match in the ruleset"}},"required":["ruleset_id","dataset_id","records"],"additionalProperties":false},"JobDay":{"type":"object","properties":{"day":{"type":"string"},"status":{"type":"string"},"jobs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","status","jobs"],"additionalProperties":false},"RecordsDay":{"type":"object","properties":{"day":{"type":"string"},"dataset_id":{"type":"string"},"records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","dataset_id","records"],"additionalProperties":false},"EventsDay":{"type":"object","properties":{"day":{"type":"string"},"events":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","events"],"additionalProperties":false},"InsightsQueue":{"type":"object","properties":{"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"running":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"oldest_ready_at":{"description":"When the queued job waiting the longest became ready to start; absent when none is ready","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["queued","running"],"additionalProperties":false},"InsightsDurations":{"type":"object","properties":{"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Jobs completed in the 14 days"},"p50_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"p95_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["completed"],"additionalProperties":false},"InsightsWebhooks":{"type":"object","properties":{"endpoints":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Webhooks registered"},"succeeded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Gave up after the last retry"},"retrying":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"At least one attempt failed and another is scheduled"},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Not attempted yet, or on the first attempt"}},"required":["endpoints","succeeded","failed","retrying","pending"],"additionalProperties":false},"InsightsOutputBody":{"type":"object","properties":{"matches":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MatchCount"}},{"type":"null"}]},"reconciled":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciledCount"}},{"type":"null"}]},"days":{"type":"array","items":{"type":"string"},"description":"The 14 days the daily series cover, oldest first, ending today in America/Sao_Paulo"},"jobs_by_day":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JobDay"}},{"type":"null"}],"description":"Jobs created each day, by current status"},"records_by_day":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/RecordsDay"}},{"type":"null"}],"description":"Records inserted by ingestions that finished each day"},"events_by_day":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EventsDay"}},{"type":"null"}],"description":"Billable events (saved matches and possible matches) each day; empty for billing-exempt tenants"},"queue":{"description":"Jobs queued or running now","$ref":"#/components/schemas/InsightsQueue"},"durations":{"description":"Run time of the jobs completed in the 14 days","$ref":"#/components/schemas/InsightsDurations"},"oldest_possible_at":{"description":"When the oldest possible match still awaiting review was created","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"webhooks":{"description":"Webhook deliveries created in the last 24 hours, by state","$ref":"#/components/schemas/InsightsWebhooks"}},"required":["matches","reconciled","days","jobs_by_day","records_by_day","events_by_day","queue","durations","webhooks"],"additionalProperties":false},"MeOutputBody":{"type":"object","properties":{"tenant_id":{"type":"string"},"tenant_name":{"type":"string"},"key_id":{"type":"string"},"scopes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"support":{"description":"The platform key is reading this tenant through support access","type":"boolean"},"user_email":{"description":"Signed-in console user; absent for API keys","type":"string"}},"required":["tenant_id","tenant_name","scopes"],"additionalProperties":false},"User":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["admin","write","read"]},"signed_in":{"type":"boolean","description":"Has signed in at least once; false for a pending invite"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","email","role","signed_in","created_at"],"additionalProperties":false},"ListUsersOutputBody":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/User"}}},"required":["data"],"additionalProperties":false},"InviteUserInputBody":{"type":"object","properties":{"email":{"type":"string","maxLength":255,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["admin","write","read"]}},"required":["email","role"],"additionalProperties":false},"UpdateUserInputBody":{"type":"object","properties":{"role":{"type":"string","enum":["admin","write","read"]}},"required":["role"],"additionalProperties":false},"CreateCompanyInputBody":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200,"description":"Company name"}},"required":["name"],"additionalProperties":false},"CompanyOutputBody":{"type":"object","properties":{"tenant_id":{"type":"string"},"tenant_name":{"type":"string"}},"required":["tenant_id","tenant_name"],"additionalProperties":false},"Stats":{"type":"object","properties":{"rows_total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows_valid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows_rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows_inserted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows_duplicate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errors_truncated":{"type":"boolean"}},"required":["rows_total","rows_valid","rows_rejected","rows_inserted","rows_duplicate"],"additionalProperties":false},"Ingestion":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dataset_id":{"type":"string"},"status":{"type":"string","enum":["awaiting_upload","queued","processing","completed","failed"]},"source":{"type":"string","enum":["api","file"]},"format":{"type":"string","enum":["ndjson","csv"]},"error_policy":{"type":"string","enum":["reject_all","skip_invalid"]},"stats":{"$ref":"#/components/schemas/Stats"},"error":{"type":"string"},"errors_report_url":{"description":"NDJSON with one line per rejected field (line, field, message). Expires in one hour.","type":"string"},"upload_url":{"description":"PUT the file here, then call the complete endpoint. Expires in one hour.","type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"finished_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","dataset_id","status","source","format","error_policy","created_at"],"additionalProperties":false},"CreateIngestionInputBody":{"type":"object","properties":{"records":{"description":"Inline records. Omit to upload a file instead.","anyOf":[{"maxItems":20000,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"format":{"description":"File format, for uploads.","type":"string","enum":["ndjson","csv"]},"csv_delimiter":{"type":"string","enum":["comma","semicolon","tab","pipe"]},"error_policy":{"description":"reject_all (default) loads nothing if any row is invalid; skip_invalid loads the valid rows.","type":"string","enum":["reject_all","skip_invalid"]}},"additionalProperties":false},"ListIngestionsOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Ingestion"}},{"type":"null"}]},"next_cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"type":"string"},"event_types":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","url","description","event_types","enabled","created_at","updated_at"],"additionalProperties":false},"CreateWebhookInputBody":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"description":{"type":"string","maxLength":500},"event_types":{"anyOf":[{"minItems":1,"type":"array","items":{"type":"string","enum":["ingestion.completed","ingestion.failed","job.completed","job.failed","job.cancelled","job.reverted","matches.created","matches.possible","match.completed"]}},{"type":"null"}]}},"required":["url","event_types"],"additionalProperties":false},"CreateWebhookOutputBody":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"type":"string"},"event_types":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"secret":{"type":"string","description":"Signing secret (Standard Webhooks). Shown only once."}},"required":["id","url","description","event_types","enabled","created_at","updated_at","secret"],"additionalProperties":false},"ListWebhooksOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},{"type":"null"}]}},"required":["data"],"additionalProperties":false},"UpdateWebhookInputBody":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"description":{"type":"string","maxLength":500},"event_types":{"anyOf":[{"minItems":1,"type":"array","items":{"type":"string","enum":["ingestion.completed","ingestion.failed","job.completed","job.failed","job.cancelled","job.reverted","matches.created","matches.possible","match.completed"]}},{"type":"null"}]},"enabled":{"description":"Disabled endpoints keep receiving events in their queue; delivery resumes when re-enabled.","type":"boolean"}},"additionalProperties":false},"RotateSecretInputBody":{"type":"object","properties":{"grace_hours":{"description":"How long deliveries are also signed with the previous secret; default 24, 0 retires it at once","type":"integer","minimum":0,"maximum":168}},"additionalProperties":false},"RotateSecretOutputBody":{"type":"object","properties":{"secret":{"type":"string","description":"New signing secret. Shown only once."},"previous_secret_expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["secret","previous_secret_expires_at"],"additionalProperties":false},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"webhook_id":{"type":"string"},"event_id":{"type":"string","description":"Value of the webhook-id header; stable across retries."},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","delivering","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_attempt_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"last_status_code":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"delivered_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","webhook_id","event_id","event_type","status","attempts","created_at"],"additionalProperties":false},"WebhookAttempt":{"type":"object","properties":{"status_code":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"},"response_body":{"type":"string"},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["duration_ms","created_at"],"additionalProperties":false},"WebhookDeliveryDetailOutputBody":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"webhook_id":{"type":"string"},"event_id":{"type":"string","description":"Value of the webhook-id header; stable across retries."},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","delivering","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_attempt_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"last_status_code":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"delivered_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"attempt_history":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/WebhookAttempt"}},{"type":"null"}]}},"required":["id","webhook_id","event_id","event_type","status","attempts","created_at","attempt_history"],"additionalProperties":false},"ListDeliveriesOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},{"type":"null"}]},"next_cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data"],"additionalProperties":false},"Thresholds":{"type":"object","properties":{"match":{"type":"number"},"possible":{"type":"number"}},"required":["match","possible"],"additionalProperties":false},"Key":{"type":"object","properties":{"left":{"type":"string"},"right":{"type":"string"}},"required":["left","right"],"additionalProperties":false},"Window":{"type":"object","properties":{"left":{"type":"string"},"right":{"type":"string"},"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["left","right","days"],"additionalProperties":false},"BlockingPass":{"type":"object","properties":{"name":{"type":"string"},"keys":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Key"}},{"type":"null"}]},"window":{"$ref":"#/components/schemas/Window"}},"required":["name","keys"],"additionalProperties":false},"Matcher":{"type":"object","properties":{"name":{"type":"string"},"score":{"type":"number"},"required":{"type":"boolean"},"expr":{"type":"string"}},"required":["name","score","expr"],"additionalProperties":false},"Sum":{"type":"object","properties":{"left":{"type":"string"},"right":{"type":"string"},"tolerance":{"description":"Accepted difference in minor units (cents)","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tolerance_percent":{"description":"Accepted difference as a percentage of the target amount (1:N, N:1 and partials); the larger of the two tolerances applies","type":"number"}},"required":["left","right"],"additionalProperties":false},"MaxItems":{"type":"object","properties":{"left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"right":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"additionalProperties":false},"AmountVariance":{"type":"object","properties":{"max_percent":{"type":"number"}},"required":["max_percent"],"additionalProperties":false},"Partial":{"type":"object","properties":{"min_members":{"description":"Default 2","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_completion":{"description":"Minimum paid share of the target, default 0.2","type":"number"},"uniformity":{"description":"Maximum stddev/mean of the installments, default 0.05","type":"number"}},"additionalProperties":false},"Strategies":{"type":"object","properties":{"complete_group":{"description":"Try the whole group first when it closes the sum","type":"boolean"},"amount_variance":{"description":"Report groups that almost close (interest, fines, discounts) as possible","$ref":"#/components/schemas/AmountVariance"},"partial":{"description":"1:N only: keep installments that arrived so far as a partial match, completed by later jobs","$ref":"#/components/schemas/Partial"}},"additionalProperties":false},"Composite":{"type":"object","properties":{"modes":{"anyOf":[{"minItems":1,"type":"array","items":{"type":"string","enum":["1:N","N:1","N:M"]}},{"type":"null"}]},"group_by":{"anyOf":[{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Key"}},{"type":"null"}]},"sum":{"$ref":"#/components/schemas/Sum"},"window":{"$ref":"#/components/schemas/Window"},"max_items":{"$ref":"#/components/schemas/MaxItems"},"strategies":{"$ref":"#/components/schemas/Strategies"},"thresholds":{"$ref":"#/components/schemas/Thresholds"},"matchers":{"description":"Expressions over the lists lefts and rights. Without matchers, a group whose sum closes scores 100.","anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Matcher"}},{"type":"null"}]}},"required":["modes","group_by","sum","thresholds"],"additionalProperties":false},"Definition":{"type":"object","properties":{"thresholds":{"$ref":"#/components/schemas/Thresholds"},"ambiguity_margin":{"type":"number"},"blocking":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BlockingPass"}},{"type":"null"}]},"matchers":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Matcher"}},{"type":"null"}]},"composite":{"$ref":"#/components/schemas/Composite"}},"required":["thresholds","blocking","matchers"],"additionalProperties":false},"Ruleset":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"latest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"definition":{"description":"Definition of the latest version","$ref":"#/components/schemas/Definition"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","name","latest_version","created_at","updated_at"],"additionalProperties":false},"RulesetVersion":{"type":"object","properties":{"ruleset_id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"definition":{"$ref":"#/components/schemas/Definition"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["ruleset_id","version","definition","created_at"],"additionalProperties":false},"CreateRulesetInputBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9_-]*$"},"definition":{"$ref":"#/components/schemas/Definition"}},"required":["name","definition"],"additionalProperties":false},"CreateRulesetVersionInputBody":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/Definition"}},"required":["definition"],"additionalProperties":false},"UpdateRulesetInputBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9_-]*$"}},"required":["name"],"additionalProperties":false},"ListRulesetsOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Ruleset"}},{"type":"null"}]}},"required":["data"],"additionalProperties":false},"Item":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["version","created_at"],"additionalProperties":false},"ListRulesetVersionsOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Item"}},{"type":"null"}]}},"required":["data"],"additionalProperties":false},"ValidateRulesetInputBody":{"type":"object","properties":{"left_dataset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"right_dataset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"required":["left_dataset_id","right_dataset_id"],"additionalProperties":false},"ValidateRulesetOutputBody":{"type":"object","properties":{"valid":{"type":"boolean"}},"required":["valid"],"additionalProperties":false},"JobPassStats":{"type":"object","properties":{"name":{"type":"string"},"candidates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"evaluated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"possible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","candidates","evaluated","matched","possible"],"additionalProperties":false},"CompositeStats":{"type":"object","properties":{"groups":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped_groups":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"targets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"searches_exhausted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"matched":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"possible":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["groups","skipped_groups","targets","searches_exhausted","matched","possible","duration_ms"],"additionalProperties":false},"StepStats":{"type":"object","properties":{"name":{"type":"string"},"left_dataset_id":{"type":"string"},"right_dataset_id":{"type":"string"},"derived_dataset_id":{"type":"string"},"left_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"right_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"possible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"candidates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"evaluated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"eval_errors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"truncated_keys":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"passes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JobPassStats"}},{"type":"null"}]},"composite":{"$ref":"#/components/schemas/CompositeStats"},"partial":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partials_extended":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partials_completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped_known":{"description":"Results not saved because the same records were already rejected, or are already pending review as possible","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"load_strategy":{"type":"string","description":"full, parallel or pushdown"},"load_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"match_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dedupe_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"persist_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"persist_phases_ms":{"description":"Milliseconds per persistence phase: reserve_ids, copy_matches, copy_items, counts, events, partials, derived, finish","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["name","left_dataset_id","right_dataset_id","left_records","right_records","matched","possible","candidates","evaluated","eval_errors","truncated_keys","passes","load_strategy","load_ms","match_ms","dedupe_ms","persist_ms"],"additionalProperties":false},"JobStats":{"type":"object","properties":{"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"possible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/StepStats"}},{"type":"null"}]}},"required":["matched","possible","steps"],"additionalProperties":false},"Job":{"type":"object","properties":{"id":{"type":"string"},"ruleset_id":{"type":"string"},"ruleset_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"left_dataset_id":{"type":"string"},"right_dataset_id":{"type":"string"},"workflow_id":{"type":"string"},"workflow_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dataset_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"dry_run":{"type":"boolean"},"size_class":{"type":"string","enum":["small","large"],"description":"large jobs run on the on-demand engine"},"estimated_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger_id":{"description":"Set when the job was started by a trigger","type":"string"},"status":{"type":"string","enum":["queued","running","completed","failed","cancelled"]},"phase":{"description":"compiling, loading, matching or persisting; workflows prefix the step name","type":"string"},"cancel_requested":{"type":"boolean"},"stats":{"$ref":"#/components/schemas/JobStats"},"error":{"type":"string"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available_at":{"description":"Queued jobs only: when the job may start; later than created_at while a trigger waits for ingestions to go quiet or a failed attempt waits to retry","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"finished_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","dataset_ids","dry_run","size_class","status","attempts","created_at"],"additionalProperties":false},"CreateJobInputBody":{"type":"object","properties":{"ruleset_id":{"description":"Run one ruleset over two datasets","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"ruleset_version":{"description":"Defaults to the latest version","type":"integer","minimum":1,"maximum":9007199254740991},"left_dataset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"right_dataset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"workflow_id":{"description":"Or run a workflow","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"workflow_version":{"description":"Defaults to the latest version","type":"integer","minimum":1,"maximum":9007199254740991},"inputs":{"description":"Workflow input name to dataset id","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"dry_run":{"description":"Run everything and report stats without saving matches","type":"boolean"},"lookback_days":{"description":"Only load records ingested in the last N days (partition pruning)","type":"integer","minimum":1,"maximum":3660}},"additionalProperties":false},"ListJobsOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Job"}},{"type":"null"}]},"next_cursor":{"type":"string"}},"required":["data"],"additionalProperties":false},"ListJobMatchesOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MatchOut"}},{"type":"null"}]},"next_cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data"],"additionalProperties":false},"MatchDecisionInputBody":{"type":"object","properties":{"note":{"type":"string","maxLength":1000}},"additionalProperties":false},"RecordRef":{"type":"object","properties":{"dataset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"record_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["dataset_id","record_id"],"additionalProperties":false},"ManualMatchInputBody":{"type":"object","properties":{"ruleset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Relationship the match belongs to; the records count as reconciled for this ruleset only"},"left":{"anyOf":[{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/RecordRef"}},{"type":"null"}]},"right":{"anyOf":[{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/RecordRef"}},{"type":"null"}]},"note":{"type":"string","maxLength":1000}},"required":["ruleset_id","left","right"],"additionalProperties":false},"RevertJobOutputBody":{"type":"object","properties":{"reverted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["reverted"],"additionalProperties":false},"Trigger":{"type":"object","properties":{"id":{"type":"string"},"ruleset_id":{"type":"string"},"ruleset_version":{"description":"Pinned version; empty means the latest version at the time the job is created","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"left_dataset_id":{"type":"string"},"right_dataset_id":{"type":"string"},"lookback_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"debounce_seconds":{"description":"Quiet period after the last ingestion before the job starts; empty means it starts right away","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_wait_seconds":{"description":"Longest wait after the first ingestion, even if ingestions keep arriving","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","ruleset_id","left_dataset_id","right_dataset_id","enabled","created_at"],"additionalProperties":false},"CreateTriggerInputBody":{"type":"object","properties":{"ruleset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"ruleset_version":{"description":"Pin a version; omit to follow the latest","type":"integer","minimum":1,"maximum":9007199254740991},"left_dataset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"right_dataset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"lookback_days":{"description":"Only records ingested in the last N days take part; default 90","type":"integer","minimum":1,"maximum":3660},"debounce_seconds":{"type":"integer","minimum":1,"maximum":3600,"description":"Wait this long without new ingestions before the job starts"},"max_wait_seconds":{"type":"integer","minimum":1,"maximum":86400,"description":"Start the job at most this long after the first ingestion; default 1800, at least debounce_seconds"}},"required":["ruleset_id","left_dataset_id","right_dataset_id"],"additionalProperties":false},"UpdateTriggerInputBody":{"type":"object","properties":{"enabled":{"type":"boolean"},"lookback_days":{"description":"Takes effect on the next ingestion, which also updates a job of this trigger still in the queue","type":"integer","minimum":1,"maximum":3660},"debounce_seconds":{"description":"null starts jobs right away again","anyOf":[{"type":"integer","minimum":1,"maximum":3600,"description":"Wait this long without new ingestions before the job starts"},{"type":"null"}]},"max_wait_seconds":{"type":"integer","minimum":1,"maximum":86400,"description":"Start the job at most this long after the first ingestion; default 1800, at least debounce_seconds"}},"additionalProperties":false},"ListTriggersOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Trigger"}},{"type":"null"}]}},"required":["data"],"additionalProperties":false},"ProjectedField":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","integer","decimal","boolean","date","timestamp"]},"scale":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expr":{"type":"string","description":"CEL over lefts and rights of the match, e.g. sum(rights.map(r, r.valor))"}},"required":["name","type","expr"],"additionalProperties":false},"Step":{"type":"object","properties":{"name":{"type":"string"},"ruleset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"ruleset_version":{"description":"Pinned version; omit to use the latest when the job starts","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"left":{"type":"string","description":"$input.<name> or $steps.<step>.matched"},"right":{"type":"string","description":"$input.<name> or $steps.<step>.matched"},"project":{"description":"Turn this step's matches into a derived dataset that later steps can use","anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ProjectedField"}},{"type":"null"}]}},"required":["name","ruleset_id","left","right"],"additionalProperties":false},"WorkflowDefinition":{"type":"object","properties":{"inputs":{"anyOf":[{"minItems":1,"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Names of the datasets the job must provide, e.g. notas, pagamentos"},"steps":{"anyOf":[{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Step"}},{"type":"null"}]}},"required":["inputs","steps"],"additionalProperties":false},"Workflow":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"latest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"definition":{"$ref":"#/components/schemas/WorkflowDefinition"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","name","latest_version","created_at","updated_at"],"additionalProperties":false},"CreateWorkflowInputBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9_-]*$"},"definition":{"$ref":"#/components/schemas/WorkflowDefinition"}},"required":["name","definition"],"additionalProperties":false},"CreateWorkflowVersionInputBody":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/WorkflowDefinition"}},"required":["definition"],"additionalProperties":false},"WorkflowVersionOutputBody":{"type":"object","properties":{"workflow_id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"definition":{"$ref":"#/components/schemas/WorkflowDefinition"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["workflow_id","version","definition","created_at"],"additionalProperties":false},"ListWorkflowsOutputBody":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Workflow"}},{"type":"null"}]}},"required":["data"],"additionalProperties":false},"ValidateWorkflowInputBody":{"type":"object","properties":{"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["inputs"],"additionalProperties":false}},"securitySchemes":{"platformKey":{"type":"http","scheme":"bearer"},"apiKey":{"type":"http","scheme":"bearer"},"session":{"type":"apiKey","in":"cookie","name":"better-auth.session_token","description":"Console login by e-mail code, see /v1/auth"}}},"paths":{"/v1/tenants":{"post":{"operationId":"create-tenant","summary":"Create a tenant","tags":["platform"],"security":[{"platformKey":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantInputBody"}}}}},"get":{"operationId":"list-tenants","summary":"List tenants","tags":["platform"],"security":[{"platformKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"default":"","type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"description":"Comma-separated statuses","schema":{"default":[],"type":"array","items":{"type":"string","enum":["active","suspended"]}}},{"name":"q","in":"query","required":false,"description":"Part of the tenant name","schema":{"default":"","type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTenantsOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/tenants/{tenant_id}":{"get":{"operationId":"get-tenant","summary":"Get a tenant","tags":["platform"],"security":[{"platformKey":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}},"patch":{"operationId":"update-tenant","summary":"Rename, suspend or reactivate a tenant, or change its billing exemption and ruleset limit","tags":["platform"],"security":[{"platformKey":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantInputBody"}}}}},"delete":{"operationId":"delete-tenant","summary":"Delete a tenant","tags":["platform"],"security":[{"platformKey":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/tenants/{tenant_id}/api-keys":{"post":{"operationId":"create-api-key","summary":"Create an API key for a tenant","tags":["platform"],"security":[{"platformKey":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyInputBody"}}}}},"get":{"operationId":"list-api-keys","summary":"List a tenant's API keys","tags":["platform"],"security":[{"platformKey":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAPIKeysOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/tenants/{tenant_id}/api-keys/{key_id}":{"delete":{"operationId":"revoke-api-key","summary":"Revoke an API key","tags":["platform"],"security":[{"platformKey":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/datasets":{"post":{"operationId":"create-dataset","summary":"Create a dataset","tags":["datasets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDatasetInputBody"}}}}},"get":{"operationId":"list-datasets","summary":"List datasets","tags":["datasets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"default":"","type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDatasetsOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/datasets/{dataset_id}":{"get":{"operationId":"get-dataset","summary":"Get a dataset","tags":["datasets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}},"patch":{"operationId":"update-dataset","summary":"Rename a dataset or add optional fields","tags":["datasets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDatasetInputBody"}}}}},"delete":{"operationId":"delete-dataset","summary":"Delete a dataset","tags":["datasets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/datasets/{dataset_id}/records":{"get":{"operationId":"list-records","summary":"List a dataset's records in load order","tags":["datasets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string","pattern":"^\\d+$"}},{"name":"limit","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":500}},{"name":"ingestion_id","in":"query","required":false,"description":"Only records loaded by this ingestion","schema":{"type":"string","pattern":"^\\d+$"}},{"name":"q","in":"query","required":false,"description":"External id prefix","schema":{"default":"","type":"string","maxLength":200}},{"name":"filter","in":"query","required":false,"description":"field:operator:value; operators eq, ne, contains, prefix, gt, gte, lt, lte, empty, present. Repeat for AND.","schema":{"default":[],"type":"array","items":{"type":"string"}}},{"name":"state","in":"query","required":false,"description":"Reconciliation state, in ruleset_id when given or in any ruleset","schema":{"type":"string","enum":["open","reconciled"]}},{"name":"ruleset_id","in":"query","required":false,"schema":{"default":"","type":"string"}},{"name":"ingested_from","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"default":"","type":"string"}},{"name":"ingested_to","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"default":"","type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRecordsOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/datasets/{dataset_id}/records/{record_id}":{"get":{"operationId":"get-record","summary":"Get a record and the matches it takes part in","tags":["datasets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","pattern":"^-?\\d+$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordDetailOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/me":{"get":{"operationId":"get-me","summary":"Tenant and scopes of the API key in use","tags":["tenants"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/matches":{"get":{"operationId":"list-matches","summary":"Search matches across jobs","tags":["matches"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"job_id","in":"query","required":false,"schema":{"default":"","type":"string"}},{"name":"ruleset_id","in":"query","required":false,"schema":{"default":"","type":"string"}},{"name":"dataset_id","in":"query","required":false,"description":"Matches with at least one record of this dataset","schema":{"default":"","type":"string"}},{"name":"status","in":"query","required":false,"description":"Comma-separated statuses","schema":{"default":[],"type":"array","items":{"type":"string","enum":["matched","possible","partial","confirmed","rejected","reverted"]}}},{"name":"kind","in":"query","required":false,"schema":{"default":[],"type":"array","items":{"type":"string","enum":["1:1","1:N","N:1","N:M"]}}},{"name":"strategy","in":"query","required":false,"schema":{"default":[],"type":"array","items":{"type":"string","enum":["pair","complete_group","subset","amount_variance","partial","meet_in_the_middle","manual"]}}},{"name":"step","in":"query","required":false,"description":"Workflow step index","schema":{"default":"","type":"string"}},{"name":"score_min","in":"query","required":false,"schema":{"default":"","type":"string"}},{"name":"score_max","in":"query","required":false,"schema":{"default":"","type":"string"}},{"name":"record","in":"query","required":false,"description":"External id of a record in any dataset of the tenant","schema":{"default":"","type":"string","maxLength":200}},{"name":"created_from","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"default":"","type":"string"}},{"name":"created_to","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"default":"","type":"string"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"]}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string","pattern":"^\\d+$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMatchesOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}},"post":{"operationId":"create-manual-match","summary":"Reconcile records by hand","tags":["matches"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchOut"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualMatchInputBody"}}}}}},"/v1/insights":{"get":{"operationId":"get-insights","summary":"Match and reconciliation totals, daily activity, queue and webhook health for the tenant","tags":["matches"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightsOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/datasets/{dataset_id}/ingestions":{"post":{"operationId":"create-ingestion","summary":"Send records inline or request a file upload","tags":["ingestions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"Idempotency-Key","in":"header","schema":{"description":"Repeating a request with the same key returns the original ingestion.","type":"string","maxLength":200}}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ingestion"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIngestionInputBody"}}}}},"get":{"operationId":"list-ingestions","summary":"List a dataset's ingestions, newest first","tags":["ingestions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string","pattern":"^\\d+$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"description":"Comma-separated statuses","schema":{"default":[],"type":"array","items":{"type":"string","enum":["awaiting_upload","queued","processing","completed","failed"]}}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListIngestionsOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/ingestions/{ingestion_id}":{"get":{"operationId":"get-ingestion","summary":"Get an ingestion","tags":["ingestions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"ingestion_id","in":"path","required":true,"schema":{"type":"string","pattern":"^-?\\d+$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ingestion"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/ingestions/{ingestion_id}/complete":{"post":{"operationId":"complete-ingestion-upload","summary":"Queue an uploaded file for processing","tags":["ingestions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"ingestion_id","in":"path","required":true,"schema":{"type":"string","pattern":"^-?\\d+$"}}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ingestion"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/webhooks":{"post":{"operationId":"create-webhook","summary":"Register a webhook endpoint","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookInputBody"}}}}},"get":{"operationId":"list-webhooks","summary":"List webhook endpoints","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWebhooksOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/webhooks/{webhook_id}":{"get":{"operationId":"get-webhook","summary":"Get a webhook endpoint","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}},"patch":{"operationId":"update-webhook","summary":"Change URL, events or enable/disable an endpoint","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookInputBody"}}}}},"delete":{"operationId":"delete-webhook","summary":"Delete a webhook endpoint; pending deliveries are dropped","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/webhooks/{webhook_id}/test":{"post":{"operationId":"test-webhook","summary":"Send a webhook.test event to this endpoint","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/webhooks/{webhook_id}/rotate-secret":{"post":{"operationId":"rotate-webhook-secret","summary":"Issue a new signing secret; the previous one keeps signing during the grace period","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateSecretOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateSecretInputBody"}}}}}},"/v1/webhooks/{webhook_id}/deliveries":{"get":{"operationId":"list-webhook-deliveries","summary":"List deliveries for an endpoint, newest first","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","delivering","succeeded","failed"]}},{"name":"event_type","in":"query","required":false,"schema":{"default":"","type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string","pattern":"^\\d+$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDeliveriesOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/webhook-deliveries/{delivery_id}":{"get":{"operationId":"get-webhook-delivery","summary":"Get a delivery with its attempt history","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","pattern":"^-?\\d+$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryDetailOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/webhook-deliveries/{delivery_id}/redeliver":{"post":{"operationId":"redeliver-webhook-delivery","summary":"Send a finished delivery again","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","pattern":"^-?\\d+$"}}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/rulesets":{"post":{"operationId":"create-ruleset","summary":"Create a ruleset (version 1)","tags":["rulesets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRulesetInputBody"}}}}},"get":{"operationId":"list-rulesets","summary":"List rulesets with the definition of their latest version","tags":["rulesets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRulesetsOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/rulesets/{ruleset_id}":{"get":{"operationId":"get-ruleset","summary":"Get a ruleset with its latest definition","tags":["rulesets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"ruleset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}},"patch":{"operationId":"rename-ruleset","summary":"Rename a ruleset","tags":["rulesets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"ruleset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRulesetInputBody"}}}}},"delete":{"operationId":"delete-ruleset","summary":"Delete a ruleset; existing jobs keep their version","tags":["rulesets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"ruleset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/rulesets/{ruleset_id}/versions":{"post":{"operationId":"create-ruleset-version","summary":"Publish a new immutable version","tags":["rulesets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"ruleset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesetVersion"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRulesetVersionInputBody"}}}}},"get":{"operationId":"list-ruleset-versions","summary":"List versions","tags":["rulesets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"ruleset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRulesetVersionsOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/rulesets/{ruleset_id}/versions/{version}":{"get":{"operationId":"get-ruleset-version","summary":"Get a version","tags":["rulesets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"ruleset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesetVersion"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/rulesets/{ruleset_id}/versions/{version}/validate":{"post":{"operationId":"validate-ruleset-version","summary":"Check that a version fits a pair of datasets","tags":["rulesets"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"ruleset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateRulesetOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateRulesetInputBody"}}}}}},"/v1/jobs":{"post":{"operationId":"create-job","summary":"Start a reconciliation job; the ruleset is validated against the datasets first","tags":["jobs"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobInputBody"}}}}},"get":{"operationId":"list-jobs","summary":"List jobs, newest first","tags":["jobs"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"default":"","type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"description":"Comma-separated statuses","schema":{"default":[],"type":"array","items":{"type":"string","enum":["queued","running","completed","failed","cancelled"]}}},{"name":"ruleset_id","in":"query","required":false,"description":"Jobs of this ruleset, including workflow jobs with a step that uses it","schema":{"default":"","type":"string"}},{"name":"workflow_id","in":"query","required":false,"schema":{"default":"","type":"string"}},{"name":"dataset_id","in":"query","required":false,"description":"Jobs that read this dataset","schema":{"default":"","type":"string"}},{"name":"origin","in":"query","required":false,"schema":{"type":"string","enum":["api","trigger"]}},{"name":"dry_run","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"created_from","in":"query","required":false,"description":"First day, YYYY-MM-DD","schema":{"default":"","type":"string"}},{"name":"created_to","in":"query","required":false,"description":"Last day, YYYY-MM-DD","schema":{"default":"","type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListJobsOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/jobs/{job_id}":{"get":{"operationId":"get-job","summary":"Get a job with its progress and stats","tags":["jobs"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/jobs/{job_id}/cancel":{"post":{"operationId":"cancel-job","summary":"Cancel a queued or running job","tags":["jobs"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/jobs/{job_id}/matches":{"get":{"operationId":"list-job-matches","summary":"List the matches produced by a job","tags":["jobs"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["matched","possible","partial","confirmed","rejected","reverted"]}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string","pattern":"^\\d+$"}},{"name":"limit","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":500}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListJobMatchesOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/matches/{match_id}":{"get":{"operationId":"get-match","summary":"Get a match with its records","tags":["matches"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"match_id","in":"path","required":true,"schema":{"type":"string","pattern":"^-?\\d+$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchOut"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/matches/{match_id}/confirm":{"post":{"operationId":"confirm-match","summary":"Accept a possible match; its records become reconciled","tags":["matches"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"match_id","in":"path","required":true,"schema":{"type":"string","pattern":"^-?\\d+$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchOut"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchDecisionInputBody"}}}}}},"/v1/matches/{match_id}/reject":{"post":{"operationId":"reject-match","summary":"Discard a possible match","tags":["matches"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"match_id","in":"path","required":true,"schema":{"type":"string","pattern":"^-?\\d+$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchOut"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchDecisionInputBody"}}}}}},"/v1/matches/{match_id}/undo":{"post":{"operationId":"undo-match","summary":"Undo a matched or confirmed match; its records become open again","tags":["matches"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"match_id","in":"path","required":true,"schema":{"type":"string","pattern":"^-?\\d+$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchOut"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchDecisionInputBody"}}}}}},"/v1/jobs/{job_id}/revert":{"post":{"operationId":"revert-job","summary":"Undo every match produced by a job","tags":["jobs"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevertJobOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/triggers":{"post":{"operationId":"create-trigger","summary":"Reconcile automatically whenever an ingestion adds records to either dataset","tags":["triggers"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trigger"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTriggerInputBody"}}}}},"get":{"operationId":"list-triggers","summary":"List triggers","tags":["triggers"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTriggersOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/triggers/{trigger_id}":{"patch":{"operationId":"update-trigger","summary":"Enable or disable a trigger, or change its lookback and wait window","tags":["triggers"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trigger"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTriggerInputBody"}}}}},"delete":{"operationId":"delete-trigger","summary":"Delete a trigger","tags":["triggers"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/workflows":{"post":{"operationId":"create-workflow","summary":"Create a workflow (version 1)","tags":["workflows"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowInputBody"}}}}},"get":{"operationId":"list-workflows","summary":"List workflows","tags":["workflows"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkflowsOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/workflows/{workflow_id}":{"get":{"operationId":"get-workflow","summary":"Get a workflow with its latest definition","tags":["workflows"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}},"delete":{"operationId":"delete-workflow","summary":"Delete a workflow","tags":["workflows"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/workflows/{workflow_id}/versions":{"post":{"operationId":"create-workflow-version","summary":"Publish a new immutable version","tags":["workflows"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowVersionOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowVersionInputBody"}}}}}},"/v1/workflows/{workflow_id}/versions/{version}":{"get":{"operationId":"get-workflow-version","summary":"Get a version","tags":["workflows"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowVersionOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/workflows/{workflow_id}/versions/{version}/validate":{"post":{"operationId":"validate-workflow-version","summary":"Check every step against the given input datasets","tags":["workflows"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateRulesetOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateWorkflowInputBody"}}}}}},"/v1/billing/matches":{"get":{"operationId":"get-match-usage","summary":"Count the matches and possible matches each tenant's jobs produced in a period","tags":["billing","platform"],"security":[{"platformKey":[]}],"parameters":[{"name":"from","in":"query","required":true,"description":"First day, YYYY-MM-DD (UTC)","schema":{"type":"string","minLength":1}},{"name":"to","in":"query","required":true,"description":"Last day, YYYY-MM-DD (UTC)","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchUsageOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/billing":{"get":{"operationId":"get-billing","summary":"Plan, subscription, available plans and this month's usage against the plan's limits","tags":["billing"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/billing/checkout":{"post":{"operationId":"start-billing-checkout","summary":"Start the payment of a plan as the signed-in user; redirect the browser to the returned url","tags":["billing"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingRedirectOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCheckoutInputBody"}}}}}},"/v1/billing/subscription":{"patch":{"operationId":"change-billing-plan","summary":"Move the live subscription to another plan now; the new allowance applies to the whole month","tags":["billing"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSubscription"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPlanInputBody"}}}}},"delete":{"operationId":"cancel-billing-subscription","summary":"Cancel the subscription at the end of the current period","tags":["billing"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSubscription"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/billing/portal":{"post":{"operationId":"open-billing-portal","summary":"Open the billing portal (invoices, payment method, e-mail); redirect the browser to the returned url","tags":["billing"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingRedirectOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}},"/v1/onboarding":{"post":{"operationId":"create-company","summary":"Create the company account (tenant) of a user who just signed up; the user becomes its admin","tags":["account"],"security":[{"session":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCompanyInputBody"}}}}}},"/v1/users":{"get":{"operationId":"list-users","summary":"List the people who can sign in to the tenant's console","tags":["account"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListUsersOutputBody"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}},"post":{"operationId":"invite-user","summary":"Invite someone by e-mail; they sign in with a code sent to that address","tags":["account"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteUserInputBody"}}}}}},"/v1/users/{user_id}":{"patch":{"operationId":"update-user","summary":"Change a user's role","tags":["account"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserInputBody"}}}}},"delete":{"operationId":"remove-user","summary":"Remove a user; their console sessions end at once","tags":["account"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}}}}}}