# Documentation Update When the Code Changes

Source: https://maito.app/workflows/update-docs-when-the-code-changes

When a pull request changes an API or setting, Maito updates the matching docs in the same pull request and lists the wiki pages that are now out of date.

When an API or setting changes, the docs get a matching update.

[Engineering](https://maito.app/workflows/team/engineering) · [Software](https://maito.app/workflows/industry/software) · When something happens · Updated October 19, 2026

Works with

-   Slack
-   Email
-   Notion
-   [Confluence](https://maito.app/workflows/tool/confluence)
-   Box

## How do you update documentation when the code changes?

To update documentation when the code changes, set a Loop in Maito that starts when a pull request opens. It reads what changed in the API or settings, commits matching edits to your docs files, and checks Notion, Confluence or Box pages that still describe the old behavior. It lists those edits for you to approve.

## How it's done today

Docs drift behind the code.

## What Maito does

1.  Read the change
2.  Find docs that describe it
3.  Draft the doc update in the same PR

## Example

Loop run: Pull request opened · #877 Add status filter to GET /v1/invoices

**Maito** (11:36 AM):

PR #877 changes GET /v1/invoices. I added a docs commit to the pull request.

• New ?status parameter: draft, open, paid, void  
• Example response updated  
• The deprecated amount field is removed. That breaks existing clients.

Changed: docs/api/invoices.md, 2 sections.

**Catch:** the Notion page Invoices API guide still tells people to read amount in 3 places, and the Zapier example on it uses it too. Replacement text is ready in notion-invoices-edits.md. I haven't touched Notion.

From the diff and the Notion page. Want me to apply the Notion edits once the reviewer approves the PR?

**Alex** (11:52 AM):

yes, once it's approved. And add a breaking-change note to the PR description.

**Maito** (11:53 AM):

Added the note to the PR description. I'll apply the Notion edits after approval and say so here.

## How to set it up

When something happens Update docs when the code changes

Ask your agent

“When a pull request changes our public API, update the API docs in the same pull request. Also check the Notion docs for anything that now says the wrong thing, and post what you found in #eng.”

Connect docs

-   Notion
-   Confluence
-   Box

Not connected yet? Your agent sends you a link to sign in.

## What it won't do

It finds the pages it is connected to. Docs kept somewhere else, or written in words that do not match the code, can be missed.

## Questions

### Does it edit our wiki pages directly?

No. It prepares replacement text for pages in Notion, Confluence or Box and leaves the pages alone until you approve.

### Where do the docs changes go?

Into the same pull request, as a separate commit, so the reviewer sees code and docs together.

### Does it warn about breaking changes?

Yes. If a field is removed or renamed, it calls that out in the pull request comment.

## More engineering workflows

-   [Turn a ticket into a tested pull request Hand over a well-scoped ticket and get back a pull request with tests. Engineering · When you ask Works with Linear, Jira.](https://maito.app/workflows/turn-a-ticket-into-a-tested-pull-request)
-   [Review a teammate's pull request Get a first review that catches bugs and missed cases before a person looks. Engineering · When something happens Works with Slack, Email.](https://maito.app/workflows/review-a-teammates-pull-request)
-   [Check a change for security problems Look at a change for injection, leaked secrets and missing permission checks. Engineering · When you ask Works with Slack, Email.](https://maito.app/workflows/check-a-change-for-security-problems)
-   [Write the changelog Twice a week, turn merged pull requests into a changelog people can read. Engineering · On a schedule Works with Slack, Email.](https://maito.app/workflows/write-the-changelog)
-   [Nudge stale pull requests Pull requests waiting too long get a polite reminder to the right reviewer. Engineering · On a schedule Works with Slack, Email.](https://maito.app/workflows/nudge-stale-pull-requests)
-   [File a bug from a Slack thread When a bug comes up in chat, mention Maito and it gets filed once, with details and no duplicates. Engineering · When you ask Works with Linear, Jira.](https://maito.app/workflows/file-a-bug-from-a-slack-thread)

[See all workflows](https://maito.app/workflows)

## Put your AI teammate to work.

Set it up in minutes. Start with this one, and let it earn the next one.

[Put Maito to work](https://maito.app/login?returnTo=%2Fworkflows%2Fupdate-docs-when-the-code-changes)[Book a demo](mailto:support@maito.app?subject=Maito%20demo)
