# Document

> > This page is auto-generated from the formations OpenAPI spec.
> Do not edit manually — run `pnpm generate-formations-resource-docs` to regenerate.

# Document

> This page is auto-generated from the formations OpenAPI spec.
> Do not edit manually — run `pnpm generate-formations-resource-docs` to regenerate.

Stores a text document in a project, optionally indexing it for knowledge retrieval.

:::note
Supports **create** and **delete** only. Updates are not applied — to replace content, delete and re-create the resource.
:::

## Syntax

```yaml
type: document
properties:
  content: String
  path: String
  filename: String
  title: String
  metadata: Object
  tags: Object
  chunk_strategy: String
  chunk_size: Integer
  chunk_overlap: Integer
```

## Output

The physical resource ID is the **public ID** of the created resource. Reference it from other resources with a `ref` expression:

```yaml
      some_field:
        ref: MyDocument
```

## Properties

**`content`**

Document text content

_Required_: Yes
_Type_: String

---

**`path`**

Virtual path for organising the document

_Required_: No
_Type_: String
_Nullable_: Yes

---

**`filename`**

Original filename

_Required_: No
_Type_: String
_Nullable_: Yes

---

**`title`**

Document title

_Required_: No
_Type_: String
_Nullable_: Yes

---

**`metadata`**

Arbitrary metadata key-value pairs

_Required_: No
_Type_: Object
_Nullable_: Yes

---

**`tags`**

Tag key-value pairs for filtering

_Required_: No
_Type_: Object
_Nullable_: Yes

---

**`chunk_strategy`**

How to split the content into embeddable chunks, matching `POST /documents`. `whole` (default) stores the content as a single chunk; `size` splits into fixed-size character windows with overlap. `page` is equivalent to `whole` for plain text.

_Required_: No
_Type_: String
_Allowed values_: `page`, `whole`, `size`

---

**`chunk_size`**

Window size in characters when `chunk_strategy=size`. Defaults to 1000.

_Required_: No
_Type_: Integer

---

**`chunk_overlap`**

Overlap in characters between consecutive windows when `chunk_strategy=size`. Defaults to 200.

_Required_: No
_Type_: Integer

---
