---
title: "Create datasets from Selected Tables of PDF"
method: POST
path: "/workspaces/{workspace_id}/projects/{project_id}/datasets-from-pdf"
tags: ["Datasets from PDF"]
---

# Create datasets from Selected Tables of PDF

`POST /workspaces/{workspace_id}/projects/{project_id}/datasets-from-pdf`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/projects/{project_id}/datasets-from-pdf`
- 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`

Takes a file ID and a list of table indices and creates a corresponding dataset in the project

## 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

## Request body

- PDFTableInput: Request body containing the file ID and list of table indices to create datasets
  - `file_object_id` integer, required: Internal ID of the file object
  - `file_id` string, nullable: Unique identifier for the uploaded PDF file in pdf2csv
  - `file_name` string, required: Original name of the uploaded PDF file
  - `table_list` integer[], nullable: Indices of the tables to extract and convert into datasets
  - `delete_file_after_extract` boolean: Whether to delete the file from storage after table extraction is complete
  - `is_preview_needed` boolean, nullable: Flag indicating whether a preview is required before dataset creation
  - `user_instruction` string, nullable: User-provided instruction for custom extraction logic.

## Response `200`

Datasets will be successfully created from the table list

- object

## Other responses

- `201`: Document created, URL follows
- `400`: Bad request syntax or unsupported method
- `401`: Authorization error - invalid or missing credentials
- `403`: Request forbidden -- authorization will not help

---

[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)
