> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/textual/tonic-textual-api/textual-rest-api/rest-api-datasets/rest-api-manage-datasets.md).

# Manage datasets

Use the Tonic Textual REST API to create and manage datasets.

## Get all datasets

> Returns all of the datasets that the user has access to.  Each dataset contains a set of minimal info, for more detailed information on a given dataset use the /api/dataset/{datasetId} endpoint.

```json
{"openapi":"3.1.1","info":{"title":"Textual API","version":"vDev"},"tags":[{"name":"Dataset Management","description":"Manage datasets for PII detection and redaction. Create, search, and edit datasets, upload and download files, and control dataset sharing permissions."}],"security":[{}],"paths":{"/api/Dataset":{"get":{"tags":["Dataset Management"],"summary":"Get all datasets","description":"Returns all of the datasets that the user has access to.  Each dataset contains a set of minimal info, for more detailed information on a given dataset use the /api/dataset/{datasetId} endpoint.","parameters":[{"schema":{"type":"boolean","default":true},"in":"path","name":"filterSynthesized","description":"When true, excludes synthesized datasets from results","required":true}],"responses":{"200":{"description":"Returns all accessible datasets","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MinimalDatasetResponseModel"}}}}}}}}},"components":{"schemas":{"MinimalDatasetResponseModel":{"type":"object","description":"Lightweight dataset summary containing only core metadata used in list views and search results.","properties":{"id":{"type":"string"},"name":{"type":"string"},"fileSource":{"allOf":[{"$ref":"#/components/schemas/FileSource"}]},"operations":{"type":"array","items":{"$ref":"#/components/schemas/DatasetOperation"}},"tags":{"type":"array","items":{"type":"string"}},"lastUpdated":{"allOf":[{"$ref":"#/components/schemas/Instant"}]},"created":{"allOf":[{"$ref":"#/components/schemas/Instant"}]},"creatorUser":{"description":"A user entity with basic identity information.","allOf":[{"$ref":"#/components/schemas/UserEntityModel"}]},"fileCount":{"type":"integer","format":"int32"}},"additionalProperties":false},"FileSource":{"type":"string","description":"The original upload location of source files (Local, S3, Azure, SharePoint, OneLake, or SDK).","enum":["Local","Sharepoint","Aws","Sdk","Azure","OneLake"]},"DatasetOperation":{"type":"string","description":"<p>Possible values:</p>\n<ul>\n<li><b>HasAccess</b>: Ability to access a dataset. Every Dataset Permission Set has this operation.</li>\n<li><b>ViewSettings</b>: View dataset settings</li>\n<li><b>EditSettings</b>: Edit dataset settings</li>\n<li><b>Share</b>: Share dataset access</li>\n<li><b>Delete</b>: Delete a dataset</li>\n<li><b>UploadFiles</b>: Upload files to a dataset</li>\n<li><b>ScanFiles</b>: Start a scan of dataset files</li>\n<li><b>DeleteFiles</b>: Delete files from a dataset</li>\n<li><b>PreviewRedactedFiles</b>: Preview redacted dataset files</li>\n<li><b>DownloadRedactedFiles</b>: Download redacted dataset files</li>\n<li><b>ViewAuditLog</b>: Access a detailed history of actions taken within the dataset for compliance and tracking purposes</li>\n<li><b>EditFileRedactions</b>: Create and delete manual redactions (text spans and PDF/image area redactions) on dataset files. Implied by</li>\n</ul>\n","enum":["HasAccess","ViewSettings","EditSettings","Share","Delete","UploadFiles","ScanFiles","DeleteFiles","PreviewRedactedFiles","DownloadRedactedFiles","ViewAuditLog","EditFileRedactions"]},"Instant":{"type":"object","description":"A point in time represented as an ISO 8601 timestamp string.","additionalProperties":false},"UserEntityModel":{"type":"object","description":"A user entity with basic identity information.","required":["id","userName"],"properties":{"id":{"type":"string","description":"The unique identifier of the user or group."},"userName":{"type":"string","description":"The display name of the user or group."},"firstName":{"type":"string","description":"The user's first name."},"lastName":{"type":"string","description":"The user's last name."}},"additionalProperties":false}}}}
```

{% openapi src="/files/sNVBNKC77yJZaRySqZwB" path="/api/Dataset/{datasetId}" method="get" %}
[swagger (23).json](https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FaMx0x4AHeMON0ynLpaKw%2Fswagger%20\(23\).json?alt=media\&token=89ac597c-d103-4ebf-828d-fee2259907cf)
{% endopenapi %}

{% openapi src="/files/sNVBNKC77yJZaRySqZwB" path="/api/Dataset" method="post" %}
[swagger (23).json](https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FaMx0x4AHeMON0ynLpaKw%2Fswagger%20\(23\).json?alt=media\&token=89ac597c-d103-4ebf-828d-fee2259907cf)
{% endopenapi %}

{% openapi src="<https://textual.tonic.ai/swagger/v1/swagger.json>" path="/api/Dataset" method="put" %}
<https://textual.tonic.ai/swagger/v1/swagger.json>
{% endopenapi %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tonic.ai/textual/tonic-textual-api/textual-rest-api/rest-api-datasets/rest-api-manage-datasets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
