---
title: "Approve or reject an approval"
---

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

Path: Shiba public API › approvals

`POST /approvals/{approvalId}/decision`

## Authentication

- `cookieAuth`, apiKey, in cookie

## Path parameters

- `approvalId` (`decideApproval.path.approvalId`; string, required) — Approval identifier

## Request body

_Required._

- `threadKey` (`decideApproval.threadKey`; string, required)
  - minLength 1; maxLength 600
- `approved` (`decideApproval.approved`; boolean, required)
- `claimAction` (`decideApproval.claimAction`; string, optional)
  - one of `"queue"`, `"new_branch"`, `"cancel"`
- `expectedInputHash` (`decideApproval.expectedInputHash`; string, optional)
  - pattern `^[a-f0-9]{64}$`

## Example request

```json
{
  "threadKey": "string",
  "approved": true,
  "claimAction": "queue",
  "expectedInputHash": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url '<base-url>/api/v1/approvals/<approvalId>/decision' \
  --header 'Content-Type: application/json' \
  --cookie 'better-auth.session_token=<better-auth.session_token>' \
  --data '
{
  "threadKey": "string",
  "approved": true,
  "claimAction": "queue",
  "expectedInputHash": "string"
}
'
```

### TypeScript

```typescript
const url = '<base-url>/api/v1/approvals/<approvalId>/decision';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    cookie: 'better-auth.session_token=<better-auth.session_token>'
  },
  body: JSON.stringify({
    threadKey: 'string',
    approved: true,
    claimAction: 'queue',
    expectedInputHash: 'string'
  })
};

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

### Python

```python
import requests

url = "<base-url>/api/v1/approvals/<approvalId>/decision"

payload = {
    "threadKey": "string",
    "approved": True,
    "claimAction": "queue",
    "expectedInputHash": "string"
}
headers = {
    "cookie": "better-auth.session_token=<better-auth.session_token>",
    "Content-Type": "application/json"
}

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

print(response.text)
```

## Responses

### 200

Decision recorded

### 400

Invalid body

#### Example

```json
{
  "ok": false,
  "error": "string",
  "detail": "string",
  "code": "string"
}
```

- `error` (`decideApproval.response.400.error`; string, required)
- `ok` (`decideApproval.response.400.ok`; boolean, optional)
- `detail` (`decideApproval.response.400.detail`; string, optional)
- `code` (`decideApproval.response.400.code`; string, optional)

### 401

Unauthorized

#### Example

```json
{
  "ok": false,
  "error": "string",
  "detail": "string",
  "code": "string"
}
```

- `error` (`decideApproval.response.401.error`; string, required)
- `ok` (`decideApproval.response.401.ok`; boolean, optional)
- `detail` (`decideApproval.response.401.detail`; string, optional)
- `code` (`decideApproval.response.401.code`; string, optional)

### 404

Approval not found

#### Example

```json
{
  "ok": false,
  "error": "string",
  "detail": "string",
  "code": "string"
}
```

- `error` (`decideApproval.response.404.error`; string, required)
- `ok` (`decideApproval.response.404.ok`; boolean, optional)
- `detail` (`decideApproval.response.404.detail`; string, optional)
- `code` (`decideApproval.response.404.code`; string, optional)


Source: https://tryshiba.dev/reference/api/approvals/decideApproval/index.md
