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

# Merge a failure group into another

> Moves this group's members into the target, unions fingerprints, and deletes this group. Returns the target.



## OpenAPI

````yaml /api-reference/openapi.generated.json post /api/failure-groups/{id}/merge
openapi: 3.1.0
info:
  title: Empirical API
  version: 1.0.0
  description: Programmatic access to Empirical test runs, snoozes, and more.
  contact:
    name: Empirical
    url: https://empirical.run
servers:
  - url: https://api.empirical.run
security:
  - Bearer: []
tags:
  - name: Test Runs
    description: Trigger, list, and inspect end-to-end test runs.
  - name: Test Cases
    description: >-
      Browse the Playwright test cases synced from a project's repository and
      manage their tags.
  - name: Environments
    description: >-
      Named deployment targets (slug + Playwright project filters) a project's
      tests run against.
  - name: Snoozes
    description: Temporarily suppress known test failures for specific Playwright tests.
  - name: Analytics
    description: Aggregated test-run, test-count and test-case analytics for a project.
  - name: Resources
    description: >-
      Project file resources — uploads stored in R2 and external link-type files
      (e.g. Google Sheets).
  - name: Failure Groups
    description: >-
      Durable, cross-run identities for failure modes, carrying the latest
      triage diagnosis.
  - name: Badges
    description: Public README status badge images (SVG) for project environments.
paths:
  /api/failure-groups/{id}/merge:
    post:
      tags:
        - Failure Groups
      summary: Merge a failure group into another
      description: >-
        Moves this group's members into the target, unions fingerprints, and
        deletes this group. Returns the target.
      operationId: mergeFailureGroup
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Failure group ID.
          required: true
          description: Failure group ID.
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MergeFailureGroupRequest'
      responses:
        '200':
          description: The target failure group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FailureGroupResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    MergeFailureGroupRequest:
      type: object
      properties:
        into_group_id:
          type: string
          minLength: 1
          description: Target group id; this group merges into it.
      required:
        - into_group_id
    FailureGroupResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            failure_group:
              $ref: '#/components/schemas/FailureGroup'
          required:
            - failure_group
          description: Response payload.
      required:
        - data
    ErrorResponse:
      type: object
      properties:
        data:
          nullable: true
          description: Always null for error responses.
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message.
          required:
            - message
          description: Error details.
      required:
        - data
        - error
    FailureGroup:
      type: object
      properties:
        id:
          type: string
        project_id:
          type: integer
        label:
          type: string
        type:
          type: string
          enum:
            - app
            - test
            - unknown
        status:
          type: string
          enum:
            - open
            - resolved
        diagnosis:
          type: string
          nullable: true
        recommendation:
          type: string
          nullable: true
        fingerprint:
          $ref: '#/components/schemas/Fingerprint'
        matcher:
          $ref: '#/components/schemas/FailureGroupMatcher'
        resolved_at:
          type: string
          nullable: true
        first_seen_at:
          type: string
        last_seen_at:
          type: string
        last_test_run_id:
          type: integer
          nullable: true
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - project_id
        - label
        - type
        - status
        - diagnosis
        - recommendation
        - fingerprint
        - matcher
        - resolved_at
        - first_seen_at
        - last_seen_at
        - last_test_run_id
        - created_at
        - updated_at
    Fingerprint:
      type: object
      nullable: true
      properties:
        signals:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
              value:
                type: string
              match:
                type: string
                enum:
                  - exact
                  - contains
                  - glob
                  - regex
              weight:
                type: number
              source:
                type: string
                enum:
                  - machine
                  - agent
                  - human
              data:
                type: object
                additionalProperties:
                  nullable: true
            required:
              - kind
              - value
              - source
      required:
        - signals
    FailureGroupMatcher:
      type: object
      nullable: true
      properties:
        source:
          type: string
          minLength: 1
          maxLength: 32768
          description: >-
            Plain-JS async function source: `async ({ testRun, testCase,
            traceUtils }) => boolean`.
        description:
          type: string
          minLength: 1
          maxLength: 1024
          description: >-
            Human-readable summary of what the matcher matches and why;
            re-articulated on every edit.
        contract_version:
          type: integer
          minimum: 1
          default: 1
          description: Input-contract version the source was written against.
      required:
        - source
        - description
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````