---
title: "Merge Datasets"
method: POST
path: "/v1/datasets/merge"
tags: ["datasets"]
---

# Merge Datasets

`POST /v1/datasets/merge`

## Request

- Base URL: `https://api.pioneer.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pioneer.ai/v1/datasets/merge`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/pioneer/apis/brain-api/docs/v1/datasets/merge/post.ts> (a function with typed inputs; its response is checked against the schema)

Merges compatible datasets into a new versioned dataset.

## Request body

- DatasetMergeRequest: Request to merge multiple datasets into one.
  - `sources` DatasetMergeSource[], required: Datasets to merge (at least 2)
    - `dataset_name` string, required: Name of the dataset
    - `version` string: Version to merge (default: latest)
  - `output_name` string, required: Name for the merged dataset
  - `project_id` string, nullable: Project to assign the merged dataset to

## Response `200`

Successful Response

- DatasetMergeResponse: Response from a merge operation.
  - `success` boolean, required
  - `dataset_name` string, required
  - `version` string, required
  - `sample_size` integer, required: Total rows in the merged dataset
  - `source_counts` object, required: Number of rows contributed by each source dataset
  - `message` string, required

## Other responses

- `409`: Could not allocate a unique version for the output name after retrying against concurrent writers. Retryable (ENG-6623).
- `422`: Validation Error

## Changes

- **2026-09-24** `0e5e86e2bae5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pioneer/apis/brain-api/changes/v1/datasets/merge/post.md)

---

[API](https://skmtc.dev/pioneer/apis/brain-api.md) - [All operations](https://skmtc.dev/pioneer/apis/brain-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pioneer/apis/brain-api/revisions/0e5e86e2bae5?raw)
