HATEOAS link relation types
In a hypermedia REST API, responses carry links named by relation type so the client follows actions by meaning rather than by hard-coded URL. This reference lists the common IANA-registered relation names with their semantics and notes on use in Link headers, HAL and JSON:API.
How it works
A link relation pairs a target URI with a rel token that names the link’s
meaning. The same tokens appear in three common carriers:
Link: </articles/1>; rel="self", </articles?page=2>; rel="next"
{ "_links": { "self": { "href": "/articles/1" },
"next": { "href": "/articles?page=2" } } }
Registered relations (per IANA, originally RFC 8288 / RFC 5988) have agreed
meanings — self, next, prev, first, last, edit, collection,
describedby — while custom relations use a full URI to avoid collisions.
Tips and notes
- Use
selfon every resource so clients always have a canonical URI. - Pagination uses
first/prev/next/lasttogether. editpoints to a URI that can be used to edit the resource (e.g. via PUT).- Extension relations should be full URIs, not bare custom words.