Drupal is a registered trademark of Dries Buytaert

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 10.3+ and 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 ApiRequestCompletedEvent and ApiRequestFailedEvent via 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/health endpoint 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:

  1. Your Code / ECA calls the orchestrator service with an endpoint ID and parameters
  2. RequestBuilderService resolves tokens, encodes the body (JSON/GraphQL), and builds the full URL with headers
  3. HttpExecutorService executes the request directly or queues it for background processing, with automatic retry on failure
  4. ResponseStorageService stores the response (large bodies are offloaded to the file system)
  5. Event Dispatcher fires ApiRequestCompletedEvent or ApiRequestFailedEvent for sub-modules to react

Quick Start

  1. Install: composer require drupal/api_orchestrator
  2. Enable: drush en api_orchestrator
  3. Go to Admin > Configuration > Services > API Orchestrator
  4. Create a Service (e.g., base URL https://jsonplaceholder.typicode.com)
  5. Add an Endpoint (e.g., GET /posts/{{post_id}})
  6. 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

Activity

Total releases
6
First release
Mar 2026
Latest release
1 day ago
Release cadence
0 days
Stability
50% stable

Release Timeline

Releases

Version Type Release date
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 Mar 8, 2026