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

# Update a check

> Update a check by id. Supports three check types based on the fields provided:
- **Rule-based** (default): include a `rule` field with fact conditions. Soundcheck evaluates these automatically.
- **Manual**: set `type: "manual"`. Results are entered by humans via the Soundcheck UI.
- **External**: omit both `rule` and `type`. An external system pushes results via POST /results.




## OpenAPI

````yaml /plugins/soundcheck/openapi.yaml put /checks/{checkId}
openapi: 3.0.0
info:
  title: soundcheck
  version: 0.1.0
  description: API for interacting with Soundcheck.
servers:
  - url: https://backstage.example.com/api/soundcheck
security: []
tags:
  - name: Campaigns
  - name: Certification
  - name: CheckResults
  - name: Checks
  - name: FactCollectors
  - name: Facts
  - name: Tracks
paths:
  /checks/{checkId}:
    put:
      tags:
        - Checks
      summary: Update a check
      description: >
        Update a check by id. Supports three check types based on the fields
        provided:

        - **Rule-based** (default): include a `rule` field with fact conditions.
        Soundcheck evaluates these automatically.

        - **Manual**: set `type: "manual"`. Results are entered by humans via
        the Soundcheck UI.

        - **External**: omit both `rule` and `type`. An external system pushes
        results via POST /results.
      operationId: updateCheck
      parameters:
        - name: checkId
          in: path
          description: The ID of the check
          required: true
          schema:
            type: string
        - name: deleteHistory
          in: query
          description: >-
            When true, also delete historical check results on rule change.
            Current results are always deleted. Defaults to false.
          required: false
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
            default: 'false'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCheckInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: No permission to update check or check not found
          content:
            text/plain:
              schema:
                type: string
components:
  schemas:
    CreateCheckInput:
      description: >
        A check definition. Supports three types based on fields provided:
        rule-based (include rule field), manual (set type to manual), or
        external (omit both rule and type).
      type: object
      properties:
        id:
          type: string
        ownerEntityRef:
          type: string
        name:
          type: string
          minLength: 1
          maxLength: 100
        description:
          type: string
        filter:
          $ref: '#/components/schemas/EntityFilter'
        exclude:
          $ref: '#/components/schemas/EntityFilter'
        rule:
          description: >-
            Fact checker rule (required for rule-based checks, omit for
            manual/external)
          type: object
        applicable:
          description: Applicability condition
          type: object
        type:
          description: >-
            Check type. Set to 'manual' for manual checks, 'default' or omit for
            rule-based checks.
          type: string
          enum:
            - default
            - manual
        warning:
          type: boolean
        passedMessage:
          type: string
          minLength: 1
        failedMessage:
          type: string
          minLength: 1
        notApplicableMessage:
          type: string
          minLength: 1
        pathResolver:
          type: string
        skillEntityRef:
          type: string
      required:
        - id
    CheckResponse:
      type: object
      properties:
        check:
          $ref: '#/components/schemas/Check'
      required:
        - check
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            name:
              type: string
            message:
              type: string
          required:
            - name
            - message
          additionalProperties: true
        request:
          type: object
          properties:
            method:
              type: string
            url:
              type: string
          required:
            - method
            - url
          additionalProperties: false
        response:
          type: object
          properties:
            statusCode:
              type: integer
          required:
            - statusCode
          additionalProperties: false
      required:
        - error
        - response
      additionalProperties: false
    EntityFilter:
      oneOf:
        - type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: array
                items:
                  type: string
        - type: array
          items:
            type: object
            additionalProperties:
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
    Check:
      type: object
      properties:
        id:
          type: string
        ownerEntityRef:
          type: string
        name:
          type: string
          minLength: 1
          maxLength: 100
        description:
          type: string
        filter:
          $ref: '#/components/schemas/EntityFilter'
        exclude:
          $ref: '#/components/schemas/EntityFilter'
        skillEntityRef:
          type: string
      required:
        - id
      additionalProperties: false

````