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

# Claim a human task

POST https://api.cloudraker.com/spaces/{spaceId}/playbook-runs/{runId}/tasks/{taskId}/claim

Marks a `ready` human task `in_progress` with the caller as claimant. Claiming is optional — anyone in the space may complete an unassigned task without claiming it. Authorization: `space:contribute` (org admins bypass); missing → 403. Errors: 409 `task_claimed` (someone else holds it), 409 `task_resolved` (already completed/skipped), 409 `run_not_running`, 422 `not_human_task`, 404 unknown task.

Reference: https://docs.cloudraker.com/api/cloud-raker-api/workspace/playbooks/claim-playbook-run-task

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: CloudRaker API
  version: 1.0.0
paths:
  /spaces/{spaceId}/playbook-runs/{runId}/tasks/{taskId}/claim:
    post:
      operationId: claim-playbook-run-task
      summary: Claim a human task
      description: >-
        Marks a `ready` human task `in_progress` with the caller as claimant.
        Claiming is optional — anyone in the space may complete an unassigned
        task without claiming it. Authorization: `space:contribute` (org admins
        bypass); missing → 403. Errors: 409 `task_claimed` (someone else holds
        it), 409 `task_resolved` (already completed/skipped), 409
        `run_not_running`, 422 `not_human_task`, 404 unknown task.
      tags:
        - playbooks
      parameters:
        - name: spaceId
          in: path
          required: true
          schema:
            type: string
        - name: runId
          in: path
          required: true
          schema:
            type: string
        - name: taskId
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The updated task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaybookRunTaskEnvelope'
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:
    PlaybookRunTaskExecutor:
      type: string
      enum:
        - agent
        - human
      title: PlaybookRunTaskExecutor
    PlaybookRunTaskStatus:
      type: string
      enum:
        - pending
        - ready
        - in_progress
        - completed
        - skipped
      title: PlaybookRunTaskStatus
    PlaybookRunTask:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        instructions:
          type:
            - string
            - 'null'
        dependsOn:
          type: array
          items:
            type: string
        executor:
          $ref: '#/components/schemas/PlaybookRunTaskExecutor'
        assignee:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/PlaybookRunTaskStatus'
        claimedBy:
          type:
            - string
            - 'null'
        summary:
          type:
            - string
            - 'null'
        completedBy:
          type:
            - string
            - 'null'
        note:
          type:
            - string
            - 'null'
        fileIds:
          type: array
          items:
            type: string
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - title
        - status
        - summary
        - completedAt
      title: PlaybookRunTask
    PlaybookRunTaskEnvelope:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PlaybookRunTask'
      required:
        - data
      title: PlaybookRunTaskEnvelope
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "data": {
    "id": "task-9f8b7c6d-1234-4e56-8a9b-0c1d2e3f4a5b",
    "title": "Review Security Audit Report",
    "status": "in_progress",
    "summary": "Security audit report review in progress",
    "completedAt": null,
    "instructions": "Please review the attached security audit report and provide your feedback by end of day.",
    "dependsOn": [
      "task-7a6b5c4d-9876-4f32-8b1a-0d2e3f4a5b6c"
    ],
    "executor": "human",
    "assignee": "jane.doe@example.com",
    "claimedBy": "jane.doe@example.com",
    "completedBy": null,
    "note": null,
    "fileIds": [
      "file-123e4567-e89b-12d3-a456-426614174000"
    ]
  }
}
```

**SDK Code**

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

async function main() {
    const client = new CloudRakerClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.playbooks.claimPlaybookRunTask("spaceId", "runId", "taskId");
}
main();

```

```python
from cloudraker import CloudRaker

client = CloudRaker(
    token="YOUR_TOKEN_HERE",
)

client.playbooks.claim_playbook_run_task(
    space_id="spaceId",
    run_id="runId",
    task_id="taskId",
)

```

```go
package main

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

func main() {

	url := "https://api.cloudraker.com/spaces/spaceId/playbook-runs/runId/tasks/taskId/claim"

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

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/spaces/spaceId/playbook-runs/runId/tasks/taskId/claim")
  .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/spaces/spaceId/playbook-runs/runId/tasks/taskId/claim', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/spaces/spaceId/playbook-runs/runId/tasks/taskId/claim");
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/spaces/spaceId/playbook-runs/runId/tasks/taskId/claim")! 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()
```