# List a mount's files

List every file and folder in a mount.

`GET https://api.smallworld.sh/api/v1/mounts/:mountId/files`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| mountId | path | UUID | Yes | The mount's ID, returned as id when the mount was created. |

## Request examples

### curl

```curl
curl --fail-with-body -X GET 'https://api.smallworld.sh/api/v1/mounts/0199a1c4-5b6e-7a10-9c2d-3e4f5a6b7c8d/files' \
  -H "Authorization: Bearer $SMALLWORLD_API_KEY"
```

### typescript

```typescript
const response = await fetch("https://api.smallworld.sh/api/v1/mounts/0199a1c4-5b6e-7a10-9c2d-3e4f5a6b7c8d/files", {
  method: "GET",
  headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
```

### python

```python
response = requests.get(
    "https://api.smallworld.sh/api/v1/mounts/0199a1c4-5b6e-7a10-9c2d-3e4f5a6b7c8d/files",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Responses

Returns items, sorted by path, without a pagination cursor. Each entry has path (inside the mount, starting with a slash), type (file or directory), size in bytes, hash (the SHA-256 of the content in hex, empty for folders), and modifiedAt.

### 200

Returns items, sorted by path, without a pagination cursor. Each entry has path (inside the mount, starting with a slash), type (file or directory), size in bytes, hash (the SHA-256 of the content in hex, empty for folders), and modifiedAt.

```json
{
  "items": [
    {
      "path": "/faq.md",
      "type": "file",
      "size": 37,
      "hash": "e08222b5163270229c47f385e4d0e8a9de482f71d0364a66de787c09b3b63b0a",
      "modifiedAt": "2026-10-10T12:00:01.000Z"
    },
    {
      "path": "/guides",
      "type": "directory",
      "size": 0,
      "hash": "",
      "modifiedAt": "2026-10-10T12:00:00.000Z"
    },
    {
      "path": "/guides/refunds.md",
      "type": "file",
      "size": 54,
      "hash": "634c0a73f251b5ddb65b10d686a52dd334acbd4674768b96a36499dcb1818fca",
      "modifiedAt": "2026-10-10T12:00:00.000Z"
    }
  ]
}
```

### 400

invalid_request: A parameter is invalid; the message names the problem. Unknown query parameters are rejected.

#### invalid_request

A parameter is invalid; the message names the problem. Unknown query parameters are rejected.

```json
{
  "statusCode": 400,
  "code": "invalid_request",
  "message": "Unknown query parameter: color"
}
```

### 401

authentication_required: The Authorization header is missing or empty. invalid_api_key: The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

#### authentication_required

The Authorization header is missing or empty.

```json
{
  "statusCode": 401,
  "code": "authentication_required",
  "message": "Authentication is required"
}
```

#### invalid_api_key

The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

```json
{
  "statusCode": 401,
  "code": "invalid_api_key",
  "message": "The API key is invalid or revoked"
}
```

### 403

ip_not_allowed: The request came from an address outside the workspace's IP allowlist.

#### ip_not_allowed

The request came from an address outside the workspace's IP allowlist.

```json
{
  "statusCode": 403,
  "code": "ip_not_allowed",
  "message": "The source IP address is not allowed by this account's security settings"
}
```

### 404

mount_not_found: The mount does not exist in your workspace, or mountId isn't a mount ID.

#### mount_not_found

The mount does not exist in your workspace, or mountId isn't a mount ID.

```json
{
  "statusCode": 404,
  "code": "mount_not_found",
  "message": "Mount not found"
}
```

### 500

internal_error: An unexpected server error.

#### internal_error

An unexpected server error.

```json
{
  "statusCode": 500,
  "code": "internal_error",
  "message": "Internal server error"
}
```

## Notes

- Paths are inside the mount: /faq.md in a mount at /workspace/docs is /workspace/docs/faq.md in the terminal.

- Folders are listed too, including empty ones. Read a file's content with GET /mounts/:mountId/files/content.
