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

# QS Check EICR JSON Report

> Upload an Electrical Installation Condition Report (EICR) in JSON format to perform automated Qualified Supervisor (QS) audit validation.

### What is validated
- **Outcome Consistency:** Checks for conflicts between the overall report outcome (Satisfactory / Unsatisfactory) and observation codes (C1, C2, C3, FI).
- **Calculations & Electrical Sanity:** Verifies measured Zs against maximum permitted Zs, R1+R2 continuity against Zs - Zdb, and RCD disconnection trip times.
- **Standards & Equipment:** Confirms OCPD product standards (e.g. BS EN numbers) and overcurrent device compliance.
- **Date Sanity:** Validates chronological dates across inspection start, end, testing dates, and re-inspection intervals.
- **Severity Breakdown:** Groups findings by severity levels: `STOP`, `ERROR`, `WARN`, and `VERIFY`.

### Supported files
- **Formats:** `.json`
- **Max file size:** 10 MB
- **Content type:** `multipart/form-data` under the `file` field




## OpenAPI

````yaml /api/api-reference/validate-report.yml post /qs-check-json
openapi: 3.0.3
info:
  title: Field Sight API
  version: 1.0.0
  description: Field Sight electrical board analysis API.
servers:
  - url: https://api.novumlogictechnologies.com
security:
  - ApiKeyAuth: []
paths:
  /qs-check-json:
    post:
      tags:
        - QS Validation
      summary: QS Check EICR JSON Report
      description: >
        Upload an Electrical Installation Condition Report (EICR) in JSON format
        to perform automated Qualified Supervisor (QS) audit validation.


        ### What is validated

        - **Outcome Consistency:** Checks for conflicts between the overall
        report outcome (Satisfactory / Unsatisfactory) and observation codes
        (C1, C2, C3, FI).

        - **Calculations & Electrical Sanity:** Verifies measured Zs against
        maximum permitted Zs, R1+R2 continuity against Zs - Zdb, and RCD
        disconnection trip times.

        - **Standards & Equipment:** Confirms OCPD product standards (e.g. BS EN
        numbers) and overcurrent device compliance.

        - **Date Sanity:** Validates chronological dates across inspection
        start, end, testing dates, and re-inspection intervals.

        - **Severity Breakdown:** Groups findings by severity levels: `STOP`,
        `ERROR`, `WARN`, and `VERIFY`.


        ### Supported files

        - **Formats:** `.json`

        - **Max file size:** 10 MB

        - **Content type:** `multipart/form-data` under the `file` field
      operationId: qsCheckJson
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: The EICR JSON report file to validate (.json).
      responses:
        '200':
          description: QS report validation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QsCheckJsonResponse'
              example:
                id: c8ab0c1e-69bf-4408-b323-7c1469a404ff
                source: api
                tokens_charged: 1
                status: completed
                created_at: '2026-11-11T12:32:19.616153Z'
                input:
                  endpoint: /qs-check-json
                  image_path: >-
                    901b68da-49c0-9f65-fee163f9bcb2/documents/EICR_100301_with_errors.json
                  service_name: QS Check JSON Report
                output:
                  file: EICR_100301_with_errors.json
                  report_ref: EICR100301
                  overall_outcome: SATISFACTORY
                  edition_profile: A4_2026
                  main_qs_stops: >-
                    Main QS stops: outcome.overall / observations.c1_c2 /
                    observations.c3_fi – SATISFACTORY; codes ['C2', 'C3']
                  counts:
                    STOP: 2
                    ERROR: 4
                    WARN: 0
                    VERIFY: 11
                  findings:
                    - rule: X_OUTCOME_VS_OBSERVATIONS
                      action: Outcome inconsistent with observations
                      current: SATISFACTORY; codes ['C2', 'C3']
                      suggested: UNSATISFACTORY
                      severity: STOP
                      json_path: >-
                        outcome.overall / observations.c1_c2 /
                        observations.c3_fi
                      description: >-
                        The overall assessment on Page 1 must follow the
                        observation codes on Page 2. Under Amendment 4, any C1
                        or C2 makes the report UNSATISFACTORY.
        '400':
          description: Bad request (missing multipart file or empty JSON file).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: EMPTY_FILE
                error: uploaded JSON file is empty
        '401':
          description: Missing, invalid, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: UNAUTHORIZED
                error: API key not found or no longer valid
        '402':
          description: No active subscription or token balance exhausted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: TOKENS_EXHAUSTED
                error: Available usage was just used up.
        '413':
          description: File size exceeds the 10MB limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: FILE_TOO_LARGE
                error: file size exceeds 10MB limit
        '415':
          description: Unsupported media type or file content is not valid JSON.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: INVALID_FILE_CONTENT
                error: file content is not valid JSON
        '422':
          description: Unprocessable entity (QS verification model error).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: UNPROCESSABLE_ENTITY
                error: Unprocessable entity
        '429':
          description: Too many requests in progress.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: TOO_MANY_PENDING_REQUESTS
                error: Too many requests in progress. Please wait a moment and retry.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: INTERNAL_ERROR
                error: Internal server error
components:
  schemas:
    QsCheckJsonResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        source:
          type: string
          example: api
        tokens_charged:
          type: integer
          example: 1
        status:
          type: string
          example: completed
        created_at:
          type: string
          format: date-time
        input:
          type: object
          properties:
            endpoint:
              type: string
            image_path:
              type: string
            service_name:
              type: string
        output:
          $ref: '#/components/schemas/QsCheckJsonOutput'
    Error:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: string
          description: Standardized error code identifier.
          example: UNAUTHORIZED
        error:
          type: string
          description: Human-readable error description.
          example: API key not found or no longer valid
    QsCheckJsonOutput:
      type: object
      properties:
        file:
          type: string
          description: Original filename of the validated JSON file.
        report_ref:
          type: string
          description: Reference identifier for the EICR report.
        overall_outcome:
          type: string
          description: Declared overall outcome (e.g., SATISFACTORY or UNSATISFACTORY).
        edition_profile:
          type: string
          description: Wiring regulations standard or amendment version evaluated against.
        main_qs_stops:
          type: string
          description: >-
            Summary text highlighting critical stop issues, or "Main QS stops:
            none".
        counts:
          type: object
          description: Aggregate count of findings per severity tier.
          properties:
            STOP:
              type: integer
            WARN:
              type: integer
            ERROR:
              type: integer
            VERIFY:
              type: integer
        findings:
          type: array
          description: >-
            Detailed list of audit discrepancies, warnings, and validation
            failures.
          items:
            $ref: '#/components/schemas/QsFinding'
    QsFinding:
      type: object
      properties:
        rule:
          type: string
          description: Unique machine-readable rule identifier.
          example: X_OUTCOME_VS_OBSERVATIONS
        action:
          type: string
          description: Required corrective action or summary label.
          example: Outcome inconsistent with observations
        current:
          type: string
          description: Current recorded value in the input report.
          example: SATISFACTORY; codes ['C2', 'C3']
        suggested:
          type: string
          description: Recommended or expected valid value.
          example: UNSATISFACTORY
        severity:
          type: string
          enum:
            - STOP
            - ERROR
            - WARN
            - VERIFY
          description: Finding severity level.
          example: STOP
        json_path:
          type: string
          description: Key path(s) within the EICR JSON where the issue was identified.
          example: outcome.overall / observations.c1_c2
        description:
          type: string
          description: >-
            Comprehensive explanation of the regulation rule and reason for
            failure.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Field Sight API key.

````