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

# Preview Dataset Upload

> Inspect an upload with the same parser and column rules used by warehousing.



## OpenAPI

````yaml https://api.truestate.io/openapi.json post /datasets/upload-preview/
openapi: 3.1.0
info:
  title: TrueState Backend API
  summary: >-
    TrueState is an AI platform for business users to create high-impact AI
    solutions.
  description: >

    This **[TrueState](https://www.truestate.io/)** backend API allows our
    clients to automate and more powerfully retrieve and modify data from the
    TrueState platform.


    Example use cases include:


    - Accessing embeddings for a dataset.

    - Automating the process of dataset creation and model retraining as your
    data changes.

    - Much more.


    Our backend is built using the [FastAPI](https://fastapi.tiangolo.com/)
    framework in python

    using [Auth0](https://auth0.com/) and [Client API
    Keys](https://www.truestate.io/dawn/docs) for internal an external
    authentication, respectively.

    Our backend is designed to be secure, scalable, easy to use and well
    documented _(each router with its own linked docs page)_.

    Clients can only access data from their own organisation, as setup in Auth0
    our the Client API Keys. See how
    **[here](https://www.truestate.io/dawn/docs)**.


    **PS**: You can view this API documentation in either
    **[Swagger](swagger/docs)** or **[Redoc](redoc/)**, but only the swagger
    lets you test calls.
  contact:
    name: True State Support
    url: https://www.truestate.io/dawn/docs
    email: support@truestate.io
  license:
    name: Private
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 0.13.95
servers: []
security: []
paths:
  /datasets/upload-preview/:
    post:
      tags:
        - datasets
      summary: Preview Dataset Upload
      description: >-
        Inspect an upload with the same parser and column rules used by
        warehousing.
      operationId: preview_dataset_upload_datasets_upload_preview__post
      parameters:
        - name: Api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Api-Key
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_preview_dataset_upload_datasets_upload_preview__post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadPreviewResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Body_preview_dataset_upload_datasets_upload_preview__post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
        delimiter:
          anyOf:
            - type: string
            - type: 'null'
          title: Delimiter
        encoding:
          anyOf:
            - type: string
            - type: 'null'
          title: Encoding
        header_row:
          type: integer
          title: Header Row
          default: 1
        footer_rows:
          type: integer
          title: Footer Rows
          default: 0
      type: object
      required:
        - file
      title: Body_preview_dataset_upload_datasets_upload_preview__post
    UploadPreviewResponse:
      properties:
        file_name:
          type: string
          title: File Name
        file_type:
          $ref: '#/components/schemas/FileType'
        encoding:
          anyOf:
            - type: string
            - type: 'null'
          title: Encoding
        delimiter:
          anyOf:
            - type: string
            - type: 'null'
          title: Delimiter
        delimiter_label:
          type: string
          title: Delimiter Label
        row_count:
          type: integer
          title: Row Count
        column_count:
          type: integer
          title: Column Count
        columns:
          items:
            $ref: '#/components/schemas/UploadPreviewColumn'
          type: array
          title: Columns
        preview_rows:
          items:
            items: {}
            type: array
          type: array
          title: Preview Rows
        warnings:
          items:
            type: string
          type: array
          title: Warnings
        errors:
          items:
            type: string
          type: array
          title: Errors
        ready_to_upload:
          type: boolean
          title: Ready To Upload
        header_row:
          type: integer
          title: Header Row
        footer_rows:
          type: integer
          title: Footer Rows
      type: object
      required:
        - file_name
        - file_type
        - encoding
        - delimiter
        - delimiter_label
        - row_count
        - column_count
        - columns
        - preview_rows
        - warnings
        - errors
        - ready_to_upload
        - header_row
        - footer_rows
      title: UploadPreviewResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FileType:
      type: string
      enum:
        - Csv
        - Parquet
        - Excel
      title: FileType
    UploadPreviewColumn:
      properties:
        original_name:
          type: string
          title: Original Name
        normalized_name:
          type: string
          title: Normalized Name
        inferred_type:
          type: string
          title: Inferred Type
        status:
          type: string
          title: Status
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
      type: object
      required:
        - original_name
        - normalized_name
        - inferred_type
        - status
      title: UploadPreviewColumn
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````