---
title: "List files in portal"
method: POST
path: "/api/portals/{portalId}/files"
tags: ["UploadPortal"]
---

# List files in portal

`POST /api/portals/{portalId}/files`

## Request

- Base URL: `https://studio.edgeimpulse.com/v1`
- URL: `https://studio.edgeimpulse.com/v1/api/portals/{portalId}/files`
- 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/portals/:portalId/files/post.ts> (a function with typed inputs; its response is checked against the schema)

List all files and directories in specified prefix.

## Path parameters

- `portalId` integer, required

## Request body

- ListPortalFilesInFolderRequest
  - `prefix` string, required: S3 prefix
  - `continuationToken` string: Only one S3 page (1000 items typically) is returned. Pass in the continuationToken on the next request to receive the next page.
  - `onlyFetchFolders` boolean: If set, then no files will be returned

## Response `200`

OK

- ListPortalFilesInFolderResponse
  - `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
  - `continuationToken` string

---

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