Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

jsonapi_resources

7,058 sites Security covered
View on drupal.org

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.

Activity

Total releases
3
First release
May 2025
Latest release
1 week ago
Release cadence
190 days
Stability
100% stable

Release Timeline

Releases

Version Type Release date
8.x-1.5 Stable May 21, 2026
8.x-1.4 Stable Jan 6, 2026
8.x-1.3 Stable May 7, 2025