This endpoint allows you to apply the same updates to multiple campaigns at once, streamlining campaign management for scenarios where you need to modify several campaigns with identical changes.
Bulk updates are processed as a single transaction. If any campaign update fails, the entire operation is rolled back to maintain data consistency.
{ "campaignIds": [ 1000013 ], "updates": { "name": "Get the Turkey club combo $10.99", "description": "Hey! You can avail the opportunity this time and get benefits by choosing 'Get the Turkey club combo $10.99'", "end_date": "2025-03-25", "start_date": "2025-12-31", "status": "inactive" }}
{ "success": true, "message": "Bulk update completed successfully", "campaignIds": [ 1000013 ], "updates": { "name": "Get the Turkey club combo $10.99", "description": "Hey! You can avail the opportunity this time and get benefits by choosing 'Get the Turkey club combo $10.99'", "end_date": "2025-03-25", "start_date": "2025-12-31", "status": "inactive" }, "updated_count": 1, "failed_updates": [], "timestamp": "2024-01-15T16:45:00Z"}
Bulk Update Process
The bulk update process follows these steps:
Validation: All campaign IDs are validated for existence and permissions
Pre-Check: Updates are validated against business rules for each campaign
Transaction Start: Database transaction begins to ensure consistency
Sequential Updates: Each campaign is updated in sequence
Error Handling: Any failures trigger rollback of all changes
Confirmation: Successful completion commits all changes
Notification: Affected systems are notified of changes
Transaction Safety: Bulk updates use database transactions to ensure either all campaigns are updated successfully or none are modified, maintaining data consistency.
Performance Consideration: For large numbers of campaigns (>50), consider breaking the update into smaller batches to avoid timeout issues and improve processing speed.
{ "success": false, "message": "Validation failed for bulk update", "error_code": "VALIDATION_ERROR", "validation_errors": [ { "field": "end_date", "error": "End date must be after start date" } ]}
Transaction Rollback
Copy
{ "success": false, "message": "Bulk update failed and was rolled back", "error_code": "TRANSACTION_FAILED", "rollback_reason": "Database constraint violation", "affected_campaigns": 0}
Impact Assessment: Bulk updates affect multiple campaigns simultaneously. Ensure you understand the impact on active promotions, customer experience, and store operations before proceeding.