# in-folder (/catalog/edges/in-folder)

Records where an item's file sits in a synced folder.



## in-folder [#in-folder]

Says where an item's file sits in a synced folder.

**written_from:** `none`

| Property | Kind | Description |
| - | - | - |
| `path` | `string` | The file's path from the folder's root. |

An item lists the folder it's **In folder**, and a folder lists its **Folder contents**. The to item is always the folder's [`system.folder`](/catalog/folder).

## How a folder uses it [#how-a-folder-uses-it]

**A folder writes these edges itself.** When it creates or moves a file, it places the item with an `in-folder` edge whose `path` names the file from the folder's root. The edge says where the file goes, never what the folder holds: the folder's query decides that.

**No file writes the edge.** A Markdown file in a folder has no `in-folder` line, since a file's place is where it sits.

## Writing one yourself [#writing-one-yourself]

A key needs write on the item's type, write on `in-folder` and read on `system.folder`. The edge must have a `path` and no other property. The `path` is relative, at most 1,024 characters, and holds no backslash and no `..`. A missing or invalid `path` is refused with `400 invalid_properties`.

While a folder is revoked, it keeps its edges and a new edge to it is refused with `400 edge_constraint_violation`.

## In the bin [#in-the-bin]

Moving the item to the bin leaves the edge and the folder's settings as they are.

## Example [#example]

A note placed at a path in a folder:

```json
{
  "edge_type": "in-folder",
  "from_id": "01a1f139-a22f-72a3-972f-3e25c4b4cb09",
  "to_id": "01a1f12c-5d0e-7f3a-8b61-2c9d4e7f1a05",
  "properties": { "path": "Trips/Lisbon.md" }
}
```
