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

# Create Dataset

> Upload a file and create a dataset in a knowledgebase

Uploads a file as a new dataset. The file is chunked and embedded asynchronously after upload — poll [List Datasets](/en/api-reference/v1/datasets/list-datasets) and watch `isParsed` to know when it's ready for query.

## Request

```bash theme={null}
POST https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets
```

### Path Parameters

<ParamField path="projectId" type="string" required>The project ID</ParamField>
<ParamField path="knowledgebaseId" type="string" required>The knowledgebase to upload into</ParamField>

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token using your developer key
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `multipart/form-data`
</ParamField>

### Body

<ParamField body="dataset" type="file" required>
  The file to upload. Supported formats: PDF, TXT, DOCX, and other text-based formats.
</ParamField>

## Response

```json theme={null}
{
  "message": "Dataset Uploaded successfully, currently embedding in the background",
  "success": true
}
```

### Example

```bash theme={null}
curl -X POST https://api.pathors.com/v1/projects/{projectId}/knowledgebases/kb_abc123/datasets \
  -H "Authorization: Bearer dk_your_key" \
  -F "dataset=@/path/to/your/file.pdf"
```
