# POST /api/v1/ap-approval/batch-approve

> Batch approve pending items

- **Tag:** ap-approval
- **Operation ID:** `batch_approve_api_v1_ap_approval_batch_approve_post`

## Description

Approve multiple suspended workflow executions in a single request.

## Authentication

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

## Request body

Schema: `BatchApproveRequest`

- `execution_ids` (array · string · required) — List of workflow execution UUIDs to approve.
- `comment` (string) — Optional comment applied to all approvals in the batch.

## Responses

### 201 — Successful Response

Schema: `BatchApproveResponse`

- `total` (integer · required) — Total executions submitted.
- `succeeded` (integer · required) — Number of successful approvals.
- `failed` (integer · required) — Number of failed approvals.
- `results` (array · BatchApproveResultItem) → `BatchApproveResultItem` — Per-execution results.
  - `execution_id` (string · required) — Execution UUID.
  - `success` (boolean · required) — Whether this approval succeeded.
  - `error` (string) — Error message if the approval failed.

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

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

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/ap-approval/batch-approve' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "execution_ids": []
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/ap-approval/batch-approve', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "execution_ids": []
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "execution_ids": []
}

response = httpx.post("https://api.ondayzero.com/api/v1/ap-approval/batch-approve", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/ap-approval/batch-approve
- OpenAPI slice: https://www.ondayzero.com/docs/reference/ap-approval/batch-approve/openapi.json
- Other endpoints in **ap-approval**: https://www.ondayzero.com/docs/reference/ap-approval
