Intelligence is foundation
Subscribe
  • Luma
  • About
  • Sources
  • Ecosystem
  • Nura
  • Marbl Codes
00:00
Contact
[email protected]
Connect
  • YouTube
  • LinkedIn
  • GitHub
Legal
Privacy Cookies Terms
  1. Home›
  2. Featured›
  3. Web Development›
  4. API Contracts Break Because Nobody Writes Down the Rules
Web Development Wednesday, 22 April 2026

API Contracts Break Because Nobody Writes Down the Rules

Share: LinkedIn
API Contracts Break Because Nobody Writes Down the Rules

Your API breaks in production not because the code is wrong. It breaks because the implicit rules you thought everyone understood were never written down.

A recent article on Dev.to makes a simple argument: most API contract failures aren't implementation bugs. They're agreements that lived in someone's head, got shipped without documentation, and broke the first time a consumer made a reasonable but undocumented assumption.

The fix isn't better testing. It's writing the contract properly in the first place.

The Silent Assumptions That Kill APIs

Here's a common failure mode. Your API returns an error. The consumer retries. The retry succeeds, but now the operation has happened twice. Was that meant to be idempotent? The spec doesn't say. The implementation assumed retry logic would handle it. The consumer assumed the endpoint was safe to retry. Both assumptions were reasonable. Both were wrong.

Or: your API starts returning a new error code. The consumer's error handling doesn't recognise it and treats it as a fatal failure. Should that new error code have been a breaking change? Was there a taxonomy of error types that indicated which ones were retryable? If there was, nobody wrote it down.

These aren't edge cases. They're the everyday reality of API contracts that specify request and response shapes but not the behaviour those shapes enable.

What Actually Needs to Be in the Spec

The article argues for three categories of rules that belong in specs but usually live in tribal knowledge:

Error taxonomy. Not just "here are the error codes" but "here's what each error means and how you should respond". Which errors are retryable? Which indicate client mistakes versus server failures? Which should trigger alerts versus silent fallbacks? If the consumer has to guess, you've left the contract incomplete.

Idempotency rules. Which operations are safe to retry? Which generate unique IDs on every call? Which require the client to send an idempotency key? This isn't optional information. It's the difference between a reliable system and one that randomly double-charges customers when a network blip causes a retry.

Breaking change definitions. What counts as breaking? Adding a field is usually safe. Removing one isn't. But what about changing field types? Adding required validation? Returning null where you used to return an empty array? If your versioning strategy depends on "we won't break things" but you haven't defined what breaking means, you're one deploy away from angry consumers.

Why Specs Fail to Cover This

OpenAPI and similar tools focus on structure. They're good at describing what a valid request looks like and what fields a response contains. They're not designed to capture "if you send this request twice, the second one is ignored" or "this error code means back off for 60 seconds".

That information ends up in README files, Slack conversations, or the heads of whoever built it. When that person leaves, the knowledge goes with them. The new developer reads the spec, thinks they understand the contract, and ships code that works until it doesn't.

For business owners running services built on third-party APIs, this is why integrations break in ways that feel like the other side changed something. Often they didn't. They just never told you the full set of rules, and you made a reasonable assumption that turned out to be wrong.

Fixing It Before It Ships

The solution isn't complicated. Before writing code, write the behavioural contract. Not as comments or documentation that will drift out of sync, but as part of the spec itself.

If your API design process starts with "what does the request look like", you're already too late. Start with "what promises are we making about how this behaves". Is it idempotent? What errors can it return and what should clients do with them? What changes would break existing consumers?

Write those rules down. Make them reviewable. Make them enforceable - some of this can be tested, some of it has to be policy, but all of it should be explicit.

The article's argument is that this prevents the majority of production API failures. Not all of them - you'll still have bugs, performance issues, unexpected edge cases. But the failures caused by "I didn't know that's how it worked" mostly disappear.

The Cost of Incomplete Contracts

Every unwritten rule is a production incident waiting to happen. Every implicit assumption is a support ticket when it turns out not everyone made the same assumption. Every "we'll document that later" is technical debt that compounds with every new consumer.

The time to fix it is before the first integration. Once you have consumers in production, changing the rules becomes a migration project. Writing them down upfront is an afternoon of careful thinking. Worth it.

More Featured Insights

Artificial Intelligence
Meta Turns Employee Keystrokes Into Training Data
Quantum Computing
Like Charges Attract - And Nobody Knows Why

Today's Sources

TechCrunch
Meta will record employees' keystrokes and use it to train its AI models
arXiv cs.AI
ARES: Adaptive Red-Teaming and End-to-End Repair of Policy-Reward System
arXiv cs.LG
Easy Samples Are All You Need: Self-Evolving LLMs via Data-Efficient Reinforcement Learning
arXiv cs.LG
Compile to Compress: Boosting Formal Theorem Provers by Compiler Outputs
arXiv cs.AI
Beyond One Output: Visualizing and Comparing Distributions of Language Model Generations
AI News
The role of AI in modern forex bot development
Physics World
Long range attraction between like charged particles
Physics World
Hidden polarization unlocks non-volatile Hall switching
arXiv – Quantum Physics
Lund Plane to Bloch (LP2B) Encoding for Object and Polarization Tagging with Quantum Jet Substructure
arXiv – Quantum Physics
Classically Forbidden Signatures of Quantum Coherence in the Mesoscopic Lipkin-Meshkov-Glick Model
arXiv – Quantum Physics
Coherence-gated quantum devices via real-time weak measurement
Dev.to
Why Your API Contract Breaks in Production (And How to Fix It in the Spec)
Dev.to
Deconstructing X (Twitter) Media Streaming: Building a High-Performance Video Extraction Engine
InfoQ
Cloudflare Outlines MCP Architecture as Enterprises Confront Security and Governance Risks
Stack Overflow Blog
How to get multiple agents to play nice at scale
Hacker News
XOR'ing a register with itself is the idiom for zeroing it out. Why not sub?

About the Curator

Richard Bland
Richard Bland
Founder, Marbl Codes

27+ years in software development, curating the tech news that matters.

Subscribe RSS Feed
View Full Digest Today's Intelligence
Richard Bland
About Sources Privacy Cookies Terms Thou Art That
MEM Digital Ltd t/a Marbl Codes
Co. 13753194 (England & Wales)
VAT: 400325657
3-4 Brittens Court, Clifton Reynes, Olney, MK46 5LG
© 2026 MEM Digital Ltd