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

# Upload dataset from JSON, JSONL, CSV, or PyArrow



## OpenAPI

````yaml post /v1/datasets/upload
openapi: 3.1.0
info:
  title: Arize-Phoenix REST API
  description: Schema for Arize-Phoenix REST API
  version: '1.0'
servers: []
security: []
paths:
  /v1/datasets/upload:
    post:
      tags:
        - datasets
      summary: Upload dataset from JSON, JSONL, CSV, or PyArrow
      operationId: uploadDataset
      parameters:
        - name: sync
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              If true, fulfill request synchronously and return JSON containing
              dataset_id.
            default: false
            title: Sync
          description: >-
            If true, fulfill request synchronously and return JSON containing
            dataset_id.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - inputs
              properties:
                action:
                  type: string
                  enum:
                    - create
                    - append
                    - update
                name:
                  type: string
                description:
                  type: string
                inputs:
                  type: array
                  items:
                    type: object
                outputs:
                  type: array
                  items:
                    type: object
                metadata:
                  type: array
                  items:
                    type: object
                splits:
                  type: array
                  items:
                    oneOf:
                      - type: string
                      - items:
                          type: string
                        type: array
                      - type: 'null'
                  description: 'Split per example: string, string array, or null'
                span_ids:
                  type: array
                  items:
                    oneOf:
                      - type: string
                      - type: 'null'
                  description: Span IDs to link examples back to spans
                example_ids:
                  type: array
                  items:
                    oneOf:
                      - type: string
                      - type: 'null'
                  description: >-
                    Optional example ID per example. If provided, it is used as
                    the example's stable public ID.
          multipart/form-data:
            schema:
              type: object
              required:
                - name
                - input_keys[]
                - output_keys[]
                - file
              properties:
                action:
                  type: string
                  enum:
                    - create
                    - append
                    - update
                name:
                  type: string
                description:
                  type: string
                input_keys[]:
                  type: array
                  items:
                    type: string
                  uniqueItems: true
                output_keys[]:
                  type: array
                  items:
                    type: string
                  uniqueItems: true
                metadata_keys[]:
                  type: array
                  items:
                    type: string
                  uniqueItems: true
                split_keys[]:
                  type: array
                  items:
                    type: string
                  uniqueItems: true
                  description: >-
                    Deprecated: use split_key instead. Column names for
                    auto-assigning examples to splits
                split_key:
                  type: string
                  description: >-
                    Single column name containing split names (plain string or
                    JSON list) per row
                flatten_keys[]:
                  type: array
                  items:
                    type: string
                  uniqueItems: true
                  description: >-
                    Column names whose object values should be flattened into
                    their selected bucket
                span_id_key:
                  type: string
                  description: Column name for span IDs to link examples back to spans
                example_id_key:
                  type: string
                  description: >-
                    Column name containing stable IDs for examples. When
                    provided, examples with matching IDs are updated in place
                    when their content changes.
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/UploadDatasetResponseBody'
                  - type: 'null'
                title: Response Uploaddataset
        '403':
          description: Forbidden
          content:
            text/plain:
              schema:
                type: string
        '409':
          content:
            text/plain:
              schema:
                type: string
          description: Dataset with the given name already exists (action=create).
        '422':
          content:
            text/plain:
              schema:
                type: string
          description: Invalid request body
components:
  schemas:
    UploadDatasetResponseBody:
      properties:
        data:
          $ref: '#/components/schemas/UploadDatasetData'
      type: object
      required:
        - data
      title: UploadDatasetResponseBody
    UploadDatasetData:
      properties:
        dataset_id:
          type: string
          title: Dataset Id
        version_id:
          type: string
          title: Version Id
        num_created_examples:
          type: integer
          title: Num Created Examples
        num_updated_examples:
          type: integer
          title: Num Updated Examples
        num_deleted_examples:
          type: integer
          title: Num Deleted Examples
      type: object
      required:
        - dataset_id
        - version_id
        - num_created_examples
        - num_updated_examples
        - num_deleted_examples
      title: UploadDatasetData

````