---
title: "Preview files in a default dataset"
method: POST
path: "/api/organizations/{organizationId}/dataset/{dataset}/files/preview"
tags: ["OrganizationData"]
---

# Preview files in a default dataset

`POST /api/organizations/{organizationId}/dataset/{dataset}/files/preview`

## Request

- Base URL: `https://studio.edgeimpulse.com/v1`
- URL: `https://studio.edgeimpulse.com/v1/api/organizations/{organizationId}/dataset/{dataset}/files/preview`
- Auth: one of:
  - API key in header `x-api-key`
  - API key in cookie `jwt`
  - API key in header `x-jwt-token`
  - OAuth 2
    - Authorization code: `/v1/oauth/authorize`
    - Client credentials
    - Implicit: `/v1/oauth/authorize`
    - Password
    - Token URL: `/v1/oauth/token`
- TypeScript: <https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/docs/api/organizations/:organizationId/dataset/:dataset/files/preview/post.ts> (a function with typed inputs; its response is checked against the schema)

Preview files and directories in a default dataset for the given prefix, with support for wildcards. This is an internal API used when starting a transformation job.

## Path parameters

- `organizationId` integer, required
- `dataset` string, required

## Request body

- PreviewDefaultFilesInFolderRequest
  - `prefix` string, required: S3 prefix
  - `itemsToList` 'files' | 'folders', required: Return either files or folders matching the specified prefix

## Response `200`

OK

- PreviewDefaultFilesInFolderResponse
  - `success` boolean, required: Whether the operation succeeded
  - `error` string: Optional error description (set if 'success' was false)
  - `files` PortalFile[], required
    - `name` string, required
    - `addedDate` string, date-time
    - `size` integer
    - `ETag` string
    - `path` string, required
    - `type` 'folder' | 'file', required
  - `isTruncated` boolean: True if results are truncated.
  - `truncationReason` 'too-many-results' | 'too-expensive-search': Explains why results are truncated; only present in the response if isTruncated is true. Results can be truncated if there are too many results (more than 500 matches), or if searching for more results is too expensive (for example, the dataset contains many items but very few match the given wildcard).

---

[API](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api.md) - [All operations](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/llms.txt) - [OpenAPI document](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/revisions/e2a976d38427?raw)
