Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

JSON:API Resources

8,777 sites Security covered Drupal 9–11
View on drupal.org

This module allows you to define custom JSON:API routes for providing unique data collections and contextual information. It supports GET and POST requests, enabling the creation of custom resources that go beyond standard entity collections.

The JSON:API Resources module makes it possible to define custom JSON:API routes. It does not define any custom routes of its own.

This can be incredibly valuable for providing custom collections (like a/jsonapi/featured-posts route) and contextual data (like a /jsonapi/me route).

In addition to GET, this module also makes it easy to accept POST requests. For example, one could define a /jsonapi/user/{id}/reminders route where a new reminder entities could be created and automatically associated with a user.

You can see examples of how to define routes here.

You can find examples of the classes that respond with your custom data here.

Pair with JSON:API Hypermedia

Add typed links and actions to your custom resources with JSON:API Hypermedia. Together they enable HATEOAS-style decoupled behaviors — attach flag, unflag, or subscribe link relations to a node resource without inventing ad-hoc URL conventions.

Looking for a Views-based alternative?

If your custom endpoint is "a filtered list of entities with sorting and pagination," use JSON:API Views instead. It exposes any Views display as a JSON:API collection — no PHP required.

Reach for JSON:API Resources when:

  • The response shape doesn't map to a single entity collection (aggregates, computed fields, mixed resource types).
  • You need request-scoped logic — auth checks, contextual filters from the session, side effects on POST.
  • The route is non-entity, like /jsonapi/me or /jsonapi/user/{id}/reminders.

Reach for JSON:API Views when the query is already expressible in Views.

Depends on

Dependencies of the latest stable release

  • jsonapi Drupal core

Required by

4 tracked projects depend on this one

Activity

Tracked releases
6
Tracked since
May 2025
Latest release
1 week ago
Releases (12 mo)
5 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
8.x-1.8 Stable 9–11 Aug 21, 2026
8.x-1.7 Stable 9–11 Jun 18, 2026
8.x-1.6 Stable 9–11 Jun 9, 2026
8.x-1.5 Stable 9–11 May 21, 2026
8.x-1.4 Stable 9–11 Jan 6, 2026
8.x-1.3 Stable 9–11 May 7, 2025