---
title: "Read directory contents"
method: GET
path: "/user/dirs"
tags: ["user APIs"]
---

# Read directory contents

`GET /user/dirs`

Returns the contents of the specified directory for the logged in user

## Query parameters

- `path` string

## Response `200`

successful operation

- DirEntry[]
  - `name` string — name of the file (or subdirectory) described by the entry. This name is the final element of the path (the base name), not the entire path
  - `size` integer — file size, omitted for folders and non regular files
  - `mode` integer — File mode and permission bits. More details here: https://golang.org/pkg/io/fs/#FileMode. Let's see some examples: - for a directory mode&2147483648 != 0 - for a symlink mode&134217728 != 0 - for a regular file mode&2401763328 == 0
  - `last_modified` string, date-time

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal Server Error
- `default` — Unexpected Error

---

[API](https://skmtc.net/kanton-bern/apis/sftpgo.md) · [All operations](https://skmtc.net/kanton-bern/apis/sftpgo/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kanton-bern/sftpgo/versions/d8d616a479b0/schema)
