Skip to main content
POST
/
api
/
dataframer
/
datasets
/
create
JavaScript
import Dataframer from 'dataframer';

const client = new Dataframer({
  apiKey: 'My API Key',
});

const response = await client.dataframer.datasets.createWithFiles({
  dataset_type: 'SINGLE_FILE',
  name: 'name',
});

console.log(response.id);
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Customer Reviews 2025",
  "description": "Product reviews with files",
  "dataset_type": "SINGLE_FILE",
  "dataset_type_display": "Single File",
  "file_count": 1,
  "folder_count": 0,
  "created_at": "2025-01-15T10:30:00Z",
  "message": "Dataset created with 1 file(s)"
}

Authorizations

Authorization
string
header
required

API Key authentication. Format: "Bearer YOUR_API_KEY"

Body

multipart/form-data
name
string
required

Dataset name (unique within company)

dataset_type
enum<string>
required

Dataset type: SINGLE_FILE, MULTI_FILE, or MULTI_FOLDER

Available options:
SINGLE_FILE,
MULTI_FILE,
MULTI_FOLDER
description
string

Optional dataset description

config_json
string

Optional configuration JSON as string

file
file

Single file for SINGLE_FILE dataset type

files
file[]

Multiple files for MULTI_FILE or MULTI_FOLDER dataset types. Each file will be sent as a separate form field named 'files'. For MULTI_FOLDER: minimum 2 files required (at least 1 file per folder, across at least 2 folders).

Minimum array length: 1
folder_names
string[]

Folder names for MULTI_FOLDER (parallel array with files). Each folder name is sent as a separate 'folder_names' form field. Minimum 2 unique folder names required.

Minimum array length: 2
csv_headers
string

Optional CSV headers as JSON array for SINGLE_FILE CSV files

Response

Dataset created successfully with files

name
string
required
Minimum string length: 1
dataset_type
enum<string>
required
Available options:
SINGLE_FILE,
MULTI_FILE,
MULTI_FOLDER
id
string<uuid>
description
string | null
dataset_type_display
string
Minimum string length: 1
config_json
Config json · object
created_at
string<date-time>
updated_at
string<date-time>
created_by
integer
created_by_name
string
Minimum string length: 1
company
string<uuid>
company_name
string
Minimum string length: 1
folders
object[]
folder_count
integer
file_count
integer
short_sample_compatibility
Short sample compatibility · object