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

# Datasets

> List and create research datasets linked to lab experiments.

# Datasets API

Datasets are tabular, image, spectral, time-series, or mixed-format data files linked to a lab's experiments. Each dataset has a version history and can be published to HuggingFace via the lab's publish pipeline.

## List Datasets

<ParamField query="labId" type="string" required>
  Convex ID of the lab.
</ParamField>

<CodeGroup>
  ```bash curl theme={null}
  curl "https://www.hubify.com/api/v1/datasets?labId=$LAB_ID" \
    -H "Authorization: Bearer $HUBIFY_TOKEN"
  ```

  ```typescript TypeScript theme={null}
  const { datasets, total } = await hubify.datasets.list({ labId });
  ```
</CodeGroup>

<ResponseField name="datasets" type="object[]" required>
  All datasets for the lab.

  <Expandable title="Dataset">
    <ResponseField name="_id" type="string" required>Convex document ID.</ResponseField>
    <ResponseField name="name" type="string" required>Dataset name.</ResponseField>
    <ResponseField name="format" type="string" required>File format: `csv`, `parquet`, `hdf5`, `fits`, `json`, `npy`, `zarr`, or other.</ResponseField>
    <ResponseField name="datasetType" type="string">One of `tabular`, `image`, `text`, `spectral`, `timeseries`, `mixed`.</ResponseField>
    <ResponseField name="description" type="string">Human-readable description.</ResponseField>
    <ResponseField name="recordCount" type="number">Row/sample count.</ResponseField>
    <ResponseField name="sizeBytes" type="number">File size in bytes.</ResponseField>
    <ResponseField name="storageUrl" type="string">Backblaze B2 / HuggingFace URL.</ResponseField>
    <ResponseField name="experimentId" type="string">Linked experiment, if any.</ResponseField>
    <ResponseField name="version" type="string">Current version string (e.g., `v1.3`).</ResponseField>
    <ResponseField name="createdAt" type="number">Unix ms.</ResponseField>
  </Expandable>
</ResponseField>

## Create Dataset

<ParamField body="labId" type="string" required>Convex lab ID.</ParamField>
<ParamField body="name" type="string" required>Dataset name.</ParamField>
<ParamField body="format" type="string" required>File format (e.g., `parquet`, `fits`).</ParamField>
<ParamField body="description" type="string">Human-readable description.</ParamField>
<ParamField body="recordCount" type="number">Row/sample count.</ParamField>
<ParamField body="sizeBytes" type="number">File size in bytes.</ParamField>
<ParamField body="datasetType" type="string">Type classification. One of `tabular`, `image`, `text`, `spectral`, `timeseries`, `mixed`.</ParamField>
<ParamField body="experimentId" type="string">Convex experiment ID to link.</ParamField>

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://www.hubify.com/api/v1/datasets \
    -H "Authorization: Bearer $HUBIFY_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "labId": "$LAB_ID",
      "name": "anomaly-catalog-v1.3",
      "format": "fits",
      "datasetType": "spectral",
      "recordCount": 37300000,
      "description": "Multi-survey anomaly catalog with 37.3M galaxy spectra"
    }'
  ```
</CodeGroup>

<ResponseField name="id" type="string" required>New dataset Convex ID.</ResponseField>
<ResponseField name="version" type="string">Initial version (`v1.0`).</ResponseField>
