---
title: "Upload file or folder"
method: POST
path: "/workspaces/{workspace_id}/projects/{project_id}/files"
tags: ["Files"]
---

# Upload file or folder

`POST /workspaces/{workspace_id}/projects/{project_id}/files`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/projects/{project_id}/files`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Upload file or folder to create a dataset

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.
- `project_id` integer, required: Project ID of the workspace

## Query parameters

- `folder_resource_id` string, nullable: Resource ID of the folder where the dataset is to be created
- `source_type` 'file' | 'clipboard' | 'generated' | 'ai_generated': Origin of the file content. e.g. the data could have been copied from clipboard
- `append_to_ds_id` integer, nullable: Dataset ID to which the file is being appended
- `override_target_schema` boolean, nullable: When appending to an existing dataset and this flag is set, the schema of the target dataset will be overridden by schema of the incoming data

## Headers

- `Idempotency-Key` string, nullable

## Response `201`

Document created, URL follows

- unknown

## Other responses

- `202`: Upload file to create a dataset
- `400`: Bad Request
- `401`: Authorization error

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/5dfd1c296ded?raw)
