How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

How do I stop my API from drifting away from its documentation?

description Specifications & Contracts Updated August 12, 2026

Short answer

Make the contract executable in your pipeline. Lint the definition on every change, run contract tests against the live API, and fail the build when the two disagree. Drift is a process problem, not a discipline problem.

Drift is not a failure of individual diligence, and telling people to be more careful has never fixed it anywhere. It is a failure of the pipeline to notice.

Three checks, all automatable, close almost all of it. First, lint the definition itself on every pull request — is it valid, does it follow the style guide, is every operation described, is every response documented. Second, run contract tests: call the deployed API and assert that responses validate against the schemas in the definition. Third, diff the definition against the previous version and fail or flag on a breaking change that has not been declared as one.

The second check is the one most teams skip and the one that catches real drift, because it compares the document to reality rather than to itself.

Underneath all three, invest in shared schema. Most drift starts as schema divergence — the same business object described five different ways in five services — and then surfaces later as an integration break that takes a week to trace. Shared, versioned, reusable JSON Schema is the stabilizing work.

And put the results where people already are. A linting failure in a pull request gets fixed. A quality report emailed monthly to a governance mailing list does not.

Go deeper in the guidance

This answer is distilled from the API Evangelist guidance catalog — the long-form treatment of each topic, with its own citations back into sixteen years of writing.

Read the original writing

The posts on apievangelist.com this answer is built on.