# notion.lookup

Find likely Notion pages for an Oatmilk account, invoice, or contractor in the mapped databases. Candidates are ranked by name, email, website domain, invoice number, amount, and dates, with the reasons for each match. Nothing is linked until a person confirms.

`GET | POST /api/v1/accounting/notion.lookup`

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

MCP tool: `accounting_notion_lookup`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `localType` | enum | Yes | One of: `party`, `invoice`, `contractor`. |
| `localId` | string (ID) | Yes | The ID of the related record. |
| `role` | enum |  | A person's access level in the company. One of: `invoices`, `companies`, `vendors`, `contacts`. |
| `query` | string |  | Text to search for. at most 100 characters. |

## Example request

```bash
curl -G https://app.getoatmilk.com/api/v1/accounting/notion.lookup \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  --data-urlencode 'localType=party' \
  --data-urlencode 'localId=1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d'
```

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