04 Links Rel Href
DodaTech
1 min read
title: Hypermedia Links — rel and href Attributes weight: 14 date: 2026-06-28 lastmod: 2026-06-28 description: Master hypermedia link structures in HATEOAS including the rel (relationship) and href (target) attributes, link relations (self, next, edit), and action links. tags: [api-development, hateoas]
Hypermedia links use two primary attributes: rel describes the relationship (self, edit, delete, next, prev) and href provides the target URI. Additional attributes like method, type, and title enrich the link with context for client processing.
```python
{
"_links": {
"self": {
"href": "/api/v1/orders/42",
"rel": "self",
"method": "GET",
"type": "application/json"
},
"update": {
"href": "/api/v1/orders/42",
"rel": "edit",
"method": "PUT"
},
"cancel": {
"href": "/api/v1/orders/42/cancel",
"rel": "action",
"method": "POST"
},
"customer": {
"href": "/api/v1/users/7",
"rel": "related",
"title": "Order customer"
},
"items": {
"href": "/api/v1/orders/42/items",
"rel": "collection"
},
"payment": {
"href": "/api/v1/orders/42/payment",
"rel": "payment",
"method": "POST",
"schema": {"type": "object", "properties": {"amount": {"type": "number"}}}
}
}
}
What's Next
Now learn about actions in HATEOAS in Hypermedia APIs and HATEOAS.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro