Hypermedia as the engine of application state and the Richardson maturity model levels 0-3, with examples, the real benefits and costs of hypermedia, where it is used (HAL, JSON:API, Siren, Microsoft Graph nextLink), and a pragmatic stance for ASP.NET Core APIs.
The Richardson maturity model grades HTTP APIs: level 0 is one endpoint doing RPC (everything POSTed to /api), level 1 adds resources (/orders/42), level 2 uses HTTP methods and status codes properly, and level 3 adds hypermedia controls (HATEOAS): responses include links describing what the client can do next.
Hypermedia lets the server drive workflows (no cancel link once an order ships) and move URLs without breaking clients. In practice most production APIs are level 2 plus OpenAPI, with targeted hypermedia where it clearly removes client logic: next links for paging, Location for created resources and status URLs for long-running operations. Full HATEOAS costs richer media types and smarter clients, which few teams get a return on.
"The Richardson maturity model, from Leonard Richardson and made popular by Martin Fowler's 2010 article, is a way of grading how much of HTTP and REST an API actually uses. Level 0 is a single endpoint, say
POST /api, with the operation in the body, like SOAP or JSON-RPC: HTTP is just a tunnel. Level 1 introduces resources, so you have/orders/42and/customers/7, but you might still POST to everything. Level 2 uses the HTTP methods and status codes for their meaning: GET to read, PUT to replace, DELETE to remove, 201 with aLocation, 404, 409 and so on. Level 3 adds hypermedia, which is HATEOAS: each response carries links for the actions available from this state, and the client navigates by following them rather than constructing URLs.The value of level 3 is that the server owns the workflow. An order in
Pendingcomes back withpayandcancellinks; once it'sShipped, thecancellink just isn't there, so the mobile app doesn't need its own copy of the business rule. It also lets the server change URLs. The honest answer to 'does anyone use it' is: fully, rarely. Most APIs I've worked on, and most public ones, are level 2 with an OpenAPI document. But partial hypermedia is everywhere: Microsoft Graph's@odata.nextLink, GitHub'sLinkheader for pagination, andOperation-Locationin Azure long-running operations.The mistake I see is either treating level 3 as the goal for its own sake, or dismissing links entirely and making clients build paging URLs and status-polling URLs by hand. My stance for an ASP.NET Core API is level 2 as the baseline, plus links where they remove logic from clients: paging, the status resource of a long-running operation, and allowed actions on a stateful resource. I'm pragmatic: hypermedia where it earns its keep."
| Level | Name | Example | What you gain |
|---|---|---|---|
| 0 | The swamp of POX | POST /api {"action":"getOrder","id":42} |
Nothing from HTTP |
| 1 | Resources | POST /orders/42/get |
Addressable things |
| 2 | HTTP verbs | GET /orders/42 -> 200; DELETE -> 204 |
Caching, safe retries, standard errors |
| 3 | Hypermedia controls | Response includes links.cancel.href |
Server-driven workflow, evolvable URLs |
| Format | Shape | Where you see it |
|---|---|---|
HAL (application/hal+json) |
_links, _embedded |
Spring, some public APIs |
| JSON:API | links, relationships |
Ember ecosystem, some SaaS |
| Siren | actions with method and fields |
Rare, richest |
| OData annotations | @odata.nextLink, @odata.id |
Microsoft Graph, Dynamics |
Link header (RFC 8288) |
Link: <...?page=3>; rel="next" |
GitHub API |
A [loan application] API used state-dependent links (submit, withdraw, upload-documents). When the business added a new ["referred to underwriter"] state, the web and mobile clients needed no release: they simply rendered the actions the API returned. Previously, [each workflow change needed coordinated releases across three apps].
Checks that the candidate knows the maturity levels accurately and has a reasoned, practical view on hypermedia rather than a dogmatic one.
Green flags
Red flags
Leonard Richardson presented the model at QCon 2008; Martin Fowler's 2010 article "Richardson Maturity Model: steps toward the glory of REST" made it famous. Fielding himself says only level 3 is REST; the model is a teaching tool, not a standard.
Level 0: POST /api {"method":"cancelOrder","orderId":42} -> 200 {"ok":false}
Level 1: POST /orders/42 {"action":"cancel"} -> 200
Level 2: POST /orders/42/cancellation -> 202 / 409 if already shipped
GET /orders/42 -> 200, Cache-Control, ETag
{
"id": 42,
"status": "Pending",
"_links": {
"self": { "href": "/orders/42" },
"pay": { "href": "/orders/42/payments", "method": "POST" },
"cancel": { "href": "/orders/42/cancellation", "method": "POST" }
}
}
The client's logic becomes "show a Cancel button if there's a cancel link". The server still enforces the rule (it must return 409 if someone calls cancel anyway); the links just stop the client duplicating it.
cancel means.LinkGenerator.Paging: {"items":[...], "nextLink":"/orders?cursor=eyJ..."}
Created resource: 201 Created, Location: /orders/42
Long-running op: 202 Accepted, Location: /operations/abc (poll it)
Allowed actions: "actions": ["cancel","pay"] or links
Opaque nextLink cursors are the best example: the client can't construct them, so the server can change the paging strategy freely.
Use LinkGenerator.GetPathByName("GetOrder", new { id }) with named endpoints (.WithName("GetOrder")), so links follow route changes. Behind a proxy, configure forwarded headers before generating absolute URIs.
links object to an order DTO with LinkGenerator, including a cancel link only for pending orders.nextLink, then change the cursor format and check the client still works.State-dependent links built with LinkGenerator, so clients render actions the server allows and URLs follow route changes.
// Program.cs (.NET 10)
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
var orders = new Dictionary<int, Order> { [42] = new(42, OrderStatus.Pending), [43] = new(43, OrderStatus.Shipped) };
app.MapGet("/orders/{id:int}", (int id, LinkGenerator links, HttpContext ctx) =>
{
if (!orders.TryGetValue(id, out var order)) return Results.NotFound();
var actions = new Dictionary<string, Link>
{
["self"] = new(links.GetPathByName(ctx, "GetOrder", new { id })!, "GET"),
};
// The server decides which transitions are valid now; the client only checks for the link.
if (order.Status == OrderStatus.Pending)
{
actions["cancel"] = new(links.GetPathByName(ctx, "CancelOrder", new { id })!, "POST");
actions["pay"] = new(links.GetPathByName(ctx, "PayOrder", new { id })!, "POST");
}
return Results.Ok(new OrderResource(order.Id, order.Status.ToString(), actions));
}).WithName("GetOrder");
app.MapPost("/orders/{id:int}/cancellation", (int id) =>
orders.TryGetValue(id, out var o) && o.Status == OrderStatus.Pending
? Results.Accepted()
: Results.Problem(statusCode: 409, title: "Order can no longer be cancelled")) // still enforced server-side
.WithName("CancelOrder");
app.MapPost("/orders/{id:int}/payments", (int id) => Results.Accepted()).WithName("PayOrder");
app.Run();
public enum OrderStatus { Pending, Shipped }
public sealed record Order(int Id, OrderStatus Status);
public sealed record Link(string Href, string Method);
public sealed record OrderResource(int Id, string Status, IReadOnlyDictionary<string, Link> Links);
{ "id": 42, "status": "Pending",
"links": { "self": { "href": "/orders/42", "method": "GET" },
"cancel": { "href": "/orders/42/cancellation", "method": "POST" },
"pay": { "href": "/orders/42/payments", "method": "POST" } } }
self link and nothing else) and calling the API hypermedia-driven. Why it is wrong: Links that never change with state remove no client logic, so clients still hard-code the workflow. Instead: Put the effort into links that encode state (allowed actions) or opacity (paging cursors, operation status URLs); self links are fine as a convenience, not as the point.cancel link doesn't stop a client calling the URL. Instead: Enforce every rule on the server and return 403 or 409; links mirror the rules, they don't replace them.LinkGenerator with named endpoints and forwarded headers.nextLink and Location/status URLs.The senior answer avoids both dogma and dismissal. Hypermedia is a tool for decoupling client releases from server workflow changes; it pays off when many independently released clients (mobile apps that users don't update, partner integrations) consume a workflow that changes. For an internal API deployed with its only client, level 2 plus generated SDKs is cheaper and just as evolvable.
I'd measure the case for it: how many client releases were forced by server-side workflow changes last year, and how often clients broke because they built URLs themselves.
| Option | When it fits | Cost | When not |
|---|---|---|---|
| Level 2 + OpenAPI | Most internal and partner APIs | Clients hard-code URLs and rules | Many uncontrolled clients with changing workflows |
| Targeted links (paging, operations, actions) | Almost any API | Small DTO and link-generation work | Never really wrong |
| Full HATEOAS (HAL/Siren) | Long-lived public APIs, workflow-heavy domains | Media types, client complexity, payload size | Single SPA client released with the API |
REST (Representational State Transfer) is an architectural style Roy Fielding described in 2000, not a protocol. It is defined by six constraints: client-server, stateless requests, cacheable responses, a uniform interface, a layered system, and optional code on demand. The uniform interface is the heart of it: resources identified by URIs, changed through representations (JSON, XML), self-descriptive messages (methods, status codes, media types) and hypermedia links that drive the client (HATEOAS).
In practice, when a team says "RESTful" they usually mean resource-oriented URLs, correct HTTP methods and status codes, and JSON, but no hypermedia. That is fine for most internal and partner APIs; the trade-off is that clients hard-code URLs and workflows instead of discovering them.
HEAD is GET without the body: same status code and headers (Content-Length, ETag, Last-Modified), so clients can check that a resource exists, how big it is or whether it changed, without downloading it. It is safe, idempotent and cacheable.
OPTIONS asks what the server supports for a URI; the answer is the Allow header. Its main real-world use is the CORS preflight: browsers send OPTIONS with Origin and Access-Control-Request-Method before non-simple cross-origin calls, and ASP.NET Core's CORS middleware answers it.
ASP.NET Core handles preflight and 405 Allow headers for you, but Minimal APIs don't map HEAD automatically. The trade-off: HEAD support is cheap to add but must not cost as much as the GET it replaces.
How to tell it (STAR)
**S:** At [company], our loan application API had three clients that each hard-coded which buttons to show for each application state, and [a third] of mobile users ran old versions. **T:** When the business added a referred state, old apps started offering actions the server rejected, and I was asked to stop this happening with every workflow change. **A:** I traced the 409 spike in Application Insights to old app versions, then proposed returning the allowed actions as links on the resource, computed from the server's state machine. I wrote the ADR, implemented the links with `LinkGenerator` and worked with the mobile leads so the apps render only what the API returns. **R:** The next two workflow changes shipped server-only with zero client releases, and 409s on workflow endpoints dropped by [~95%].
Last updated 23 Nov 2026.