---
title: "Claim a human task raised by a turn"
---

> 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.

# Claim a human task raised by a turn

Path: CloudRaker Workspace API › Workspace Sessions

`POST /workspace/sessions/{sessionId}/tasks/{taskId}/claim`

Claims a ready human task for the caller. Claiming is optional. **Authorization:** `work_session:comment` on the session, OR `space:contribute` on one of its linked spaces; a desk session is writable only by its owner. Any denial is 404.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `sessionId` (`claimWorkspaceTask.path.sessionId`; string, required)
- `taskId` (`claimWorkspaceTask.path.taskId`; string, required)

## Query parameters

- `turnId` (`claimWorkspaceTask.query.turnId`; string, optional)
  - minLength 1; maxLength 128

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/workspace/sessions/<sessionId>/tasks/<taskId>/claim' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/workspace/sessions/<sessionId>/tasks/<taskId>/claim';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

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/workspace/sessions/<sessionId>/tasks/<taskId>/claim"

headers = {"Authorization": "Bearer <token>"}

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

print(response.text)
```

## Responses

### 200

The engine’s own result for the turn.

#### Example

```json
{
  "data": {
    "property1": null,
    "property2": null
  }
}
```

- `data` (`claimWorkspaceTask.response.200.data`; map<unknown>, required)

### 400

`validation_failed` — a malformed body.

### 404

No such session or turn, or the caller may not write it.

### 409

`run_not_running` — the turn is already terminal.


Source: https://docs.cloudraker.com/workspace/api/workspace-sessions/claim-workspace-task/index.md
