> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cloudraker.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cloudraker.com/_mcp/server.

# Decide a batch of playbook run approvals

POST https://api.cloudraker.com/spaces/{spaceId}/playbook-runs/{runId}/approvals:decide-batch
Content-Type: application/json

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.

Reference: https://docs.cloudraker.com/api/cloud-raker-api/workspace/playbooks/decide-playbook-run-approvals-batch

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: CloudRaker API
  version: 1.0.0
paths:
  /spaces/{spaceId}/playbook-runs/{runId}/approvals:decide-batch:
    post:
      operationId: decide-playbook-run-approvals-batch
      summary: Decide a batch of playbook run approvals
      description: >-
        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.
      tags:
        - playbooks
      parameters:
        - name: spaceId
          in: path
          required: true
          schema:
            type: string
        - name: runId
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Per-decision outcomes, in request order.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaybookApprovalBatchOutcomeList'
        '413':
          description: Request body exceeded 1 MiB (payload_too_large)
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        description: >-
          Up to 20 decisions, applied in order; each item is validated
          independently and failures are reported per item without rolling back
          the others. Capped at 1 MiB.
        content:
          application/json:
            schema:
              type: object
              properties:
                decisions:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/SpacesSpaceIdPlaybookRunsRunIdApprovalsDecideBatchPostRequestBodyContentApplicationJsonSchemaDecisionsItems
              required:
                - decisions
servers:
  - url: https://api.cloudraker.com
    description: Production
  - url: https://api.staging.raker.one
    description: Staging
  - url: https://api.dev.raker.one
    description: Development
components:
  schemas:
    SpacesSpaceIdPlaybookRunsRunIdApprovalsDecideBatchPostRequestBodyContentApplicationJsonSchemaDecisionsItemsDecision:
      type: string
      enum:
        - approve
        - reject
      title: >-
        SpacesSpaceIdPlaybookRunsRunIdApprovalsDecideBatchPostRequestBodyContentApplicationJsonSchemaDecisionsItemsDecision
    SpacesSpaceIdPlaybookRunsRunIdApprovalsDecideBatchPostRequestBodyContentApplicationJsonSchemaDecisionsItems:
      type: object
      properties:
        decision:
          $ref: >-
            #/components/schemas/SpacesSpaceIdPlaybookRunsRunIdApprovalsDecideBatchPostRequestBodyContentApplicationJsonSchemaDecisionsItemsDecision
        note:
          type: string
          description: Required when rejecting.
        editedParams:
          type: object
          additionalProperties:
            description: Any type
          description: Override the action parameters.
        editedFileIds:
          type: array
          items:
            type: string
        editedOutput:
          description: Override the reviewed output.
        approvalId:
          type: string
      required:
        - decision
        - approvalId
      title: >-
        SpacesSpaceIdPlaybookRunsRunIdApprovalsDecideBatchPostRequestBodyContentApplicationJsonSchemaDecisionsItems
    PlaybookApprovalBatchOutcomeListDataItemsStatus:
      type: string
      enum:
        - decided
        - error
      title: PlaybookApprovalBatchOutcomeListDataItemsStatus
    PlaybookApprovalKind:
      type: string
      enum:
        - pre
        - post
      description: '`pre` gates the dispatch; `post` reviews the output.'
      title: PlaybookApprovalKind
    PlaybookApprovalFilesItems:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
      title: PlaybookApprovalFilesItems
    PlaybookApprovalArtifactsItemsOpen:
      type: string
      enum:
        - tab
        - embed
      title: PlaybookApprovalArtifactsItemsOpen
    PlaybookApprovalArtifactsItems:
      type: object
      properties:
        id:
          type: string
        kind:
          type: string
          enum:
            - link
        title:
          type: string
        url:
          type: string
        open:
          $ref: '#/components/schemas/PlaybookApprovalArtifactsItemsOpen'
      required:
        - id
        - kind
        - title
        - url
        - open
      title: PlaybookApprovalArtifactsItems
    PlaybookApprovalStatus:
      type: string
      enum:
        - pending
        - approved
        - rejected
        - void
      title: PlaybookApprovalStatus
    PlaybookApproval:
      type: object
      properties:
        id:
          type: string
        kind:
          $ref: '#/components/schemas/PlaybookApprovalKind'
          description: '`pre` gates the dispatch; `post` reviews the output.'
        actionSlug:
          type: string
        installedActionId:
          type: string
        actionName:
          type: string
        actionRunId:
          type:
            - string
            - 'null'
        rationale:
          type:
            - string
            - 'null'
        files:
          type: array
          items:
            $ref: '#/components/schemas/PlaybookApprovalFilesItems'
        params:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/PlaybookApprovalArtifactsItems'
        status:
          $ref: '#/components/schemas/PlaybookApprovalStatus'
        requestedAt:
          type: string
          format: date-time
        decidedBy:
          type:
            - string
            - 'null'
        decidedAt:
          type:
            - string
            - 'null'
          format: date-time
        note:
          type:
            - string
            - 'null'
        editedParams:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
        editedFileIds:
          type:
            - array
            - 'null'
          items:
            type: string
      required:
        - id
        - kind
        - actionSlug
        - installedActionId
        - actionName
        - actionRunId
        - rationale
        - files
        - params
        - artifacts
        - status
        - requestedAt
        - decidedBy
        - decidedAt
        - note
        - editedParams
        - editedFileIds
      title: PlaybookApproval
    PlaybookApprovalBatchOutcomeListDataItems:
      type: object
      properties:
        approvalId:
          type: string
        status:
          $ref: '#/components/schemas/PlaybookApprovalBatchOutcomeListDataItemsStatus'
        approval:
          oneOf:
            - $ref: '#/components/schemas/PlaybookApproval'
            - type: 'null'
        error:
          type:
            - string
            - 'null'
      required:
        - approvalId
        - status
        - approval
        - error
      title: PlaybookApprovalBatchOutcomeListDataItems
    PlaybookApprovalBatchOutcomeList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PlaybookApprovalBatchOutcomeListDataItems'
      required:
        - data
      title: PlaybookApprovalBatchOutcomeList
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "decisions": [
    {
      "decision": "approve",
      "approvalId": "apprv-1234abcd5678efgh"
    }
  ]
}
```

**Response**

```json
{
  "data": [
    {
      "approvalId": "apprv-1234abcd5678efgh",
      "status": "decided",
      "approval": {
        "id": "apprv-1234abcd5678efgh",
        "kind": "pre",
        "actionSlug": "deploy-service",
        "installedActionId": "act-9876zyxw4321vuts",
        "actionName": "Deploy Service",
        "actionRunId": "run-20240115-093000",
        "rationale": "Automated deployment approval after successful tests",
        "files": [
          {
            "id": "file-0011223344",
            "name": "deployment-config.yaml"
          }
        ],
        "params": {},
        "artifacts": [
          {
            "id": "art-5566778899",
            "kind": "link",
            "title": "Deployment Logs",
            "url": "https://logs.cloudraker.com/deployments/20240115-093000",
            "open": "tab"
          }
        ],
        "status": "approved",
        "requestedAt": "2024-01-15T09:30:00Z",
        "decidedBy": "user-jdoe",
        "decidedAt": "2024-01-15T09:45:00Z",
        "note": "Approved after verifying all checks passed.",
        "editedParams": {},
        "editedFileIds": [
          "file-0011223344"
        ]
      },
      "error": ""
    }
  ]
}
```

**SDK Code**

```typescript
import { CloudRakerClient } from "@cloudraker/api";

async function main() {
    const client = new CloudRakerClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.playbooks.decidePlaybookRunApprovalsBatch("spaceId", "runId", {
        decisions: [
            {
                decision: "approve",
                approvalId: "apprv-1234abcd5678efgh",
            },
        ],
    });
}
main();

```

```python
from cloudraker import CloudRaker
from cloudraker.playbooks import DecidePlaybookRunApprovalsBatchRequestDecisionsItem

client = CloudRaker(
    token="YOUR_TOKEN_HERE",
)

client.playbooks.decide_playbook_run_approvals_batch(
    space_id="spaceId",
    run_id="runId",
    decisions=[
        DecidePlaybookRunApprovalsBatchRequestDecisionsItem(
            decision="approve",
            approval_id="apprv-1234abcd5678efgh",
        )
    ],
)

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"decisions\": [\n    {\n      \"decision\": \"approve\",\n      \"approvalId\": \"apprv-1234abcd5678efgh\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.cloudraker.com/spaces/spaceId/playbook-runs/runId/approvals:decide-batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"decisions\": [\n    {\n      \"decision\": \"approve\",\n      \"approvalId\": \"apprv-1234abcd5678efgh\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.cloudraker.com/spaces/spaceId/playbook-runs/runId/approvals:decide-batch")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"decisions\": [\n    {\n      \"decision\": \"approve\",\n      \"approvalId\": \"apprv-1234abcd5678efgh\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cloudraker.com/spaces/spaceId/playbook-runs/runId/approvals:decide-batch', [
  'body' => '{
  "decisions": [
    {
      "decision": "approve",
      "approvalId": "apprv-1234abcd5678efgh"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/spaces/spaceId/playbook-runs/runId/approvals:decide-batch");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"decisions\": [\n    {\n      \"decision\": \"approve\",\n      \"approvalId\": \"apprv-1234abcd5678efgh\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["decisions": [
    [
      "decision": "approve",
      "approvalId": "apprv-1234abcd5678efgh"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cloudraker.com/spaces/spaceId/playbook-runs/runId/approvals:decide-batch")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```