# Listing

> Browse a vault one folder at a time, seeing only the secrets you may view.

Paths read like folders: `web/github`, `web/gitlab` and `db/prod/root` sit in the folders `web/` and `db/`. Listing a
folder shows what is directly in it, so you can find a secret by browsing rather than remembering its exact path.

What's missing today: on some sites, a listing made straight after a write can miss the newest path for a moment.

## Before you begin

- **Who:** anyone with every right in the vault sees every path; a `view` grantee sees only the paths granted to them.
  A `use` grant doesn't list.
- **Where:** the API. There are no screens yet.
- **First:** the store is on.

## How it works

A listing answers the next part of each path under the prefix you name, with folders ending in `/`. For the three
paths above, under `https://foobar.cvyuh.com/api/v0/vault/managed/v1/me`:

| `GET` | Answers |
|---|---|
| `…/metadata?list=true` | `["db/", "web/"]` |
| `…/metadata/web/?list=true` | `["github", "gitlab"]` |

The `LIST` method on the same address gives the same listing, for tools that use it. Names are sorted, and each
appears once.

## Set it up

There's nothing to set up. List the `web/` folder of your own vault ([Call the API](/develop/api/) shows how to get
`$CVYUH_SESSION`):

```sh
curl "https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/metadata/web/?list=true" \
  -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
```

```json
{ "data": { "keys": ["github", "gitlab"] } }
```

## When it fails

| Answer | When | What to do |
|---|---|---|
| `404` | Nothing is under the prefix, or nothing you may view | Check the prefix; list one level up |
| `403` | No right and no grant in a group's or the realm's vault | Ask for membership or a grant |

## Limits and defaults

| Limit | Value |
|---|---|
| Entries in one listing | every name under the prefix, in one answer; no paging |
| Depth | one level: the next segment of each path |

## Troubleshooting

| Symptom | Cause | Fix |
|---|---|---|
| A path you just wrote isn't listed | On some sites, a listing can lag a write for a moment | Read the path itself, which answers at once, or list again. See [Known limitations](/reference/known-limitations/#secrets-store) |
| A deleted secret is still listed | Its versions are deleted but its metadata remains | Delete the whole secret with `DELETE …/metadata/<path>` |
| A grantee can't find a secret by listing | They hold `use`, which doesn't list | They read it at its path, found with `GET …/shared` |

## Audit record

A listing changes nothing, so it writes no change record; it is an `ACCESS` record under the caller. See
[Secrets audit trail](/secrets-store/keys-and-protection/audit-trail/).

## Good to know

- **A deleted secret isn't listed.** A secret whose versions are all deleted, but whose metadata remains, still is.
- **Paths are sealed.** The store keeps each path sealed, and opens it only for a listing by someone allowed to see it.

## Coming next

A listing made straight after a write that always includes the path just written: see
[What's next for secrets](/secrets-store/secrets/whats-next/#read-your-own-listing).

## Related

- [Organize and find secrets](/secrets-store/guides/organize-and-find-secrets/): folders, listing and subkeys.
- [Grants](/secrets-store/sharing/grants/): what a grantee sees when they list your vault.
