# documents.snippets.create

Save a block of Markdown (kind block) or a footer (kind footer, up to 500 characters and two lines) to reuse in agreements, with a title and an idempotencyKey. Insert a saved block into a template with documents.content.edit insert_text.

`POST /api/v1/accounting/documents.snippets.create`

Permissions: `accounting:read`, `accounting:write` · Roles: admin, finance · Idempotency key required

MCP tool: `accounting_documents_snippets_create`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `kind` | enum | Yes | Which kind of record or job this is. One of: `block`, `footer`. |
| `title` | string | Yes | A short title. 1–120 characters. |
| `body` | string | Yes | 1–20000 characters. |
| `idempotencyKey` | string | Yes | Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match. 8–200 characters. |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/documents.snippets.create \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "kind": "block",
  "title": "Synthetic services agreement",
  "body": "Synthetic example from the docs"
}'
```

Reference page: https://app.getoatmilk.com/docs/api/documents.snippets.create
