> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cloudraker.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cloudraker.com/_mcp/server.

# Complete a human step

POST https://api.cloudraker.com/v1/agent-runs/{id}/tasks/{taskId}/complete
Content-Type: application/json

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/api/cloud-raker-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.
</Note>

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

Reference: https://docs.cloudraker.com/api/cloud-raker-api/agents/complete-agent-run-task

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: CloudRaker API
  version: 1.0.0
paths:
  /v1/agent-runs/{id}/tasks/{taskId}/complete:
    post:
      operationId: complete-agent-run-task
      summary: Complete a human step
      description: >-
        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/api/cloud-raker-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.

        </Note>


        **Learn more:** [Agents
        guide](https://docs.cloudraker.com/capabilities/agents)
      tags:
        - agents
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: taskId
          in: path
          required: true
          schema:
            type: string
        - name: wait
          in: query
          description: >-
            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.
          required: false
          schema:
            type: integer
            default: 60
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The completed step, and where the run stands after it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1AgentRunTaskCompletion'
        '400':
          description: Invalid request (`invalid_request`).
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: >-
            Unknown run id (`not_found`), unknown step (`task_not_found`), or a
            file id that is not yours (`not_found`).
          content:
            application/json:
              schema:
                description: Any type
        '409':
          description: >-
            Dependencies unfinished (`task_blocked`), already done
            (`task_resolved`), taken by someone else (`task_claimed`), or the
            run has not started yet (`run_not_started`).
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: Not a human step (`task_not_completable`).
          content:
            application/json:
              schema:
                description: Any type
        '429':
          description: >-
            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`.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CompleteAgentRunTaskRequestTooManyRequestsError
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1CompleteAgentRunTaskBody'
servers:
  - url: https://api.cloudraker.com
    description: Production
  - url: https://api.staging.raker.one
    description: Staging
  - url: https://api.dev.raker.one
    description: Development
components:
  schemas:
    V1CompleteAgentRunTaskBody:
      type: object
      properties:
        note:
          type: string
          description: What you did, recorded on the step and visible on the run.
        files:
          type: array
          items:
            type: string
          description: Files produced while doing the step, by file id.
      title: V1CompleteAgentRunTaskBody
    V1AgentRunTaskCompletionExecutor:
      type: string
      enum:
        - agent
        - human
      description: >-
        Who performs the step: `agent` runs by itself, `human` waits for a
        person to complete it.
      title: V1AgentRunTaskCompletionExecutor
    V1AgentRunTaskCompletionStatus:
      type: string
      enum:
        - pending
        - ready
        - in_progress
        - completed
        - skipped
      title: V1AgentRunTaskCompletionStatus
    V1AgentRunPointerStatus:
      type: string
      enum:
        - queued
        - processing
        - waiting
        - paused
        - completed
        - failed
        - cancelled
        - expired
      description: >-
        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`.
      title: V1AgentRunPointerStatus
    V1AgentRunPointer:
      type: object
      properties:
        id:
          type: string
        status:
          $ref: '#/components/schemas/V1AgentRunPointerStatus'
          description: >-
            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`.
        statusUrl:
          type: string
      required:
        - id
        - status
        - statusUrl
      title: V1AgentRunPointer
    V1AgentRunTaskCompletion:
      type: object
      properties:
        object:
          type: string
          enum:
            - agent_run_task
        id:
          type: string
        title:
          type: string
        executor:
          $ref: '#/components/schemas/V1AgentRunTaskCompletionExecutor'
          description: >-
            Who performs the step: `agent` runs by itself, `human` waits for a
            person to complete it.
        status:
          $ref: '#/components/schemas/V1AgentRunTaskCompletionStatus'
        summary:
          type:
            - string
            - 'null'
        note:
          type: string
        completedAt:
          type:
            - string
            - 'null'
        run:
          $ref: '#/components/schemas/V1AgentRunPointer'
      required:
        - object
        - id
        - title
        - executor
        - status
        - summary
        - completedAt
        - run
      title: V1AgentRunTaskCompletion
    V1AgentRunsIdTasksTaskIdCompletePostResponsesContentApplicationJsonSchemaCode:
      type: string
      enum:
        - rate_limited
      title: >-
        V1AgentRunsIdTasksTaskIdCompletePostResponsesContentApplicationJsonSchemaCode
    CompleteAgentRunTaskRequestTooManyRequestsError:
      type: object
      properties:
        code:
          $ref: >-
            #/components/schemas/V1AgentRunsIdTasksTaskIdCompletePostResponsesContentApplicationJsonSchemaCode
        message:
          type: string
        retryable:
          type: boolean
        requestId:
          type: string
        docUrl:
          type: string
      required:
        - code
        - message
        - retryable
        - requestId
      title: CompleteAgentRunTaskRequestTooManyRequestsError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "object": "agent_run_task",
  "id": "task_9f8b7c6d5e4a3b2c1d0e",
  "title": "Review Contract Signature",
  "executor": "human",
  "status": "completed",
  "summary": "Client has signed the contract and all documents are verified.",
  "completedAt": "2024-06-10T15:45:00Z",
  "run": {
    "id": "run_123abc456def789ghi",
    "status": "processing",
    "statusUrl": "https://app.cloudraker.com/runs/run_123abc456def789ghi/status"
  },
  "note": "Client signed; scan attached."
}
```

**SDK Code**

```typescript
import { CloudRakerClient } from "@cloudraker/api";

async function main() {
    const client = new CloudRakerClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.agents.completeAgentRunTask("id", "taskId", {});
}
main();

```

```python
from cloudraker import CloudRaker

client = CloudRaker(
    token="YOUR_TOKEN_HERE",
)

client.agents.complete_agent_run_task(
    id="id",
    task_id="taskId",
)

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.cloudraker.com/v1/agent-runs/id/tasks/taskId/complete"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.cloudraker.com/v1/agent-runs/id/tasks/taskId/complete")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.cloudraker.com/v1/agent-runs/id/tasks/taskId/complete")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cloudraker.com/v1/agent-runs/id/tasks/taskId/complete', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/v1/agent-runs/id/tasks/taskId/complete");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cloudraker.com/v1/agent-runs/id/tasks/taskId/complete")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```