---
title: "Get file tree snapshot. Either one of workspace, branch or commit ID needs to be specified as ref ID."
method: GET
path: "/repos/{repo_id}/trees/{ref_id}"
tags: ["Repository Manipulation"]
---

# Get file tree snapshot. Either one of workspace, branch or commit ID needs to be specified as ref ID.

`GET /repos/{repo_id}/trees/{ref_id}`

## Path parameters

- `repo_id` string, required
- `ref_id` string, required

## Query parameters

- `recurse` boolean
- `skip` integer
- `limit` integer
- `offset` string
- `include_deleted` boolean
- `workspace_journal_ordinal_id` integer — An ordinal ID of a workspace journal entry
- `item_name_query` string
- `dirs_only` boolean

## Response `200`

Success

- object
  - `object` 'FileEntry', required
  - `items` FileEntry[], required
    - `path` string, required
    - `prev_path` string — Optional hint in case the item was renamed or moved
    - `status` 1 | 2 | 3 | 4, required — One of: 1 - INTACT, 2 - ADDED, 3 - MODIFIED, 4 - DELETED
    - `mode` 16877 | 33188 | 33261 | 40960, required — The file mode (as Unix mode)
    - `mtime` string, date-time
    - `blob` object
      - `storage_uri` string, required — Coupled with storage_backend, a uri to storage location
      - `storage_backend` 1 | 2, required — One of: 1 - EFS, 2 - S3
      - `size` integer, required — Size in bytes
      - `sha` string, required
  - `workspace_journal_ordinal_id` integer — An ordinal ID of a workspace journal entry

## Other responses

- `400` — The request does not meet the required conditions
- `404` — The specified resource was not found
- `412` — The specified resource is no longer up to date
- `default` — An error occurred

---

[API](https://skmtc.dev/diversion/apis/diversion-core-api.md) · [All operations](https://skmtc.dev/diversion/apis/diversion-core-api/llms.txt) · [OpenAPI document](https://skmtc.dev/diversion/apis/diversion-core-api/revisions/38a18aba804b?raw)
