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

# Update a failure group

> Updates a group's authored fields. `fingerprint`, when present, replaces the stored one; omit it to keep it. Latest write wins.



## OpenAPI

````yaml /api-reference/openapi.generated.json patch /api/failure-groups/{id}
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}:
    patch:
      tags:
        - Failure Groups
      summary: Update a failure group
      description: >-
        Updates a group's authored fields. `fingerprint`, when present, replaces
        the stored one; omit it to keep it. Latest write wins.
      operationId: updateFailureGroup
      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/PatchFailureGroupRequest'
      responses:
        '200':
          description: The updated 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:
    PatchFailureGroupRequest:
      type: object
      properties:
        label:
          type: string
          minLength: 1
        type:
          type: string
          enum:
            - app
            - test
        status:
          type: string
          enum:
            - open
            - resolved
        diagnosis:
          type: string
        recommendation:
          type: string
        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
          description: >-
            Present → replaces the stored fingerprint wholesale; omit to keep
            it.
        matcher:
          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
          description: >-
            Present → replaces the stored matcher wholesale (null clears it);
            omit to keep it. Re-submitting an identical source + description is
            a no-op (no revision).
        source_run_id:
          type: integer
          nullable: true
    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

````