# notion.sync.run

Start a Notion sync now: read changed invoice rows and prepare suggestions for differences, then update Notion rows from Oatmilk invoices. Returns a runId to follow with runs.get. Supply direction (push, pull, both, full) and idempotencyKey.

`POST /api/v1/accounting/notion.sync.run`

Permissions: `accounting:read`, `accounting:write` · Roles: admin, finance · Idempotency key required · Reaches outside Oatmilk (email or a provider)

MCP tool: `accounting_notion_sync_run`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `direction` | enum |  | One of: `push`, `pull`, `both`, `full`. Default `"both"`. |
| `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/notion.sync.run \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{}'
```

Reference page: https://app.getoatmilk.com/docs/api/notion.sync.run
