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

# Pause Workflow

> Pause a workflow for an entire campaign or customers matching optional filters.

### Headers

**Authorization** `string` *required*

Bearer token for authentication (e.g., `Bearer <your_token>`).

**X-ORG-ID** `string`

Optional. Use this header only when the authenticated user belongs to multiple organizations. It identifies the organization to target for this action.

### Body Parameters

**campaignId** `string` *required*

The unique identifier of the campaign. When supplied without `filters`, the workflow is paused for the entire campaign.

**filters** `object`

Optional filters that limit the action to matching customers. When present, the action does not apply to the whole campaign.

**properties**

**ids** `string[]`

Customer IDs (`loan_id` or `lead_id`) to target. Maximum 50 IDs.

**exclude\_ids** `string[]`

Customer IDs (`loan_id` or `lead_id`) to exclude.

**payment\_status** `string[]`

Payment statuses to match.

**language** `string[]`

Customer language preferences to match.

**custom** `object`

Custom field exact-match filters as key-value pairs. Values can be a single string or an array of strings.

```json Example theme={null}
      {
        "branch": "mumbai",
        "product_type": ["personal_loan", "home_loan"]
      }
```

> [!NOTE]
>
> Customer-level workflow actions (requests with `filters`) can only be performed while the campaign workflow is running.

### Response

**success** `boolean`

Indicates whether the action was successful.

**message** `string`

A description of the action applied or the reason it could not be applied.

**data** `object`

Details of the action and its scope.

**properties**

**campaignId** `string`

The campaign ID used for the request.

**action** `string`

The action performed: `pause`.

**scope** `string`

Whether the action applied to `campaign` or `customers`.

**previousStatus** `string`

The prior campaign status. Present for whole-campaign actions.

**matched** `integer`

Number of customers matched. Present for customer actions.

**currentStatus** `string`

The current workflow status when the action cannot be applied.

**results** `object`

Processing results for customer actions.

**properties**

**matched** `integer`

Number of customers matching the filters.

**updated** `integer`

Number of customers updated.

**failed** `integer`

Number of customers that could not be updated.

**errors** `array`

Details of failed customer updates.

```json 200 OK - Whole Campaign theme={null}
{
  "success": true,
  "message": "Workflow pause applied to the whole campaign",
  "data": {
    "campaignId": "lSKmrINyfZEywkpPCaGv",
    "action": "pause",
    "scope": "campaign",
    "previousStatus": "resumed"
  }
}
```

```json 200 OK - Matching Customers theme={null}
{
  "success": true,
  "message": "Workflow pause applied to 1 of 1 customers",
  "data": {
    "campaignId": "lSKmrINyfZEywkpPCaGv",
    "action": "pause",
    "scope": "customers",
    "matched": 1
  },
  "results": {
    "matched": 1,
    "updated": 1,
    "failed": 0,
    "errors": []
  }
}
```

```json 409 Conflict theme={null}
{
  "success": false,
  "message": "Customer workflows can only be modified while the campaign workflow running.",
  "data": {
    "campaignId": "lSKmrINyfZEywkpPCaGv",
    "action": "pause",
    "currentStatus": "paused"
  }
}
```

```json 400 Bad Request theme={null}
{
  "success": false,
  "message": "Validation failed",
  "errors": [
    "campaignId is required and must be a string"
  ]
}
```

```json 401 Unauthorized theme={null}
{
  "success": false,
  "error": "Unauthorized",
  "message": "Missing or invalid authorization header"
}
```

```json 403 Forbidden theme={null}
{
  "success": false,
  "error": "Forbidden",
  "message": "You don't have the required permission to perform this action"
}
```

```json 404 Not Found theme={null}
{
  "success": false,
  "message": "Campaign not found"
}
```

```json 500 Server Error theme={null}
{
  "success": false,
  "error": "InternalServerError",
  "message": "An unexpected error occurred"
}
```

## Error Codes

| Status | Description |
| - | - |
| `400` | Validation error - `campaignId` is required |
| `401` | Unauthorized - missing or invalid authorization header |
| `403` | Forbidden - insufficient permission to modify the workflow |
| `404` | Campaign not found |
| `409` | Customer workflows can only be modified while the campaign workflow is running |
| `500` | Internal server error |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.