Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

JSON-RPC

722 sites Security covered
View on drupal.org

This module provides a framework for creating non-RESTful services in Drupal. It allows for remote execution of Drupal actions, such as clearing caches, and exposes internal data like permissions and installed modules. It is designed to be the foundation for decoupled Drupal interfaces.

JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol.

This module implements a framework for creating non-RESTful services. It is intended to be the platform on which a decoupled Drupal administration and introspection interface can be built.

While JSON API module handles entity data and REST can be used to create custom REST resources, some Drupal actions can't be neatly handled with REST principles. Clearing cache is a perfect example.

JSON-RPC exposes Drupal internal data like permissions or installed modules. Additionally, JSON-RPC can be used to execute actions remotely against your Drupal application, like clearing caches or putting the site in maintenance mode.

Not all features are implemented. If you would like to help, you can find or add to the list of missing APIs.

Learn more about the motivation and the internals of this module in this article.

Read the article

Discovery

The available RPC services along with documentation and usage details can be discovered by sending an HTTP GET request to /jsonrpc/methods. To make these available you will need to enable the jsonrpc_discovery sub-module.

Usage

To execute an RPC method, send an HTTP POST request to /jsonrpc. The body of your request must adhere the JSON-RPC specification.

You can also execute an RPC method sending a GET request with a ?query= parameter. Remember to URL-encode the JSON string. Many CDNs only allow caching on GET requests so this is the recommended approach in most situations.

Examples

You can use this Postman Collection with examples and tests. These RPC examples are provided by the jsonrpc_core sub-module. Enable it to see the examples in action.

Example request/response:

Request
POST
{
  "jsonrpc": "2.0",
  "method": "plugins.list",
  "params": {
    "service": "plugin.manager.link_relation_type",
    "page": {
      "limit": 3,
      "offset": 1
    }
  },
  "id": "relation-types"
}

The same request using the GET method (after URL encode) would be:

https://example.org/jsonrpc?query=%7B%22jsonrpc%22%3A%222.0%22%2C%22method%22%3A%22plugins.list%22%2C%22params%22%3A%7B%22service%22%3A%22plugin.manager.link_relation_type%22%2C%22page%22%3A%7B%22limit%22%3A3%2C%22offset%22%3A1%7D%7D%2C%22id%22%3A%22relation-types%22%7D

Response

That will return a list of the relation type plugins available on the site.

{
  "jsonrpc": "2.0",
  "id": "relation-types",
  "result": {
    "add-page": {
      "class": "Drupal\\Core\\Http\\LinkRelationType",
      "uri": "https://drupal.org/link-relations/add-page",
      "description": "A page where a resource of this type and related types can be created.",
      "provider": "core",
      "id": "add-page"
    },
    "delete-form": {
      "class": "Drupal\\Core\\Http\\LinkRelationType",
      "uri": "https://drupal.org/link-relations/delete-form",
      "description": "A form where a resource of this type can be deleted.",
      "provider": "core",
      "id": "delete-form"
    },
    "revision": {
      "class": "Drupal\\Core\\Http\\LinkRelationType",
      "uri": "https://drupal.org/link-relations/revision",
      "description": "A particular version of this resource.",
      "provider": "core",
      "id": "revision"
    }
  }
}

Contenta CMS

This module is part of the Contenta CMS decoupled distribution and integrates with Contenta JS. Learn more about these projects:

👉 Contenta CMS 👈
🔥 Contenta JS 🔥

Supporting this Module

All contributions are welcome. Please submit MRs, not patches, so that the CI tests are run. Please add tests if possible.

If you post an issue and do not receive a response, feel free to contact me by private message in the Drupal Slack (ptmkenny) or via my Drupal.org contact form.

Activity

Total releases
3
First release
Jul 2025
Latest release
8 months ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Slowing

Release Timeline

Releases

Version Type Release date
3.0.1 Stable Oct 31, 2025
3.0.0 Stable Oct 17, 2025
3.0.0-beta1 Pre-release Jul 21, 2025