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

# Merge entities into a target

> Merges the source entities into the target so they report under it in analytics; the merge can be reversed via the unmerge endpoint, though conflicting alias variants dropped during the merge are not restored.



## OpenAPI

````yaml https://api.mentionlab.io/api/docs-json post /api/entities/merge
openapi: 3.0.0
info:
  title: MentionLab Public API v0.3.4-rc
  description: ''
  version: 0.3.4-rc
  contact: {}
servers:
  - url: https://api.mentionlab.io
security: []
tags: []
paths:
  /api/entities/merge:
    post:
      tags:
        - Entities
      summary: Merge entities into a target
      description: >-
        Merges the source entities into the target so they report under it in
        analytics; the merge can be reversed via the unmerge endpoint, though
        conflicting alias variants dropped during the merge are not restored.
      operationId: EntitiesRefController_merge
      parameters:
        - name: x-project-id
          in: header
          description: Project ID to specify the project context
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MergeEntitiesDto'
      responses:
        '204':
          description: ''
        '400':
          description: >-
            The request failed validation — the body, query or path parameters
            are malformed or out of range.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: The request is missing valid authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: >-
            The authenticated principal lacks the required permission, or access
            to the requested organisation/project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
components:
  schemas:
    MergeEntitiesDto:
      type: object
      properties:
        targetId:
          type: string
          description: The entity ID to merge into (target).
          example: 3f29c1a4-1b2c-4e7d-9a8b-0c1d2e3f4a5b
        sourceIds:
          description: >-
            Entity IDs to merge into the target (sources). The target id is
            ignored if present, and duplicates are collapsed.
          example:
            - a1b2c3d4-e5f6-4789-90ab-cdef12345678
            - b2c3d4e5-f6a7-4890-81bc-def234567890
          type: array
          items:
            type: string
      required:
        - targetId
        - sourceIds
    ApiErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code of the error.
          example: 400
        message:
          type: string
          description: >-
            Human-readable description of the error. Validation failures return
            an array of per-field validation errors instead of a single string.
          example: Validation failed
        error:
          type: string
          description: Short name of the HTTP error.
          example: Bad Request
      required:
        - statusCode

````