> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clinia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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

````yaml /api-reference/mdm.yml post /mdm/v1/collections/{collectionKey}/entity-resolution/preview
openapi: 3.0.1
info:
  title: MDM API
  version: 1.0.0
servers:
  - url: https://api.{workspaceId}.clinia.cloud
    variables:
      workspaceId:
        default: ''
        description: The workspace id.
security:
  - apiKey: []
  - basicHttpAuth: []
  - bearerHttpAuth: []
tags:
  - name: Collections
    description: Management of collections.
  - name: Relationship Definitions
    description: Management of relationship definitions.
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.

        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.
      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.

                    If 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.

                    Note: identifier match are done at the source record level,
                    so it doesn't include source identifiers in the format
                    `source:<>:<>`.
                  type: array
                  items:
                    $ref: '#/components/schemas/v1Identifier'
                data:
                  type: object
                  x-is-generic: true
                  description: >
                    The data used in the resolution preview.

                    It contains properties which must match the resolution
                    properties defined in the resolution rule of the unified
                    collection

                    Note: The data must be a valid JSON object and values must
                    be defined as arrays.
        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'
        '429':
          $ref: '#/components/responses/v1TooManyRequestError'
        '504':
          $ref: '#/components/responses/v1GatewayTimeoutError'
components:
  schemas:
    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.
          allOf:
            - $ref: '#/components/schemas/v1Symbol'
        system:
          description: >-
            Establishes the namespace for the value - that is, a URL that
            describes a set values that are unique.
          allOf:
            - $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.
          allOf:
            - $ref: '#/components/schemas/v1Symbol'
        use:
          description: The purpose of this identifier.
          allOf:
            - $ref: '#/components/schemas/v1Code'
        period:
          description: Time period when identifier was/is in use.
          allOf:
            - $ref: '#/components/schemas/v1Period'
      additionalProperties: false
    v1EntityResolutionPreviewResponse:
      type: object
      oneOf:
        - $ref: '#/components/schemas/v1IdentifierHits'
        - $ref: '#/components/schemas/v1ResolutionPropertyHits'
      discriminator:
        propertyName: type
        mapping:
          IDENTIFIER:
            $ref: '#/components/schemas/v1IdentifierHits'
          RESOLUTION_PROPERTY:
            $ref: '#/components/schemas/v1ResolutionPropertyHits'
    v1Error:
      type: object
      required:
        - code
        - message
        - type
      properties:
        code:
          $ref: '#/components/schemas/v1ErrorCode'
        message:
          type: string
        type:
          $ref: '#/components/schemas/v1ErrorType'
        details:
          description: list of errors that occurred if applicable.
          type: array
          items:
            $ref: '#/components/schemas/v1Error'
        additionalContext:
          type: object
          additionalProperties: true
    v1Symbol:
      pattern: ^[\s\S]+$
      type: string
      description: A sequence of Unicode characters.
    v1Uri:
      pattern: ^\S*$
      type: string
      description: String of characters used to identify a name or a resource.
    v1Code:
      pattern: ^[^\s]+( [^\s]+)*$
      type: string
      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.
    v1Period:
      type: object
      description: A time period defined by a start and end date and optionally time.
      properties:
        id:
          $ref: '#/components/schemas/v1Symbol'
          description: >-
            Unique id for the property within a resource (for internal
            references). This may be any string value that does not contain
            spaces.
        start:
          $ref: '#/components/schemas/v1DateTime'
          description: The start of the period. The boundary is inclusive.
        end:
          $ref: '#/components/schemas/v1DateTime'
          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.
      additionalProperties: false
    v1IdentifierHits:
      type: object
      required:
        - type
        - hits
      properties:
        type:
          $ref: '#/components/schemas/v1ResolutionHitType'
        hits:
          type: array
          items:
            $ref: '#/components/schemas/v1IdentifierHit'
    v1ResolutionPropertyHits:
      type: object
      required:
        - type
        - hits
      properties:
        type:
          $ref: '#/components/schemas/v1ResolutionHitType'
        hits:
          type: array
          items:
            $ref: '#/components/schemas/v1ResolutionMatchResult'
    v1ErrorCode:
      type: integer
      format: int32
      enum:
        - 400
        - 401
        - 403
        - 404
        - 408
        - 409
        - 413
        - 429
        - 500
        - 501
        - 504
    v1ErrorType:
      type: string
      enum:
        - ALREADY_EXISTS
        - FAILED_PRECONDITION
        - INTERNAL
        - INVALID_ARGUMENT
        - NOT_FOUND
        - OUT_OF_RANGE
        - UNIMPLEMENTED
        - PERMISSION_DENIED
        - UNAUTHENTICATED
        - CONTENT_TOO_LARGE
        - REQUEST_TIMEOUT
        - TOO_MANY_REQUEST
        - GATEWAY_TIMEOUT
    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
      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.
    v1ResolutionHitType:
      type: string
      enum:
        - IDENTIFIER
        - RESOLUTION_PROPERTY
    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
    v1ResolutionMatchResult:
      allOf:
        - $ref: '#/components/schemas/v1MatchResult'
        - type: object
          required:
            - type
          properties:
            type:
              $ref: '#/components/schemas/v1MatchType'
    v1IdentifierMatch:
      type: object
      required:
        - source
        - id
        - identifier
      properties:
        source:
          type: string
        id:
          type: string
        identifier:
          $ref: '#/components/schemas/v1Identifier'
          description: Identifier which matched the unified record.
    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'
    v1MatchType:
      type: string
      enum:
        - MATCH_TYPE_NO_MATCH
        - MATCH_TYPE_MATCH
        - MATCH_TYPE_POSSIBLE_MATCH
    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
        - type
      properties:
        source:
          type: string
        id:
          type: string
        type:
          type: string
    v1RecordHighlighting:
      type: object
      required:
        - source
        - id
        - type
        - highlighting
      properties:
        source:
          type: string
        id:
          type: string
        type:
          type: string
        highlighting:
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/v1HighlightingHit'
    v1HighlightingHit:
      type: object
      oneOf:
        - $ref: '#/components/schemas/v1HighlightingHitTextual'
        - $ref: '#/components/schemas/v1HighlightingHitVector'
      discriminator:
        propertyName: type
        mapping:
          textual:
            $ref: '#/components/schemas/v1HighlightingHitTextual'
          vector:
            $ref: '#/components/schemas/v1HighlightingHitVector'
    v1HighlightingHitTextual:
      type: object
      required:
        - type
        - highlight
      properties:
        type:
          $ref: '#/components/schemas/v1HighlightingHitType'
        highlight:
          type: string
    v1HighlightingHitVector:
      type: object
      required:
        - type
        - score
        - path
        - data
      properties:
        type:
          $ref: '#/components/schemas/v1HighlightingHitType'
        score:
          type: number
        path:
          type: string
        data:
          type: string
    v1HighlightingHitType:
      type: string
      enum:
        - textual
        - vector
  responses:
    v1PayloadTooLargeError:
      description: Returned when the payload exceeds the max content size (100kB).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
    v1TooManyRequestError:
      description: Returned when the server starts throttling the requests.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
    v1GatewayTimeoutError:
      description: Returned when the request exceeds the server timeout window.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Clinia-API-Key
    basicHttpAuth:
      description: Basic HTTP authentication.
      type: http
      scheme: basic
    bearerHttpAuth:
      description: JWT Bearer authentication.
      type: http
      scheme: Bearer
      bearerFormat: JWT

````