---
updatedAt: 2024-12-12T15:50:09.000Z
agentTools:
  projectIndex: https://clinia.readme.io/llms.txt
---

# Execute a entity resolution preview for a given set of data (resolution properties) and identifiers

This endpoint allows you to preview/simulate the outcome of the entity resolution process for the given collection.
It returns a list of hits/matches to unified records in the system based the resolution rule of the collection, using the provided data and identifiers.
Use this endpoint to understand how the entity resolution process would behave when injecting a record into the collection, helping you to understand the result on the system.

Note: Entity resolution first checks for duplicate identifiers already present in the system (unified records) and then applies the resolution rule to find matches.
Therefore if matches are found based on identifiers, the resolution properties are ignored.


# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "MDM API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://{workspaceId}.clinia.cloud",
      "variables": {
        "workspaceId": {
          "default": "",
          "description": "The workspace id."
        }
      }
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Collections",
      "description": "Management of collections."
    }
  ],
  "paths": {
    "/mdm/v1/collections/{collectionKey}/entity-resolution/preview": {
      "post": {
        "tags": [
          "Collections"
        ],
        "summary": "Execute a entity resolution preview for a given set of data (resolution properties) and identifiers",
        "description": "This endpoint allows you to preview/simulate the outcome of the entity resolution process for the given collection.\nIt returns a list of hits/matches to unified records in the system based the resolution rule of the collection, using the provided data and identifiers.\nUse this endpoint to understand how the entity resolution process would behave when injecting a record into the collection, helping you to understand the result on the system.\n\nNote: Entity resolution first checks for duplicate identifiers already present in the system (unified records) and then applies the resolution rule to find matches.\nTherefore if matches are found based on identifiers, the resolution properties are ignored.\n",
        "operationId": "EntityResolutionPreview",
        "parameters": [
          {
            "name": "collectionKey",
            "in": "path",
            "description": "Key of the collection.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "properties": {
                  "identifier": {
                    "description": "Identifiers used in the resolution preview.\nIf any of those identifiers are used by a source record linked to a unified record in the system, the resolution preview will return the unified record as an exact match.\nNote: identifier match are done at the source record level, so it doesn't include generated relative identities or source identifiers in the format `source:<>:<>`.\n",
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/v1Identifier"
                    }
                  },
                  "data": {
                    "type": "object",
                    "x-is-generic": true,
                    "x-go-type": "json.RawMessage",
                    "description": "The data used in the resolution preview.\nIt contains properties which must match the resolution properties defined in the resolution rule of the unified collection\nNote: The data must be a valid JSON object and values must be defined as arrays.\n"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response. The response contains the list of hits/matches to unified records.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1EntityResolutionPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Returned when the request is malformed or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1Error"
                }
              }
            }
          },
          "404": {
            "description": "Returned when the collection does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1Error"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/v1PayloadTooLargeError"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "v1MatchType": {
        "type": "string",
        "enum": [
          "MATCH_TYPE_NO_MATCH",
          "MATCH_TYPE_MATCH",
          "MATCH_TYPE_POSSIBLE_MATCH"
        ]
      },
      "v1ErrorType": {
        "type": "string",
        "x-common-model": true,
        "enum": [
          "ALREADY_EXISTS",
          "FAILED_PRECONDITION",
          "INTERNAL",
          "INVALID_ARGUMENT",
          "NOT_FOUND",
          "OUT_OF_RANGE",
          "UNIMPLEMENTED",
          "PERMISSION_DENIED",
          "UNAUTHENTICATED",
          "CONTENT_TOO_LARGE",
          "REQUEST_TIMEOUT"
        ],
        "x-go-type": "apiv1.V1ErrorType",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1Error": {
        "type": "object",
        "x-common-model": true,
        "required": [
          "code",
          "message",
          "type"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32",
            "enum": [
              400,
              401,
              403,
              404,
              408,
              409,
              413,
              500,
              501
            ]
          },
          "message": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/v1ErrorType"
          },
          "details": {
            "description": "list of errors that occurred if applicable.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/v1Error"
            }
          }
        },
        "x-go-type": "apiv1.V1Error",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1Symbol": {
        "pattern": "^[\\s\\S]+$",
        "type": "string",
        "x-common-model": true,
        "description": "A sequence of Unicode characters.",
        "x-go-type": "apiv1.V1Symbol",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1Uri": {
        "pattern": "^\\S*$",
        "type": "string",
        "x-common-model": true,
        "description": "String of characters used to identify a name or a resource.",
        "x-go-type": "apiv1.V1Uri",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1Code": {
        "pattern": "^[^\\s]+( [^\\s]+)*$",
        "type": "string",
        "x-common-model": true,
        "description": "A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents.",
        "x-go-type": "apiv1.V1Code",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1DateTime": {
        "pattern": "^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]{1,9})?)?)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)?)?)?$",
        "type": "string",
        "x-common-model": true,
        "description": "A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates.",
        "x-go-type": "apiv1.V1DateTime",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1Period": {
        "type": "object",
        "x-common-model": true,
        "description": "A time period defined by a start and end date and optionally time.",
        "properties": {
          "id": {
            "description": "Unique id for the property within a resource (for internal references). This may be any string value that does not contain spaces.",
            "$ref": "#/components/schemas/v1Symbol"
          },
          "start": {
            "description": "The start of the period. The boundary is inclusive.",
            "$ref": "#/components/schemas/v1DateTime"
          },
          "end": {
            "description": "The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.",
            "$ref": "#/components/schemas/v1DateTime"
          }
        },
        "additionalProperties": false,
        "x-go-type": "apiv1.V1Period",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1Identifier": {
        "description": "An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers.",
        "properties": {
          "id": {
            "description": "Unique id for the property within a resource (for internal references). This may be any string value that does not contain spaces.",
            "$ref": "#/components/schemas/v1Symbol"
          },
          "system": {
            "description": "Establishes the namespace for the value - that is, a URL that describes a set values that are unique.",
            "$ref": "#/components/schemas/v1Uri"
          },
          "value": {
            "description": "The portion of the identifier typically relevant to the user and which is unique within the context of the system.",
            "$ref": "#/components/schemas/v1Symbol"
          },
          "use": {
            "description": "The purpose of this identifier.",
            "$ref": "#/components/schemas/v1Code"
          },
          "period": {
            "description": "Time period when identifier was/is in use.",
            "$ref": "#/components/schemas/v1Period"
          }
        },
        "additionalProperties": false,
        "x-go-type": "apiv1.V1Identifier",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        },
        "x-common-model": true
      },
      "v1ResolutionHitType": {
        "type": "string",
        "enum": [
          "IDENTIFIER",
          "RESOLUTION_PROPERTY"
        ]
      },
      "v1IdentifierMatch": {
        "type": "object",
        "required": [
          "source",
          "id",
          "identifier"
        ],
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identifier": {
            "description": "Identifier which matched the unified record.",
            "$ref": "#/components/schemas/v1Identifier"
          }
        }
      },
      "v1IdentifierHit": {
        "type": "object",
        "required": [
          "to",
          "matches",
          "type"
        ],
        "properties": {
          "to": {
            "type": "string"
          },
          "matches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/v1IdentifierMatch"
            }
          },
          "type": {
            "type": "string",
            "enum": [
              "MATCH_TYPE_MATCH"
            ]
          }
        }
      },
      "v1IdentifierHits": {
        "type": "object",
        "required": [
          "type",
          "hits"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/v1ResolutionHitType"
          },
          "hits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/v1IdentifierHit"
            }
          }
        }
      },
      "v1ResolverResult": {
        "type": "object",
        "required": [
          "type",
          "result",
          "matchers"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/v1MatchType"
          },
          "result": {
            "type": "boolean"
          },
          "matchers": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        }
      },
      "v1MatcherResult": {
        "type": "object",
        "required": [
          "source",
          "id"
        ],
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "v1HighlightingHitType": {
        "type": "string",
        "x-common-model": true,
        "enum": [
          "textual",
          "vector"
        ],
        "x-go-type": "apiv1.V1HighlightingHitType",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1HighlightingHitTextual": {
        "type": "object",
        "x-common-model": true,
        "required": [
          "type",
          "highlight"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/v1HighlightingHitType"
          },
          "highlight": {
            "type": "string"
          }
        },
        "x-go-type": "apiv1.V1HighlightingHitTextual",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1HighlightingHitVector": {
        "type": "object",
        "x-common-model": true,
        "required": [
          "type",
          "score",
          "path",
          "data"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/v1HighlightingHitType"
          },
          "score": {
            "type": "number"
          },
          "path": {
            "type": "string"
          },
          "data": {
            "type": "string"
          }
        },
        "x-go-type": "apiv1.V1HighlightingHitVector",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1HighlightingHit": {
        "type": "object",
        "x-common-model": true,
        "oneOf": [
          {
            "$ref": "#/components/schemas/v1HighlightingHitTextual"
          },
          {
            "$ref": "#/components/schemas/v1HighlightingHitVector"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "textual": "#/components/schemas/v1HighlightingHitTextual",
            "vector": "#/components/schemas/v1HighlightingHitVector"
          }
        },
        "x-go-type": "apiv1.V1HighlightingHit",
        "x-go-type-import": {
          "name": "apiv1",
          "path": "github.com/clinia/atlas/server/api/v1"
        }
      },
      "v1RecordHighlighting": {
        "type": "object",
        "required": [
          "source",
          "id",
          "highlighting"
        ],
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "highlighting": {
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/v1HighlightingHit"
              }
            }
          }
        }
      },
      "v1MatchResult": {
        "type": "object",
        "required": [
          "to",
          "resolvers",
          "matchers"
        ],
        "properties": {
          "to": {
            "type": "string"
          },
          "resolvers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/v1ResolverResult"
            }
          },
          "matchers": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/v1MatcherResult"
              }
            }
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/v1RecordHighlighting"
            }
          }
        }
      },
      "v1ResolutionMatchResult": {
        "allOf": [
          {
            "$ref": "#/components/schemas/v1MatchResult"
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "$ref": "#/components/schemas/v1MatchType"
              }
            }
          }
        ]
      },
      "v1ResolutionPropertyHits": {
        "type": "object",
        "required": [
          "type",
          "hits"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/v1ResolutionHitType"
          },
          "hits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/v1ResolutionMatchResult"
            }
          }
        }
      },
      "v1EntityResolutionPreviewResponse": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/v1IdentifierHits"
          },
          {
            "$ref": "#/components/schemas/v1ResolutionPropertyHits"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "IDENTIFIER": "#/components/schemas/v1IdentifierHits",
            "RESOLUTION_PROPERTY": "#/components/schemas/v1ResolutionPropertyHits"
          }
        }
      }
    },
    "responses": {
      "v1PayloadTooLargeError": {
        "x-common-model": true,
        "description": "Returned when the payload exceeds the max content size (100kB).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/v1Error"
            }
          }
        }
      }
    }
  }
}
```