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

# Upload a CSV file for BI analysis

> Accepts a CSV file, validates the content, parses headers and row count, stores the file in S3, and returns metadata including the first 5 rows as a sample. Separator is auto-detected or can be set explicitly via the 'separator' form field (comma, semicolon, tab, pipe, or auto).



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/bi/upload-csv
openapi: 3.1.0
info:
  title: apowerb API
  description: REST API of the apowerb agentic framework (open-source edition).
  version: 0.1.2
  license:
    name: MIT
    url: https://github.com/apowerb/apowerb/blob/main/LICENSE
servers:
  - url: https://api.example.com
    description: Your apowerb instance
  - url: http://localhost:8000
    description: Local stack
security: []
paths:
  /api/v1/bi/upload-csv:
    post:
      tags:
        - bi-upload
      summary: Upload a CSV file for BI analysis
      description: >-
        Accepts a CSV file, validates the content, parses headers and row count,
        stores the file in S3, and returns metadata including the first 5 rows
        as a sample. Separator is auto-detected or can be set explicitly via the
        'separator' form field (comma, semicolon, tab, pipe, or auto).
      operationId: upload_csv_api_v1_bi_upload_csv_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_csv_api_v1_bi_upload_csv_post'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Upload Csv Api V1 Bi Upload Csv Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Body_upload_csv_api_v1_bi_upload_csv_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
        organization_id:
          type: string
          title: Organization Id
        project_id:
          type: string
          title: Project Id
          default: thaink2
        separator:
          type: string
          title: Separator
          default: auto
      type: object
      required:
        - file
        - organization_id
      title: Body_upload_csv_api_v1_bi_upload_csv_post
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````

## Related topics

- [Import a Google Drive file for BI analysis](/api-reference/bi-upload/import-a-google-drive-file-for-bi-analysis.md)
- [Preview a OneDrive spreadsheet (xlsx/xls/xlsm/ods/csv/tsv)](/api-reference/bi-datasets/preview-a-onedrive-spreadsheet-xlsxxlsxlsmodscsvtsv.md)
- [Upload File](/api-reference/files/upload-file.md)
- [Delete an uploaded dataset](/api-reference/bi-datasets/delete-an-uploaded-dataset.md)
- [Upload Chunk](/api-reference/files/upload-chunk.md)
