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

# Inspect a spreadsheet before importing it

> Reads the file and returns its headers, the first rows and a suggested `mapping` of field keys to headers
(null where no header matched). Nothing is stored.



## OpenAPI

````yaml post /v1/import/files/inspect
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/import/files/inspect:
    post:
      tags:
        - ImportFile
      summary: Inspect a spreadsheet before importing it
      description: >-
        Reads the file and returns its headers, the first rows and a suggested
        `mapping` of field keys to headers

        (null where no header matched). Nothing is stored.
      operationId: import.files.inspect
      parameters:
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ImportFileInspectRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    type: object
                    properties:
                      type:
                        type: string
                      file_name:
                        type: string
                      row_count:
                        type: integer
                      headers:
                        type: array
                        items: {}
                      sample_rows:
                        type: array
                        items: {}
                      mapping:
                        type: object
                        additionalProperties:
                          type:
                            - string
                            - 'null'
                    required:
                      - type
                      - file_name
                      - row_count
                      - headers
                      - sample_rows
                      - mapping
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
        '428':
          description: >-
            Mandatory setup is incomplete. Finish the setup wizard first;
            `data.next_step` names the step to continue with.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    examples:
                      - false
                  error_code:
                    type: string
                    enum:
                      - SETUP_REQUIRED
                    examples:
                      - SETUP_REQUIRED
                  message:
                    type: string
                    examples:
                      - Complete the required setup steps to continue.
                  data:
                    type: object
                    properties:
                      next_step:
                        type:
                          - string
                          - 'null'
                        examples:
                          - clinic_info
                    required:
                      - next_step
                required:
                  - success
                  - error_code
                  - message
                  - data
components:
  schemas:
    ImportFileInspectRequest:
      type: object
      properties:
        type:
          type: string
          description: >-
            The record type the file holds, from the spreadsheet import types
            (for example product).
          enum:
            - product
            - treatment
            - invoice
        file:
          type: string
          format: binary
          contentMediaType: application/octet-stream
          description: >-
            The spreadsheet: an xlsx, xls or csv file of up to 2 MB, 5,000 rows
            and 50 columns. The first sheet with data is read; its header is the
            row among the first ten that names the most fields, so a title row
            above it is skipped.
      required:
        - type
        - file
      title: ImportFileInspectRequest
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.flextell.ai/oauth/authorize
          tokenUrl: https://app.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

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