# POST /api/v1/advisory-firms/{firm_id}/cleanup-sessions/{session_id}/run

> Re-run matching for a session (iterative clearing)

- **Tag:** intercompany-cleanup
- **Operation ID:** `rerun_cleanup_session_api_v1_advisory_firms__firm_id__cleanup_sessions__session_id__run_post`

## Description

Confirmed pairs drop out of the pool, so each re-run surfaces the next layer of matches.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `firm_id` (path, string, required)
- `session_id` (path, string, required)

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_CleanupRunResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (CleanupRunResponse)

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 422 — Validation Error - Invalid data format

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/cleanup-sessions/{session_id}/run' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/cleanup-sessions/{session_id}/run', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
  },
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

response = httpx.post("https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/cleanup-sessions/{session_id}/run", headers=headers)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/intercompany-cleanup/rerun-cleanup-session
- OpenAPI slice: https://www.ondayzero.com/docs/reference/intercompany-cleanup/rerun-cleanup-session/openapi.json
- Other endpoints in **intercompany-cleanup**: https://www.ondayzero.com/docs/reference/intercompany-cleanup
