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

# Upload a material property dataset

> Upload a parquet or CSV file as a material property dataset.

The file must contain at least the columns declared in ``columns``. All
values are coerced to Float64; non-parseable cells are stored as NaN. The
raw file is preserved in storage alongside the processed parquet.

The ``columns`` field must be a JSON-encoded array, e.g.::

    [
        {"name": "c_e", "unit": "mol/L"},
        {"name": "kappa", "unit": "S/m"},
        {"name": "diffusivity", "unit": "m^2/s"}
    ]



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /material_property_datasets
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /material_property_datasets:
    post:
      tags:
        - Material Property Datasets
      summary: Upload a material property dataset
      description: >-
        Upload a parquet or CSV file as a material property dataset.


        The file must contain at least the columns declared in ``columns``. All

        values are coerced to Float64; non-parseable cells are stored as NaN.
        The

        raw file is preserved in storage alongside the processed parquet.


        The ``columns`` field must be a JSON-encoded array, e.g.::

            [
                {"name": "c_e", "unit": "mol/L"},
                {"name": "kappa", "unit": "S/m"},
                {"name": "diffusivity", "unit": "m^2/s"}
            ]
      operationId: create_material_property_dataset_material_property_datasets_post
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_create_material_property_dataset_material_property_datasets_post
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaterialPropertyDataset'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_create_material_property_dataset_material_property_datasets_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
        material_id:
          type: string
          title: Material Id
        project_id:
          type: string
          title: Project Id
        name:
          type: string
          title: Name
          description: User-provided dataset name
        columns:
          type: string
          title: Columns
          description: 'JSON array of column specs: [{"name": "c_e", "unit": "mol/L"}, ...]'
        no_header:
          type: boolean
          title: No Header
          description: >-
            Set to true when the CSV has no header row. Each column spec must
            include source_column_index to identify its position in the file.
          default: false
      type: object
      required:
        - file
        - material_id
        - project_id
        - name
        - columns
      title: Body_create_material_property_dataset_material_property_datasets_post
    MaterialPropertyDataset:
      properties:
        material_id:
          type: string
          title: Material Id
          description: ID of the parent material
        project_id:
          type: string
          title: Project Id
          description: ID of the project this property is scoped to
        name:
          type: string
          title: Name
          description: User-provided dataset name, e.g. 'Electrolyte transport'
        columns:
          items:
            $ref: '#/components/schemas/ColumnSpec'
          type: array
          title: Columns
          description: All columns in the dataset with their units.
        id:
          type: string
          title: Id
          description: Unique identifier
        organization_id:
          type: string
          title: Organization Id
          description: Organization that owns this record
        storage_path:
          type: string
          title: Storage Path
          description: >-
            Path to the processed parquet file in the material-property-datasets
            bucket.
        original_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Original Path
          description: >-
            Path to the raw original file in the material-property-datasets
            bucket. NULL only for records created before this field was
            introduced.
        data_version:
          type: integer
          title: Data Version
          description: >-
            Increments on every data-changing operation (file replacement or
            column re-processing). Downstream code can store this alongside
            computed results and compare against the current value to detect
            staleness.
        nan_counts:
          anyOf:
            - additionalProperties:
                type: integer
              type: object
            - type: 'null'
          title: Nan Counts
          description: >-
            Number of NaN/null values per column, keyed by display name.
            Computed at upload time. ``None`` for records uploaded before this
            field was introduced.
        no_header:
          type: boolean
          title: No Header
          description: >-
            True when the uploaded CSV had no header row. Column positions are
            mapped via ``source_column_index`` on each column spec.
          default: false
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: User ID of the uploader
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Upload timestamp
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Last update timestamp
      type: object
      required:
        - material_id
        - project_id
        - name
        - columns
        - id
        - organization_id
        - storage_path
        - data_version
        - created_at
        - updated_at
      title: MaterialPropertyDataset
      description: Material property dataset record as returned by the API.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ColumnSpec:
      properties:
        name:
          type: string
          title: Name
          description: Display name stored in the processed parquet
        unit:
          type: string
          title: Unit
          description: >-
            Physical unit, e.g. 'mol.L-1' or 'S.m-1'. Empty string for unitless
            quantities.
          default: ''
        source_column_index:
          type: integer
          title: Source Column Index
          description: >-
            0-based column position in the uploaded file. The column at this
            position is selected and stored under ``name``. Required for all
            uploads regardless of whether the file has a header row.
      type: object
      required:
        - name
        - source_column_index
      title: ColumnSpec
      description: One column in a material property dataset, with its unit and role.
    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

````