API Architecture

An API is a promise.

When you publish one, you are telling other teams, partners and increasingly AI agents: "Call me this way, and I will behave like this." Every consumer that builds on that promise makes it harder to change.

That is why API architecture matters so much. A well-designed API can serve an organization for a decade. A poorly designed one becomes technical debt the day it goes live.

What API Architecture Covers

API architecture is the set of decisions about how APIs are designed, structured, secured, versioned and operated across an organization. It sits at two levels:

Most teams focus on the first. The second is where architects add the most value.

Grid of API architecture principles: contract first, resource oriented, versioned, secure by default, consistent, observable, discoverable
Principles that make APIs last

Principles I Rely On

Design the contract first

Write the API specification, usually in OpenAPI, before writing any code. Share it with consumers. Let them react. Changing a specification costs minutes. Changing a live API costs months.

Model business resources, not tables

An API should speak the language of the business: Customer, Order, Shipment. If your API exposes column names from a legacy database, you have leaked complexity to every consumer.

Be consistent

Naming, error formats, pagination, filtering and date formats should work the same way across every API in the organization. Consistency is what makes a large API landscape feel simple.

Secure by default

Every API needs authentication and authorization. Use standards like OAuth 2.0, give each consumer the least access it needs, and never rely on "nobody knows this URL exists".

Plan for change

APIs evolve. Add fields without breaking consumers. When breaking changes are unavoidable, version the API and give consumers a clear migration path and timeline.

Make it observable

Every call should be logged, measured and traceable. When something breaks, you need to know who called what, when, and what happened.

REST, GraphQL or Events?

This is one of the most common questions I get.

Most mature landscapes use all three, each where it fits best.

Common Mistakes

APIs and AI Agents

APIs are quickly becoming the way AI agents interact with the enterprise. Agents need clear descriptions, predictable behavior, strong security and fine-grained permissions. Organizations with well-designed APIs are discovering they are already halfway to being agent-ready.

Final Thought

Good API architecture is not about following a style guide perfectly.

It is about treating every API as a product with real consumers, designing it with care, and remembering that the promise you make today will be kept for many years.