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.

Universal Entity API

3 sites No security coverage
View on drupal.org

This module provides structured JSON APIs for all Drupal content, perfect for headless setups and mobile apps. It handles relationships between content components and offers features like filtering, sorting, and OpenAPI documentation.

Universal Entity API is a plug-and-play Drupal module that exposes deeply structured, normalized JSON APIs for all content entities β€” ideal for decoupled frontends, mobile apps, and content hubs.

Features

Universal Entity API transforms Drupal into a powerful backend for headless and decoupled architectures. It delivers structured, flexible APIs with deep reference resolution, optional rendering, and OpenAPI documentation β€” all with minimal setup.

βœ… Supported Entity Types:
This module fully supports all core content entity types out of the box:

🧱 Nodes β€” Articles, pages, and all custom content types

🧩 Paragraphs β€” Nested reusable components

πŸ–ΌοΈ Media β€” Images, videos, remote media

🏷️ Taxonomy Terms β€” Categories, tags, vocabularies

🧱 Custom Blocks β€” Block content of any bundle

πŸ“¦ Menus β€” Complete menu trees with fields and hierarchy

βš™οΈ Config Entities β€” Basic site settings (site name, logo, theme)

🧭 Layout Builder (beta) β€” Section layout, blocks, and nested data (under development)

πŸ”— Key API Endpoints:

  • /api/{entity_type}/{bundle}/{id} β€” Fetch a single entity (node, block, media, term, etc.) with full reference normalization
  • /api/node/{bundle}/list β€” Paginated, sortable node list with filters and field pruning
  • /api/block/{bundle}/list β€” List all custom blocks of a given bundle
  • /api/menu/{menu_name}?depth=n β€” Load full menu tree with fields, weights, and descriptions
  • /api/entity-type/list β€” Discover all available entity types and bundles
  • /api/config/basic β€” Get basic configuration (site name, logo, theme)

βœ… Load any entity (node, taxonomy, block, media, etc.) with
/api/{entity_type}/{bundle}/{id} β€” Works for all core content entities

πŸ›  Enhancements:

  • Deep reference resolution: Paragraphs inside blocks, media inside paragraphs, blocks inside paragraphs
  • Field-level filtering via ?fields=title,field_image
  • Sorting & pagination: ?sort=-created&page=1&limit=10
  • OpenAPI Documentation:
    • Schema JSON: /openapi.json
    • Interactive Explorer: /api-docs

Post-Installation

After enabling the module, you’re ready to go:

  1. Visit /api-docs to explore the endpoints
  2. Test with real content via URLs like /api/node/article/1 or /api/block_content/hero_banner/2
  3. Access control is handled via Drupal's standard permissions system
  4. No config screens β€” just plug and play, or extend via hooks/services

Additional Requirements

  • Drupal 10 or 11 Core
  • Layout Builder (optional, for layout structure API)
  • Paragraphs module (optional, for nested reusable components)
  • Media module (optional, for file/image/video embedding)
  • OpenAPI UI β€” For alternate Swagger rendering
  • Subrequests β€” Enables batch fetching (experimental)
  • Decoupled Router β€” Helpful for resolving paths and aliases

Similar Projects

Project Difference JSON:API Exposes raw entity structure. Limited in-depth resolution and no rendered output. GraphQL Requires schema definition and specialized clients. Complex for simple use cases. REST UI Basic entity output. Lacks nested reference support and field filtering. Decoupled Router Route-focused. Doesn’t expose full entity data.

Universal Entity API excels at full-entity normalization for frontend-ready JSON with zero configuration.

Supporting this Module

  • ⭐ Star on Drupal.org
  • πŸ›  Submit patches or enhancements
  • 🧠 Share documentation and real-world integrations
  • 🀝 Apply for co-maintainership if interested

Community Documentation

  • πŸŽ₯ Live walkthroughs β€” Coming soon
  • πŸ“Ί Next.js frontend integration β€” Planned
  • 🧰 GitLab decoupled starter kit β€” Coming soon
  • πŸ“š Swagger Explorer: /api-docs

🧩 Layout Builder API (Under Development)

  • /api/layout/node/{id} β€” Returns layout sections, components, and inline block data
  • Recursively normalizes Paragraphs, Media, and nested Blocks
  • Includes structured fields + rendered HTML preview per section
  • Great for rendering Layout Builder pages in headless environments

Enabling CORS for Frontend Access

To allow your decoupled frontend (e.g. React, Next.js) to access these APIs, add the following CORS config to your settings.php:

$settings['cors.config'] = [
  'enabled' => TRUE,
  'allowedHeaders' => ['*'],
  'allowedMethods' => ['GET', 'POST', 'OPTIONS'],
  'allowedOrigins' => ['*'], // Replace * with specific domain(s) in production
  'exposedHeaders' => FALSE,
  'maxAge' => 1000,
  'supportsCredentials' => FALSE,
];

πŸ’‘ You can restrict allowedOrigins to http://localhost:3000, https://yourfrontend.com, etc., for better security in production.

Activity

Total releases
2
First release
Jun 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Release date
1.0.0 Stable Jun 23, 2025
1.0.x-dev Dev Jun 23, 2025