# Organize and find secrets

> Keep secrets in folders by naming their paths, list a folder, and see what a secret holds without opening it.

With many secrets, you find them by browsing. Paths read like folders: `web/github`, `web/gitlab` and `db/prod/root`
sit in the folders `web/` and `db/`. You list a folder to see what is in it, and read a secret's names to check what it
holds before anyone opens it.

**Before you start:** you have a few secrets in your own vault, and you are signed in with your session in
`$CVYUH_SESSION` ([Call the API](/develop/api/) shows how).

## Find a secret

<Steps>

1. List the top of your vault:

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

   The realm answers `{ "data": { "keys": ["db/", "web/"] } }`. Folders end in `/`.

2. List a folder:

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

   The realm answers `{ "data": { "keys": ["github", "gitlab"] } }`. The `LIST` method on the same address does the
   same.

3. See what a secret holds, without its values:

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

   The realm answers `{ "subkeys": { "user": null, "password": null }, … }` under `data`. Add `?depth=1` to stop at
   the first level.

</Steps>

## Check it worked

A listing with nothing under the prefix answers `404`. A secret you deleted whole is no longer listed.

## Good to know

- **A listing straight after a write can miss the newest path** for a moment, on some sites. Read the path itself
  when you need it at once. See [Known limitations](/reference/known-limitations/#secrets-store).
- **Through a grant, you see what you may view.** Someone with a `view` grant who lists your vault sees only the
  secrets they may view.

## Related

- [Listing](/secrets-store/secrets/listing/) and [Subkeys](/secrets-store/secrets/subkeys/): how each works.
- [Metadata](/secrets-store/secrets/metadata/): labels that help you find a secret.
