---
title: "Decide an approval raised by a work session"
---

> 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 an approval raised by a work session

Path: CloudRaker Paperwork API › Work Sessions

`POST /v1/work-sessions/{id}/approvals/{approvalId}`

Approves or rejects an action a turn proposed. The platform runs it; the agent never holds the credential. A rejection needs a `note` saying why — the agent reads it and takes another route.

An EGRESS approval releases a credentialed request the agent already formed, so its parameters cannot be edited (`422 egress_not_editable`) and only an approver the agent version names may decide it (`403 not_an_approver`).

If approval ownership cannot be resolved the call fails closed with `503`: releasing a credentialed request without that check is never safe.

**Learn more:** [Work sessions](https://docs.cloudraker.com/paperwork/api)

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `id` (`decideWorkSessionApproval.path.id`; string, required)
  - minLength 1; maxLength 128
- `approvalId` (`decideWorkSessionApproval.path.approvalId`; string, required)
  - minLength 1; maxLength 128

## Request body

_Required._

- `decision` (`decideWorkSessionApproval.decision`; string, required)
  - one of `"approve"`, `"reject"`
- `note` (`decideWorkSessionApproval.note`; string, optional)
  - maxLength 2000
- `editedParams` (`decideWorkSessionApproval.editedParams`; map<unknown>, optional)
- `edits` (`decideWorkSessionApproval.edits`; map<unknown>, optional)

## Example request

```json
{
  "decision": "approve",
  "note": "string",
  "editedParams": {
    "property1": null,
    "property2": null
  },
  "edits": {
    "property1": null,
    "property2": null
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/v1/work-sessions/<id>/approvals/<approvalId>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "decision": "approve",
  "note": "string",
  "editedParams": {
    "property1": null,
    "property2": null
  },
  "edits": {
    "property1": null,
    "property2": null
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/work-sessions/<id>/approvals/<approvalId>';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    decision: 'approve',
    note: 'string',
    editedParams: {property1: null, property2: null},
    edits: {property1: null, property2: null}
  })
};

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/v1/work-sessions/<id>/approvals/<approvalId>"

payload = {
    "decision": "approve",
    "note": "string",
    "editedParams": {
        "property1": None,
        "property2": None
    },
    "edits": {
        "property1": None,
        "property2": None
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

The decided approval.

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`decideWorkSessionApproval.response.400.success`; boolean, required)
  - one of `false`
- `error` (`decideWorkSessionApproval.response.400.error`; array<unknown>, required)
- `data` (`decideWorkSessionApproval.response.400.data`; unknown, required)

### 401

Missing or invalid credential.

### 403

`not_an_approver` — this credential may not decide egress requests.

### 404

Unknown session or approval.

### 422

`egress_not_editable` — an egress approval cannot be edited; `note_required` — a rejection needs a reason.

### 429

Rate limited. The `/v1` API allows at least **67 requests per minute per organization** (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the `Retry-After` interval and retry — the error is `retryable`.

#### Example

```json
{
  "code": "rate_limited",
  "message": "string",
  "retryable": true,
  "requestId": "string",
  "docUrl": "string"
}
```

- `code` (`decideWorkSessionApproval.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`decideWorkSessionApproval.response.429.message`; string, required)
- `retryable` (`decideWorkSessionApproval.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`decideWorkSessionApproval.response.429.requestId`; string, required)
- `docUrl` (`decideWorkSessionApproval.response.429.docUrl`; string, optional)

### 503

`approval_owner_unavailable` — ownership could not be resolved.


Source: https://docs.cloudraker.com/paperwork/api/work-sessions/decide-work-session-approval/index.md
