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

# Terminate All Calls to Numbers

> Terminates all active calls (across all campaigns) to specific mobile numbers.

## Terminate All Calls to Numbers

Stop ALL active calls to specific phone numbers across ALL campaigns. This is the most comprehensive way to ensure certain numbers are no longer contacted.

<Warning>
  **Global Impact**: This terminates calls to the specified numbers across ALL active campaigns, not just one campaign.
</Warning>

## When to Use This

* **Global Opt-Outs**: Customers who want to stop ALL calls from your organization
* **Legal Compliance**: Honor comprehensive do-not-call requests
* **Data Privacy**: Implement "right to be forgotten" requests
* **Emergency Stops**: Immediately halt all contact attempts to specific numbers
* **Account Closure**: Stop all calls when customers close accounts

## Scope of Termination

### ✅ What Gets Terminated:

* **All Campaigns**: Calls across every active campaign
* **All Call Types**: Both individual and campaign calls
* **Queued Calls**: All registered/retry status calls
* **Future Calls**: Prevents these numbers from being called again in current campaigns

### ❌ What Continues:

* **Other Numbers**: Calls to different numbers continue normally
* **Completed Calls**: Historical call data remains intact
* **Active Calls**: Currently connected calls finish naturally

## Perfect Use Cases

### Customer Service Integration

```json theme={null}
// When customer calls support requesting no more calls
{
  "mobile_numbers": ["+918882876897"]
}
```

### Bulk Opt-Out Processing

```json theme={null}
// Process multiple opt-out requests at once
{
  "mobile_numbers": [
    "+918882876897",
    "+918882876898", 
    "+918882876899"
  ]
}
```

### Account Deletion Workflow

When customers delete accounts, ensure no future contact across all campaigns.

## Important Considerations

### Number Format Requirements

* ✅ **Correct**: `+918882876897` (with country code)
* ✅ **Correct**: `+1234567890` (international format)
* ❌ **Wrong**: `8882876897` (missing country code)

### Limits & Constraints

* **Maximum**: 100 numbers per request
* **Rate Limits**: Standard API rate limits apply
* **Permanent**: Cannot undo this action for current campaigns

### Impact Analysis

Before using this endpoint, consider:

* **Business Impact**: How many campaigns will be affected?
* **Legal Requirements**: Is this necessary for compliance?
* **Alternative Actions**: Could campaign-specific termination work instead?

<Info>
  **Best Practice**: Use this endpoint for definitive opt-outs. For temporary or campaign-specific issues, consider using the campaign-numbers endpoint instead.
</Info>

## Integration Example

```javascript theme={null}
// Example: Customer support integration
async function globalOptOut(phoneNumber) {
  try {
    const response = await fetch('/campaign/terminate/numbers', {
      method: 'PATCH',
      headers: {
        'Content-Type': 'application/json',
        'X-API-KEY': 'your-api-key'
      },
      body: JSON.stringify({
        mobile_numbers: [phoneNumber]
      })
    });
    
    if (response.ok) {
      console.log('Customer successfully opted out of all campaigns');
    }
  } catch (error) {
    console.error('Opt-out failed:', error);
  }
}
```


## OpenAPI

````yaml patch /campaign/terminate/numbers
openapi: 3.0.0
info:
  title: Revenueable AI API Documentation
  description: >-
    This is the documentation for the Revenueable AI APIs. The Revenueable AI
    API follows RESTful principles, making it intuitive and easy to integrate
    with your applications. All API requests should be made to the base URL. The
    API accepts and returns data in JSON format. Ensure your requests include
    the appropriate Content-Type header for POST and PATCH requests.
  version: 2.0.0
servers:
  - url: https://prod-api.revenueable.ai/ca/api/v0
security: []
tags:
  - name: workspace
    description: Endpoints for managing your workspace.
  - name: agent
    description: Endpoints for managing assistants (agents).
  - name: calling
    description: Endpoints for making and managing calls.
  - name: campaign
    description: Endpoints for managing campaigns.
  - name: analytics
    description: Endpoints for accessing call analytics and performance metrics.
  - name: termination
    description: Endpoints for terminating active calls using different methods.
  - name: knowledgebase
    description: Endpoints for managing knowledge bases.
paths:
  /campaign/terminate/numbers:
    patch:
      tags:
        - termination
      summary: Terminate All Calls to Numbers
      description: >-
        Terminates all active calls (across all campaigns) to specific mobile
        numbers.
      operationId: terminateCallsByNumbers
      parameters:
        - name: X-API-KEY
          in: header
          description: (Required) Your Revenueable AI API key.
          required: true
          schema:
            type: string
            example: 7251cb4b-3373-43a4-844c-b27a1d45e0c9
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - mobile_numbers
              properties:
                mobile_numbers:
                  type: array
                  items:
                    type: string
                  description: >-
                    (Required) Array of mobile numbers to terminate calls for
                    across all campaigns (max 100)
                  example:
                    - '+918882876897'
                    - '+918882876898'
      responses:
        '200':
          description: Calls terminated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Calls terminated successfully!
        '400':
          description: Bad Request - Invalid mobile numbers or no terminable calls found.
        '401':
          description: Unauthorized - Invalid or missing API key.

````