---
title: "Complete a human step"
---

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

Path: CloudRaker Paperwork API › Agents

`POST /v1/agent-runs/{id}/tasks/{taskId}/complete`

Marks one of the run's `executor: "human"` steps done, which releases everything waiting on it.

```json
{ "note": "Client signed; scan attached.", "files": ["file_01JQ8ZKMRT4V6WXYZ0ABCDEF"] }
```

Both fields are optional. `files` are ids you [registered](https://docs.cloudraker.com/paperwork/api/files/create-file) or that the run already holds; they are attached to the step and show up in the run's `output.files`.

Only human steps are completable — an agent's own step answers `422`. A step whose dependencies are unfinished answers `409`, and so does one that is already done. The response carries the step plus `run.status`; `?wait=` holds the request while the run picks the work back up.

> **Note:** An API key has no person behind it, so the run records your organization's key as the actor rather than a named individual.

**Learn more:** [Agents guide](https://docs.cloudraker.com/paperwork/capabilities/agents)

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `id` (`completeAgentRunTask.path.id`; string, required)
  - minLength 1
- `taskId` (`completeAgentRunTask.path.taskId`; string, required)
  - minLength 1

## Query parameters

- `wait` (`completeAgentRunTask.query.wait`; integer, optional) — How many seconds to hold the request open. Releases early the moment the run finishes **or** blocks on a person. Maximum 120; `0` returns immediately.
  - min 0; max 120; default `60`

## Header parameters

- `idempotency-key` (`completeAgentRunTask.header.idempotency-key`; string, optional) — Retries with the same key replay the first applied mutation.
  - minLength 1; maxLength 255

## Request body

_Required._

- `note` (`completeAgentRunTask.note`; string, optional) — What you did, recorded on the step and visible on the run.
  - maxLength 2000
- `files` (`completeAgentRunTask.files`; array<string>, optional) — Files produced while doing the step, by file id.
  - minLength 1; maxLength 128

## Example request

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

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/agent-runs/<id>/tasks/<taskId>/complete';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({note: 'string', files: ['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/v1/agent-runs/<id>/tasks/<taskId>/complete"

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

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

print(response.text)
```

## Responses

### 200

The completed step, and where the run stands after it.

#### Example

```json
{
  "object": "agent_run_task",
  "id": "string",
  "title": "string",
  "executor": "agent",
  "status": "pending",
  "summary": "string",
  "note": "string",
  "completedAt": "string",
  "run": {
    "id": "string",
    "status": "queued",
    "statusUrl": "string"
  }
}
```

- `object` (`completeAgentRunTask.response.200.object`; string, required)
- `id` (`completeAgentRunTask.response.200.id`; string, required)
- `title` (`completeAgentRunTask.response.200.title`; string, required)
- `executor` (`completeAgentRunTask.response.200.executor`; string, required) — Who performs the step: `agent` runs by itself, `human` waits for a person to complete it.
  - one of `"agent"`, `"human"`
- `status` (`completeAgentRunTask.response.200.status`; string, required)
  - one of `"pending"`, `"ready"`, `"in_progress"`, `"completed"`, `"skipped"`
- `summary` (`completeAgentRunTask.response.200.summary`; string | null, required)
- `completedAt` (`completeAgentRunTask.response.200.completedAt`; string | null, required)
- `run` (`completeAgentRunTask.response.200.run`; object, required)
  - `id` (`completeAgentRunTask.response.200.run.id`; string, required)
  - `status` (`completeAgentRunTask.response.200.run.status`; string, required) — Where the agent run is in its life. | Status | Meaning | | --- | --- | | `queued` | Accepted; its files are still being prepared | | `processing` | The agent is working | | `waiting` | Blocked on a person — see `waiting`, `approvals` and `tasks[]` | | `paused` | Stopped short of finishing and resumable; not a failure | | `completed` | Finished; `result` and `output` are populated | | `failed` | Finished without producing a result | | `cancelled` | Stopped on request | | `expired` | Reached its `expiresAt` without finishing | `completed`, `failed`, `cancelled` and `expired` are terminal. A `completed` run that still had outstanding work also carries `incomplete: true`.
    - one of `"queued"`, `"processing"`, `"waiting"`, `"paused"`, `"completed"`, `"failed"`, `"cancelled"`, `"expired"`
  - `statusUrl` (`completeAgentRunTask.response.200.run.statusUrl`; string, required)
- `note` (`completeAgentRunTask.response.200.note`; string, optional)

### 400

Invalid request (`invalid_request`).

### 401

Missing or invalid credentials.

#### Example

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

- `code` (`completeAgentRunTask.response.401.code`; string, required)
- `message` (`completeAgentRunTask.response.401.message`; string, required)
- `retryable` (`completeAgentRunTask.response.401.retryable`; boolean, required)
- `requestId` (`completeAgentRunTask.response.401.requestId`; string, required)
- `docUrl` (`completeAgentRunTask.response.401.docUrl`; string, optional)

### 403

The credential is valid but cannot administer this organization.

#### Example

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

- `code` (`completeAgentRunTask.response.403.code`; string, required)
- `message` (`completeAgentRunTask.response.403.message`; string, required)
- `retryable` (`completeAgentRunTask.response.403.retryable`; boolean, required)
- `requestId` (`completeAgentRunTask.response.403.requestId`; string, required)
- `docUrl` (`completeAgentRunTask.response.403.docUrl`; string, optional)

### 404

Unknown run id (`not_found`), unknown step (`task_not_found`), or a file id that is not yours (`not_found`).

### 409

Dependencies unfinished (`task_blocked`), already done (`task_resolved`), taken by someone else (`task_claimed`), or the run has not started yet (`run_not_started`).

### 422

Not a human step (`task_not_completable`).

### 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` (`completeAgentRunTask.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`completeAgentRunTask.response.429.message`; string, required)
- `retryable` (`completeAgentRunTask.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`completeAgentRunTask.response.429.requestId`; string, required)
- `docUrl` (`completeAgentRunTask.response.429.docUrl`; string, optional)


Source: https://docs.cloudraker.com/paperwork/api/agents/complete-agent-run-task/index.md
