This module provides a documented and authenticated API for your Drupal site, allowing other applications to access its content. It serves read-only JSON:API data and offers OpenAPI documentation, with configurable authentication methods.
Web API gives a Drupal site a documented, authenticated API for other applications to read its content.
What it sets up
- JSON:API served from
/api, and read-only. Write operations stay a decision for the site owner, at/admin/config/services/jsonapi. Read-only is what the Drupal Security Team recommends, because past JSON:API advisories had their root cause in write handling. - Authentication and authorization: OAuth 2.0 with Simple OAuth and consumers, and HTTP Basic authentication.
- Documentation: OpenAPI documents for JSON:API and REST, rendered with Swagger UI at
/api-docs. - Settings at
/admin/config/services/webapi: which entity types expose their new bundles automatically, and whether the View JSON and View API documentation links appear in entity operations.
Good to know
- Every package comes from drupal.org. The Swagger UI asset library belongs to the project template, where Composer installer paths take effect.
- Cross-origin requests are not configuration: set
cors.configinsites/default/services.ymlper site. No module can ship it. - Web API is used by the Webships Starter and WebAPI Starter site templates.
Drupal 11
· not 10
Ask your assistant about Drupal Website API
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.