Let me provide a comprehensive solution for CAPA webhook payload validation:
JSON Schema Validation: Don’t rely on the official schema documentation as gospel. Build a flexible schema that treats most fields as optional:
{"type": "object",
"required": ["capaId", "status", "timestamp"],
"properties": {"assignedTo": {"type": "string"},
"dueDate": {"type": "string", "format": "date"}}}
Webhook Payload Structure: Arena sends different payload structures based on the triggering event. State transitions send minimal payloads, while field updates send full object representations. Configure your webhook in Arena QMS with ‘Event Type: All CAPA Changes’ to get consistent full payloads.
Required vs Optional Fields: Implement a two-tier validation approach. First, validate against a permissive schema that only requires capaId, status, and timestamp. Second, apply business logic validation based on status:
- If status = ‘assigned’, then validate assignedTo is present
- If status = ‘action-planning’, then validate both assignedTo and dueDate
- If status = ‘investigation’, only capaId and investigationNotes are mandatory
Schema Documentation: The AQP 2022.2 webhook documentation has known gaps. Reference the API response schemas from GET endpoints instead - they’re more accurate. The /api/v2/capa/{id} endpoint response shows the complete object model, which better represents what webhooks can send.
Practical Implementation: Add webhook payload logging to capture actual structures across all workflow states. Build your validation schema from observed reality rather than documentation. Also, implement a fallback mechanism - if validation fails, log the payload and queue it for manual review rather than rejecting it outright.
Configuration Fix: In Arena QMS webhook settings, set ‘Payload Mode: Complete Object’ rather than ‘Changed Fields Only’. This ensures you always get a full representation. Navigate to Admin > Integrations > Webhooks > CAPA Configuration > Payload Settings.
The 40% failure rate suggests you’re hitting multiple workflow states with different field populations. Implement the conditional validation approach and you should see failures drop to near zero.