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

# Check Patch Compatibility

> Check if a patch is compatible with a target resource.

Evaluates the patch's compatibility constraints against the target
resource's current configuration. Does not apply the patch.

Returns:
    CompatibilityResult with overall verdict and per-constraint details.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json post /projects/{project_id}/patches/{patch_id}/check/{target_resource_id}
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /projects/{project_id}/patches/{patch_id}/check/{target_resource_id}:
    post:
      tags:
        - patches
      summary: Check Patch Compatibility
      description: |-
        Check if a patch is compatible with a target resource.

        Evaluates the patch's compatibility constraints against the target
        resource's current configuration. Does not apply the patch.

        Returns:
            CompatibilityResult with overall verdict and per-constraint details.
      operationId: patches-check_patch_compatibility
      parameters:
        - name: patch_id
          in: path
          required: true
          schema:
            type: string
            title: Patch Id
        - name: target_resource_id
          in: path
          required: true
          schema:
            type: string
            title: Target Resource Id
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            title: Project Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompatibilityResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CompatibilityResult:
      properties:
        compatible:
          type: boolean
          title: Compatible
        failed_constraints:
          items:
            $ref: '#/components/schemas/FailedConstraint'
          type: array
          title: Failed Constraints
          default: []
      type: object
      required:
        - compatible
      title: CompatibilityResult
      description: |-
        Result of a patch compatibility check against a target resource.

        Attributes:
            compatible: Whether all constraints are satisfied.
            failed_constraints: Constraints that did not pass, with reasons.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FailedConstraint:
      properties:
        field:
          type: string
          title: Field
        operator:
          type: string
          title: Operator
        expected:
          title: Expected
        actual:
          anyOf:
            - {}
            - type: 'null'
          title: Actual
        reason:
          type: string
          title: Reason
      type: object
      required:
        - field
        - operator
        - expected
        - reason
      title: FailedConstraint
      description: |-
        A single constraint that failed during compatibility checking.

        Attributes:
            field: Config field name that was checked.
            operator: The comparison operator.
            expected: The constraint's expected value.
            actual: The actual value found in the resource config (None if field missing).
            reason: Human-readable explanation of why it failed.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````