- Base URL:
https://deduplication.sls.epilot.io - Full API Docs: https://docs.epilot.io/api/deduplication
import { epilot } from '@epilot/sdk' epilot.authorize(() => '<token>') const { data } = await epilot.deduplication.deduplicate(...)
import { getClient, authorize } from '@epilot/sdk/deduplication' const deduplicationClient = getClient() authorize(deduplicationClient, () => '<token>') const { data } = await deduplicationClient.deduplicate(...)
deduplicatededuplicateAsyncgetDeduplicationJobdetectDuplicatesresolveDuplicatesdismissDuplicateslistUniquenessCriteriacreateUniquenessCriteriagetUniquenessCriteriaupdateUniquenessCriteriadeleteUniquenessCriteriagetUniquenessCriteriaByIdupdateUniquenessCriteriaByIddeleteUniquenessCriteriaByIdsetGlobalUniquenessCriteriaregisterUniquenessCriteriaUsageunregisterUniquenessCriteriaUsage
Schemas
DeduplicateRequestBodyDeduplicateRequestResponseEntityDeduplicateAsyncResponseJobStatusDeduplicationJobDetectDuplicatesRequestBodyDetectDuplicatesResponseDetectedDuplicateMatchResolveDuplicatesRequestBodyResolutionModeResolveDuplicatesResponseResolutionCandidateRuleStrengthDismissDuplicatesRequestBodyDismissDuplicatesResponseUniquenessCriteriaListResponseUniquenessCriteriaMatchRuleMatchAttributeMatchModeRuleSetUsageUniquenessCriteriaCreateBodyRuleSetConflictUniquenessCriteriaUpdateBodyRuleSetUsageBody
Deduplicates Entities
POST /v1/deduplicate
const { data } = await client.deduplicate( null, [ { toKeep: 'string', toDelete: ['string'] } ], )
Response
{
"deduplicatedEntities": [
{
"_id": "string",
"_org": "string",
"_schema": "string",
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z",
"_created_by": "string",
"created_by": "string",
"_tags": ["string"],
"_acl": {},
"_owners": [
{
"org_id": "string",
"user_id": "string"
}
],
"type": "string"
}
]
}Submits an async deduplication job. Returns a job ID immediately. Poll GET /v1/deduplicate/jobs/{jobId} for status.
POST /v1/deduplicate/job
const { data } = await client.deduplicateAsync( null, [ { toKeep: 'string', toDelete: ['string'] } ], )
Returns the current status of an async deduplication job
GET /v1/deduplicate/jobs/{jobId}
const { data } = await client.getDeduplicationJob({ jobId: 'example', })
Response
{
"jobId": "string",
"status": "pending",
"message": "string",
"result": [
{
"_id": "string",
"_org": "string",
"_schema": "string",
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z",
"_created_by": "string",
"created_by": "string",
"_tags": ["string"],
"_acl": {},
"_owners": [
{
"org_id": "string",
"user_id": "string"
}
],
"type": "string"
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"updatedAt": "1970-01-01T00:00:00.000Z"
}Detects potential duplicate entities for the given entity using the schema's prioritized uniqueness rules. Returns matches with a confidence score. Used by entity-mapping-api while the self-contained
POST /v1/detect-duplicates
const { data } = await client.detectDuplicates( null, { schema: 'string', entity: {} }, )
Response
{
"matches": [
{
"entity": {
"_id": "string",
"_org": "string",
"_schema": "string",
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z",
"_created_by": "string",
"created_by": "string",
"_tags": ["string"],
"_acl": {},
"_owners": [
{
"org_id": "string",
"user_id": "string"
}
],
"type": "string"
},
"confidence": 0,
"matched_attributes": ["string"],
"fuzzy_attributes": ["string"]
}
]
}Answers 'is this payload an existing record, and which one?' as an action the caller executes: update that entity, create, or ask the user. The action follows from the matching rule's strength and the
POST /v1/duplicates/resolve
const { data } = await client.resolveDuplicates( null, { schema: 'string', entity: {}, mode: 'automated', criteria_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6' }, )
Response
{
"action": "update",
"entity": {
"_id": "string",
"_org": "string",
"_schema": "string",
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z",
"_created_by": "string",
"created_by": "string",
"_tags": ["string"],
"_acl": {},
"_owners": [
{
"org_id": "string",
"user_id": "string"
}
],
"type": "string"
},
"rule_name": "string",
"matched_attributes": ["string"]
}Confirms entities as NOT duplicates. Every pair among them is remembered as dismissed, so no later flagging pass raises it again, and the entries they hold about each other are removed from their dupl
POST /v1/duplicates/dismiss
const { data } = await client.dismissDuplicates( null, { schema: 'string', entityIds: ['string'] }, )
Response
{
"dismissed": ["string"]
}Lists the rule sets of the requesting organization, optionally one schema's, each with its usages.
GET /v1/uniqueness-criteria
const { data } = await client.listUniquenessCriteria({ schema: 'example', })
Response
{
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"orgId": "string",
"schema": "string",
"name": "string",
"global": true,
"matchRules": [
{
"name": "string",
"attributes": [
{
"attribute": "string",
"match": "exact"
}
],
"strength": "certain",
"confidence": 0
}
],
"usages": [
{
"consumer": "string",
"ref": "string",
"label": "string",
"registeredAt": "1970-01-01T00:00:00.000Z"
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"updatedAt": "1970-01-01T00:00:00.000Z"
}
]
}Creates a rule set. The first set of a schema becomes its global set unless 'global' is false.
POST /v1/uniqueness-criteria
const { data } = await client.createUniquenessCriteria( null, { schema: 'string', name: 'string', global: true, matchRules: [ { name: 'string', attributes: [ { attribute: 'string', match: 'exact' } ], strength: 'certain', confidence: 0 } ] }, )
Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"orgId": "string",
"schema": "string",
"name": "string",
"global": true,
"matchRules": [
{
"name": "string",
"attributes": [
{
"attribute": "string",
"match": "exact"
}
],
"strength": "certain",
"confidence": 0
}
],
"usages": [
{
"consumer": "string",
"ref": "string",
"label": "string",
"registeredAt": "1970-01-01T00:00:00.000Z"
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"updatedAt": "1970-01-01T00:00:00.000Z"
}The schema's global rule set.
GET /v1/uniqueness-criteria/{schema}
const { data } = await client.getUniquenessCriteria({ schema: 'example', })
Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"orgId": "string",
"schema": "string",
"name": "string",
"global": true,
"matchRules": [
{
"name": "string",
"attributes": [
{
"attribute": "string",
"match": "exact"
}
],
"strength": "certain",
"confidence": 0
}
],
"usages": [
{
"consumer": "string",
"ref": "string",
"label": "string",
"registeredAt": "1970-01-01T00:00:00.000Z"
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"updatedAt": "1970-01-01T00:00:00.000Z"
}Replaces the rules, and the name when given, of the schema's global rule set.
PUT /v1/uniqueness-criteria/{schema}
const { data } = await client.updateUniquenessCriteria( { schema: 'example', }, { name: 'string', matchRules: [ { name: 'string', attributes: [ { attribute: 'string', match: 'exact' } ], strength: 'certain', confidence: 0 } ] }, )
Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"orgId": "string",
"schema": "string",
"name": "string",
"global": true,
"matchRules": [
{
"name": "string",
"attributes": [
{
"attribute": "string",
"match": "exact"
}
],
"strength": "certain",
"confidence": 0
}
],
"usages": [
{
"consumer": "string",
"ref": "string",
"label": "string",
"registeredAt": "1970-01-01T00:00:00.000Z"
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"updatedAt": "1970-01-01T00:00:00.000Z"
}Deletes the schema's global rule set. Refused while it is referenced or while the schema has other rule sets.
DELETE /v1/uniqueness-criteria/{schema}
const { data } = await client.deleteUniquenessCriteria({ schema: 'example', })
One rule set by id.
GET /v1/uniqueness-criteria/{schema}/{id}
const { data } = await client.getUniquenessCriteriaById({ schema: 'example', id: '123e4567-e89b-12d3-a456-426614174000', })
Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"orgId": "string",
"schema": "string",
"name": "string",
"global": true,
"matchRules": [
{
"name": "string",
"attributes": [
{
"attribute": "string",
"match": "exact"
}
],
"strength": "certain",
"confidence": 0
}
],
"usages": [
{
"consumer": "string",
"ref": "string",
"label": "string",
"registeredAt": "1970-01-01T00:00:00.000Z"
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"updatedAt": "1970-01-01T00:00:00.000Z"
}Replaces the rules, and the name when given, of a rule set.
PUT /v1/uniqueness-criteria/{schema}/{id}
const { data } = await client.updateUniquenessCriteriaById( { schema: 'example', id: '123e4567-e89b-12d3-a456-426614174000', }, { name: 'string', matchRules: [ { name: 'string', attributes: [ { attribute: 'string', match: 'exact' } ], strength: 'certain', confidence: 0 } ] }, )
Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"orgId": "string",
"schema": "string",
"name": "string",
"global": true,
"matchRules": [
{
"name": "string",
"attributes": [
{
"attribute": "string",
"match": "exact"
}
],
"strength": "certain",
"confidence": 0
}
],
"usages": [
{
"consumer": "string",
"ref": "string",
"label": "string",
"registeredAt": "1970-01-01T00:00:00.000Z"
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"updatedAt": "1970-01-01T00:00:00.000Z"
}Deletes a rule set. Refused with the usages while a consumer references it, and while it is the global set of a schema that has other rule sets.
DELETE /v1/uniqueness-criteria/{schema}/{id}
const { data } = await client.deleteUniquenessCriteriaById({ schema: 'example', id: '123e4567-e89b-12d3-a456-426614174000', })
Makes the rule set the schema's global one. The previous global set becomes a custom set.
POST /v1/uniqueness-criteria/{schema}/{id}/global
const { data } = await client.setGlobalUniquenessCriteria({ schema: 'example', id: '123e4567-e89b-12d3-a456-426614174000', })
Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"orgId": "string",
"schema": "string",
"name": "string",
"global": true,
"matchRules": [
{
"name": "string",
"attributes": [
{
"attribute": "string",
"match": "exact"
}
],
"strength": "certain",
"confidence": 0
}
],
"usages": [
{
"consumer": "string",
"ref": "string",
"label": "string",
"registeredAt": "1970-01-01T00:00:00.000Z"
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"updatedAt": "1970-01-01T00:00:00.000Z"
}Records that a consumer configuration references the rule set. Idempotent. A referenced rule set cannot be deleted.
PUT /v1/uniqueness-criteria/{schema}/{id}/usages/{consumer}/{ref}
const { data } = await client.registerUniquenessCriteriaUsage( { schema: 'example', id: '123e4567-e89b-12d3-a456-426614174000', consumer: 'example', ref: 'example', }, { label: 'string' }, )
Response
{
"consumer": "string",
"ref": "string",
"label": "string",
"registeredAt": "1970-01-01T00:00:00.000Z"
}Removes a consumer configuration's reference to the rule set.
DELETE /v1/uniqueness-criteria/{schema}/{id}/usages/{consumer}/{ref}
const { data } = await client.unregisterUniquenessCriteriaUsage({ schema: 'example', id: '123e4567-e89b-12d3-a456-426614174000', consumer: 'example', ref: 'example', })
type DeduplicateRequestBody = Array<{ toKeep: string toDelete: string[] }>
type DeduplicateRequestResponse = { deduplicatedEntities: Array<{ _id: string _org?: string _schema?: string _created_at?: string // date-time _updated_at?: string // date-time _created_by?: string | number created_by?: string | number _tags?: string[] _acl?: Record<string, string[]> _owners?: Array<{ org_id: { ... } user_id: { ... } }> type?: string }> }
Base Entity schema
type Entity = { _id: string _org?: string _schema?: string _created_at?: string // date-time _updated_at?: string // date-time _created_by?: string | number created_by?: string | number _tags?: string[] _acl?: Record<string, string[]> _owners?: Array<{ org_id: string user_id: string }> type?: string }
Response returned immediately when a deduplication job is submitted
type DeduplicateAsyncResponse = { jobId: string status: "pending" | "processing" | "completed" | "failed" message: string }
type JobStatus = "pending" | "processing" | "completed" | "failed"
Represents an async deduplication job
type DeduplicationJob = { jobId: string status: "pending" | "processing" | "completed" | "failed" message?: string result?: Array<{ _id: string _org?: string _schema?: string _created_at?: string // date-time _updated_at?: string // date-time _created_by?: string | number created_by?: string | number _tags?: string[] _acl?: Record<string, string[]> _owners?: Array<{ org_id: { ... } user_id: { ... } }> type?: string }> createdAt: string // date-time updatedAt: string // date-time }
type DetectDuplicatesRequestBody = { schema: string entity: Record<string, unknown> }
type DetectDuplicatesResponse = { matches: Array<{ entity: { _id: { ... } _org?: { ... } _schema?: { ... } _created_at?: { ... } _updated_at?: { ... } _created_by?: { ... } created_by?: { ... } _tags?: { ... } _acl?: { ... } _owners?: { ... } type?: { ... } } confidence: number matched_attributes: string[] fuzzy_attributes?: string[] }> }
type DetectedDuplicateMatch = { entity: { _id: string _org?: string _schema?: string _created_at?: string // date-time _updated_at?: string // date-time _created_by?: string | number created_by?: string | number _tags?: string[] _acl?: Record<string, string[]> _owners?: Array<{ org_id: { ... } user_id: { ... } }> type?: string } confidence: number matched_attributes: string[] fuzzy_attributes?: string[] }
type ResolveDuplicatesRequestBody = { schema: string entity: Record<string, unknown> mode: "automated" | "interactive" criteria_id?: string // uuid }
'automated' when no human is present (automations, integrations): certain matches are acted on, probable ones only flagged. 'interactive' when a person is filling in a form: every match is put in front of them.
type ResolutionMode = "automated" | "interactive"
type ResolveDuplicatesResponse = { action: "update" entity: { _id: string _org?: string _schema?: string _created_at?: string // date-time _updated_at?: string // date-time _created_by?: string | number created_by?: string | number _tags?: string[] _acl?: Record<string, string[]> _owners?: Array<{ org_id: { ... } user_id: { ... } }> type?: string } rule_name?: string matched_attributes: string[] } | { action: "create" reason: "no_match" | "ambiguous" | "probable_only" } | { action: "ask" candidates: Array<{ entity: { _id: { ... } _org?: { ... } _schema?: { ... } _created_at?: { ... } _updated_at?: { ... } _created_by?: { ... } created_by?: { ... } _tags?: { ... } _acl?: { ... } _owners?: { ... } type?: { ... } } strength: "certain" | "probable" rule_name?: string matched_attributes: string[] fuzzy_attributes?: string[] }> }
type ResolutionCandidate = { entity: { _id: string _org?: string _schema?: string _created_at?: string // date-time _updated_at?: string // date-time _created_by?: string | number created_by?: string | number _tags?: string[] _acl?: Record<string, string[]> _owners?: Array<{ org_id: { ... } user_id: { ... } }> type?: string } strength: "certain" | "probable" rule_name?: string matched_attributes: string[] fuzzy_attributes?: string[] }
How sure a match on the rule is. 'certain': the attributes identify one record. 'probable': the records are likely the same and a person should decide.
type RuleStrength = "certain" | "probable"
type DismissDuplicatesRequestBody = { schema: string entityIds: string[] }
type DismissDuplicatesResponse = { dismissed: string[] }
type UniquenessCriteriaListResponse = { items: Array<{ id: string // uuid orgId: string schema: string name: string global: boolean matchRules: Array<{ name?: { ... } attributes: { ... } strength?: { ... } confidence?: { ... } }> usages: Array<{ consumer: { ... } ref: { ... } label?: { ... } registeredAt: { ... } }> createdAt: string // date-time updatedAt: string // date-time }> }
A named rule set defining what makes an entity of a schema the same record. An org can have several per schema, at most one of them global.
type UniquenessCriteria = { id: string // uuid orgId: string schema: string name: string global: boolean matchRules: Array<{ name?: string attributes: Array<{ attribute: { ... } match?: { ... } }> strength?: "certain" | "probable" confidence?: number }> usages: Array<{ consumer: string ref: string label?: string registeredAt: string // date-time }> createdAt: string // date-time updatedAt: string // date-time }
One way to identify the same entity. Evaluated in order; first rule whose attributes are all available and that returns hits wins.
type MatchRule = { name?: string attributes: Array<{ attribute: string match?: object }> strength?: "certain" | "probable" confidence?: number }
One attribute participating in a match rule.
type MatchAttribute = { attribute: string match?: object }
How an attribute's values are compared. 'exact': the same value, ignoring case and surrounding whitespace. 'fuzzy': also ignoring doubled spaces and umlaut transcription (Müller / Mueller), and allowing a typo or two, scaled by the value's length. Fuzzy applies to text-like attributes (string, text,
type MatchMode = "exact" | "fuzzy"
A consumer configuration that references a rule set. A referenced rule set cannot be deleted.
type RuleSetUsage = { consumer: string ref: string label?: string registeredAt: string // date-time }
type UniquenessCriteriaCreateBody = { schema: string name?: string global?: boolean matchRules: Array<{ name?: string attributes: Array<{ attribute: { ... } match?: { ... } }> strength?: "certain" | "probable" confidence?: number }> }
type RuleSetConflict = { message: string usages: Array<{ consumer: string ref: string label?: string registeredAt: string // date-time }> }
type UniquenessCriteriaUpdateBody = { name?: string matchRules: Array<{ name?: string attributes: Array<{ attribute: { ... } match?: { ... } }> strength?: "certain" | "probable" confidence?: number }> }
type RuleSetUsageBody = { label?: string }