HATEOAS, short for hypermedia as the engine of application state, is the REST architectural constraint under which a server tells the client what it can do next by embedding links and actions inside each response, instead of relying on URL patterns hard-coded in the client. In the field of APIs, it is the property that separates a fully RESTful interface from one that merely uses HTTP verbs and JSON.
The idea comes from the uniform interface constraint described in Roy Fielding’s 2000 dissertation, which defined REST. A client that follows HATEOAS needs to know only an entry point URL and the meaning of the link relations it encounters; everything else is discovered at runtime, much as a person browses a website by clicking links rather than typing addresses.
How hypermedia drives application state
HATEOAS works by making every representation a state description plus a set of transitions. When a client retrieves an order, the response contains the order data and links such as cancel, pay or track, and only the transitions that are valid in the current state appear. A shipped order, for example, no longer offers a cancel link.
Each link carries a link relation type (the rel value) that names its meaning, and a target URI. Standard relations such as self, next, prev, item and collection are registered by IANA under RFC 8288 (Web Linking); custom relations are usually expressed as URIs so that they stay unambiguous. The client is coded against relation names, not URLs, which is the source of the decoupling.
The following table breaks a hypermedia response into its working parts and states what each part contributes.
| Component | Role | Example |
|---|---|---|
| Resource state | Current data of the resource | Order total, status, items |
| Link relation | Names the meaning of a transition | rel: "payment" |
| Target URI | Where the transition is sent | /orders/812/payment |
| Method or affordance | How to invoke the transition | POST with a form template |
| Media type | Defines how links are encoded | application/hal+json |
Hypermedia formats used for HATEOAS
Plain JSON has no native concept of a link, so HATEOAS in practice depends on a hypermedia-aware media type that defines where links live and what they mean. HTML is the oldest and most complete example, because forms and anchors already express both navigation and actions.
Several JSON formats emerged to fill this gap, and they differ mainly in whether they describe only links or also actions with their required fields. The comparison below covers the formats most often seen in production APIs.
| Format | Links | Actions and forms | Typical use |
|---|---|---|---|
| HAL | Yes, in _links | No, links only | Simple navigable APIs |
| JSON:API | Yes, in links objects | Limited, by convention | Resource-oriented CRUD APIs |
| Siren | Yes, in links | Yes, in actions with fields | Workflow-heavy APIs |
| Collection+JSON | Yes | Yes, via templates | List and query APIs |
| JSON-LD with Hydra | Yes, semantic | Yes, operation descriptions | Linked data and semantic web |
| HTML | Yes, anchors | Yes, forms | Browser-facing applications |
Choosing a format is a long-term contract decision, because clients must parse it everywhere. HAL is the most widely adopted for its simplicity, while Siren suits processes in which the client must know which fields an action requires.
HATEOAS within the REST maturity model
HATEOAS is the top level of the Richardson Maturity Model, a popular way to grade how far an HTTP API follows REST. Most public interfaces described as a REST API stop at level two, using resources and HTTP methods correctly but documenting URL templates for clients to build.
| Level | Characteristic | Client knowledge required |
|---|---|---|
| Level 0 | Single endpoint, RPC over HTTP | All operations and payloads |
| Level 1 | Distinct resources with URIs | Every URI pattern |
| Level 2 | HTTP methods and status codes used properly | URI patterns and method semantics |
| Level 3 | Hypermedia controls in responses | Entry point and link relations only |
Fielding himself has stated that an API which is not driven by hypertext is not RESTful, a point frequently ignored in industry usage. The gap explains why the term REST is often used loosely for any JSON-over-HTTP interface.
How HATEOAS compares with other API styles
HATEOAS shifts workflow knowledge from client to server, whereas most competing styles keep it in the client or in a shared schema. GraphQL, gRPC and JSON-RPC rely on out-of-band contracts such as schemas or protocol buffer definitions, and an OpenAPI document plays a similar role for level-two REST.
| Style | Discovery mechanism | Coupling to server URLs | Workflow logic location |
|---|---|---|---|
| HATEOAS REST | Links in each response | Low | Server |
| Level 2 REST with OpenAPI | Static description file | High | Client |
| GraphQL | Introspected schema | Single endpoint | Client queries |
| gRPC | Protocol buffer definitions | Generated stubs | Client |
The styles are not mutually exclusive. An OpenAPI description can document link relations alongside a hypermedia API, and many teams publish both so that human developers and generated SDK code have a reference.
When HATEOAS pays off and when it does not
HATEOAS delivers the most value when business rules change often and many independent clients must follow them. Because the server decides which links to emit, a new rule such as “orders above a threshold need approval” can be enforced by withholding a link, without redeploying every mobile or partner client.
- Long-lived public APIs benefit because servers can reorganize URLs without breaking clients, which eases API versioning.
- Multi-step workflows such as checkout, onboarding or claims processing map naturally to state transitions.
- Generic clients, such as API browsers and admin consoles, can render any resource by following links.
- Pagination becomes simpler, because
nextandprevlinks remove client-side offset arithmetic.
The benefits shrink for internal APIs with one tightly coupled frontend, where the team owns both sides and can change them together. In such cases the added payload and design effort may not be justified.
Limitations and common mistakes
The main criticism of HATEOAS is that clients still need semantic knowledge: a link relation named approve is useless unless the client developer knows what approval means. Hypermedia removes URL coupling, but it does not remove domain coupling, and fully autonomous machine clients remain rare.
| Mistake | Consequence | Better practice |
|---|---|---|
| Links without relation types | Clients guess meaning from URLs | Use registered or URI-based rel values |
| Static links in every state | No state information conveyed | Emit only valid transitions |
| Clients building URLs anyway | Decoupling benefit lost | Follow links from the entry point |
| Ad hoc link formats | Every client needs custom parsing | Adopt HAL, Siren or JSON:API |
| Undocumented relations | Developers cannot interpret actions | Publish a relation catalog |
Other practical costs include larger response payloads, additional caching considerations for link-heavy representations and a steeper learning curve for client developers used to calling fixed endpoints.
The idea in brief
HATEOAS means that an API answer tells you what you can do next. Instead of a client memorizing every address, each response includes a short menu of links, and the menu changes depending on the situation.
Think of a well-designed website. You do not type the address of the checkout page; you click the button that appears once your cart has items. HATEOAS gives programs the same experience. The key takeaway is that the server guides the client, so the server can change its rules without forcing every app to be rewritten.
A practical scenario
A regional bank exposes a loan application API used by its own mobile app, a broker portal and two partner platforms. Each response for an application includes links such as submit, upload-document, withdraw and, for underwriters, approve. A draft application returns submit and upload-document; once submitted, only withdraw and status remain.
When regulators require an extra identity check for loans above 50,000 dollars, the bank changes server logic so that large applications receive a verify-identity link and no submit link until verification is complete. The partner platforms, which already render whatever actions the API offers, enforce the new rule without a single client release, and the bank avoids a coordinated rollout across four teams.