API Orchestrator
This module provides a centralized system to manage all your external API integrations within Drupal. You can define APIs and their specific endpoints in the admin interface, and then use a single service to execute requests, which automatically handles logging, retries, queuing, and event dispatching.
Overview
API Orchestrator is a Drupal module that provides a unified layer for managing all external API integrations. Instead of writing raw curl_init() calls spread across your codebase, you define services (external APIs) and endpoints (specific API calls) as configuration entities — then execute requests through a single orchestration service that handles logging, retries, queue processing, and event dispatching automatically.
Supports Drupal 11. Requires PHP 8.2+.
Core Features
- Service & Endpoint Management — Define external APIs as config entities with base URL, authentication headers, timeout, and retry settings. Add endpoints with HTTP method, path, body template, and encoding type. Manage everything from the admin UI.
- Token Replacement — Use
{{token}}placeholders in URLs and request bodies. Supports default values with{{token|default}}syntax. Tokens are replaced at runtime from request parameters. - REST & GraphQL Support — First-class support for both REST and GraphQL APIs through an encoder/decoder plugin system. The GraphQL encoder handles query, variables, and operation name formatting automatically.
- Automatic Retries — Configure max retries and retry interval per service. Failed requests are retried with exponential backoff.
- Queue & Direct Execution — Choose per-endpoint whether requests execute immediately (direct mode) or are queued for background processing via Drupal cron. Queue mode is ideal for non-blocking workflows like content syndication.
- Full Request Logging — Every request is stored as a content entity with method, URL, headers, request body, response body, status code, and duration. Response bodies larger than 100KB are automatically offloaded to the private file system.
- Event System — Dispatches
ApiRequestCompletedEventandApiRequestFailedEventvia Symfony EventDispatcher. Sub-modules and custom code can subscribe to react to API activity. - Admin Dashboard — Overview of recent requests, service health, and quick access to all management pages. Built with Single Directory Components (SDC).
- Drush Commands — Execute API requests and list services from the command line.
- Public Health Check API — Token-authenticated
/api/api-orchestrator/healthendpoint for external uptime monitoring.
Sub-Modules
Enable only what you need. Each sub-module is independent and adds specific functionality on top of the core:
- Analytics — Interactive charts showing request volume, success/failure rates, response time distributions, and per-endpoint performance metrics. Filter by date range, service, or status.
- Monitoring — Real-time dashboard with live metrics (5min / 15min / 1hr windows), a scrolling request feed, and a day-of-week x hour-of-day heatmap for traffic pattern visualization.
- Alerts — Define threshold-based alert rules (error rate, response time, failure count) with configurable cooldown periods. Triggers multi-channel notifications when thresholds are breached.
- Notifications — Pluggable notification providers for Email, Slack, Microsoft Teams, and WhatsApp. Used by the Alerts module for dispatch, but can also be invoked programmatically.
- Export — Export request logs in CSV, Excel (XLSX), PDF, or JSON format. Includes scheduled reports that run via cron and deliver results by email.
- Reports — Generate standalone interactive HTML reports with embedded Chart.js visualizations — shareable without Drupal access.
- ECA Integration — Provides ECA events, conditions, and actions to trigger API requests from ECA workflows and react to API responses.
- Integration Samples — Pre-configured sample integrations (Shopify via mock.shop GraphQL, JSONPlaceholder REST, Magento 2 REST) to get started immediately.
Architecture
The request flow follows a clean pipeline:
- Your Code / ECA calls the orchestrator service with an endpoint ID and parameters
- RequestBuilderService resolves tokens, encodes the body (JSON/GraphQL), and builds the full URL with headers
- HttpExecutorService executes the request directly or queues it for background processing, with automatic retry on failure
- ResponseStorageService stores the response (large bodies are offloaded to the file system)
- Event Dispatcher fires
ApiRequestCompletedEventorApiRequestFailedEventfor sub-modules to react
Quick Start
- Install:
composer require drupal/api_orchestrator - Enable:
drush en api_orchestrator - Go to Admin > Configuration > Services > API Orchestrator
- Create a Service (e.g., base URL
https://jsonplaceholder.typicode.com) - Add an Endpoint (e.g., GET
/posts/{{post_id}}) - Execute a request and see it logged in the dashboard
Or enable the Integration Samples sub-module for pre-configured Shopify, JSONPlaceholder, and Magento endpoints.
Requirements
- Drupal 10.3+ or 11
- PHP 8.2+
- Guzzle HTTP client (included with Drupal core)
Resources
- Project Website & Documentation: api-orchestrator.online — Full documentation, case studies, installation guide, and sub-module details.
- Source Code: git.drupalcode.org/project/api_orchestrator
- Issue Queue: Report bugs and feature requests
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.
Activity
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.1.7 | Stable | 11 | Fixes request execution to use evaluated runtime headers instead of raw endpoint header configuration. Thanks to mwebaze for reporting the issue and providing the initial patch. | Jul 2, 2026 | |
| 1.1.6 | Stable | 11 | Fixes API endpoint query parameters being lost after saving the endpoint form. | Jul 1, 2026 | |
| 1.1.5 | Stable | Environment architecture overhaul — individual environment entities with URL-based hostname detection. | Mar 10, 2026 | ||
| 1.1.4 | Stable | Drupal.org code review compliance: OOP hooks, PHP attributes, constructor promotion, #config_target, zero ESLint warnings. | Mar 10, 2026 | ||
| 1.1.3 | Stable | Code quality release with full Drupal.org GitLab CI compliance. Fixes linting and static analysis issues; no functional changes. | Mar 10, 2026 | ||
| 1.1.2 | Stable | Mar 8, 2026 | |||
| 1.1.1 | Stable | Mar 8, 2026 | |||
| 1.1.0 | Stable | Mar 8, 2026 | |||
| 1.0.0-beta3 | Pre-release | Mar 8, 2026 | |||
| 1.0.0-beta2 | Pre-release | Mar 8, 2026 | |||
| 1.0.0-beta1 | Pre-release | 10–11 | Mar 8, 2026 |