---
title: "GET /v2/vals/{val_id}/files"
method: GET
path: "/v2/vals/{val_id}/files"
tags: ["vals"]
---

# GET /v2/vals/{val_id}/files

`GET /v2/vals/{val_id}/files`

Get metadata for files and directories in a val. If path is an empty string, returns files at the root directory.

## Path parameters

- `val_id` string, uuid, required

## Query parameters

- `version` integer
- `branch_id` string, uuid
- `path` string, required
- `recursive` boolean, required
- `offset` integer, required
- `limit` integer, required

## Response `200`

A paginated result set

- object — A paginated result set
  - `data` FileRevisionMetadataV2[], required
    - `name` string, required
    - `id` string, uuid, required — The id of the resource
    - `path` string, required
    - `version` integer, required
    - `updatedAt` string, date-time, required
    - `type` 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script', required
    - `links` object, required
      - `self` string, uri, required — The URL of this resource on this API
      - `html` string, uri, required — The URL of this resource on Val Town
      - `module` string, uri, required — The URL of this resource's source code as a module
      - `endpoint` string, uri — This resource's web endpoint, where it serves a website or API
      - `email` string, email — This resource's email address for receiving emails (for email-type vals)
  - `links` PaginationLinks, required — Links to use for pagination
    - `self` string, uri, required — URL of this page
    - `prev` string, uri — URL of the previous page, if any
    - `next` string, uri — URL of the next page, if any

---

[API](https://skmtc.net/val-town/apis/val-town-api.md) · [All operations](https://skmtc.net/val-town/apis/val-town-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/val-town/val-town-api/versions/4d8b6d2e6db3/schema)
