APIs are promises — design them accordingly
Every API you publish is a contract. External consumers, internal services, mobile apps, and third-party integrations all depend on your API behaving as documented. When you change that behaviour — even subtly — you risk breaking systems you do not control and may not even know about. This makes API design one of the most consequential decisions in software engineering, yet it is routinely treated as an implementation detail rather than an architectural concern.
At Logicbric, our APIs power integrations across property management platforms, field service dispatch systems, compliance screening tools, and industrial ERP. Some of these integrations are consumed by client systems we have no visibility into. The cost of a breaking change is not just a failed build — it is a broken integration that might not be discovered until a compliance audit fails or a field technician cannot access their work orders.
The cost of fixing a bad API is not in the code — it is in the coordination. Every consumer you break must be found, notified, updated, and verified. This cost grows linearly with your consumer count and exponentially with your API surface area.
Design for evolution, not perfection
No API is perfect at launch, and no API remains unchanged. The goal is not to design the perfect API — it is to design one that can evolve without breaking existing consumers. This requires discipline in three areas: additive-only changes, explicit versioning, and consumer-driven contracts.
Additive-only changes mean that you can add new fields to responses, new optional parameters to requests, and new endpoints — but you never remove a field, change a field’s type, or alter the behaviour of an existing endpoint. Consumers that do not know about the new fields simply ignore them. This approach covers 80% of API evolution needs without any versioning complexity.
When additive changes are not enough — when you need to fundamentally restructure a resource, change a core workflow, or fix a design mistake — you version. But versioning is expensive. Each version you maintain is a parallel codebase that needs testing, monitoring, and eventual deprecation. We version at the resource level rather than the API level: /v2/properties can coexist with /v1/tenants. This limits the blast radius of versioning to the specific resource that is changing.
Practical versioning strategies
- URL path versioning (/v1/resources): The most explicit and debuggable approach. Every request clearly identifies which version it targets. We use this for public APIs because it makes version usage visible in logs, documentation, and consumer code.
- Header versioning (Accept: application/vnd.api+json; version=2):Cleaner URLs but less visible. We use this for internal APIs where all consumers are services we control.
- Query parameter versioning (?version=2): Avoid this. It is easy to overlook, awkward to cache, and ambiguous when combined with other parameters.
Consumer-driven contract testing
The most powerful tool for preventing breaking changes is consumer-driven contract testing. Instead of testing your API against your own expectations, you test it against the actual contracts your consumers depend on. Each consumer defines the fields, types, and behaviours they rely on. Your CI pipeline verifies that every change satisfies all consumer contracts before deployment.
In Dynabric, where the field service API is consumed by both the mobile app and the vendor portal, consumer-driven contracts have caught three potentially breaking changes before deployment in the last six months. Each would have caused production incidents affecting field technicians in the field — exactly the people who cannot wait for a hotfix.
Deprecation as a first-class process
Old API versions must eventually be retired, but deprecation is often handled carelessly — a note in the changelog that nobody reads, followed by a sudden shutdown that breaks consumers. We treat deprecation as a multi-stage process: announcement (6 months before sunset), migration support (documentation, tooling, and direct outreach to known consumers), sunset warning headers on every response from the deprecated version, usage monitoring (do not sunset a version that still has active consumers), and finally decommissioning with a clear error message directing consumers to the new version.
What this means for your team
Invest in API design review as a formal step in your development process. Every new endpoint or significant change should be reviewed by someone who understands API design principles and the full consumer landscape. Build consumer-driven contracts early, before your consumer count makes it impractical to retrofit. And treat your API documentation as a product, not an afterthought — if your docs are wrong, your API is wrong, because consumers build against the docs, not the code.