---
title: "List files"
method: GET
path: "/v1/workspaces/{workspace_id}/files"
tags: ["Files"]
---

# List files

`GET /v1/workspaces/{workspace_id}/files`

## Request

- Base URL: `https://api.stacksync.com`
- URL: `https://api.stacksync.com/v1/workspaces/{workspace_id}/files`
- Auth: HTTP bearer

The files of the workspace in a region, newest first.

## Path parameters

- `workspace_id` integer, required

## Query parameters

- `region` 'besg' | 'usnv', required
- `search` string, nullable: Only files whose name contains this text
- `limit` integer: Maximum number of files returned, at most 100
- `cursor` string, nullable: next_cursor of the previous page; absent for the first page

## Response `200`

OK

- FileList
  - `data` WorkspaceFile[], required
    - `file_id` string, required
    - `name` string, required
    - `mime_type` string, nullable, required
    - `size_bytes` integer, nullable, required
    - `tags` string[], required
    - `source` string, nullable, required
    - `source_ref` string, nullable, required: Id of the resource the file belongs to, null when it belongs to none
    - `created_at` string, nullable, required
    - `region` string, required
  - `has_more` boolean, required: Whether more files may follow this page: request the next one with cursor = next_cursor
  - `next_cursor` string, nullable, required: Pass as cursor to get the next page; null on the last page

## Other responses

- `400`: Bad Request
- `403`: Forbidden

---

[API](https://skmtc.dev/stacksync/apis/stacksync-api.md) - [All operations](https://skmtc.dev/stacksync/apis/stacksync-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stacksync/apis/stacksync-api/revisions/21f4ba4b214e?raw)
