Fact-checked by Grok 2 weeks ago

Hypertext Application Language

Hypertext Application Language () is a format designed to provide a standardized way of expressing hyperlinks and embedded resources within or XML representations of responses, enabling the creation of self-descriptive and navigable hypermedia-driven APIs. Developed by software engineer Mike Kelly and first released in July 2011, HAL addresses the challenges of API evolution by decoupling client-server coupling through hypermedia controls, allowing clients to discover available actions dynamically without hardcoded URLs. HAL establishes conventions for structuring API resources as Resource Objects, which consist of a primary data payload alongside reserved properties for hyperlinks (_links) and embedded sub-resources (_embedded). The _links property contains an object of link relations (e.g., self, next, or custom rel values) pointing to related resources via target URIs, while _embedded allows nesting of full Resource Objects to avoid additional requests. This structure supports features like URI Templates for parameterized links and Compact URIs (CURIEs) for compact, documentation-linked relation names, enhancing API discoverability. The format's media types are application/hal+json for JSON and application/hal+xml for XML, with the JSON variant being the most widely implemented. Originally created to improve developer experience in a client project requiring flexible URL changes, HAL evolved from a solution into an open specification through community feedback on the HAL Discuss . Its first IETF Internet-Draft (draft-kelly-json-hal-00) was published in June 2012, with the latest revision (draft-kelly-json-hal-11) issued in October 2023 as an informational document, though it has not yet advanced to status. HAL's simplicity—requiring no schema beyond its core conventions—has contributed to its adoption as a dominant hypermedia format, notably in Amazon's starting in early 2014 and various open-source libraries for languages like , .NET, and . By prioritizing human-readable links over complex forms or actions, HAL facilitates API exploration via tools like browsers and automated clients, reducing overhead and supporting RESTful principles.

Introduction

Definition and Purpose

The Hypertext Application Language () is a format designed for representing hypermedia within RESTful using or XML, utilizing the media types application/+json and application/hal+xml (with the JSON variant being the most widely implemented). It establishes conventions for embedding hyperlinks and related metadata directly into resource representations, enabling clients to navigate dynamically without prior knowledge of specific endpoints. The primary purpose of is to standardize the structure of resources, links, and metadata in responses, thereby facilitating the Hypermedia as the Engine of Application State () principle central to architecture. By providing a consistent for hypermedia controls, HAL allows API consumers to discover and traverse available actions through links, reducing the need for custom client-side logic or domain-specific implementations. Unlike plain , which offers flexibility but no inherent semantic structure for hyperlinks or extensibility, HAL imposes lightweight conventions to enhance discoverability and interoperability across services.

Key Features

HAL enables self-descriptive messages by incorporating hyperlinks and embedded resources within or XML representations, allowing clients to navigate and understand structures without prior knowledge of specific endpoints. The _links property contains an object of link objects, each with a href for the target and an optional rel for the type, while the optional _embedded property nests full resource representations to avoid additional requests. This structure supports the principle by making responses navigable through hypermedia controls. A core feature is the use of standardized link relations, such as those registered with the IANA, to enhance discoverability and interoperability across . Link relations serve as identifiers for the semantics of connections between resources, enabling generic clients to interpret actions like "next" for or "self" for the current resource without custom logic. For example, a link with rel: "next" points to the subsequent page in a collection, promoting uniform patterns. HAL's extensibility is achieved through support for custom properties alongside its reserved ones, allowing domain-specific data without violating the format, and CURIEs (Compact URIs) for abbreviating complex link relation namespaces. CURIEs expand prefixed relations (e.g., ea:find) to full URIs defined in a curies within _links, facilitating versioned and compact representations in large . This mechanism ensures flexibility while maintaining a consistent structure. Media type negotiation is facilitated by the application/hal+json type (or application/hal+xml for XML), which clients request to receive HAL-formatted responses, and linking via the profile parameter or Link headers to indicate API versions or constraints. For instance, a response might include a profile URI like https://example.com/api/v1/profile to specify the expected shape, enabling safe evolution of APIs over time. Property constraints emphasize uniformity, such as requiring the root to be a object and including an optional _links property for effective in hypermedia-driven , though minimal valid documents can be empty objects. These conventions ensure that even simple responses include mechanisms for discovery, preventing opaque data dumps.

History and Development

Origins and Initial Proposal

The () was initially proposed by Mike Kelly, a UK-based software engineer and API consultant, in 2011. Kelly released the first version of the specification on June 13, 2011, as a simple, JSON-based format aimed at providing a consistent structure for hypermedia links in RESTful . The proposal was motivated by the need to minimize developer friction caused by frequent API changes, such as evolving structures, by leveraging hypermedia to make APIs more evolvable and self-descriptive. Kelly's work stemmed from observations of fragmented hypermedia practices in early , where developers often invented ad-hoc methods for handling links and resource relations, leading to inconsistent and non-explorable designs. To address this, focused on as the foundational format due to its widespread adoption in services at the time, allowing for straightforward without requiring new mechanisms. The initial draft emphasized uniform link handling to support principles like , enabling clients to discover and navigate resources dynamically, and included the _embedded property for representing related resources directly within a primary resource. The proposal was first shared via a detailed web page on Kelly's site, stateless.co, and quickly gained traction through open discussion. Early feedback came from API design communities, including the hal-discuss Google Group and the REST Discuss mailing list, where contributors like Mike Amundsen and Darrel Miller provided input that refined the core concepts. This community engagement led to the draft being hosted on GitHub under the repository mikekelly/hal_specification, fostering further iteration while keeping the focus on simplicity and interoperability. The JSON variant of HAL was registered with IANA as the media type application/vnd.hal+json on July 14, 2011.

Evolution and Standardization

The first IETF Internet-Draft for (draft-kelly-json-hal-00) was published on June 6, 2012. Subsequent community-driven updates further evolved the format, notably the addition of (Compact URI) support in draft-kelly-json-hal-06 published on October 3, 2013, enabling templated link relations via the curies array for more concise and extensible hypermedia controls in link documentation. Ongoing maintenance occurs via the official repository, where API practitioners contribute refinements and issue discussions, with updates continuing through 2023 in the latest (version 11) issued on October 19, 2023; despite this, lacks formal by bodies like the W3C or IETF, remaining an informal specification that has achieved wide de facto adoption in RESTful API design.

Design Principles

HATEOAS Integration

, or Hypermedia as the Engine of Application State, is a core constraint of the architectural style that enables clients to discover and navigate application states dynamically through hypermedia links provided by the server, rather than relying on hardcoded URLs or knowledge. In this model, the server includes hyperlinks in its representations to indicate possible state transitions, allowing clients to interact with the as if following a web of discoverable resources. HAL embodies this HATEOAS principle by mandating the inclusion of a _links object in every resource representation, which is an object whose keys are link relation types (e.g., self or next) and whose values are either a single link object or an array of link objects, each specifying a target URI via the href property for navigation. These links support URI templates—parameterized paths marked with templated: true—enabling clients to construct and follow dynamic transitions, such as querying related resources or advancing through paginated collections. By standardizing this structure in JSON, HAL provides a concrete, machine-readable format for hypermedia controls that aligns directly with HATEOAS requirements. This integration enhances evolvability, as servers can modify endpoints or introduce new resources without disrupting clients, which discover actions solely through the provided links rather than fixed paths. thus serves as a practical JSON-based implementation of the constraint outlined in Roy Fielding's 2000 dissertation on , bridging theoretical architectural principles with interoperable design. In HAL, a resource is modeled as a JSON object that encapsulates both the domain-specific state of the resource and navigational elements for hypermedia-driven interactions. The object's properties represent the resource's attributes, such as "currency" or "status," while reserved top-level keys "_links" and "_embedded" provide structured access to related resources. The "_links" key holds an object whose keys are link relation types (e.g., "self" or "next") and whose values are either a single link object or an array of link objects, enabling the representation of multiple possible links for a given relation. This structure ensures that resources are self-descriptive, allowing clients to discover and traverse API affordances without prior knowledge of the entire schema. Link modeling in HAL centers on the link object, a standardized JSON construct that defines hyperlinks with essential attributes for . Each link object requires an "href" property containing the target reference, which may be absolute or relative, and is associated with a type via the enclosing key in the "_links" object. Optional attributes include "templated," a indicating whether the "href" employs URI Templates for parameterization (e.g., "/orders{?id}"), and "title," a human-readable string for labeling the link. Additional extensible properties like "type" (media type of the target) can be included to enhance semantics without altering the core model. This approach supports a uniform way to express both navigational and contextual relationships, aligning with RESTful principles by embedding hyperlinks directly within resource representations. The uniform provided by HAL's model integrates data with navigational , fostering a consistent experience across diverse services. By colocating properties with "_links" and the optional "_embedded" (which mirrors "_links" but embeds full objects or arrays thereof under keys), HAL enables clients to process responses holistically—extracting state while simultaneously building a of accessible endpoints. This combination reduces between client and , as navigational logic is conveyed through rather than hardcoded URIs. HAL's extensibility model allows implementers to incorporate custom namespaces and properties without disrupting parser compatibility, promoting adoption in varied domains. Properties not starting with an underscore are treated as domain-specific extensions, while link relations can use Compact URIs (CURIEs) for namespacing (e.g., ":find") to avoid collisions and support versioning. The media type "" further signals this structure, with optional "" parameters in HTTP headers or links providing semantic context for extensions. This design ensures and flexibility, as parsers can safely ignore unrecognized elements while leveraging the core linking mechanism.

Specification Details

Core Conventions

The core conventions of the Hypertext Application Language (HAL) establish the fundamental structural requirements for JSON documents to represent hypermedia-driven resources in a consistent manner. Every HAL document must consist of a single root-level Resource Object, which is a JSON object that includes application-specific state properties alongside HAL-specific control properties. This root object is required to contain a "_links" property, an object that holds at least one Link Object—most commonly a "self" relation pointing to the resource's own URI—to enable self-description and navigation. HAL reserves properties prefixed with an underscore ("_") to avoid conflicts with domain-specific data, ensuring clear separation between resource state and hypermedia controls. The primary such properties are "_links", which maps relation names to either a Link Object or an array of Link Objects, and "_embedded", an optional property for including related Objects inline to reduce API roundtrips. These conventions promote discoverability by standardizing how hyperlinks and embedded content are expressed within . Link Objects within "_links" adhere to strict JSON type constraints: the "href" property must be a string containing a (absolute or relative) that identifies the target resource, where the link relation (per the Web Linking standard, 5988) is denoted by the key name in the "_links" object. Additional optional properties like "" (a string for human-readable labels) or "deprecation" (an optional providing further about the ) may appear but do not alter the core structure. Similarly, "_embedded" must be a object (for single resources) or array (for multiples), where each value is itself a Resource Object conforming to these rules. For error responses, while does not mandate a specific , some implementations use an "_error" object at the root level to provide details such as error codes and messages, maintaining the hypermedia even in cases. Versioning in is handled through links, leveraging the "profile" parameter in the (e.g., application/+; profile="https://example.com/v1") as defined in 6906 for the 'profile' type. In HAL, link relations, or "rel" types, serve as semantic identifiers that describe the purpose and target of a link within a , enabling clients to understand and navigate the without prior knowledge of specific URIs. These relations are expressed as keys in the _links object, with values being link objects containing at least an href property pointing to the target . Common relations draw from the IANA Link Relations registry, such as "" to the itself, "next" and "prev" for sequential in collections, and "item" for individual elements within a set. To manage longer or namespaced relation identifiers, HAL supports Compact URIs (CURIEs), which abbreviate full Internationalized Resource Identifiers (IRIs) into a compact :reference format, such as "ea:admin" where "ea" expands to a base for documentation. CURIEs are declared in a special _links entry named "curies", which is an array of objects each specifying a name (the ), an href template for expansion (using {rel} as a ), and optionally "templated": true to indicate URI templating. This mechanism allows rel values to reference external documentation, like http://example.com/docs/rels/{rel}, promoting discoverability and avoiding ambiguity in distributed systems. HAL links may incorporate URI templating in the href attribute to support parameterized navigation, following the Level 4 URI Templates specification (RFC 6570), where placeholders like {?id} or {.fields} denote variables to be substituted by clients. For instance, a link with href: "/orders{?id}" and "templated": true enables dynamic querying by filling in the id parameter. This feature enhances flexibility for actions like searching or filtering, while the templated flag signals to clients that expansion is required before following the link. For custom relations beyond the IANA registry, HAL recommends namespacing via prefixes to prevent collisions and ensure semantic clarity, such as "acme:widgets" for domain-specific links to widget resources. Guidelines emphasize using descriptive, lowercase names with hyphens for readability, registering novel relations in the IANA registry when they gain broad adoption, and providing documentation through href templates to explain usage and expected behaviors. This approach maintains interoperability while allowing API designers to extend for proprietary needs.

Embedded Resources

In HAL, the _embedded property provides a mechanism for including related resources directly within a primary resource representation, thereby reducing the number of HTTP requests required for clients to access associated data while preserving the hypermedia-driven navigation of HATEOAS. This object maps link relation types (as keys) to either a single Resource Object or an array of Resource Objects, each of which must conform to HAL's structure as a valid, self-contained document. Unlike mere links, embedded resources convey both the target URI (via the _links property) and the resource's state (via arbitrary properties), enabling inline access to pertinent details without separate fetches. Embedded resources follow specific conventions to ensure consistency and . They must appear as a direct property of the root Resource Object, parallel to _links, and can represent full, partial, or even inconsistent views of the resource available at the target —though servers are encouraged to align them closely with the linked representation for reliability. Each embedded item qualifies as a complete document, complete with its own _links and , allowing recursive if needed. To maintain document manageability, implementations should limit depth, as excessive nesting can lead to oversized payloads that undermine performance and readability, though the specification does not enforce a strict limit. A common for embedding arises in scenarios requiring contextual enrichment, such as including details within a blog post resource to provide immediate access to without additional queries. For instance, a of a post might embed the 's as follows:
{
  "_links": {
    "self": { "href": "/posts/1" },
    "author": { "href": "/people/123" }
  },
  "title": "Sample Post",
  "_embedded": {
    "author": {
      "_links": {
        "self": { "href": "/people/123" }
      },
      "name": "Jane Doe",
      "email": "[email protected]"
    }
  }
}
This approach delivers the author's essential state inline, streamlining client-side rendering or processing. Embedding strikes a balance between efficiency and adherence to principles, as it optimizes for reduced latency in common navigation paths (e.g., via hypertext caching patterns) while mandating that full navigational remain present for clients that ignore or cannot process embeds. Servers should embed resources using the same types as their corresponding , ensuring that even non-supporting clients can and follow them independently, thus avoiding any dilution of the hypermedia controls essential to discoverability. This trade-off supports performance gains in bandwidth-constrained environments without compromising the 's self-descriptive nature.

Practical Examples

Basic Resource Representation

In HAL, a basic resource representation consists of a JSON object that encapsulates the resource's state through standard properties, while hyperlinks to related resources are provided via the reserved _links property. This structure adheres to the core conventions of the JSON Hypertext Application Language specification, enabling clients to navigate APIs without prior knowledge of specific URIs. A typical example occurs in an HTTP response to a retrieval request for a single resource. For instance, a GET request to /users/123 with the Accept: application/[hal](/page/Hal)+[json](/page/JSON) header yields a 200 OK response with Content-Type: application/[hal](/page/Hal)+[json](/page/JSON). The body represents a resource as follows:
json
{
  "_links": {
    "self": { "href": "/users/123" },
    "profile": { "href": "/profiles/123" }
  },
  "id": "123",
  "name": "John Doe"
}
```[](https://www.ietf.org/archive/id/draft-kelly-json-hal-11.html)

Here, the properties `id` and `name` hold the domain-specific data of the resource, conveying its essential attributes in plain JSON format. The `_links` object, a required element for hypermedia, contains link objects keyed by relation types such as `self` and `profile`; each link includes an `href` property specifying the target URI. The `self` link particularly ensures the resource's unique identity, allowing clients to reference or bookmark it independently.[](https://www.ietf.org/archive/id/draft-kelly-json-hal-11.html)

HAL parsers process this representation by first extracting the resource's properties for display or manipulation, then traversing the `_links` object to discover available actions, such as following the `profile` relation to access additional details. This link extraction follows standardized relation types defined in RFC 5988, promoting uniform navigation across HAL-compliant APIs.[](https://www.ietf.org/archive/id/draft-kelly-json-hal-11.html)[](https://www.rfc-editor.org/info/rfc5988)

### Collection and Pagination Example

In HAL, collections of resources are typically represented as a primary resource containing an [array](/page/Array) of [embedded](/page/Embedded) items under the `_embedded` [key](/page/Key), allowing clients to access related data without additional requests. Each [embedded](/page/Embedded) item functions as its own [resource](/page/Resource) object, complete with its own `_links` for [navigation](/page/Navigation), such as a `self` [relation](/page/Relation) pointing to the individual item's [URI](/page/Uri). This structure supports efficient representation of lists, like orders in an [e-commerce](/page/E-commerce) [API](/page/API), while maintaining hypermedia principles.[](https://stateless.group/hal_specification.html)[](https://www.ietf.org/archive/id/draft-kelly-json-hal-11.html)

Pagination in HAL collections is handled through navigational links in the top-level `_links` object, using standard relation types to enable clients to traverse pages without hardcoding offsets or limits. Common relations include `first` for the initial page, `last` for the final page, `next` for the subsequent page, and `prev` for the previous page, each with an `href` attribute specifying the URI. These links often incorporate query parameters like `?page=2` to indicate the current position in the sequence. For instance, a paginated collection might include metadata such as `count` for items on the current page and `total` for the overall number of resources.[](https://apigility.org/documentation/api-primer/halprimer)[](https://stateless.group/hal_specification.html)

The following JSON example illustrates a paginated collection of orders, with embedded order items and full pagination links:

```json
{
    "_links": {
        "self": { "href": "http://example.com/orders?page=1" },
        "first": { "href": "http://example.com/orders" },
        "next": { "href": "http://example.com/orders?page=2" },
        "last": { "href": "http://example.com/orders?page=10" }
    },
    "count": 2,
    "total": 20,
    "_embedded": {
        "orders": [
            {
                "_links": {
                    "self": { "href": "http://example.com/orders/123" }
                },
                "orderId": 123,
                "total": 30.00,
                "status": "shipped"
            },
            {
                "_links": {
                    "self": { "href": "http://example.com/orders/124" }
                },
                "orderId": 124,
                "total": 20.00,
                "status": "processing"
            }
        ]
    }
}
This example shows two embedded orders, each with a link for direct access, embedded within a collection that provides navigation across 10 total pages of 20 orders. For dynamic querying, HAL supports templated links in collections, where the href uses URI templates (per RFC 6570) and the templated property set to true to indicate parameter substitution. This allows clients to filter or sort the collection, such as retrieving orders by via /orders{?status}. An example link might appear as "search": { "href": "/orders{?status}", "templated": true }, enabling expansions like /orders?status=shipped for targeted pagination.

Implementations and Ecosystem

Client-Side Libraries

Client-side libraries for Hypertext Application Language () enable developers to parse, navigate, and interact with -formatted resources in applications, facilitating the consumption of hypermedia-driven without hardcoding endpoints. These tools typically handle the extraction of by relation types, support for resources, and traversal of resource graphs, aligning with 's emphasis on discoverability. In the ecosystem, Traverson serves as a prominent library for following in both and environments, allowing asynchronous navigation through relations like "self" or "next" to fetch related resources dynamically. Halson provides utilities for constructing and manipulating resource objects, including methods to add and data while validating against conventions. More recent options, such as @contentgrid/hal, offer type-safe representations of for modern projects, updated as late as March 2025. For , Spring HATEOAS incorporates client-side features through its Traverson , which enables link traversal and data extraction via fluent methods, such as following a chain of relations to retrieve nested object properties. The library's HalLinkDiscoverer component parses _links sections to identify relations efficiently, integrating seamlessly with Spring's WebClient or RestTemplate for HTTP interactions. These tools support templated links with parameter substitution, enhancing flexibility in consumption. In , the library supports both parsing incoming JSON into navigable objects and generating outgoing representations, with built-in handling for expansion and validation of required HAL elements like _links and _embedded. It allows building resource graphs declaratively, making it suitable for scripting interactions or integrating with frameworks like Flask. Common features across these libraries include automatic resolution by dereferencing links via HTTP clients, expansion to resolve abbreviated relation URIs, and error handling for cases like missing relations or invalid media types, which promote robust client implementations. As of 2025, active maintenance continues in key ecosystems; for instance, Spring HATEOAS documentation reflects updates through November 2025, while .NET's HAL.Client.Net library, last updated in June 2024, provides support for HAL consumption though it is no longer actively maintained. In , packages like @contentgrid/hal demonstrate sustained development for frontend and backend use cases.

Server-Side Frameworks and Tools

Spring HATEOAS is a module within the that simplifies the creation of HAL-compliant REST representations, particularly for Spring MVC applications. It provides builder APIs such as RepresentationModel and EntityModel to construct resources with _links and _embedded sections directly from domain models, enabling developers to add hypermedia controls like self-referential links and related resource embeddings without manual JSON serialization. This approach integrates seamlessly with Spring Boot's auto-configuration for hypermedia-driven APIs, supporting features like link relations via RelProvider and content negotiation for application/hal+json media type. In Node.js environments, libraries like express-hal offer middleware to generate HAL responses in Express.js applications. It exposes a res.hal method that assembles JSON-HAL bodies from resource objects, automatically handling link arrays and embedded resources while supporting templating for dynamic URIs. Although originally released in 2012, it remains available via npm and can be integrated into modern Express setups for basic HAL rendering, though developers may extend it for current Node.js versions. For Ruby-based APIs, Grape supports HAL output through extensions like grape-roar, which leverages the Roar gem to render hypermedia representations. This integration allows API builders to define entities with HAL-specific formatters, automatically generating _links from route helpers and embedding related objects while maintaining Grape's lightweight DSL for endpoint definitions. The grape-roar adapter ensures compliance with HAL conventions by mapping Ruby objects to the required JSON structure, facilitating hypermedia in Rack-mounted services. Tooling for server-side HAL development includes the HAL Explorer, a web-based viewer for testing and visualizing API endpoints. This application fetches HAL responses, renders navigable links, and supports form interactions via HAL-FORMS, allowing developers to verify resource structures and hypermedia controls during implementation. Updated as of March 2025, it provides an interactive interface for exploring embedded resources and link relations without custom client code. Compliance with HAL specifications up to version 1.0 (stable since 2014, with extensions like in 2025 drafts) can be ensured using validators integrated into frameworks or standalone tools. For instance, Spring HATEOAS includes built-in assertions for link validity and adherence, while libraries like grape-roar validate output against the HAL schema during rendering. Additionally, the profile, as implemented in tools like Dwolla's hal-forms, adds form validation to resources, helping servers check submitted data against embedded schemas for spec-conformant interactions.

Comparisons and Alternatives

HAL vs. JSON API

Hypertext Application Language (HAL) and JSON API are both JSON-based formats designed to enable hypermedia-driven APIs that adhere to the HATEOAS principle, allowing clients to discover available actions through links embedded in responses. However, HAL adopts a minimalist approach, primarily enhancing plain JSON with conventions for hyperlinks and resource embedding, without prescribing broader API behaviors such as pagination or error handling. In contrast, JSON API provides a more comprehensive and opinionated specification that standardizes resource serialization, including structured support for compound documents, sparse fieldsets, and errors, resulting in a heavier but more prescriptive framework. HAL's core strength lies in its simplicity, using the _links object to represent relations like "" or "next" and the _embedded object for including related resources inline, which keeps the format lightweight and flexible for custom implementations. It lacks built-in mechanisms for —relying instead on ad-hoc —or standardized error responses, leaving these to HTTP conventions or application-specific extensions. JSON API, on the other hand, enforces a rigid structure with mandatory type and id fields in resources, alongside attributes for data and relationships for , enabling features like sparse fieldsets (where clients request only needed fields via query parameters) and compound documents that bundle related resources in an included array to minimize round trips. It also defines a standardized error format with objects containing status, title, and detail fields, promoting consistency across implementations. The trade-offs between the two highlight their suitability for different scenarios: HAL's minimalism makes it easier to integrate into existing for custom hypermedia needs, reducing overhead in smaller or evolving projects, but it can lead to inconsistencies in large teams without additional conventions. excels in enforcing uniformity and reducing client-server negotiation through its detailed spec, making it preferable for collaborative environments or complex ecosystems, though its verbosity and strict rules may complicate adoption in simpler use cases. In terms of , both formats support by providing discoverable links, but they diverge in embedding strategies—HAL's _embedded allows direct nesting of full or partial resources, while JSON API's included separates top-level resources from sideloaded ones to avoid duplication and support polymorphic relations. This difference can affect client parsing logic, with HAL offering more straightforward nesting at the cost of potential , and JSON API prioritizing for efficiency in data-heavy responses.

HAL vs. Siren and Other Hypermedia Formats

Hypertext Application Language () and represent two distinct approaches to hypermedia in JSON-based , with emphasizing a lightweight structure built on standard objects and arrays, while introduces more expressive elements for entity representation and interactions. In , resources are expressed as objects containing arbitrary properties alongside dedicated _links and _embedded members for and inline resources, respectively, promoting a simple extension of plain without requiring additional semantics. In contrast, structures responses around entities that include class for semantic classification, properties for data, entities for sub-resources, links for , and notably actions that define RPC-like operations with specified HTTP methods, fields, and types, enabling clients to and invoke complex interactions directly from the representation. This difference highlights 's focus on basic hyperlinking versus 's provision for form-like actions that guide client behavior more explicitly. Compared to other hypermedia formats, HAL's design aligns closely with everyday JSON usage, differing from Collection+JSON, which is narrowly tailored for managing collections through a root collection object containing version, href, an items array for resources, queries for search capabilities, and a template for additions or updates, but lacks broad support for individual resource representations or embedding. Similarly, prioritizes semantic web interoperability by incorporating @context to map JSON keys to RDF vocabularies, facilitating serialization with implicit hypermedia via properties like @id and @type, though it introduces additional complexity for non-semantic API use cases. HAL's primary strength lies in its simplicity and minimal overhead, allowing seamless integration with existing JSON tooling and reducing verbosity in representations, which contrasts with Siren's richer action model that supports detailed input validation and method specification but can result in more structured, potentially heavier payloads. HAL's native alignment with also contributes to its advantages in verbosity over formats like , which requires context definitions that expand documents for semantic precision. Regarding ecosystem support, HAL benefits from broader tooling availability, including libraries in frameworks like Spring , due to its straightforward JSON conventions that leverage general-purpose parsers without format-specific overhead.

Adoption and Impact

Notable Use Cases

One notable use case of is in the API Gateway, where it serves as the hypermedia format for resource-based s, enabling standardized linking between API resources to facilitate navigation and discoverability in serverless architectures. employs in its API guidelines to provide consistent hyperlinking between resources, ensuring that API responses include embedded links for related endpoints, which supports scalable integration across their and internal services. A practical case study in the banking sector involves Dwolla's payment , which leverages to embed forms and in responses, enabling clients to evolve independently—such as updating payment flows or integrating new verification steps—without requiring server-side redeployments, thus reducing overhead in financial transactions.

Benefits and Criticisms

One key benefit of is its promotion of between clients and servers, as provided in responses allow clients to discover and navigate resources dynamically without hardcoding URLs, enabling independent evolution of API versions and reducing breakage during updates. This approach facilitates easier , since changes to server-side resource locations or structures can be propagated through updated rather than requiring client redeployments. Additionally, 's lightweight design—relying on simple conventions like _links and _embedded properties atop standard —avoids the overhead of comprehensive schemas, making it simpler to implement and parse compared to more rigid formats. As of November 2025, continues to see support in frameworks such as Spring , contributing to its role in hypermedia-driven APIs. Despite these advantages, HAL's informal specification has drawn criticism for leading to inconsistent implementations across tools and libraries, as the lack of strict enforcement allows variations in how links and embeddings are handled, complicating . Critics also note limited built-in support for error handling, with the format focusing primarily on representation rather than standardized mechanisms for conveying detailed error contexts or recovery options, often requiring custom extensions. Furthermore, is not well-suited for complex, GraphQL-style queries that demand fine-grained data selection, as its hypermedia-driven navigation encourages sequential discovery over batched or relational fetches. Adoption gaps persist due to competition from more mature alternatives like OpenAPI (formerly Swagger), which offer superior tooling for , validation, and client generation, overshadowing HAL's hypermedia focus in many enterprise settings. Performance concerns, such as added payload size from embedded resources and links, can introduce parsing overhead, particularly in resource-constrained environments, contributing to HAL's underuse relative to schema-based .

References

  1. [1]
    HAL - Hypertext Application Language
    Sep 18, 2013 · HAL is a simple format that gives a consistent and easy way to hyperlink between resources in your API. Adopting HAL will make your API explorable.
  2. [2]
    An Interview with HAL Creator Mike Kelly - InfoQ
    Nov 25, 2014 · In 2011 he released the Hypertext Application Language (HAL) media type for APIs. Since that time, HAL has grown to be the dominant hypermedia ...
  3. [3]
    JSON Hypertext Application Language - IETF
    Oct 19, 2023 · The JSON Hypertext Application Language (HAL) is a standard which establishes conventions for expressing hypermedia controls, such as links, with JSON.
  4. [4]
    draft-kelly-json-hal-00 - JSON Hypertext Application Lanuage
    Jun 6, 2012 · The JSON Hypertext Application Language (HAL) is a standard which establishes conventions for expressing hyperlinks with JSON [RFC4627]. HAL ...<|control11|><|separator|>
  5. [5]
    mikekelly/hal_specification: HAL Specification - GitHub
    HAL - Hypertext Application Language. A lean hypermedia type. HAL is a simple way of linking with JSON or XML. It provides a small set of conventions on top ...Hal - Hypertext Application... · A Lean Hypermedia Type · Discussion Group
  6. [6]
    draft-kelly-json-hal-11 - IETF Datatracker
    Oct 19, 2023 · Reserved Properties. 4.1.1. _links. The reserved "_links" property is OPTIONAL.¶. It is an object whose property names are link relation types ...Missing: constraints | Show results with:constraints
  7. [7]
    draft-kelly-json-hal-06 - IETF Datatracker
    JSON Hypertext Application Language (Internet-Draft, 2014)
  8. [8]
    draft-kelly-json-hal-07 - IETF Datatracker
    JSON Hypertext Application Language · This is an older version of an Internet-Draft whose latest revision state is "Expired". Expired & archived. This document ...
  9. [9]
    CHAPTER 5: Representational State Transfer (REST)
    This chapter introduces and elaborates the Representational State Transfer (REST) architectural style for distributed hypermedia systems.
  10. [10]
    [PDF] Fielding's dissertation - UC Irvine
    I describe the software engineering principles guiding REST and the interaction constraints chosen to retain those principles, contrasting them to the ...
  11. [11]
  12. [12]
    Error Responses and Error Representation - Apiture Developer Portal
    An _error object may contain additional data about the error in the attributes property. This is an open (JSON) object. Examples. Error Type, Attributes ...
  13. [13]
  14. [14]
    Link Relations
    ### Common Link Relation Types Used in HAL
  15. [15]
    Hypertext Application Language (HAL) - Apigility
    HAL, short for Hypertext Application Language, is an open specification describing a generic structure for RESTful resources.
  16. [16]
    Spring HATEOAS - Reference Documentation
    Jun 12, 2025 · Configuring link rendering. In HAL, the _links entry is a JSON object. The property names are link relations and each value is either a link ...
  17. [17]
    Spring HATEOAS :: Spring Boot
    If you develop a RESTful API that makes use of hypermedia, Spring Boot provides auto-configuration for Spring HATEOAS that works well with most applications.
  18. [18]
    dominicbarnes/express-hal - GitHub
    An implementation of HAL for Express.js. Exposes a res.hal method for automatically assembling a JSON-HAL response body. Adds a req/res.resource object for ...Missing: Node. | Show results with:Node.
  19. [19]
    express-hal - NPM
    Oct 30, 2012 · HAL support for Express. Latest version: 0.0.1, last published: 13 years ago. Start using express-hal in your project by running `npm i ...Missing: Node. | Show results with:Node.
  20. [20]
    ruby-grape/grape: An opinionated framework for creating ... - GitHub
    Grape is a REST-like API framework for Ruby. It's designed to run on Rack or complement existing web application frameworks such as Rails and Sinatra.Ruby Grape · Grape Swagger · Grape Entity · Issues 223
  21. [21]
    HAL Explorer - GitHub Pages
    Mar 3, 2025 · With HAL Explorer you can browse and explore HAL and HAL-FORMS-based RESTful Hypermedia APIs. HAL Explorer was inspired by Mike Kelly's HAL-Browser.Missing: tool | Show results with:tool
  22. [22]
    toedter/hal-explorer - GitHub
    With HAL Explorer you can browse and explore HAL and HAL-FORMS based RESTful Hypermedia APIs. HAL Explorer was inspired by Mike Kelly's HAL-Browser.
  23. [23]
    Dwolla HAL Form Profile - GitHub
    API providers MUST validate submitted forms for validity regardless of the validation information embedded in the form. Example validation object.
  24. [24]
    JSON:API — A specification for building APIs in JSON
    JSON:API has been properly registered with the IANA. Its media type designation is application/vnd.api+json . Format documentation. To get started with JSON ...
  25. [25]
    On choosing a hypermedia type for your API - HAL, JSON-LD ...
    Mar 11, 2014 · In this post I will evaluate a few mature hypermedia types for APIs, offering a side-by-side comparison of their strengths and weaknesses.
  26. [26]
    JSON API? No … HAL! - Leonid Mamchenkov
    Dec 16, 2016 · Whereas JSON API is almost like an “ORM over HTTP”, HAL does a lot less for you though, so it's not really an apples-to-apples type of ...Missing: differences | Show results with:differences<|control11|><|separator|>
  27. [27]
    Siren: a hypermedia specification for representing entities - GitHub
    Siren is intended to be a general specification of a generic media type that can be applied to other types that are not inherently hypermedia-powered. The ...
  28. [28]
    collection-json/spec - GitHub
    Jul 12, 2011 · Collection+JSON is a JSON-based read/write hypermedia-type designed to support management and querying of simple collections.
  29. [29]
    JSON-LD 1.1 - W3C
    Jul 16, 2020 · JSON is a useful data serialization and messaging format. This specification defines JSON-LD 1.1, a JSON-based format to serialize Linked Data.
  30. [30]
    An Example Of An API Service Provider Using Hypermedia
    Feb 27, 2017 · The Amazon API Gateway web service is a resource-based API that uses Hypertext Application Language (HAL). HAL provides a standard way for ...Missing: notable | Show results with:notable<|separator|>
  31. [31]
    HAL - adidas API Guidelines
    Jun 19, 2024 · The Hypertext Application Language application/hal+json (HAL) MUST be used as the representation format of a resource.
  32. [32]
    loopbackio/loopback4-example-shopping: LoopBack 4 ... - GitHub
    This project aims to represent an online ecommerce platform APIs to validate / test the LoopBack 4 framework readiness for GA.Missing: HAL | Show results with:HAL
  33. [33]
    HATEOAS and Microservices - Stack Overflow
    Mar 27, 2015 · We can have HATEOAS based communication patterns built into our microservices architecture in order to be fully flexible for ever changing/upgrading ...
  34. [34]
    JSON-HAL and Dwolla HAL-Forms
    JSON-HAL is a hypermedia API format. Dwolla HAL-Forms is an extension for representing forms within the API, enabling dynamic UI generation.Missing: validator | Show results with:validator
  35. [35]
    Relationship and Difference Between HAL and HATEOAS | Baeldung
    Nov 9, 2024 · HAL is a simple format that helps developers create hypermedia representations for RESTful APIs, supporting the HATEOAS principle. It defines a ...
  36. [36]
    JSON Linking with HAL
    ### Benefits of HAL for JSON Linking in APIs
  37. [37]
    REST with Hypermedia - Hot or Not? - Reflectoring
    Jan 1, 2018 · This article explains what hypermedia means for creating an API, what benefits it brings and which drawbacks you might encounter when using it.
  38. [38]
    Thoughts on REST APIs: Open API v. Hypermedia | DanKlco.com
    Nov 3, 2021 · Open API's are REST-like, with one big difference: consumers are expected to manipulate URLs. Open APIs are defined with Swagger 2.0 or Open API ...Missing: competition | Show results with:competition
  39. [39]
    Why HAL-Forms (_templates) Slow Down Your API Responses
    Jun 4, 2025 · HAL-Forms aims to enhance REST APIs with rich form metadata—but _templates can silently degrade performance.