← Lessons

quiz vs the machine

Platinum1750

System Design

HATEOAS and Discoverability

Letting responses tell the client what it can do next instead of hardcoding every URL.

5 min read · advanced · beat Platinum to climb

The idea behind the acronym

HATEOAS stands for hypermedia as the engine of application state. In plain terms, each response includes links to the actions and related resources available next, so the client follows links rather than constructing URLs from hardcoded templates.

What it changes

A plain REST client knows every URL ahead of time and breaks when the server reshapes them. A hypermedia client starts at one entry point and navigates by reading the links the server returns, much like a browser following anchor tags.

  • Available transitions are discoverable at runtime.
  • The server can relocate resources without breaking clients that follow links.
  • State specific actions appear only when valid, like a cancel link that vanishes once an order ships.

Why adoption is modest

HATEOAS adds payload weight and demands clients written to follow links. Many teams skip it because they control both sides and find hardcoded URLs simpler. It shines most for long lived, widely consumed public APIs.

Key idea

HATEOAS embeds next step links in responses so clients discover actions at runtime and survive URL changes.

Check yourself

Answer to earn rating on the learn ladder.

1. What does a HATEOAS response add that a plain REST response does not?

2. Why might a cancel link be absent from a shipped order response?