# Connectors and webhooks

> Webhooks, Wise, Notion, Google Drive and other data sources.

MCP toolset: `connectors` (https://app.getoatmilk.com/api/mcp?toolset=connectors)

## connectors.credentials

- [`connectors.credentials.remove`](https://app.getoatmilk.com/docs/api/connectors.credentials.remove.md) — Disconnect organization-scoped Stripe, Wise, Notion or Google Drive credentials from the administrator dashboard. Existing accounting records remain. Requires expectedRevision and idempotencyKey.

- [`connectors.credentials.save`](https://app.getoatmilk.com/docs/api/connectors.credentials.save.md) — Store organization-scoped Stripe, Wise, or Notion credentials from the administrator dashboard. Values are encrypted server-side, never returned, and replace the prior credentials after verification. Requires idempotencyKey and the current revision when replacing.

## connectors

- [`connectors.get`](https://app.getoatmilk.com/docs/api/connectors.get.md) — Read one connector's status and non-secret configuration. For Notion this includes the mapped invoice, customer, vendor, and contact databases, property and status mappings, sync settings, and the last sync summary.

- [`connectors.list`](https://app.getoatmilk.com/docs/api/connectors.list.md) — List available connectors grouped as financial (Stripe, Wise), data (Notion), and communication (email delivery), with connection status and capabilities. Organization admins manage provider credentials in Settings; secret values are never returned.

- [`connectors.test`](https://app.getoatmilk.com/docs/api/connectors.test.md) — Check a connector's connection now and record the result. For Notion this verifies the integration token and returns the workspace and integration name.

- [`connectors.update`](https://app.getoatmilk.com/docs/api/connectors.update.md) — Save Notion connector settings: database mappings (data source, property mapping, status option mapping) for invoices, customers, vendors, and contacts, and sync settings. Mappings are validated against the live Notion schema. Supply idempotencyKey and optionally expectedRevision.

## connectors.googleDrive

- [`connectors.googleDrive.connect`](https://app.getoatmilk.com/docs/api/connectors.googleDrive.connect.md) — Start connecting the company's Google Drive with read-only access: returns url, the Google consent page for the admin to open while signed in to Oatmilk (only the admin who asked can finish it, within ten minutes). Optional returnTo is an Oatmilk path to come back to. Once connected, import files and folders with dataSources.import (source google_drive; target company_documents to file incorporation papers and fill the company profile). Disconnect with connectors.credentials.remove (id google_drive).

- [`connectors.googleDrive.status`](https://app.getoatmilk.com/docs/api/connectors.googleDrive.status.md) — Read whether Google Drive can be connected here (configured), whether it is connected, and the Google account that connected it. Never returns a token.

## connectors.wise

- [`connectors.wise.signingKey.create`](https://app.getoatmilk.com/docs/api/connectors.wise.signingKey.create.md) — Create a signing key for Wise's strong customer authentication from the administrator dashboard. The private half is saved encrypted with the Wise credential; only the public half is returned, to add in Wise (Settings › API tokens › Manage public keys). A saved key is replaced only with replace true, because payouts sign with the same key. Requires the credential's expectedRevision and idempotencyKey.

- [`connectors.wise.statementAccess`](https://app.getoatmilk.com/docs/api/connectors.wise.statementAccess.md) — Read whether Wise's monthly statement PDFs reach Oatmilk: the state (working, waiting, needs a signing key, key not in Wise, refused, not found), how many are kept, when Oatmilk last approved Wise's strong customer authentication and when Wise will ask again (about every 90 days; Oatmilk approves it automatically with the saved signing key), the last refusal, and the saved key's public half to add in Wise. The private key is never returned.

- [`connectors.wise.statements.check`](https://app.getoatmilk.com/docs/api/connectors.wise.statements.check.md) — Ask Wise for statement PDFs now without waiting out a refusal: one month per synced balance, oldest missing first, signing Wise's approval request with the saved key when Wise asks. Returns what was kept and the statement access status. Supply idempotencyKey.

## dataImports

- [`dataImports.commit`](https://app.getoatmilk.com/docs/api/dataImports.commit.md) — Start an import in the background with the mapping and decisions: create or choose customers and contractors, link or skip invoice numbers already in Oatmilk, and import or skip possible duplicate payments. Invoices keep their original numbers without using the invoice sequence, paid rows get their payment, the first PDF becomes the invoice's PDF, and Notion rows are linked for sync. Contractor payments are recorded as paid outside Wise; no money is sent and nobody is emailed. Rows already imported are skipped. Returns the import to follow with dataImports.get. Supply idempotencyKey.

- [`dataImports.definitions`](https://app.getoatmilk.com/docs/api/dataImports.definitions.md) — List what can be imported from a connected database (invoices and contractor payment history): each field with its type, whether it's required, and the kinds of columns it accepts, plus the databases imported from recently.

- [`dataImports.files`](https://app.getoatmilk.com/docs/api/dataImports.files.md) — Get short-lived download links for the files an imported invoice came with, and where it was imported from.

- [`dataImports.get`](https://app.getoatmilk.com/docs/api/dataImports.get.md) — Read one import with its progress, counts, the customers or contractors it added, and each row's outcome with a link to what it created.

- [`dataImports.history`](https://app.getoatmilk.com/docs/api/dataImports.history.md) — List imports, newest first, with their source database, status and counts. Filter by target or database.

- [`dataImports.preview`](https://app.getoatmilk.com/docs/api/dataImports.preview.md) — Read every row of the database with a column mapping and group the rows: ready, needs a decision (a new or ambiguous customer or contractor, an invoice number already in Oatmilk, or a possible duplicate payment), already imported, can't import (with the reason), or left out. Nothing is saved. Payment and tax columns are never read, and what they hold is hidden anywhere else in the preview.

- [`dataImports.resume`](https://app.getoatmilk.com/docs/api/dataImports.resume.md) — Continue an import that paused before it finished, for example after a time limit. It continues as the person who started it. Supply idempotencyKey.

- [`dataImports.suggest`](https://app.getoatmilk.com/docs/api/dataImports.suggest.md) — Suggest a column of a connected database (Notion) for each field of an import target, with a sample value per column, the status options found, and the mapping remembered for that database. Supply target, source and databaseId. A column whose name says it holds payment or tax details is marked sensitive, has no sample or options, and is never suggested or imported.

- [`dataImports.undo`](https://app.getoatmilk.com/docs/api/dataImports.undo.md) — Undo a contractor payment import: the payouts it recorded are cancelled when they haven't changed since, and the rows can be imported again. Imported invoices are voided from each invoice instead. Supply reason and idempotencyKey.

## dataSources

- [`dataSources.files`](https://app.getoatmilk.com/docs/api/dataSources.files.md) — List the files attached to a row or page: files in file columns and files embedded in the page. For google_drive, itemId is a folder (its files, partial when there are more than 200) or a file (itself); Google Docs, Sheets and Slides are listed as PDFs. With target, files already imported there are marked. File download addresses are never returned.

- [`dataSources.importFiles`](https://app.getoatmilk.com/docs/api/dataSources.importFiles.md) — Import up to 25 files from a data source into Oatmilk: receipts (processed like uploaded receipts), tax_sources (supporting originals, no expense), signing_files (documents to send for signature), executed_agreements (agreements signed elsewhere; targetOptions parties, executedOn, title) contractor_agreements (draft documents; optional targetOptions contractorId, expectedContractorRevision and title create the draft agreement) or company_documents (incorporation papers and other company records: each is filed through intake as a company record, read, and fills the company profile's empty fields; the record is the document id). Sources are notion and google_drive. Each file is downloaded server-side, checked against its target's size limit and file types by its contents, and run through that target's usual upload path. Importing the same file into the same place again returns the existing record. Returns a result for each file. Supply idempotencyKey.

- [`dataSources.list`](https://app.getoatmilk.com/docs/api/dataSources.list.md) — List data sources files and records can be imported from (Notion, and Google Drive once an admin connects it with connectors.googleDrive.connect; OneDrive is listed as not available yet), with connection status, pinned databases and databases mapped in Settings › Connectors.

- [`dataSources.pin`](https://app.getoatmilk.com/docs/api/dataSources.pin.md) — Pin or unpin a database for everyone in the workspace so it appears first when importing. Supply source, databaseId, pinned and idempotencyKey.

- [`dataSources.readText`](https://app.getoatmilk.com/docs/api/dataSources.readText.md) — Read the text of a CSV or plain-text file attached to a row or page (up to 2 MB, UTF-8), for example a bank statement to import with imports.preview and imports.commit. Nothing is stored.

- [`dataSources.resolve`](https://app.getoatmilk.com/docs/api/dataSources.resolve.md) — Open a pasted link or ID from a data source (for Notion: notion.so, app.notion.com, notion.site links, database and page IDs; for Google Drive: drive.google.com and docs.google.com links to files and folders, or a Drive ID). Returns whether it is a database or a page and the database ID to read rows from.

- [`dataSources.rows`](https://app.getoatmilk.com/docs/api/dataSources.rows.md) — Read rows of a database with readable, typed values for every column: text, numbers with their format, dates, options, people, related page titles, checkboxes, links and attached files. Supports search, sort by a column, only rows with files, and cursor paging. With target, files already imported there are marked. File download addresses are never returned. Columns whose names say they hold payment or tax details (bank, account, transit, institution and routing numbers, IBAN, SWIFT/BIC, Wise or Interac addresses, SIN, SSN, business or tax numbers) read as [hidden], what they hold is hidden anywhere else in the rows too, and they're never searched or sorted by.

- [`dataSources.schema`](https://app.getoatmilk.com/docs/api/dataSources.schema.md) — Read a database's columns with their types, options, number formats (and the currency they imply), related databases, and the columns suggested for a first view. Columns whose names say they hold payment or tax details list no options and can't be sorted or searched by.

- [`dataSources.search`](https://app.getoatmilk.com/docs/api/dataSources.search.md) — Search a data source for databases and pages shared with Oatmilk, most recently edited first. Supply source, optional query, kind (database, page, file or any), cursor and limit. For google_drive it searches file and folder names across My Drive and shared drives (kind file leaves folders out; Drive has no databases).

## notion.dataSources

- [`notion.dataSources.get`](https://app.getoatmilk.com/docs/api/notion.dataSources.get.md) — Read a Notion data source's properties and suggested mappings for each role (invoices, customers, vendors, contacts), including suggested status option mappings.

- [`notion.dataSources.query`](https://app.getoatmilk.com/docs/api/notion.dataSources.query.md) — Preview rows of a Notion data source with simplified property values, optionally filtered by a title search. Paged with cursor. Properties whose names say they hold payment or tax details (bank, account, transit, institution and routing numbers, IBAN, SWIFT/BIC, Wise or Interac addresses, SIN, SSN, business or tax numbers) read as [hidden], and what they hold is hidden anywhere else in the rows too.

## notion.invoices

- [`notion.invoices.import`](https://app.getoatmilk.com/docs/api/notion.invoices.import.md) — Link existing Notion invoice rows to Oatmilk invoices. Status differences become suggestions for review; nothing is overwritten. Supply selections of pageId and invoiceId, plus idempotencyKey.

- [`notion.invoices.importPreview`](https://app.getoatmilk.com/docs/api/notion.invoices.importPreview.md) — Preview existing rows in the mapped Notion invoice database with the Oatmilk invoice each one most likely matches, whether it's already linked, and whether the statuses differ.

## notion.links

- [`notion.links.confirm`](https://app.getoatmilk.com/docs/api/notion.links.confirm.md) — Confirm a suggested Notion link. Any other confirmed link for the same record and database is replaced. Requires expectedRevision and idempotencyKey.

- [`notion.links.create`](https://app.getoatmilk.com/docs/api/notion.links.create.md) — Link an Oatmilk account, invoice, or contractor to a Notion page by page ID or pasted link. Links created by a person are confirmed unless status is proposed. Supply idempotencyKey.

- [`notion.links.list`](https://app.getoatmilk.com/docs/api/notion.links.list.md) — List links between Oatmilk records (accounts, invoices, contractors) and Notion pages, with their status (suggested, confirmed, declined), method, match reasons, and sync state.

- [`notion.links.reject`](https://app.getoatmilk.com/docs/api/notion.links.reject.md) — Decline a suggested Notion link so it isn't suggested again. Requires expectedRevision and idempotencyKey.

- [`notion.links.remove`](https://app.getoatmilk.com/docs/api/notion.links.remove.md) — Remove a Notion link. The Notion page itself is not changed. Requires expectedRevision and idempotencyKey.

## notion

- [`notion.lookup`](https://app.getoatmilk.com/docs/api/notion.lookup.md) — 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.

- [`notion.resolveLink`](https://app.getoatmilk.com/docs/api/notion.resolveLink.md) — Resolve a pasted Notion link or ID (notion.so, app.notion.com, notion.site, collection://) to the page, database, or data source it refers to.

- [`notion.search`](https://app.getoatmilk.com/docs/api/notion.search.md) — Search Notion databases (data sources) or pages that are shared with the integration, most recently edited first.

## notion.sync

- [`notion.sync.run`](https://app.getoatmilk.com/docs/api/notion.sync.run.md) — 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.

## webhooks.deliveries

- [`webhooks.deliveries.list`](https://app.getoatmilk.com/docs/api/webhooks.deliveries.list.md) — List webhook deliveries with status, attempts, response code, duration, a redacted response excerpt, and the signed payload. Filter by endpoint, status, or event type.

- [`webhooks.deliveries.retry`](https://app.getoatmilk.com/docs/api/webhooks.deliveries.retry.md) — Queue a failed or cancelled delivery to be sent again with the same event payload. Requires expectedRevision and idempotencyKey.

- [`webhooks.deliveries.stats`](https://app.getoatmilk.com/docs/api/webhooks.deliveries.stats.md) — Summarize webhook deliveries of real events (not tests) for the last 1, 7 or 30 days: how many were delivered, failed or are still waiting, median and 95th percentile response times, deliveries per day, each endpoint's counts, the busiest event types and the most common failure reasons.

## webhooks.endpoints

- [`webhooks.endpoints.archive`](https://app.getoatmilk.com/docs/api/webhooks.endpoints.archive.md) — Remove an endpoint and cancel its queued deliveries. Delivery history is kept. Requires expectedRevision and idempotencyKey.

- [`webhooks.endpoints.create`](https://app.getoatmilk.com/docs/api/webhooks.endpoints.create.md) — Create an outgoing webhook endpoint with an https URL on the standard port (443) or 8443 and event subscriptions (exact names, group wildcards such as invoice.*, or *). Private and local network addresses are refused. The signing secret is returned once; replaying the same idempotencyKey returns the same response to the same person. Supply idempotencyKey.

- [`webhooks.endpoints.list`](https://app.getoatmilk.com/docs/api/webhooks.endpoints.list.md) — List outgoing webhook endpoints with their subscribed events, status, recent delivery counts, and the last four characters of each signing secret.

- [`webhooks.endpoints.rotateSecret`](https://app.getoatmilk.com/docs/api/webhooks.endpoints.rotateSecret.md) — Replace an endpoint's signing secret. The new secret is returned once and signs every later delivery. Requires expectedRevision and idempotencyKey.

- [`webhooks.endpoints.update`](https://app.getoatmilk.com/docs/api/webhooks.endpoints.update.md) — Change an endpoint's URL, description, events, or turn it on or off. Turning a disabled endpoint back on resets its failure count. Requires expectedRevision and idempotencyKey.

## webhooks.events

- [`webhooks.events.catalog`](https://app.getoatmilk.com/docs/api/webhooks.events.catalog.md) — List the event types Oatmilk can send to webhooks, grouped by area, with descriptions and sample payloads.

## webhooks

- [`webhooks.test`](https://app.getoatmilk.com/docs/api/webhooks.test.md) — Send a test event to an endpoint, either webhook.test or a sample of a catalog event, signed like real deliveries. Supply idempotencyKey.

## wise

- [`wise.profiles`](https://app.getoatmilk.com/docs/api/wise.profiles.md) — Discover eligible Wise profiles using backend read-only credentials.

- [`wise.status`](https://app.getoatmilk.com/docs/api/wise.status.md) — Read safe Wise synchronization readiness and last successful sync.

- [`wise.sync`](https://app.getoatmilk.com/docs/api/wise.sync.md) — Synchronize configured Wise statements with durable history and duplicate handling, and keep Wise's own monthly statement PDF for each balance once the month is over (each month once). Optional from and to fetch that inclusive history period (up to 400 days), including quiet balances, without changing the normal sync cursor. Each run fetches up to three monthly windows; remainingWindows and nextFrom say what remains. Pass nextFrom as from with the same to to continue. Future end dates stop at the database cutoff accepted for that request. Retrying the same key resumes its frozen original inputs; completed retries return the saved response. Use a new key for the next history pass or a new sync. Receipt jobs may be queued with imported zero and continue in their own worker. Matching and Autopilot jobs are queued once per accepted sync; Autopilot classifies the new lines afterwards unless skipAi is true.

## wise.receipts

- [`wise.receipts.decide`](https://app.getoatmilk.com/docs/api/wise.receipts.decide.md) — Keep saved fields or accept proved incoming merchant, canonical tax, and address values from an immutable Wise receipt review. Values come from the server. Requires exact review and entry revisions, fingerprint, reason, and idempotency key. Bank money and date use the existing correction workflow.

- [`wise.receipts.review`](https://app.getoatmilk.com/docs/api/wise.receipts.review.md) — Compare the previous Wise source, newly read evidence, and saved transaction using a private immutable review. Unknown tax stays distinct from confirmed zero.

- [`wise.receipts.status`](https://app.getoatmilk.com/docs/api/wise.receipts.status.md) — Read scoped durable receipt-sync progress for one Wise purchase without starting provider work.

- [`wise.receipts.sync`](https://app.getoatmilk.com/docs/api/wise.receipts.sync.md) — Queue a preserved, evidence-only read of receipts attached to this exact existing Wise purchase. Requires current entry revision and a stable idempotency key. Reviewed purchases are supported; closed purchases retain evidence without financial changes.
