> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reach.raysium.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Campaign Operations

> Guide to performing bulk operations on multiple campaigns with permissions and limitations

## Bulk Operations Overview

Bulk operations allow you to perform actions on multiple campaigns simultaneously, saving time when managing many campaigns. All operations respect organization context and role-based permissions.

## Selecting Campaigns

### Individual Selection

Select campaigns individually by clicking the checkbox next to each campaign in the list.

**Selection Behavior:**

* Checkbox toggles selection state
* Selected campaigns highlighted
* Selection persists during filtering/searching
* Cleared after bulk operation completes

### Select All

Use the checkbox in the table header to select all visible campaigns.

**Scope:**

* Selects all campaigns currently displayed
* Respects current filters and search
* Does not select campaigns on other pages (pagination)
* Does not select campaigns not visible (filtered out)

**Limitations:**

* Only selects campaigns you can see (based on permissions)
* In organization mode: Only selects campaigns you have access to
* In personal mode: Only selects your own campaigns

### Deselecting

**Methods:**

* Click individual checkboxes to deselect
* Click header checkbox again to deselect all
* Use "Clear Selection" button in bulk actions bar
* Selection cleared automatically after bulk operation

## Bulk Actions Bar

When campaigns are selected, a bulk actions bar appears showing:

**Information:**

* Number of selected campaigns
* Available bulk actions (based on selection)
* Clear selection button

**Actions Available:**

* Enable (if any disabled)
* Disable (if any enabled)
* Launch (if any draft/paused)
* Stop (if any active)
* Delete (if permitted)

**Permissions:**

* Actions only shown if you have permissions
* Some actions may be disabled based on campaign status
* Error messages shown for unauthorized operations

## Available Bulk Operations

### Enable Campaigns

Enable multiple disabled campaigns at once.

**Requirements:**

* Selected campaigns must be disabled (`enabled = false`)
* You must have edit permissions for all selected campaigns
* Campaigns can be in any status

**Process:**

1. Select disabled campaigns
2. Click "Enable" in bulk actions bar
3. Each campaign's `enabled` flag set to `true`
4. Campaigns can now be launched (if status allows)

**Permissions:**

* Owner: Can enable own campaigns
* Admin: Can enable own campaigns
* Member: Can enable own campaigns
* Owner/Admin: Can enable other members' campaigns (if can edit)
* Member: Cannot enable other members' campaigns

**Results:**

* Success count: Number of campaigns successfully enabled
* Error count: Number of campaigns that failed
* Error details: Specific errors for failed campaigns

### Disable Campaigns

Disable multiple campaigns to prevent launching and stop active executions.

**Requirements:**

* Selected campaigns can be in any status
* You must have edit permissions for all selected campaigns

**Process:**

1. Select campaigns to disable
2. Click "Disable" in bulk actions bar
3. Each campaign's `enabled` flag set to `false`
4. All active executions cancelled immediately
5. Campaigns cannot be launched until re-enabled

**Permissions:**

* Owner: Can disable own campaigns
* Admin: Can disable own campaigns
* Member: Can disable own campaigns
* Owner/Admin: Can disable other members' campaigns (if can edit)
* Member: Cannot disable other members' campaigns

**Impact:**

* Active executions cancelled immediately
* Campaigns cannot be launched
* Different from pause (cannot launch when disabled)

**Results:**

* Success count: Number of campaigns successfully disabled
* Cancelled executions: Total executions cancelled across all campaigns
* Error count: Number of campaigns that failed

### Launch Campaigns

Start multiple campaigns simultaneously.

**Requirements:**

* Selected campaigns must be in `draft` or `paused` status
* Campaigns must be enabled (`enabled = true`)
* Telegram accounts must be connected and healthy
* At least one contact selected per campaign
* You must have launch permissions for all selected campaigns

**Process:**

1. Select campaigns in `draft` or `paused` status
2. Click "Launch" in bulk actions bar
3. Each campaign's status changes to `active` (or `scheduled` if scheduled)
4. Paused executions resume
5. Completed executions reset (if applicable)
6. Workers pick up executions on next cycle

**Permissions:**

* Owner: Can launch own campaigns
* Admin: Can launch own campaigns
* Member: Can launch own campaigns
* Cannot launch other members' campaigns (even with view access)

**Status Handling:**

* `draft` → `active` (or `scheduled`)
* `paused` → `active`
* Other statuses skipped with error message

**Results:**

* Success count: Number of campaigns successfully launched
* Skipped count: Number of campaigns skipped (wrong status)
* Error count: Number of campaigns that failed

### Stop Campaigns

Stop multiple active campaigns immediately.

**Requirements:**

* Selected campaigns must be `active` or `paused`
* You must have stop permissions for all selected campaigns

**Process:**

1. Select active or paused campaigns
2. Click "Stop" in bulk actions bar
3. Confirm the stop action
4. Each campaign's status changes to `cancelled`
5. All active executions cancelled immediately
6. Progress lost (cannot resume)

**Permissions:**

* Owner: Can stop own campaigns
* Admin: Can stop own campaigns
* Member: Can stop own campaigns
* Owner/Admin: Can stop other members' campaigns (if can edit)
* Member: Cannot stop other members' campaigns

**Impact:**

* All active executions cancelled
* Progress lost (cannot resume)
* Must duplicate to restart

**Results:**

* Success count: Number of campaigns successfully stopped
* Cancelled executions: Total executions cancelled across all campaigns
* Error count: Number of campaigns that failed

### Delete Campaigns

Permanently remove multiple campaigns (soft delete).

**Requirements:**

* Selected campaigns can be in any status (except `active` - must stop first)
* You must have delete permissions for all selected campaigns

**Process:**

1. Select campaigns to delete
2. Click "Delete" in bulk actions bar
3. Confirm the deletion
4. Each campaign's `deleted_at` timestamp set
5. Campaigns hidden from list (soft delete)
6. Statistics and logs preserved

**Permissions:**

* Owner: Can delete own campaigns
* Admin: Can delete own campaigns
* Member: Can delete own campaigns
* Owner/Admin: Can delete other members' campaigns
* Member: Cannot delete other members' campaigns

**Status Restrictions:**

* `active` campaigns must be stopped first
* Other statuses can be deleted directly

**Results:**

* Success count: Number of campaigns successfully deleted
* Skipped count: Number of campaigns skipped (active status)
* Error count: Number of campaigns that failed

## Bulk Operation Results

After performing a bulk operation, you'll see:

**Success Message:**

* Number of campaigns successfully processed
* Summary of operation results
* Updated status for affected campaigns

**Error Message:**

* Number of campaigns that couldn't be processed
* Specific errors for each failed campaign
* Reasons for failures (permissions, status, etc.)

**Updated Status:**

* Campaigns reflect their new status
* Selection automatically cleared
* List refreshed to show changes

**Partial Success:**

* If some campaigns fail, operation continues for remaining campaigns
* Check error messages for details
* Retry failed campaigns individually if needed

## Limitations

### Operation Limits

**Batch Processing:**

* Bulk operations process campaigns in batches
* Large selections may take time to process
* Progress indicator shown for long operations

**Rate Limits:**

* Some operations may have rate limits
* Large bulk operations may be throttled
* Wait between operations if rate limited

**Timeout:**

* Operations timeout after 60 seconds
* Large selections may need to be split
* Use smaller batches if timeout occurs

### Status Restrictions

**Enable/Disable:**

* Works on any status
* No status restrictions

**Launch:**

* Only `draft` and `paused` campaigns
* Other statuses skipped with error

**Stop:**

* Only `active` and `paused` campaigns
* Other statuses skipped with error

**Delete:**

* Any status except `active` (must stop first)
* `active` campaigns skipped with error

### Permission Restrictions

**Own Campaigns:**

* All roles can perform bulk operations on own campaigns
* Subject to status restrictions

**Other Members' Campaigns:**

* Owner: Can perform bulk operations (subject to status)
* Admin: Can perform bulk operations (subject to status)
* Member: Cannot perform bulk operations on other members' campaigns

**Mixed Selection:**

* If selection includes campaigns you cannot edit:
  * Operation fails for unauthorized campaigns
  * Authorized campaigns processed successfully
  * Error message shows which campaigns failed

### Organization Context

**Personal Mode:**

* Only your own campaigns visible
* No organization campaigns in selection
* Complete isolation

**Organization Mode:**

* Selection respects view mode (`own` vs `all`)
* `own` mode: Only your campaigns selectable
* `all` mode: All organization campaigns selectable (Owner/Admin only)
* Members cannot select other members' campaigns

## Best Practices

### Before Bulk Operations

1. **Review Selection**: Double-check which campaigns are selected
2. **Verify Status**: Ensure campaigns are in correct status for operation
3. **Check Permissions**: Verify you have permissions for all selected campaigns
4. **Backup Important**: Consider duplicating important campaigns before bulk delete
5. **Test First**: Try bulk operations on small group first

### During Bulk Operations

1. **Wait for Completion**: Don't navigate away during bulk operations
2. **Monitor Progress**: Watch for success/error messages
3. **Check Results**: Verify campaigns were processed correctly
4. **Handle Errors**: Review error messages and retry if needed

### After Bulk Operations

1. **Review Changes**: Check that campaigns have expected status
2. **Verify Results**: Confirm operation achieved your goals
3. **Document**: Note what was changed and why
4. **Monitor**: Watch for any unexpected behavior

## Troubleshooting

### Bulk Operation Fails

**Check:**

1. Selected campaigns are in correct status
2. You have permissions for all selected campaigns
3. Campaigns are not locked by another process
4. Requirements met (contacts, accounts, etc.)

**Solutions:**

* Verify permissions and status
* Try smaller batches
* Check error messages for details
* Retry failed campaigns individually

### Some Campaigns Not Processed

**Check:**

1. Their status (may not be eligible)
2. Your permissions (may not have access)
3. Requirements (contacts, accounts, etc.)

**Solutions:**

* Review error messages
* Check campaign status individually
* Verify permissions
* Try processing them individually

### Selection Cleared Unexpectedly

**Behavior:**

* Selection cleared automatically after bulk operation
* This is normal behavior
* Re-select campaigns if needed

**Solutions:**

* Re-select campaigns for next operation
* Use filters to narrow down campaigns
* Check if page was refreshed

### Timeout Errors

**Symptoms:**

* Operation times out after 60 seconds
* Large selections fail

**Solutions:**

* Split selection into smaller batches
* Process campaigns in groups
* Use individual operations for large sets

## Use Cases

### Campaign Cleanup

Use bulk delete to clean up:

* Old test campaigns
* Completed campaigns no longer needed
* Duplicate campaigns
* Failed campaigns

**Process:**

1. Filter campaigns to clean up
2. Select all visible campaigns
3. Bulk delete
4. Confirm deletion

### Campaign Launch

Use bulk launch to:

* Start multiple campaigns at once
* Launch scheduled campaigns together
* Resume multiple paused campaigns

**Process:**

1. Filter campaigns to launch
2. Select campaigns in `draft` or `paused` status
3. Bulk launch
4. Monitor progress

### Campaign Management

Use bulk enable/disable to:

* Temporarily disable multiple campaigns
* Enable campaigns after maintenance
* Manage campaign availability

**Process:**

1. Select campaigns to manage
2. Bulk enable or disable
3. Verify status changes

### Emergency Stop

Use bulk stop to:

* Stop multiple problematic campaigns
* Emergency halt of all active campaigns
* Cancel executions across campaigns

**Process:**

1. Filter active campaigns
2. Select all active campaigns
3. Bulk stop
4. Confirm stop action
