Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Statistics Counter Module statistics_counter crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

Entity Gateway provides a configurable REST API for exposing selected Drupal entities and fields to external applications. Administrators can choose which entity types, bundles, and fields to make available, and the module automatically expands entity reference fields for easier consumption. It offers built-in filtering capabilities and is designed for projects where Drupal serves as a content backend with a need for simpler, structured JSON representations.

⚠️ Development status

Entity Gateway is currently under active development and is not yet ready for production use. The first beta release is planned for the end of August 2026. APIs, configuration options, and behavior may change before the beta release.

Entity Gateway provides a simple, configurable REST API for exposing selected Drupal entities and fields to frontend applications, mobile apps, and integrations.

Administrators choose which entity types, bundles, and fields are available. Entity reference fields can be automatically expanded into related entity data, providing API responses that are easier to consume without requiring custom REST resources.

Features

  • Configurable resources: Choose which entity types, bundles, and fields are exposed.
  • Simple REST endpoints: Access resources through predictable URLs such as /api/node/article.
  • Automatic relationship expansion: Entity references return related entity data instead of only internal IDs.
  • Nested relationships: Relationships can be expanded up to three levels deep.
  • Built-in filtering: Filter collections through query parameters using common comparison and text operators.
  • UUID reference filtering: Entity reference fields can be filtered using referenced entity UUIDs.

Entity Gateway is intended for projects where Drupal acts as a structured content backend and consumers need a simpler JSON representation of entities and their relationships.

Configuration

No Drupal content is exposed by default.

1. Select entity types

Go to:

/admin/config/services/entity-gateway

Choose the entity types that should be available through the API.

2. Configure resources

Go to:

/admin/config/services/entity-gateway/resource-list

Select the bundles and fields that should be exposed.

3. Consume the API

Resources are available using:

/api/{entity_type}/{bundle}

For example:

GET /api/node/article

Entity reference fields included in the resource are automatically resolved according to the configured resources.

Relationship expansion is limited to three levels to prevent uncontrolled recursive loading.

Administrators should expose only the entities and fields required by API consumers.

Requirements

Entity Gateway supports Drupal 10 and Drupal 11.

The Drupal core Serialization module must be enabled.

No third-party PHP libraries or contributed modules are required.

API filtering

Collections can be filtered using the filter query parameter.

Basic filtering

GET /api/node/article?filter[status]=1

Filtering with an operator

GET /api/node/article?filter[created][operator]=>=&filter[created][value]=1700000000

Supported operators:

  • =, !=, <, >, <=, >=
  • IN, NOT IN, LIKE
  • contains, start_with, end_with

Custom Drupal fields can be queried without the field_ prefix.

For example:

GET /api/node/article?filter[category]=desserts

is applied internally to field_category.

Comma-separated values are treated as an IN condition:

GET /api/node/article?filter[category]=desserts,pizza,salads

Entity reference fields are filtered using referenced entity UUIDs:

GET /api/node/article?filter[category]=d0f7a6a0-9a2e-4c83-9d9a-111122223333

Unsupported operators return HTTP 422 Unprocessable Entity.

Similar projects

Drupal core JSON:API

JSON:API is the recommended choice when consumers need the standardized JSON:API specification.

Entity Gateway focuses on simpler responses, explicit field exposure, built-in filtering, and automatically expanded entity relationships.

Drupal core REST

Drupal core REST provides the foundation for building REST APIs.

Entity Gateway focuses on quickly exposing selected entity data through configuration without requiring a custom REST resource for each endpoint.

Contributing

Entity Gateway is an open source Drupal project. Bug reports, testing, documentation improvements, patches, merge requests, and API use-case suggestions are welcome.

Configuration details and additional API examples are maintained in the project documentation and README.

Built by a human using an AI assistant: 🤖 ➕ 🧠

Parts of this module were generated with AI coding agents under human supervision.

Activity

Tracked releases
1
Tracked since
Aug 2026
Latest release
1 week ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
1.0.x-dev Dev Aug 10, 2026