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

# Read a sample file's columns

> The shape of a sample file: its column names, first rows, row count, the Excel columns holding real dates, and where the header row is. Send the sample as CSV text (csv), or name a file Statisfy already received (import_id) to read its exact bytes, Excel included. detect finds a header row that isn't row 1; header_layout sets it. Writes nothing.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/integrations/imports/sample
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/integrations/imports/sample:
    post:
      tags:
        - integrations
      summary: Read a sample file's columns
      description: >-
        The shape of a sample file: its column names, first rows, row count, the
        Excel columns holding real dates, and where the header row is. Send the
        sample as CSV text (csv), or name a file Statisfy already received
        (import_id) to read its exact bytes, Excel included. detect finds a
        header row that isn't row 1; header_layout sets it. Writes nothing.
      operationId: integrations_read_sample
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                csv:
                  anyOf:
                    - maxLength: 1048576
                      minLength: 1
                      type: string
                    - type: 'null'
                  default: null
                  description: >-
                    The sample as CSV text: the header row and some rows
                    (convert an Excel sheet first). Only its first 512 KB is
                    read
                  title: Csv
                detect:
                  default: false
                  description: Find the header row when it isn't row 1
                  title: Detect
                  type: boolean
                header_layout:
                  anyOf:
                    - $ref: '#/components/schemas/HeaderLayout'
                    - type: 'null'
                  default: null
                  description: Where the column names are; wins over detect
                import_id:
                  anyOf:
                    - maxLength: 64
                      minLength: 1
                      type: string
                    - type: 'null'
                  default: null
                  description: >-
                    Or a file Statisfy received or was given
                    (integrations.list_imports): its exact bytes
                  title: Import Id
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportSample'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    HeaderLayout:
      description: |-
        Where the column names are in a file.

        Row numbers are 1-based raw rows of the file. ``HeaderLayout()`` is
        today's layout: the names are in row 1 and there is no group row.
      properties:
        group_row:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          default: null
          description: 1-based raw row of the group names above the column names, or None
          title: Group Row
        header_row:
          default: 1
          description: 1-based raw row of the column names
          maximum: 20
          minimum: 1
          title: Header Row
          type: integer
      title: HeaderLayout
      type: object
    ImportSample:
      properties:
        columns:
          description: The column names, in file order
          items:
            type: string
          title: Columns
          type: array
        detected_reason:
          anyOf:
            - type: string
            - type: 'null'
          description: Why detection chose a layout other than row 1, when it did
          title: Detected Reason
        groups:
          description: Each column's group name, from a group row above the names
          items:
            anyOf:
              - type: string
              - type: 'null'
          title: Groups
          type: array
        header_layout:
          $ref: '#/components/schemas/HeaderRows'
          description: Where the column names were read from
        row_count:
          description: >-
            Data rows read, empty rows aside (of the file's start, for a long
            CSV)
          title: Row Count
          type: integer
        rows:
          description: The first data rows, as text
          items:
            additionalProperties: true
            type: object
          title: Rows
          type: array
        top_rows:
          description: The file's first rows as text, to place the header row by
          items:
            items:
              type: string
            type: array
          title: Top Rows
          type: array
        typed_date_columns:
          description: 'Excel columns that hold real dates: they need no date_format'
          items:
            type: string
          title: Typed Date Columns
          type: array
      required:
        - columns
        - rows
        - row_count
        - typed_date_columns
        - header_layout
        - detected_reason
        - top_rows
        - groups
      title: ImportSample
      type: object
    HeaderRows:
      description: >-
        Where a file's column names are (a request takes the same fields as
        ``header_layout``).
      properties:
        group_row:
          anyOf:
            - type: integer
            - type: 'null'
          description: 1-based row of group names above them, or null
          title: Group Row
        header_row:
          description: 1-based row of the column names
          title: Header Row
          type: integer
      required:
        - header_row
        - group_row
      title: HeaderRows
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

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