> 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 playbook run approval

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

Approves or rejects a pending approval on the run — either a pre-action gate (allow the action to run) or a post-action output review. Authorization: `space:contribute` (org admins bypass); missing → 403. Body: `decision` ("approve" | "reject", required); optional `note` (≤4000 chars); and, when approving, you may edit before proceeding — `editedParams` (override the action params), `editedFileIds` (1–200, override the input files), `editedOutput` (override the reviewed output). The request body is capped at 1 MiB → 413 `payload_too_large` if exceeded. Returns 200 `{ data: Approval }` with the updated approval.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: CloudRaker API
  version: 1.0.0
paths:
  /spaces/{spaceId}/playbook-runs/{runId}/approvals/{approvalId}:
    post:
      operationId: decide-playbook-run-approval
      summary: Decide a playbook run approval
      description: >-
        Approves or rejects a pending approval on the run — either a pre-action
        gate (allow the action to run) or a post-action output review.
        Authorization: `space:contribute` (org admins bypass); missing → 403.
        Body: `decision` ("approve" | "reject", required); optional `note`
        (≤4000 chars); and, when approving, you may edit before proceeding —
        `editedParams` (override the action params), `editedFileIds` (1–200,
        override the input files), `editedOutput` (override the reviewed
        output). The request body is capped at 1 MiB → 413 `payload_too_large`
        if exceeded. Returns 200 `{ data: Approval }` with the updated approval.
      tags:
        - playbooks
      parameters:
        - name: spaceId
          in: path
          required: true
          schema:
            type: string
        - name: runId
          in: path
          required: true
          schema:
            type: string
        - name: approvalId
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The updated approval.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaybookApprovalEnvelope'
        '413':
          description: Request body exceeded 1 MiB (payload_too_large)
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        description: The whole body is capped at 1 MiB (413 `payload_too_large` beyond it).
        content:
          application/json:
            schema:
              type: object
              properties:
                decision:
                  $ref: >-
                    #/components/schemas/SpacesSpaceIdPlaybookRunsRunIdApprovalsApprovalIdPostRequestBodyContentApplicationJsonSchemaDecision
                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.
              required:
                - decision
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:
    SpacesSpaceIdPlaybookRunsRunIdApprovalsApprovalIdPostRequestBodyContentApplicationJsonSchemaDecision:
      type: string
      enum:
        - approve
        - reject
      title: >-
        SpacesSpaceIdPlaybookRunsRunIdApprovalsApprovalIdPostRequestBodyContentApplicationJsonSchemaDecision
    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
    PlaybookApprovalEnvelope:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PlaybookApproval'
      required:
        - data
      title: PlaybookApprovalEnvelope
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "decision": "approve"
}
```

**Response**

```json
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
    "kind": "pre",
    "actionSlug": "deploy-infrastructure",
    "installedActionId": "action-12345",
    "actionName": "Deploy Infrastructure",
    "actionRunId": "run-67890",
    "rationale": "Pre-deployment check passed successfully.",
    "files": [
      {
        "id": "file-98765",
        "name": "infrastructure-plan.yaml"
      }
    ],
    "params": {},
    "artifacts": [
      {
        "id": "artifact-54321",
        "kind": "link",
        "title": "Deployment Logs",
        "url": "https://cloudraker.com/logs/deploy-67890",
        "open": "tab"
      }
    ],
    "status": "approved",
    "requestedAt": "2024-01-15T09:30:00Z",
    "decidedBy": "user-112233",
    "decidedAt": "2024-01-15T09:45:00Z",
    "note": "Approved after verifying all checks.",
    "editedParams": {},
    "editedFileIds": [
      "file-98765"
    ]
  }
}
```

**SDK Code**

```python
import requests

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

payload = { "decision": "approve" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.cloudraker.com/spaces/spaceId/playbook-runs/runId/approvals/approvalId';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"decision":"approve"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"decision\": \"approve\"\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/approvalId")

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  \"decision\": \"approve\"\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/approvalId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"decision\": \"approve\"\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/approvalId', [
  'body' => '{
  "decision": "approve"
}',
  '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/approvalId");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"decision\": \"approve\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["decision": "approve"] 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/approvalId")! 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()
```