---
title: "Decide a batch of playbook run approvals"
---

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

# Decide a batch of playbook run approvals

Path: CloudRaker Workspace API › Playbooks

`POST /spaces/{spaceId}/playbook-runs/{runId}/approvals:decide-batch`

Applies up to 20 approval decisions in order. Each decision is validated independently (same fields as the single-decision endpoint, plus `approvalId`) and failures are reported per item without rolling back the others; the agent loop is resumed once at the end. Authorization: `space:contribute` (org admins bypass); missing → 403. The body is capped at 1 MiB → 413 `payload_too_large`. Returns 200 `{ data: Outcome[] }` in request order.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`decidePlaybookRunApprovalsBatch.path.spaceId`; string, required)
- `runId` (`decidePlaybookRunApprovalsBatch.path.runId`; string, required)

## Request body

_Required._

- `decisions` (`decidePlaybookRunApprovalsBatch.decisions`; array<object>, required)
  - `decision` (`decidePlaybookRunApprovalsBatch.decisions.decision`; string, required)
    - one of `"approve"`, `"reject"`
  - `approvalId` (`decidePlaybookRunApprovalsBatch.decisions.approvalId`; string, required)
    - minLength 1
  - `note` (`decidePlaybookRunApprovalsBatch.decisions.note`; string, optional) — Required when rejecting.
    - maxLength 4000
  - `editedParams` (`decidePlaybookRunApprovalsBatch.decisions.editedParams`; map<unknown>, optional) — Override the action parameters.
  - `editedFileIds` (`decidePlaybookRunApprovalsBatch.decisions.editedFileIds`; array<string>, optional)
    - minLength 1
  - `editedOutput` (`decidePlaybookRunApprovalsBatch.decisions.editedOutput`; unknown, optional) — Override the reviewed output.

## Example request

```json
{
  "decisions": [
    {
      "decision": "approve",
      "note": "string",
      "editedParams": {
        "property1": null,
        "property2": null
      },
      "editedFileIds": [
        "string"
      ],
      "editedOutput": null,
      "approvalId": "string"
    }
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/playbook-runs/<runId>/approvals:decide-batch' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "decisions": [
    {
      "decision": "approve",
      "note": "string",
      "editedParams": {
        "property1": null,
        "property2": null
      },
      "editedFileIds": [
        "string"
      ],
      "editedOutput": null,
      "approvalId": "string"
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/playbook-runs/<runId>/approvals:decide-batch';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    decisions: [
      {
        decision: 'approve',
        note: 'string',
        editedParams: {property1: null, property2: null},
        editedFileIds: ['string'],
        editedOutput: null,
        approvalId: 'string'
      }
    ]
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/spaces/<spaceId>/playbook-runs/<runId>/approvals:decide-batch"

payload = { "decisions": [
        {
            "decision": "approve",
            "note": "string",
            "editedParams": {
                "property1": None,
                "property2": None
            },
            "editedFileIds": ["string"],
            "editedOutput": None,
            "approvalId": "string"
        }
    ] }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Per-decision outcomes, in request order.

#### Example

```json
{
  "data": [
    {
      "approvalId": "string",
      "status": "decided",
      "approval": {
        "id": "string",
        "kind": "pre",
        "actionSlug": "string",
        "installedActionId": "string",
        "actionName": "string",
        "actionRunId": "string",
        "rationale": "string",
        "files": [
          {
            "id": "string",
            "name": "string"
          }
        ],
        "params": {
          "property1": null,
          "property2": null
        },
        "output": {},
        "artifacts": [
          {
            "id": "string",
            "kind": "link",
            "title": "string",
            "url": "string",
            "open": "tab"
          }
        ],
        "status": "pending",
        "requestedAt": "2019-08-24T14:15:22Z",
        "decidedBy": "string",
        "decidedAt": "2019-08-24T14:15:22Z",
        "note": "string",
        "editedParams": {
          "property1": null,
          "property2": null
        },
        "editedFileIds": [
          "string"
        ],
        "editedOutput": {}
      },
      "error": "string"
    }
  ]
}
```

- `data` (`decidePlaybookRunApprovalsBatch.response.200.data`; array<object>, required)
  - `approvalId` (`decidePlaybookRunApprovalsBatch.response.200.data.approvalId`; string, required)
  - `status` (`decidePlaybookRunApprovalsBatch.response.200.data.status`; string, required)
    - one of `"decided"`, `"error"`
  - `approval` (`decidePlaybookRunApprovalsBatch.response.200.data.approval`; any of, required)
    - any of: `PlaybookApproval`, `null`
  - `error` (`decidePlaybookRunApprovalsBatch.response.200.data.error`; string | null, required)

### 413

Request body exceeded 1 MiB (payload_too_large)


Source: https://docs.cloudraker.com/workspace/api/playbooks/decide-playbook-run-approvals-batch/index.md
