---
title: "Complete a human task"
---

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

# Complete a human task

Path: CloudRaker Workspace API › Playbooks

`POST /spaces/{spaceId}/playbook-runs/{runId}/tasks/{taskId}/complete`

Completes a human task out-of-band, with an optional note and file references that flow into the agent’s context for the tasks that follow. Anyone in the space may complete an unassigned task; claiming first is optional. A second completion is a no-op. Authorization: `space:contribute` (org admins bypass). Errors: 409 `task_blocked` (gates not cleared), 409 `run_not_running`, 422 `not_human_task`, 404.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`completePlaybookRunTask.path.spaceId`; string, required)
- `runId` (`completePlaybookRunTask.path.runId`; string, required)
- `taskId` (`completePlaybookRunTask.path.taskId`; string, required)

## Request body

_Required._

- `note` (`completePlaybookRunTask.note`; string, optional)
  - maxLength 2000
- `fileIds` (`completePlaybookRunTask.fileIds`; array<string>, optional)
  - minLength 1; maxLength 128

## Example request

```json
{
  "note": "string",
  "fileIds": [
    "string"
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/playbook-runs/<runId>/tasks/<taskId>/complete' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "note": "string",
  "fileIds": [
    "string"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/playbook-runs/<runId>/tasks/<taskId>/complete';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({note: 'string', fileIds: ['string']})
};

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/spaces/<spaceId>/playbook-runs/<runId>/tasks/<taskId>/complete"

payload = {
    "note": "string",
    "fileIds": ["string"]
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

The completed task.

#### Example

```json
{
  "data": {
    "id": "string",
    "title": "string",
    "instructions": "string",
    "dependsOn": [
      "string"
    ],
    "executor": "agent",
    "assignee": "string",
    "status": "pending",
    "claimedBy": "string",
    "summary": "string",
    "completedBy": "string",
    "note": "string",
    "fileIds": [
      "string"
    ],
    "completedAt": "2019-08-24T14:15:22Z"
  }
}
```

- `data` (`completePlaybookRunTask.response.200.data`; object, required)
  - `id` (`completePlaybookRunTask.response.200.data.id`; string, required)
  - `title` (`completePlaybookRunTask.response.200.data.title`; string, required)
  - `status` (`completePlaybookRunTask.response.200.data.status`; string, required)
    - one of `"pending"`, `"ready"`, `"in_progress"`, `"completed"`, `"skipped"`
  - `summary` (`completePlaybookRunTask.response.200.data.summary`; string | null, required)
  - `completedAt` (`completePlaybookRunTask.response.200.data.completedAt`; any of, required)
    - any of: `string`, `null`
  - `instructions` (`completePlaybookRunTask.response.200.data.instructions`; string | null, optional)
  - `dependsOn` (`completePlaybookRunTask.response.200.data.dependsOn`; array<string>, optional)
  - `executor` (`completePlaybookRunTask.response.200.data.executor`; string, optional)
    - one of `"agent"`, `"human"`
  - `assignee` (`completePlaybookRunTask.response.200.data.assignee`; string | null, optional)
  - `claimedBy` (`completePlaybookRunTask.response.200.data.claimedBy`; string | null, optional)
  - `completedBy` (`completePlaybookRunTask.response.200.data.completedBy`; string | null, optional)
  - `note` (`completePlaybookRunTask.response.200.data.note`; string | null, optional)
  - `fileIds` (`completePlaybookRunTask.response.200.data.fileIds`; array<string>, optional)


Source: https://docs.cloudraker.com/workspace/api/playbooks/complete-playbook-run-task/index.md
