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

# Read a rule spreadsheet without storing anything

> Read a workbook and report what it says. Nothing is stored.

This step exists because column types are *inferred*. A column of
ages read as text compiles, validates, and then never matches, so
the reading is shown back — every column, including the ones that
were skipped — while correcting it is still an edit to a
spreadsheet rather than a version someone has to reject.

The response also carries the compiled graph and any rows that can
never fire, so the whole picture is available before the first
write.

**Required roles**: `author` or `workspace_admin`



## OpenAPI

````yaml post /api/decisions/{workspace}/spreadsheet/parse
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/decisions/{workspace}/spreadsheet/parse:
    post:
      tags:
        - Decisions
      summary: Read a rule spreadsheet without storing anything
      description: |-
        Read a workbook and report what it says. Nothing is stored.

        This step exists because column types are *inferred*. A column of
        ages read as text compiles, validates, and then never matches, so
        the reading is shown back — every column, including the ones that
        were skipped — while correcting it is still an edit to a
        spreadsheet rather than a version someone has to reject.

        The response also carries the compiled graph and any rows that can
        never fire, so the whole picture is available before the first
        write.

        **Required roles**: `author` or `workspace_admin`
      operationId: parse_rule_spreadsheet_api_decisions__workspace__spreadsheet_parse_post
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
            maxLength: 64
            pattern: ^[a-z0-9][a-z0-9-]{0,63}$
            description: Workspace slug.
            title: Workspace
          description: Workspace slug.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_parse_rule_spreadsheet_api_decisions__workspace__spreadsheet_parse_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpreadsheetParseResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Content Too Large
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    Body_parse_rule_spreadsheet_api_decisions__workspace__spreadsheet_parse_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
          description: The `.xlsx` workbook to read.
        hit_policy:
          type: string
          title: Hit Policy
          description: >-
            `first` takes the first matching row and stops — row order matters.
            `collect` gathers every matching row.
          default: first
        sheet:
          anyOf:
            - type: string
            - type: 'null'
          title: Sheet
          description: Sheet to read. Defaults to `Rules`, else the first sheet.
      type: object
      required:
        - file
      title: >-
        Body_parse_rule_spreadsheet_api_decisions__workspace__spreadsheet_parse_post
    SpreadsheetParseResponse:
      properties:
        sheet:
          type: string
          title: Sheet
          description: The sheet that was read.
        rows_read:
          type: integer
          title: Rows Read
          description: Non-blank rows below the header.
        spec:
          additionalProperties: true
          type: object
          title: Spec
          description: >-
            The rule table as columns and rows. Submit this back to
            `/versions/from-spec` after any correction, or re-upload the
            corrected workbook.
        columns:
          items:
            $ref: '#/components/schemas/SpreadsheetColumnReport'
          type: array
          title: Columns
          description: >-
            One entry per spreadsheet column, including the ones that were not
            read — a header typo is never silent.
        problems:
          items:
            $ref: '#/components/schemas/SpreadsheetProblem'
          type: array
          title: Problems
          description: Cells that could not be translated. Empty means a clean read.
        shadowed:
          items:
            $ref: '#/components/schemas/ShadowedRule'
          type: array
          title: Shadowed
          description: >-
            Rows an earlier row already covers, so they can never fire under the
            `first` hit policy.
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
          description: >-
            The compiled JDM, when the spec compiled. Null when it did not — see
            `problems`.
        compile_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Compile Error
          description: Why the rows could not be compiled, if they could not.
      type: object
      required:
        - sheet
        - rows_read
        - spec
      title: SpreadsheetParseResponse
      description: The reading of an uploaded workbook. Nothing has been stored.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    SpreadsheetColumnReport:
      properties:
        header:
          type: string
          title: Header
          description: The header cell, exactly as written.
        side:
          type: string
          title: Side
          description: >-
            `when` for a condition column, `then` for a result, `note` for the
            row annotation, `ignored` for a column that was not read.
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
          description: The rule field this column maps to.
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: '`string`, `number` or `boolean`.'
        type_declared:
          type: boolean
          title: Type Declared
          description: >-
            True when the header declared the type, as in `when:age (number)`.
            False means it was inferred from the cells and is worth checking.
          default: false
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Why the column was ignored, or what was assumed about it.
      type: object
      required:
        - header
        - side
      title: SpreadsheetColumnReport
      description: What the reader made of one spreadsheet column.
    SpreadsheetProblem:
      properties:
        row:
          type: integer
          title: Row
          description: Spreadsheet row number, header included.
        column:
          anyOf:
            - type: string
            - type: 'null'
          title: Column
          description: The column's header.
        detail:
          type: string
          title: Detail
      type: object
      required:
        - row
        - detail
      title: SpreadsheetProblem
      description: A cell that could not be translated, named by where it sits.
    ShadowedRule:
      properties:
        row:
          type: integer
          title: Row
          description: Position in the rule list, from 1.
        shadowed_by:
          type: integer
          title: Shadowed By
        detail:
          type: string
          title: Detail
      type: object
      required:
        - row
        - shadowed_by
        - detail
      title: ShadowedRule
      description: A row that can never fire, because an earlier row covers it.
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.