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

# Read the context rows once, from a CSV or Parquet file



## OpenAPI

````yaml /api-reference/openapi.json post /v1/fit-file
openapi: 3.1.0
info:
  title: tabSutra API
  version: '1.0'
  description: >-
    One pretrained model for forecasting, classification, regression and
    recommendation on tables and databases.
servers:
  - url: https://api.tabsutra.com
security:
  - bearerAuth: []
paths:
  /v1/fit-file:
    post:
      summary: Read the context rows once, from a CSV or Parquet file
      operationId: fit_file_v1_fit_file_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_fit_file_v1_fit_file_post'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FitResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_fit_file_v1_fit_file_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
          description: A CSV or Parquet file.
        target:
          type: string
          title: Target
        task:
          type: string
          enum:
            - classification
            - regression
          title: Task
        column_types:
          anyOf:
            - type: string
            - type: 'null'
          title: Column Types
          description: 'JSON, for example {"postcode": "category"}'
        id_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Id Column
        max_context:
          type: integer
          title: Max Context
          default: 0
        embed_dims:
          type: integer
          title: Embed Dims
          default: 8
        target_range:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Range
          description: JSON, for example [0, 1]
        time_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Column
        group_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Group Column
        known_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Known Column
        target_delay_days:
          type: number
          title: Target Delay Days
          default: 0
        group_target:
          anyOf:
            - type: string
            - type: 'null'
          title: Group Target
        group_task:
          anyOf:
            - type: string
              enum:
                - classification
                - regression
            - type: 'null'
          title: Group Task
        group_target_range:
          anyOf:
            - type: string
            - type: 'null'
          title: Group Target Range
          description: JSON, for example [0, 100]
        as_of:
          anyOf:
            - type: string
            - type: 'null'
          title: As Of
          description: A date, or a number as the time column
      type: object
      required:
        - file
        - target
        - task
      title: Body_fit_file_v1_fit_file_post
    FitResponse:
      properties:
        context_id:
          type: string
          title: Context Id
          description: >-
            Pass it to /v1/predict. The same rows and settings always give the
            same id.
        report:
          additionalProperties: true
          type: object
          title: Report
          description: Column types and why, rows used and left out, text columns, timings.
      type: object
      required:
        - context_id
        - report
      title: FitResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as ''Authorization: Bearer <key>''.'

````

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