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

# import Csv Dataset

> The website uses Upload CSV in market search. API and MCP clients can call the same import service directly with authorized credentials. Requires request_id. Private sources stay in workspace-bound storage and never enter the public GitHub catalog. A public upload commits its CSV and catalog atomically in GitHub; index_sync reports separate Firestore metadata mirror status. Optional email_alert is personal opt-in, validated before saving. Upload retries never re-enable a subscription changed later. A setup_failed/setup_unconfirmed email_alert response leaves the CSV saved and directs the user to settings; do not duplicate the upload. No training or paid forecast starts.



## OpenAPI

````yaml /docs/api/openapi.json post /v1/csv-imports
openapi: 3.1.0
info:
  title: Quantura API
  version: 1.0.0
  description: >-
    Search markets and public datasets, download historical observations, create
    forecasts and inspect screener quantiles.
  contact:
    name: Quantura
    url: https://quantura.studio/contact
  license:
    name: Quantura API Terms
    url: https://quantura.studio/terms
servers:
  - url: https://quantura.studio/api
security:
  - bearerAuth: []
  - clerkOAuth:
      - openid
      - profile
      - email
tags:
  - name: Access
  - name: Forecast
  - name: Screener
  - name: Admin Canvas
  - name: CSV library
  - name: Privacy
  - name: Search
  - name: Download
  - name: Scout
paths:
  /v1/csv-imports:
    servers:
      - url: https://quantura.studio/api
    post:
      tags:
        - CSV library
      summary: import Csv Dataset
      description: >-
        The website uses Upload CSV in market search. API and MCP clients can
        call the same import service directly with authorized credentials.
        Requires request_id. Private sources stay in workspace-bound storage and
        never enter the public GitHub catalog. A public upload commits its CSV
        and catalog atomically in GitHub; index_sync reports separate Firestore
        metadata mirror status. Optional email_alert is personal opt-in,
        validated before saving. Upload retries never re-enable a subscription
        changed later. A setup_failed/setup_unconfirmed email_alert response
        leaves the CSV saved and directs the user to settings; do not duplicate
        the upload. No training or paid forecast starts.
      operationId: importCsvDataset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CsvImportInput'
                - required:
                    - request_id
                - if:
                    properties:
                      dataset_kind:
                        const: sagemaker_predictions
                  then:
                    required:
                      - ticker
                    properties:
                      ticker:
                        minLength: 1
      responses:
        '200':
          description: >-
            Saved data, visibility, preview_url and Download URL; identical
            completed retries reuse the result
          content:
            application/json:
              schema:
                type: object
              example:
                data:
                  success: true
                meta:
                  api_version: v1
        '401':
          description: Sign-in required
          content:
            application/json:
              schema:
                type: object
        '403':
          description: Scope, current membership or CSV permission denied
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
        '409':
          description: >-
            Conflicting request ID or an unconfirmed write; do not blindly retry
            with a new ID
          content:
            application/json:
              schema:
                type: object
        '412':
          description: Connect Google and grant drive.file
          content:
            application/json:
              schema:
                type: object
        '413':
          description: Decoded CSV or Sheets export limit exceeded
          content:
            application/json:
              schema:
                type: object
        '422':
          description: CSV, type, mapping, metrics or metadata invalid
          content:
            application/json:
              schema:
                type: object
        '503':
          description: Provider unavailable; source data is retained
          content:
            application/json:
              schema:
                type: object
      security:
        - bearerAuth: []
        - clerkOAuth:
            - openid
            - profile
            - email
components:
  schemas:
    CsvImportInput:
      type: object
      required:
        - dataset_kind
      description: >-
        Provide exactly one of csv_text or content_base64. Source CSV is stored
        without value/column rewrites. Typed imports are limited to one series,
        ISO timestamps and3,000,000 decoded UTF-8 bytes. Predictions and
        observed history cannot be interchanged.
      oneOf:
        - required:
            - csv_text
          not:
            required:
              - content_base64
        - required:
            - content_base64
          not:
            required:
              - csv_text
      properties:
        csv_text:
          type: string
          maxLength: 3000000
        content_base64:
          type: string
          maxLength: 4000000
          contentEncoding: base64
        dataset_kind:
          enum:
            - sagemaker_predictions
            - historical_series
        request_id:
          type: string
          pattern: ^[A-Za-z0-9_-]{16,100}$
          description: >-
            Required when saving. Reuse for retries of the identical upload; an
            uncertain request is never duplicated automatically.
        filename:
          type: string
          maxLength: 240
        name:
          type: string
          maxLength: 120
          description: >-
            Optional API override. If omitted, the server names the dataset from
            its ticker, kind, row count and actual UTF-8 byte size.
        ticker:
          type: string
          maxLength: 12
          description: >-
            Required for new prediction CSV uploads. Used to select the
            underlying stock history in Download. Optional for non-market
            observed time series.
        date_column:
          type: string
          maxLength: 160
        value_column:
          type: string
          maxLength: 160
        metrics:
          $ref: '#/components/schemas/CsvModelMetrics'
        metrics_basis:
          type: string
          maxLength: 240
        email_alert:
          $ref: '#/components/schemas/CsvCloseAlert'
        visibility:
          enum:
            - workspace
            - public
          default: workspace
        workspace_id:
          type: string
          description: >-
            Defaults to the session active Clerk organization, otherwise the
            personal workspace. Current membership and upload permission are
            checked on every request.
        publish_confirmed:
          type: boolean
          description: >-
            Must be true for public publishing. Only the verified primary email
            tamzid257@gmail.com may publish; org admin/paid status alone never
            grants this.
    CsvModelMetrics:
      type: object
      additionalProperties: false
      properties:
        average_wql:
          type: number
          minimum: 0
          description: Supplied Canvas validation metric; zero is accepted.
        mape:
          type: number
          minimum: 0
          description: >-
            Supplied validation ratio. 0.050 means5%. Never inferred from
            prediction values.
        wape:
          type: number
          minimum: 0
          description: >-
            Supplied validation ratio. 0.050 means5%. Never inferred from
            prediction values.
        rmse:
          type: number
          minimum: 0
          description: Supplied Canvas validation metric; zero is accepted.
        mase:
          type: number
          minimum: 0
          description: Supplied Canvas validation metric; zero is accepted.
        mae:
          type: number
          minimum: 0
          description: Supplied Canvas validation metric; zero is accepted.
        smape:
          type: number
          minimum: 0
          maximum: 2
          description: >-
            Supplied validation ratio. 0.050 means5%. Never inferred from
            prediction values.
    CsvCloseAlert:
      type: object
      additionalProperties: false
      required:
        - enabled
        - rules
      properties:
        enabled:
          type: boolean
          description: Explicit personal opt-in; false disables queued conditions.
        rules:
          type: array
          maxItems: 4
          items:
            oneOf:
              - type: object
                additionalProperties: false
                required:
                  - kind
                  - direction
                  - value
                properties:
                  kind:
                    const: price
                  direction:
                    enum:
                      - above
                      - below
                  value:
                    type: number
                    exclusiveMinimum: 0
                    maximum: 1000000000
              - type: object
                additionalProperties: false
                required:
                  - kind
                  - direction
                  - quantile
                properties:
                  kind:
                    const: quantile
                  direction:
                    enum:
                      - above
                      - below
                  quantile:
                    type: string
                    pattern: ^P(?:100|[0-9]{1,2})(?:\.[0-9]{1,6})?$
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Clerk personal API key or legacy Quantura key
    clerkOAuth:
      type: oauth2
      description: >-
        Clerk authorization code with PKCE S256. Pass
        resource=https://quantura.studio on authorization and token requests.
        Paid Pro, enterprise or verified administrator API access is required.
      flows:
        authorizationCode:
          authorizationUrl: https://clerk.quantura.studio/oauth/authorize
          tokenUrl: https://clerk.quantura.studio/oauth/token
          refreshUrl: https://clerk.quantura.studio/oauth/token
          scopes:
            openid: Identify the Quantura account
            profile: Resolve the account profile
            email: Verify account email
            offline_access: Refresh access after expiry

````

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