API Orchestrator

Complete documentation for the Drupal API management module.

API Orchestrator replaces scattered curl_init() calls across your Drupal codebase with a centralized, managed API integration layer. Define your external services and endpoints as Drupal config entities, then make requests with built-in logging, retries, monitoring, and alerting.

Whether your site makes 10 or 10,000 API calls a day, every request is logged, searchable, and exportable from one dashboard. Config entities deploy via drush cex/cim with {{env:VAR}} token support — same YAML files across dev, test, staging, and production.

Drupal Compatibility: API Orchestrator requires Drupal 11 with PHP 8.2+. All sub-modules follow the same requirement.

Installation

Via Composer (recommended)

composer require drupal/api_orchestrator
drush en api_orchestrator -y
drush cr

Enable sub-modules

Each feature is a separate sub-module. Enable only what you need:

# Analytics dashboard
drush en api_orchestrator_analytics -y

# Real-time monitoring
drush en api_orchestrator_monitoring -y

# Alerts with threshold rules
drush en api_orchestrator_alerts -y

# Multi-channel notifications (Email, Slack, Teams, WhatsApp)
drush en api_orchestrator_notifications -y

# Export to CSV/Excel/PDF/JSON with scheduled reports
drush en api_orchestrator_export -y

# Standalone HTML reports with charts
drush en api_orchestrator_reports -y

# ECA workflow integration
drush en api_orchestrator_eca -y

# Sample integrations
drush en api_orchestrator_integration_samples -y
drush en api_orchestrator_sample_shopify -y
drush en api_orchestrator_sample_jsonplaceholder -y
drush en api_orchestrator_sample_magento -y

Quick Start

The fastest way to see API Orchestrator in action is with the built-in sample integrations.

1. Enable Shopify sample

drush en api_orchestrator_sample_shopify -y

This installs a pre-configured Shopify Storefront service pointing to mock.shop (Shopify's official mock API) with 5 GraphQL endpoints. No API key needed.

2. Make your first request

# List products
drush api-orchestrator:request shopify_product_list \
  --data='{"page_size":"5"}'

# Get product detail
drush api-orchestrator:request shopify_product_detail \
  --data='{"handle":"men-t-shirt"}'

# Search products
drush api-orchestrator:request shopify_search_products \
  --data='{"search_term":"pants"}'

3. View results

Navigate to /admin/config/services/api-orchestrator to see the dashboard with all logged requests, response codes, durations, and full request/response bodies.

JSONPlaceholder is another zero-configuration sample. Enable api_orchestrator_sample_jsonplaceholder for REST API testing with GET and POST endpoints.

Services

A Service represents an external API provider (e.g., Shopify, Magento, your custom backend). It stores:

PropertyDescription
base_urlThe root URL of the API (e.g., https://mock.shop)
api_keyAuthentication token (stored encrypted)
api_key_headerHeader name for the API key (e.g., Authorization)
additional_headersKey-value pairs for extra HTTP headers
timeoutRequest timeout in seconds (default: 30)
max_retriesNumber of automatic retries on failure
retry_intervalSeconds between retries
log_requestsEnable/disable request logging
log_curl_commandsLog equivalent cURL commands for debugging

Create services via the admin UI at /admin/config/services/api-orchestrator/services/add or via config install YAML files.

Endpoints

An Endpoint belongs to a service and defines a specific API operation:

PropertyDescription
service_idParent service machine name
pathURL path appended to service base_url
methodHTTP method: GET, POST, PUT, PATCH, DELETE
headersEndpoint-specific headers (merged with service headers)
query_parametersDefault query string parameters
body_templateJSON body template with {{token}} placeholders
is_graphqlEnable GraphQL mode
is_directExecute immediately (vs. queue)
encoder_typejson or graphql
decoder_typejson (extensible via plugins)

Token Replacement

Tokens allow dynamic values in paths, query parameters, body templates, and GraphQL variables.

Simple tokens

# In path:
/api/products/{{product_id}}

# In body template:
{"title": "{{title}}", "price": {{price}}}

Tokens with defaults

# If page_size is not provided, defaults to 20:
{"first": {{page_size|20}}}

# In query parameters:
?status={{status|published}}&limit={{limit|50}}

Passing data

# Via Drush:
drush api-orchestrator:request my_endpoint \
  --data='{"product_id":"42","page_size":"10"}'

# Via PHP service:
$orchestrator->request('my_endpoint', [
  'product_id' => 42,
  'page_size' => 10,
]);

Environments

Each environment (dev, test, live, etc.) is a config entity that you add one by one from the admin UI at /admin/config/services/api-orchestrator/environment. One environment can be marked as the default.

Each endpoint can use a different service per environment. For example, your shopify_product_list endpoint can point to a dev Shopify store in Development, a staging store in Test, and the production store in Live.

Environment-Specific Services UI

URL Pattern Detection

Each environment has a required URL pattern field. The module matches the current request's hostname against these patterns:

EnvironmentURL PatternMatches
Developmentdev.example.comhttps://dev.example.com/*
Test/Stagestaging.example.comhttps://staging.example.com/*
Production (default)example.comhttps://example.com/*

How service overrides work

  1. Add environments one by one with a URL pattern and default checkbox
  2. Create separate services for each environment with different base URLs and API keys
  3. On the endpoint form, assign each environment its service
  4. When a request is made, the module detects the current environment and uses the correct service
# Your code never changes between environments:
$result = $orchestrator->request('shopify_product_list', [
  'page_size' => 10,
]);
# On dev  → hits dev.myshopify.com (shopify_dev service)
# On test → hits stage.myshopify.com (shopify_stage service)
# On live → hits prod.myshopify.com (shopify_prod service)

Deployment

# Export config on dev
drush cex -y

# Import on stage/production
drush cim -y
# Same YAML files, environment overrides travel with the config.
URL-based detection: The module detects the current environment by matching the site hostname against each environment's URL pattern. One environment can be marked as default for local development.

GraphQL Support

API Orchestrator has first-class GraphQL support. When is_graphql is enabled on an endpoint:

  • The graphql_query field stores your GraphQL query/mutation
  • The graphql_variables field accepts a JSON template with {{token|default}} placeholders
  • The request body is automatically encoded as {"query": "...", "variables": {...}}

Example: Shopify product listing

# graphql_query:
query GetProducts($first: Int!, $after: String) {
  products(first: $first, after: $after) {
    edges {
      node { id title handle priceRange { minVariantPrice { amount currencyCode } } }
    }
    pageInfo { hasNextPage endCursor }
  }
}

# graphql_variables:
{"first": {{page_size|20}}}

# graphql_operation_name:
GetProducts

Queue & Direct Mode

Each endpoint can be configured for direct or queue execution:

  • Direct mode (is_direct: true): Executes immediately and returns the response.
  • Queue mode (is_direct: false): Adds to Drupal's queue system. Processed on next cron run.

Drush Commands

CommandDescription
drush api-orchestrator:request <endpoint_id>Execute an API request
drush api-orchestrator:request <id> --data='{...}'Execute with token data (JSON)
drush api-orchestrator:list-servicesList all configured services
drush api-orchestrator:list-endpointsList all configured endpoints

Examples

REST Fetch posts from JSONPlaceholder
drush api-orchestrator:request jp_list_posts
# Output:
 [success] Request completed: 200 OK (127ms)
 Service:  jsonplaceholder
 Endpoint: jp_list_posts
 Method:   GET
 URL:      https://jsonplaceholder.typicode.com/posts
REST + Tokens Get a single post by ID
drush api-orchestrator:request jp_get_post \
  --data='{"post_id":"42"}'
# Output:
 [success] Request completed: 200 OK (89ms)
 URL:  https://jsonplaceholder.typicode.com/posts/42
 Body: {"id":42,"title":"...","body":"...","userId":5}
GraphQL List Shopify products
drush api-orchestrator:request shopify_product_list \
  --data='{"page_size":"5"}'
# Output:
 [success] Request completed: 200 OK (312ms)
 Service:  shopify_storefront (GraphQL)
 URL:      https://mock.shop/api
 Products: 5 items returned, hasNextPage: true
POST Create a new resource
drush api-orchestrator:request jp_create_post \
  --data='{"title":"My New Post","body":"Hello!","userId":"1"}'
# Output:
 [success] Request completed: 201 Created (145ms)
 Method:   POST
 URL:      https://jsonplaceholder.typicode.com/posts
 Response: {"id":101,"title":"My New Post",...}
Discovery List all services and endpoints
# List all configured services
drush api-orchestrator:list-services

# List all endpoints
drush api-orchestrator:list-endpoints
# Services:
 shopify_storefront   https://mock.shop         GraphQL  Active
 jsonplaceholder      https://jsonplaceholder..  REST     Active

# Endpoints:
 shopify_product_list    shopify_storefront  GraphQL  Direct
 jp_list_posts           jsonplaceholder     GET      Direct
 jp_create_post          jsonplaceholder     POST     Queue
1 / 5

Sub-Modules Overview

API Orchestrator follows a modular architecture. The core module handles services, endpoints, request execution, and logging. Everything else is a separate sub-module.

ModuleMachine NamePurpose
Analyticsapi_orchestrator_analyticsCharts, timelines, endpoint performance
Monitoringapi_orchestrator_monitoringReal-time dashboard, heatmap, live feed
Alertsapi_orchestrator_alertsThreshold rules, cooldowns, multi-channel
Notificationsapi_orchestrator_notificationsEmail, Slack, Teams, WhatsApp providers
Exportapi_orchestrator_exportCSV, XLSX, PDF, JSON + scheduled reports
Reportsapi_orchestrator_reportsStandalone HTML reports with Chart.js
ECAapi_orchestrator_ecaECA actions, events, conditions
Integration Samplesapi_orchestrator_integration_samplesContainer for sample integrations

Analytics Module

Provides an interactive dashboard at /admin/config/services/api-orchestrator/analytics with:

  • Overview cards: Total requests, success rate, average duration, error count
  • Timeline chart: Request volume over time (minute/hour/day/week/month granularity)
  • Duration distribution: Response time histogram
  • Status code distribution: 2xx, 3xx, 4xx, 5xx breakdown
  • Endpoint performance table: Per-endpoint stats with sorting

All data is filterable by date range, service, endpoint, status, HTTP method, response code, and duration range.

Monitoring Module

Real-time monitoring dashboard with:

  • Live metrics: Requests in last 5min, 15min, and 1 hour with success/failure counts
  • Activity heatmap: GitHub-style heatmap showing request density by day/hour
  • Live request feed: Auto-updating feed with pause/resume controls
  • Queue status: Current items in queue and processing count

Alerts Module

Define alert rules evaluated on every cron run. Plugin-based channel architecture with built-in Slack and Discord.

Alert TypeDescription
ERROR_RATEPercentage of failed requests in time window
AVG_DURATIONAverage response time in milliseconds
FAILURE_COUNTAbsolute number of failed requests
NO_REQUESTSNo requests received in time window
SUCCESS_RATE_DROPSuccess rate drops below threshold

Plugin-based notification channels

Alert channels are Drupal plugins discovered via the #[AlertChannel] PHP attribute:

ChannelPlugin IDDescription
SlackslackIncoming Webhook with channel override, username, mentions, rich formatting
DiscorddiscordWebhook with rich embeds, role mentions, severity-based colors
LogAlways-on Drupal watchdog logging

Creating a custom alert channel

PagerDutyAlertChannel.php
use Drupal\api_orchestrator_alerts\Attribute\AlertChannel; use Drupal\api_orchestrator_alerts\Plugin\AlertChannelBase; #[AlertChannel( id: 'pagerduty', label: new TranslatableMarkup('PagerDuty'), )] class PagerDutyAlertChannel extends AlertChannelBase { public function sendAlert(ApiAlert $alert, array $result, array $config): void { $this->sendWebhook($config['routing_key'], [ 'event_action' => 'trigger', 'payload' => ['summary' => $result['message']], ]); } }

Notifications Module

Plugin-based notification system with 4 built-in providers:

  • Email: Drupal mail system with customizable subject/body
  • Slack: Incoming Webhooks with rich message formatting
  • Microsoft Teams: Adaptive Cards format
  • WhatsApp: Via Twilio API integration

Export Module

Export request data in multiple formats:

  • CSV: Always available, no extra dependencies
  • Excel (XLSX): Requires phpoffice/phpspreadsheet
  • PDF: Requires dompdf/dompdf
  • JSON: Raw JSON export

Scheduled Reports

Create scheduled reports that run automatically via cron. Configure name, format, schedule (daily/weekly/monthly), and email recipients.

Reports Module

Generates standalone HTML documents with embedded Chart.js charts. Reports include executive summary, request volume trends, per-endpoint performance, and SLA compliance metrics.

ECA Integration

Integrates with the ECA module (Events, Conditions, Actions).

  • Actions: Send API Request, Send Direct API Request
  • Events: API Request Completed, API Request Failed
  • Conditions: Response Status Code, Response Contains, Service Exists

Example: "When user logs in, sync profile to CRM"

Event:   User Login
Action:  Send API Request
         Endpoint: crm_sync_user
         Data: {"user_id": "[user:uid]", "email": "[user:mail]"}
         Mode: Queue (non-blocking)

Sample Integrations

Shopify Storefront (mock.shop)

Uses Shopify's official mock API. Works immediately with no API key. 5 GraphQL endpoints.

JSONPlaceholder (REST)

Uses https://jsonplaceholder.typicode.com. Zero configuration needed. 5 REST endpoints.

Magento 2 (GraphQL)

10 pre-configured GraphQL endpoints. Requires a real Magento instance.

Custom Encoders & Decoders

The core module ships with json and graphql encoders, and a json decoder. Add custom ones by implementing EncoderInterface or DecoderInterface and registering as a tagged service.

# my_module.services.yml
services:
  my_module.xml_encoder:
    class: Drupal\my_module\Encoder\XmlEncoder
    tags:
      - { name: api_orchestrator.encoder, id: xml }

Events & Hooks

Symfony Events

EventWhen
api_orchestrator.request.completedAfter a successful request
api_orchestrator.request.failedAfter a failed request (all retries exhausted)

Drupal Hooks

function mymodule_api_orchestrator_request_failed(ApiRequest $request): void {
  // React to failed API requests.
}

API Reference

Making requests in PHP

$orchestrator = \Drupal::service('api_orchestrator.service');

$result = $orchestrator->request('shopify_product_list', [
  'page_size' => 10,
]);

$statusCode = $result->getResponseCode();
$body = $result->getDecodedResponse();
$duration = $result->getDurationMs();

Health Check API

# Public endpoint (no auth required):
GET /api/orchestrator/health

# Response:
{
  "status": "healthy",
  "module": "api_orchestrator",
  "version": "1.0.0",
  "timestamp": "2026-03-08T12:00:00+00:00"
}
Need help? File issues on the Drupal.org issue queue.

API Orchestrator

Complete documentation for the WordPress API management plugin.

API Orchestrator replaces scattered wp_remote_get/post calls across your WordPress codebase with a centralized, managed API integration layer. Define your external services and endpoints from a full-featured React admin dashboard, then make requests with built-in logging, retries, monitoring, and alerting.

The plugin ships with 17 PHP classes, 8 custom database tables, 40+ REST API endpoints, and a React admin dashboard with 13 pages. Everything is built-in — no add-ons or extensions needed.

Requirements: WordPress 6.0+ with PHP 8.1+. Single plugin, no dependencies.

Installation

Via WordPress Admin

# 1. Download the plugin ZIP
# 2. Go to Plugins → Add New → Upload Plugin
# 3. Upload the ZIP file
# 4. Click "Activate"

Via WP-CLI

wp plugin install api-orchestrator --activate

On activation, the plugin automatically creates 8 database tables and registers all REST API endpoints.

Quick Start

1. Navigate to the admin dashboard

After activation, find API Orchestrator in the WordPress admin menu. The React dashboard loads with 13 navigation pages.

2. Install a sample integration

Go to Samples and click "Install JSONPlaceholder". This creates a REST service with 5 endpoints pointing to https://jsonplaceholder.typicode.com. No API key needed.

3. Execute your first request

Navigate to Request Builder. Select the jp_list_posts endpoint and click Execute. You'll see the full response with status code, duration, headers, and body.

4. Check the dashboard

Go to Dashboard to see your request logged with stats: total requests, success rate, average response time.

Also available: Click "Install Shopify" for a GraphQL sample using Shopify's mock.shop API. Works instantly, no API key needed.

Services

A Service represents an external API provider. Stored in the wp_api_orch_services table:

FieldDescription
nameDisplay name
machine_nameUnique identifier (auto-generated)
base_urlRoot URL of the API
auth_typenone, api_key, bearer, basic, oauth2
auth_configJSON auth credentials
default_headersJSON key-value headers
timeoutRequest timeout in seconds
max_retriesRetry count on failure (default: 3)
retry_intervalBase retry interval in ms (default: 1000)

5 auth types supported: No Auth, API Key (custom header), Bearer Token, Basic Auth (user:pass), OAuth 2.0.

Endpoints

An Endpoint belongs to a service and defines a specific API operation:

FieldDescription
service_idParent service
name / machine_nameDisplay name and unique ID
pathURL path appended to base_url
methodGET, POST, PUT, PATCH, DELETE
protocolrest or graphql
headersEndpoint-specific headers (JSON)
body_templateJSON body with {{token}} placeholders
query_paramsDefault query parameters (JSON)
execution_modedirect (sync) or queue (background)

Token Replacement

The {{token}} system works identically to Drupal. Tokens with defaults: {{token|default_value}}

# In URL path:
/api/products/{{product_id}}

# In body template:
{"title": "{{title}}", "first": {{page_size|20}}}

# In query parameters:
?status={{status|published}}&limit={{limit|50}}

# Applied to: URLs, headers, query params, body templates

Environments

Hostname-based auto-detection. Add environments from the admin UI with a name, machine name, and hostname pattern.

EnvironmentHostnameMatches
Developmentdev.example.comhttps://dev.example.com/*
Stagingstaging.example.comhttps://staging.example.com/*
Production (default)example.comhttps://example.com/*

Service overrides per environment

Override base_url, auth_config, and default_headers per environment. When a request executes, the plugin auto-detects the environment from home_url() hostname and applies the correct override.

# Your code never changes between environments:
$executor = new Executor();
$result = $executor->execute('shopify.product_list', ['page_size' => 10]);
# On dev.example.com  → hits dev.myshopify.com
# On staging.example.com → hits stage.myshopify.com
# On example.com → hits prod.myshopify.com

GraphQL Support

Set protocol: graphql on an endpoint. The body_template stores the GraphQL query with {{token}} variables. The executor automatically builds the {"query": "...", "variables": {...}} payload.

Queue & Direct Mode

  • Direct: Executes immediately, returns response. Best for real-time needs.
  • Queue: Adds to WP Cron queue. Processed in background batches (configurable batch size, default: 10). Custom cron schedules: every minute, every 5 minutes.

WP-CLI Commands

CommandDescription
wp api-orchestrator request <endpoint> [--data=<json>]Execute by ID or service.endpoint name
wp api-orchestrator list-servicesTable: ID, Name, Machine Name, Base URL, Auth, Status
wp api-orchestrator list-endpoints [--service=<id>]Table: ID, Service, Name, Method, Path, Mode, Status
wp api-orchestrator stats [--period=<period>]Summary: total, success, failed, rate, duration (default: 24h)
wp api-orchestrator healthCheck database, active services, queue size

Examples

REST Fetch posts via WP-CLI
wp api-orchestrator request jp_list_posts
# Output:
 Success: 200 OK (127ms)
 Service:  jsonplaceholder
 Endpoint: jp_list_posts
 Method:   GET
 URL:      https://jsonplaceholder.typicode.com/posts
GraphQL Shopify products with pagination
wp api-orchestrator request shopify_product_list \
  --data='{"page_size":"5"}'
# Output:
 Success: 200 OK (312ms)
 Service:  shopify_storefront (GraphQL)
 URL:      https://mock.shop/api
 Products: 5 items, hasNextPage: true
Stats Get analytics summary
wp api-orchestrator stats --period=7d
# Output:
 Period:       Last 7 days
 Total:        3,842 requests
 Successful:   3,811 (99.2%)
 Failed:       31 (0.8%)
 Avg Duration: 186ms
 Max Duration: 2,340ms
Health Check system health
wp api-orchestrator health
# Output:
 Database:     Connected ✔
 Tables:       8/8 present ✔
 Services:     12 active
 Endpoints:    47 active
 Queue:        3 items pending
 Last request: 2 minutes ago
1 / 4

Built-in Features

Everything ships in a single plugin. No add-ons, no sub-modules, no extensions.

FeatureHighlights
React Dashboard13 pages, Chart.js graphs, real-time data
Request BuilderNo-code drag-and-drop API testing
AnalyticsVolume, duration, status codes, per-endpoint stats
MonitoringReal-time health, service status, queue monitor
AlertsThreshold rules: error_rate, response_time, failure_count
6 Notification ChannelsEmail, Slack, Discord, Teams, WhatsApp, PagerDuty
ExportCSV, JSON, analytics reports
WP-CLI5 commands: request, list-services, list-endpoints, stats, health
Health CheckToken-authenticated external monitoring endpoint
SamplesJSONPlaceholder (REST) + Shopify (GraphQL)

React Admin Dashboard

A full React 18 SPA with React Router, Chart.js 4.4, and 13 navigation pages:

  • Dashboard: 8 stat cards (total, success rate, failed, avg time, services, endpoints, queue, alerts) + recent requests table
  • Services: CRUD with modal forms. Auth type selector, JSON config editor, headers editor
  • Endpoints: CRUD with service filter. Method/protocol selectors, body template editor
  • Environments: CRUD with hostname and default toggle. Shows current environment badge
  • Logs: Filterable/paginated table. Click any row for full request/response detail modal
  • Settings: Health token, log retention, max response size, queue batch size, alert interval

Request Builder

No-code drag-and-drop interface for building and testing API requests. Built with @dnd-kit.

  • Drag palette: Header, Query Param, JSON Body, GraphQL, Auth, Token Variable
  • Tabs: URL & method, headers, query params, body, auth, timeout
  • Live execution: Click Execute to see full response with status, duration, headers, body
  • Direct URL mode: Test any URL without pre-configuring a service/endpoint

Analytics

Interactive analytics dashboard with Chart.js visualizations:

  • Period selector: 1h, 6h, 12h, 24h, 7d, 30d, 90d
  • Summary cards: Total, successful, failed, success rate, min/avg/max duration
  • Volume chart: Requests over time (hourly or daily granularity)
  • Service stats: Per-service breakdown with request counts and avg duration
  • Endpoint stats: Per-endpoint breakdown with min/avg/max duration
  • Status codes: HTTP status distribution chart
  • Duration histogram: 0-100ms, 100-300ms, 300-500ms, 500ms-1s, 1-3s, 3-5s, 5s+

Alerts & Notifications

Alert rules

MetricOperatorsExample
error_rate> >= < <= ==Error rate > 10% in 15 minutes
response_time> >= < <= ==Avg response time > 2000ms in 5 minutes
failure_count> >= < <= ==Failure count > 50 in 30 minutes

Each rule has a cooldown period to prevent notification spam. Scope rules to specific services or endpoints.

6 notification channels

ChannelConfigFormat
EmailRecipient addressHTML-formatted via wp_mail()
SlackWebhook URLBlock Kit with fields
DiscordWebhook URLRich embeds with severity colors
Microsoft TeamsWebhook URLMessageCard adaptive cards
WhatsAppTwilio account SID, auth token, from/toText message via Twilio API
PagerDutyRouting keyEvents API v2, severity: critical

Each channel has a Test button in the admin UI to verify configuration.

Export & Reports

  • CSV Export: Logs with filters (service, date range, success/failure)
  • JSON Export: Pretty-printed JSON with same filter options
  • Analytics Report: Full report with summary, volume, services, endpoints, status codes, duration distribution. Periods: 1h to 90d.

Sample Integrations

One-click install from the Samples admin page:

  • JSONPlaceholder (REST): 5 endpoints — list posts, get post, create post, list users, get user
  • Shopify (GraphQL): 5 endpoints — product list, product detail, collections, collection products, search. Uses mock.shop (no API key).

Health Check

Token-authenticated endpoint for external monitoring systems (UptimeRobot, Pingdom, etc.):

# Endpoint:
GET /wp-json/api-orchestrator/v1/health

# Authentication (choose one):
Header: X-Health-Token: your-secret-token
Query:  ?token=your-secret-token

# Response (200 OK):
{
  "status": "healthy",
  "version": "1.0.0",
  "checks": {
    "database": true,
    "tables": true,
    "services": 12,
    "recent_requests": {"total": 142, "avg_duration": 186},
    "queue": {"size": 3}
  },
  "time": "2026-03-12T14:30:00+00:00"
}

# Unhealthy response: 503 Service Unavailable

REST API Reference

Namespace: api-orchestrator/v1. All endpoints require WordPress admin authentication (nonce or application password).

Services

MethodEndpointDescription
GET/servicesList all services
POST/servicesCreate service
GET/services/{id}Get service details
PUT/services/{id}Update service
DELETE/services/{id}Delete service (cascades endpoints)

Endpoints

MethodEndpointDescription
GET/endpointsList all endpoints
POST/endpointsCreate endpoint
GET/endpoints/{id}Get endpoint details
PUT/endpoints/{id}Update endpoint
DELETE/endpoints/{id}Delete endpoint

Environments & Overrides

MethodEndpointDescription
GET/environmentsList environments
POST/environmentsCreate environment
PUT/environments/{id}Update environment
DELETE/environments/{id}Delete environment
GET/overridesList service overrides
POST/overridesSave service override

Execution & Logs

MethodEndpointDescription
POST/executeExecute configured endpoint
POST/builder/executeNo-code builder request (direct URL)
GET/logsList logs with filters
GET/logs/{id}Get log detail with decoded headers

Analytics

MethodEndpointDescription
GET/analytics/summarySummary stats (period: 1h-90d)
GET/analytics/volumeRequest volume over time
GET/analytics/servicesPer-service stats
GET/analytics/endpointsPer-endpoint stats
GET/analytics/status-codesHTTP status distribution

Alerts, Notifications, Export, Other

MethodEndpointDescription
GET/POST/alertsList / Create alert rules
PUT/DELETE/alerts/{id}Update / Delete rule
GET/alerts/historyAlert trigger history
GET/POST/notificationsList / Create channels
PUT/DELETE/notifications/{id}Update / Delete channel
POST/notifications/test/{id}Send test notification
GET/export/csvExport logs as CSV
GET/export/jsonExport logs as JSON
GET/export/reportExport analytics report
GET/PUT/settingsGet / Update plugin settings
GET/dashboardDashboard data (summary, recent, counts)
POST/samples/installInstall sample integration
GET/healthHealth check (token-authenticated)

Hooks & Filters

Filters

FilterDescription
api_orchestrator_pre_requestModify request before execution
api_orchestrator_executorGet executor instance

Actions

ActionWhen
api_orchestrator_post_requestAfter request completes
api_orchestrator_request_completedOn success
api_orchestrator_request_failedOn failure
api_orchestrator_request_loggedAfter log entry created
api_orchestrator_alert_triggeredWhen alert fires
api_orchestrator_notification_sentAfter notification sent
api_orchestrator_retry_successRetry succeeded
api_orchestrator_retry_attemptBefore retry
api_orchestrator_retry_exhaustedAll retries failed
api_orchestrator_queue_errorQueued request failed

Usage example

// Log failed requests to a custom system
add_action('api_orchestrator_request_failed', function($log_data) {
  error_log('API failed: ' . $log_data['url'] . ' - ' . $log_data['error_message']);
});

// Modify request before execution
add_filter('api_orchestrator_pre_request', function($args) {
  $args['headers']['X-Custom-Header'] = 'my-value';
  return $args;
});

Database Schema

8 custom tables with wp_api_orch_ prefix:

TablePurposeKey Columns
servicesAPI providersname, machine_name, base_url, auth_type, auth_config, timeout, max_retries
endpointsAPI operationsservice_id, path, method, protocol, body_template, execution_mode
environmentsDeploy environmentsname, machine_name, hostname, is_default
service_env_overridesPer-env service configservice_id, environment_id, base_url, auth_config, default_headers
logsRequest audit trailservice_id, endpoint_id, url, response_status, duration, success, error_message
alert_rulesAlert definitionsmetric, operator, threshold, time_window, cooldown, notification_channels
alert_historyAlert trigger logalert_rule_id, metric_value, message, notified_channels
notification_channelsChannel configsname, type (email/slack/discord/teams/whatsapp/pagerduty), config

Settings

OptionDefaultDescription
health_tokenBearer token for health check endpoint
log_retention_days30Auto-cleanup old logs (days)
max_response_log_kb100Truncate large response bodies (KB)
queue_batch_size10Items processed per cron run
alert_check_interval5Minutes between alert evaluations
Need help? Contact the developer via LinkedIn.